Our Sentiment Analysis API demo is a good place to try out our API’s ability to find the tone of a sentence or paragraph. This API can be useful if you have a large amount of user responses or reviews and you want to quickly find the negative comments to see what your customers don’t like and vice versa.
However, our API gives you more power than that. Besides just reading the type response (“negative”, ”neutral”, or ”positive”), you can actually determine for yourself what you consider positive or negative. Below we will explain two useful information, score and ratio, that our API returns for each text analyzed.
Score
The score indicates how negative or positive the overall text analyzed is. Anything below a score of -0.05 we tag as negative and anything above 0.05 we tag as positive. Anything in between inclusively, we tag as neutral.
Since we have provided the actual scores we used to determine the type, you are free to reject our interpretation and interpret the actual scores yourself and create your own negative and positive minimum scores.
Ratio
The ratio is the combined total score of negative words compared to the combined total score of positive words, ranging from -1 to 1. It. Take the below for example.
Let’s say we are analyzing words A, B, C and D.
- Scenario 1) If words A and B are negative words having a combined total score of -5.0 and words C and D are positive words having a combined total score of 5.0, then the ratio would be 0 (or 1:1) as both sides are balanced.
- Scenario 2) If negative words have a total combined score of -5.0 while positive words have a total combined score of 2.5, then the ratio would be -0.667 (or 2:1).
- Scenario 3) If negative words total -5.0 and positive words total 0.0, then the ratio would be -1 (or 1:0).
Ultimately, the score and ratio allows you to go beyond what we think is negative or what we think is positive. In your code, you can consider the impact of the score or the impact of the ratio, or even combine them all to set your own positive and negative thresholds to suit your application.
Maybe your users are generally very negative? You can, for example, instead of using our interpretation that less than -0.05 is negative and more than 0.05 is positive, you can write your own algorithm that says below -0.9 is negative and above -0.8 is positive.
Take a look at our Sentiment Analysis API Demo and try it out yourself.
Use Cases Of Sentiment Analysis API
The possibilities are endless. First off, you can use our API to build your own sentiment analysis app by learning how to build your own sentiment analysis app. Also, you might want to check out this tutorial on how to analyze twitter feeds for analyzing your social media comments.
If you are intersted in example of OpenAI GPT, this company, named RAW Labs, created an OpenAI GPT that measures the impact of news sentiment on stock prices. It responds to queries about stock price and news sentiment correlation such as:
1. What’s the sentiment correlation for Tesla’s stock?
2. Analyze Apple’s stock with recent news sentiment.
3. Is there a link between Amazon’s stock price and news sentiment?
4. How does Microsoft’s news sentiment affect its stock?
This is accomplished by utilizing multiple APIs including a GPT in OpenAI to consume them, IEX Cloud for stock ticker prices, Twinword API for sentiment analysis and newsdata.io for news information.
Sentiment Analysis has been heavily used by businesses for social media opinion mining, especially in the service industry, where customers feedback are critical. In the recently year, it has been gaining popularity in the finance sector, where it has been used to analyze tweets of influential financial analysts and decision makers. It seems like there are so much potential to be unlocked for the usage of Sentiment Analysis. It is curious to what will be the next breakthrough!
6 Comments
Hi,
I am currently testing twitter sentiment analysis and I noticed that all the tweets that start with @username are not considered(discarded). Please advise.
Regards,
Emile
Unfortunately, we do not provide out-of-box API. It means we do not discard @username since we cannot assume API consumer’s environment. For example, some API consumers might want to utilize @username.
Instead, how about excluding @username from the input? You might want to get useful code at https://stackoverflow.com/questions/5188792/how-to-check-a-string-for-specific-characters
I don’t understand the score. It seems in some cases, it is an average of the scores of each word. But in other cases it is not. How is the total score calculated as a function of the scores of each word?
Thank you for the well interpreted article. I am now looking forward to check more essential entries dedicated to this problem!
Eνery weekend I used to visit this web site, for the reason that і wіsh for enjoyment, since
thіs these web page conations truly nice funny material tοo.
Hi. I’m currently doing my research study about AlchemyAPI and your post really help me in getting the idea of how AlchemyAPI works. it would be a great help if you can explain how exactly the system calculate the score? is there any algorithm behind it?