DEV Community

Cover image for Designing and Implementing a Microsoft Azure AI Solution
Olatunji Ayodele Abidemi
Olatunji Ayodele Abidemi

Posted on

Designing and Implementing a Microsoft Azure AI Solution

Image descriptionfrom azure.ai.textanalytics import TextAnalyticsClient
from azure.core.credentials import AzureKeyCredential

Set up the client with your Azure key and endpoint

key = "your-key-here"
endpoint = "your-endpoint-here"

text_analytics_client = TextAnalyticsClient(endpoint=endpoint, credential=AzureKeyCredential(key))

Example function to analyze sentiment

def analyze_sentiment(
print("Document Sentiment: response.confidence_scores.neutral,
response.confidence_scores.negative,
))

Example usage

text_to_analyze = "Azure AI is quite impressive!"
analyze_sentiment(text_to_analyze)

Top comments (0)