Today I'll be mentioning one of the useful functions of Azure Text Analytics - Sentiment Analysis. Azure text analytics is a cloud-based offering from Microsoft and it provides Natural Language Processing over raw text.
Use Case Described
In this article, I will
explain how to use customer-provided product reviews to understand the market
insight and how one can take a call on manufacturing the products in the
future. Here is the pictorial representation of this use case.
Here are the high-level steps of how we can achieve this entire flow:
Step 1
This entire process starts with the data collection part and for this, I'm using a CSV file with customer-provided reviews. Here is the gist of it:
Step 2
Once data is collected, we need to import the data and for that, I'm using Jupyter Notebook inside Visual Studio Code. Here is the Python code to read and extract data from CSV file:
Step 3
Next, we need to create a Text Analytics resource in Azure to get a key and an endpoint. This can be done by log onto the Azure portal and search for Text Analytics to create a new instance.
Step 5
Next is to install the required Python module. In VS Code, open a new terminal and install the below module using Pip:
Step 6
Import the modules and create client objects as shown below:
At this point, if you will run the code, you will get the results from sentiment analysis.
Step 7
Now, it's time to plot the analysis results. This
can be done by using MatplotLib. If VS Code is not detecting it, then you can
install it using Pip (pip install matplotlib).
Here is the code to plot the results:
Step 8
If everything went well so far, then on executing the application, you will see similar output as shown below:
Conclusion and Takeaway
Looking at the above chart, the manufacturer can
take a call and decide, whether he needs to increase the production or slow
down the production and understand the customer's pain points.
Hope you enjoyed reading this article. There may be a few steps, which I didn't explain here. So, in case, if you got stuck at any point while reading this, I would recommend you to watch out for my video demonstrating end-to-end flow on my YouTube channel named Shweta Lodha.
Comments
Post a Comment