API Reference
Cognitive Services APIs
Explore the comprehensive APIs for Azure Cognitive Services, enabling you to add intelligent features to your applications.
Vision APIs
Computer Vision API
Analyze images to detect objects, read text, generate descriptions, and more.
POST https://api.cognitive.microsoft.com/bing/v7.0/images/visualsearchParameters:
Name | Type | Description | Required |
---|---|---|---|
Ocp-Apim-Subscription-Key |
String | Your subscription key. | Yes |
image |
File | The image file to analyze. | Yes |
language |
String | The language of the text in the image. | No |
Face API
Detect and analyze human faces in images.
POST https://westus.api.cognitive.microsoft.com/face/v1.0/detectParameters:
Name | Type | Description | Required |
---|---|---|---|
Ocp-Apim-Subscription-Key |
String | Your subscription key. | Yes |
returnFaceId |
Boolean | Whether to return faceIds. | No |
Speech APIs
Speech to Text API
Convert spoken audio into text.
POST https://speech.googleapis.com/v1/speech:recognizeParameters:
Name | Type | Description | Required |
---|---|---|---|
key |
String | Your API key. | Yes |
audio |
Object | The audio content. | Yes |
Language APIs
Text Analytics API
Perform sentiment analysis, key phrase extraction, and language detection.
POST https://[region].api.cognitive.microsoft.com/text/analytics/v3.0/analyzeParameters:
Name | Type | Description | Required |
---|---|---|---|
Ocp-Apim-Subscription-Key |
String | Your subscription key. | Yes |
kind |
String | The type of analysis to perform (e.g., SentimentAnalysis, KeyPhraseExtraction). | Yes |
Azure ML SDK
The Azure Machine Learning SDK for Python provides tools to build, train, and deploy machine learning models.
Core SDK Classes
Workspace
Represents your Azure Machine Learning workspace.
azureml.core.Workspace.from_config(path='.')
Description:
Loads workspace configuration from a JSON file.
Experiment
Represents a machine learning experiment.
workspace.experiments["my_experiment"]
Description:
Access an existing experiment or create a new one.
ScriptRunConfig
Configures the training script and environment.
ScriptRunConfig(source_directory='.', script='train.py', arguments=['--learning-rate', 0.01])
Description:
Specifies the training script, its directory, and command-line arguments.
Data Science Libraries
Reference for commonly used data science libraries integrated with Azure AI/ML services.
NumPy
Fundamental package for scientific computing with Python.
import numpy as np
# Create an array
a = np.array([1, 2, 3, 4, 5])
print(a.mean())
Pandas
Data manipulation and analysis library.
import pandas as pd
# Create a DataFrame
data = {'col1': [1, 2], 'col2': [3, 4]}
df = pd.DataFrame(data=data)
print(df.describe())
Scikit-learn
Machine learning library for Python.
from sklearn.linear_model import LinearRegression
# Example model
model = LinearRegression()
model.fit([[1, 2], [3, 4]], [1, 2])
print(model.predict([[5, 6]]))