Skip to content

.Net Core implementation of Microsoft Cognitive Services Text Analysis API

License

Notifications You must be signed in to change notification settings

ealsur/CognitiveServicesText

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Microsoft Cognitive Services Text Analysis API

Since I couldn't find any existing NuGet package that covered this particular API (other APIs are available though), this is a .Net Core implementation of Microsoft Cognitive Services Text Analysis API as described by the documentation.

You will need an ApiKey which is obtained once you activate the product on your Azure Subscription (activation/purchase option is available on the Service page).

Analysis of Key phrases

ICognitiveServicesTextAnalysis textAnalysis = new CognitiveServicesTextAnalysis(ApiKey);
var keyPhrases = await textAnalysis.KeyPhrases(language:"en", text:"I had a wonderful experience! The rooms were wonderful and the staff were helpful.");

Returns:

[
	"staff",
	"wonderful experience",
	"rooms"
]

Analysis of Sentiment

The Sentiment is a number from 0 to 1 that expresses positiveness, 1 being totally positive and 0 totally negative.

ICognitiveServicesTextAnalysis textAnalysis = new CognitiveServicesTextAnalysis(ApiKey);
var keyPhrases = await textAnalysis.Sentiment(language:"en", text:"I had a wonderful experience! The rooms were wonderful and the staff were helpful.");

Returns:

0.9750894

About

.Net Core implementation of Microsoft Cognitive Services Text Analysis API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages