from azure.ai.textanalytics import TextAnalyticsClient
from azure.core.credentials import AzureKeyCredential
key = “your-key-here”
endpoint = “your-endpoint-here”
text_analytics_client = TextAnalyticsClient(endpoint=endpoint, credential=AzureKeyCredential(key))
def analyze_sentiment(
print(“Document Sentiment: response.confidence_scores.neutral,
response.confidence_scores.negative,
))
text_to_analyze = “Azure AI is quite impressive!”
analyze_sentiment(text_to_analyze)
Discover more from Coursity
Subscribe to get the latest posts sent to your email.