Jiglu comes with its own sentiment analysis algorithm built in. For aggregate analytics and observing trends with larger sets of content this will give good results. For increased accuracy for individual items from external sources you can instead configure Jiglu to use Amazon Comprehend.
Note that Amazon Comprehend usage is charged on a per-item basis and Amazon may retain content submitted so it should only be used on public content. Also note that Comprehend can only analyse up to 5,000 characters, so any sentences above that will not be analysed.
To get started you will first need to create an account used to access Amazon Comprehend:
- Log on to AWS.
- From the dropdown menu with your name choose the My security credentials option and then Users from the menu on the left.
- Select the Add user button, enter a suitable name, check the Programmatic access checkbox and then the Next button.
- On the Set permissions screen select the Attach existing policies directly tab and then select the ComprehendFullAccess permission. Now, unless you wish to assign the user to a tag, select the Next button through the next two screens and then the Create user button.
- You now need to copy the values for the access key and secret key to somewhere safe. The access key is a set of upper-case letters and numbers while the secret key a mix of base 64-encoded characters.
Now you need to configure the algorithm and access details in the Jiglu
.properties file usually found in
- Change the
- Ensure the
com.jiglu.contentAnalysis.awsRegionproperty is set to the correct region.
- Set the
com.jiglu.contentAnalysis.awsAccessKeyproperty to the access key you noted down in step 5.
- Set the
com.jiglu.contentAnalysis.awsSecretKeyproperty to the secret key you noted down in step 5.
You should now have these properties set like below.
# The sentiment analysis to use. This is either 'internal' to use the
# internal sentiment analysis or 'comprehend' to use Amazon Comprehend.
# The AWS region when using Amazon services.
# The AWS access key when using Amazon services.
# The AWS secret key when using Amazon services.
You are now ready to restart the Jiglu server. If everything is correct then the system log (usually found in
/var/log/jiglu/system.log for the current day) should contain an entry confirming that it was able to successfully connect to the Amazon Comprehend service as the user that you specified.