Azure / azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.46k stars 4.8k forks source link

[FEATURE REQ] Azure.Ai.TextAnalytics - supported languages for sentiment analysis #20774

Closed efchao closed 3 years ago

efchao commented 3 years ago

Azure.Ai.TextAnalytics

I would like to add an endpoint to get the list of supported languages for sentiment analysis. Also, it would be helpful to get the detected language for each document in the response of TextAnalyticsClient.AnalyzeSentiment method.

Thank you! This is a great tool! Eduardo

jsquire commented 3 years ago

Thank you for your feedback. Tagging and routing to the team member best able to assist.

maririos commented 3 years ago

Thanks for the feedback @efchao

I would like to add an endpoint to get the list of supported languages for sentiment analysis.

@assafi wondering if there is a list that can be added to the swagger so the SDK can expose it as an extensible enum? Or of course, an endpoint.

Also, it would be helpful to get the detected language for each document in the response of TextAnalyticsClient.AnalyzeSentiment method.

@efchao in Analyze Sentiment there is no automatic language detection. If in your input you specify the language of the document, the service respects that. If you don't assign a language, the default is English. Does this help?

efchao commented 3 years ago

@maririos Thank you! Yes, my request or question is if there is an endpoint which returns the supported languages for sentiment analysis, and if it does not exist, I thought this would be the place to ask for it.

I know there is no language detection in sentiment analysis, but since the language can be taken from the input, then from the client DefaultLanguage and then yes it would use 'en' as last default, I thought it would be useful to return the language used for each document (if one or many in the batch endpoint). I think of a use case where users can enter text in any language and then I try to get the sentiment of it. If I detect the language first, then not always I can get sentiment since the set of sentiment languages is smaller than the detected languages. That is why I asked for the sentiment supported languages endpoint in the first place.

maririos commented 3 years ago

Noted! I will communicate the ask and will post here when there is an update. Thank you Eduardo :)

assafi commented 3 years ago

@efchao That's great feedback!

We have been thinking of ways of both adding auto language detection to our endpoints as well as provide additional details for models (e.g. supported language list). There is some progress done here and will hope to start introducing those functionalities to one of the upcoming API versions.

@maririos The problem of adding supported languages to the Swagger or SDK is that this list is both dynamic (expands over time) and also depends on the model-version used. Older models will not support all of the languages naturally. Probably the best option would be to add an endpoint for those on the service side which the SDK can probe.

maririos commented 3 years ago

Ahh makes total sense. Excited about what is coming !!! :)

ghost commented 3 years ago

Hi @efchao. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “/unresolve” to remove the “issue-addressed” label and continue the conversation.

ghost commented 3 years ago

Hi @efchao, since you haven’t asked that we “/unresolve” the issue, we’ll close this out. If you believe further discussion is needed, please add a comment “/unresolve” to reopen the issue.