Text analysis is very important for many businesses and can provide a wealth of useful information. Traditionally, having a system that did this meant developing a text analysis system from scratch. With many services providing text analysis as a service (such as Azure Cognitive Services), having a text analysis system is easier than ever.
Text analysis can take many forms. It can include:
- Sentiment – determines whether the text is positive or negative.
- Named Entity recognition – finds different entities in text and categorizes them into predefined classes or types such as a person, location, event, product, and organization.
- Key phrases – identifies important terms from within the text.
- Personal information – finds identifying information such as name, email, phone, address, etc.
- Text summarization – creates a summary of the analyzed text
To test out Azure Text Analytics, I built a simple system that looked at two aspects of my blog posts:
- Determine whether my posts are positive or negative
- Find named entities within my posts
Building the Text Analysis System
Building this system is quite simple.
- Create a .NET Console application.
- Add NuGet package (dotnet add package Azure.AI.TextAnalytics –version 5.0.0).
- Create a client.
- Call AnalyzeSentiment (gives us the positive/negative).
- Call RecognizeEntities (gives us the most common entities).
Running the System Against My Posts
The system performed a FOR loop over all my blog posts, running the text through the AnalyzeSentiment and RecognizeEntities methods.
So what did it find?
When it comes to sentiment, I am happy to say my blog posts rate mostly positive (although I wish they were a little more positive).
For named entities, Azure Text Analytics returned pretty much what I expected.
Text analysis has a lot of uses and is a handy tool for many applications. Building a complete text analysis solution from bare metal would be a massive undertaking, but Azure has much of that covered with their cognitive services.