I've used the code from the quickstart guide on using text analytics client library.
documents = ['It was a bleak experience attending this language school for the exam. It was very hard to find. ']
response = client.analyze_sentiment(documents=documents)[0]
print("Document Sentiment: {}".format(response.sentiment))
print("Overall scores: positive={0:.2f}; neutral={1:.2f}; negative={2:.2f} \n".format(
response.confidence_scores.positive,
response.confidence_scores.neutral,
response.confidence_scores.negative,
))
And I've implemented authentication using the following:
key = "1234556"
base_url = "https://myresource.cognitiveservices.azure.com/"
path = "/text/analytics/v3.0/sentiment"
endpoint = base_url + path
from azure.ai.textanalytics import TextAnalyticsClient
from azure.core.credentials import AzureKeyCredential
def authenticate_client():
ta_credential = AzureKeyCredential(key)
text_analytics_client = TextAnalyticsClient(
endpoint=endpoint,
credential=ta_credential)
return text_analytics_client
client = authenticate_client()
However I get the error: 404 Resource not found.
Do I need to add a dependency in my project folder somehow or something else is amiss?
Greatly appreciate any and all help and pointers.