Skip to content

bfdill/SentimentAnalysis

Repository files navigation

Sentiment Analysis

This project was developed to simplify the sentiment analysis of text. It is meant to be easily extensible with additional implementations. For the initial release, there are two different sentiment analysis engines programmed in.

Setup

The code can be cloned and built from GitHub or installed via NuGet.

PM> Install-Package SentimentAnalysis.AzureMachineLearning
OR
PM> Install-Package SentimentAnalysis.Vivekn

The Azure Machine Learning implementation requires the use of an API Key and allows 10,000 free lookups a month. If you need more than that, you have to pay them. Not me, I'm not affiliated with them in any way, shape, or form. Their implementation was one of many that came up while I was researching Sentiment Analysis.

This means you will need to request that from them and put it in the config file under this setting AzureMachineLearning:BasicAuthenticationCredentials.

<appSettings>
    <add key="AzureMachineLearning:BasicAuthenticationCredentials" value="AccountKey:{YOUR ACCOUNT KEY HERE}" />
</appSettings>

Use

Single item requests

var service = ServiceFactory.Build();

var results = await service.GetSentimentAsync("String to test");

Batch requests

var service = ServiceFactory.Build();

var request = new Dictionary<string, string>
                    {
                        { "A", "Data to be tested" },
                        { "B", "Data to be tested" }
                    };

var batchResult = await service.GetBatchSentimentAsync(request);

Credits

This project is a rebasing of work done by my friend and mentor Dale Alleshouse.

Assistance/Questions/Etc

Most of the code has covering unit tests, so reviewing those may provide insight to call/result processing. Pull requests and feature requests are welcome as is feedback of any kind.

Thanks and enjoy, Ben

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages