Discover the art of sentiment analysis using the Azure AI Language Service.
Published: 2024-01-28 18:09:13

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jel2r32z9e8o6ic090h7.png)
- 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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u164clwb7j32aoi2moj4.png)

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


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sfrorvmlinm3qwr21gm3.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fwy123380k4zq870u3ni.png)

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8rbibc798n6o5sertw4n.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kb555yl89nkw22mznu1r.png)

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


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a2k6b5gonspq0jbk2vgj.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/btlzkchiurnx1uahm4a7.png)