DEV Community

Cover image for Discover the art of sentiment analysis using the Azure AI Language Service.
Eshan Dutta
Eshan Dutta

Posted on

Discover the art of sentiment analysis using the Azure AI Language Service.

Welcome to Azure AI Language, where the power of technology meets linguistics.

Language Detection: Identify the meaning of languages with just a snippet of text. Azure AI Language has the knack for pinpointing the language of any passage, that lets us decode the diverse languages of our world.

Sentiment Analysis: Dive deep into the world of emotions encoded within text. From joyous exclamations to somber reflections, Azure AI Language can express the sentiment behind every word, unveiling the true essence of human expression.

Key Phrase Extraction: Extract the hidden expressions buried within paragraphs and sentences. Azure AI Language acts as a linguistic archaeologist, excavating the pivotal phrases that hold the essence of meaning, discovering the path to comprehension.

Entity Recognition and Linking: Enter the domain of entities, where names, dates, and places come to life. Azure AI Language possesses the power to identify these entities and weave them into a cohesive narrative, connecting the dots across vast seas of information.

With Azure AI Language as your guide, prepare to discover the secrets encapsulated within the text, transforming mere words into a gateway to knowledge and understanding. Let the journey begin!

prerequisite: an active azure subscription | vs code | .net sdk 7

First things first: go to: https://portal.azure.com
Create Azure Resource - Search for "Azure AI Services" in the search box

  • Click on create in the search results

  • fill in the required text boxes and click "Review + create"

  • choose the pricing tier as S

Image description

  • now clone the git hub repository - https://github.com/eshandutta/artificial-intelligence

  • this repo contains c# code to perform sentiment analysis of text

  • if you open the file appsettings.json in the "Sentiment Analysis" directory you will find the endpoint and the key of your Azure AI Services.

just like this

Image description

you can find your endpoint and key of your Azure AI Service as shown below here

Image description

So coming to the motive of our exercise today, we have 5 hotel reviews. These reviews are of different temperaments and sentiments and even in different languages. I am going to use Azure AI Language service to extract and dig out various information from the reviews given.

Image description

  • Now have a look at the program.cs it is comprised of all the objectives block for our exercise today

Image description

the package needed for the sentiment analysis to work

dotnet add package Azure.AI.TextAnalytics --version 5.3.0

  • Now open cmd and see the program in action
    Image description

  • you will be able to see the Sentiment Analysis of the Reviews I have shown you above

Image description

Image description

Top comments (1)

Collapse
 
emonkalyan profile image
Emon Kalyan

Well explained!