.Net Core implementation of Microsoft Cognitive Services Text Analysis API
C#
Switch branches/tags
Nothing to show
Clone or download
Latest commit 3e15da6 Mar 31, 2017
Permalink
Failed to load latest commit information.
src ConfigureAwait(false) Mar 31, 2017
.gitignore Creation Sep 16, 2016
LICENSE Create LICENSE Sep 16, 2016
README.md Update README.md Sep 16, 2016

README.md

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