Sentiment140
The Qlik Sentiment140 connector uses the Sentiment140 API to classify short strings, such as Tweets, into positive, neutral, or negative sentiment categories. The classification score is represented by a number: 1 (positive), 0 (neutral), or -1 (negative). The score is determined by keywords that appear in the text.
In previous versions of the Qlik Web Connectors, the Sentiment140 API was accessible through the Sentiment and Text Analytics Connector.
Supported offerings
- Qlik Sense Desktop
- Qlik Sense Enterprise on Windows
- QlikView
This connector must be installed separately.
Ways to access your data
To access the Sentiment140 API to retrieve a sentiment score for your data, you can manually enter your text into the connector but this is not an effective way to analyze a large number of short strings. We recommend that you use one of the methods below to quickly analyze a large number of strings. See, Analyzing text.
Loading data from tables
Use the following table to fetch sentiment scores from your text strings.
Table | Description |
---|---|
Sentiment | Use this table to fetch sentiment scores for text strings. |
Analyzing text
The most effective way to use the Sentiment140 connector is to have a script pass rows of data to the Sentimen140 API to generate a new table with sentiment scores.
Using method
Use this method to make multiple Qlik Web Connectors requests without requiring a For/Next loop. This method does not require any URL encoding. More information about the processParams method can be found here, Making data request with synchronous, asynchronous, batch, and auto mode.
Using a For/Next loop with URL encoded text
Example:
Using a For/Next loop with text that is not URL encoded
If you are using text data from a source which is not already URL encoded, you can write a script that encodes the text before sending it to the sentiment analyzer like the following example.
Caching
The sentiment analyzer caches the sentiment scores. If you want to clear the cache, follow the instructions on this web page:
Clearing the Qlik Web Connectors cache
Backing Up The Cache
The cache will grow to a considerable size and retrieving items from the cache will be significantly faster than accessing the sentiment API. For this reason it is recommended that you take regular backups of this cache so that it can be restored if necessary.
By default the cache can be found at the following location:
[INSTALLATION_DIR]\[Web_connector_folder]\App_Data\[USER_GUID]\TextAnalyser_Sentiment140Connector_Cache
Working with the Sentiment140 API quota limits
The Qlik Web Connectors use the Sentiment140 API to fetch sentiment data from Sentiment140 and load it into your Qlik Sense app. While reloading you Sentiment140-based app, you might receive an error message that the connector has reached the Sentiment140 API rate limit and that all subsequent API calls will fail until the connector falls back under the throttling limit. If you receive this error message, then you have exceeded one of the API rate limits.
You receive an error message that you have reached the API rate limit
Reference - Sentiment140 developer documentation
You can refer to the Sentiment140 API documentation to learn more about the different ways to use the Sentiment140 API.
Troubleshooting
You receive an error message that you have reached the API rate limit
Possible cause
You have exceeded the API limits that are imposed on the Qlik Web Connectors by the Sentiment140 API.
Proposed action
To reduce the impact of reaching the API rate limits, develop your app with the following in mind:
- Extract only the data you need.
- Reload one Sentiment140-based application at a time.
- Ensure that loops in your script that make API calls will not result in infinite loops.