Custom sentiments

By default, the Natural Language Processing engine provides a dictionary that contains keywords or phrases and their sentiment value between -1 and 1, indicating whether they are positive, neutral, or negative. In order for a word or phrase to be included in the sentiment calculation for a document, it must be included in the dictionary file. There is a dictionary file for each of the installed languages.

You must store custom sentiment dictionaries alongside your project in the following location.

\Custom\SalienceData\<language>\salience\sentiment\general.hsd

Where <language> is the two-character code of the language that you are using. For example, the following are the languages that are supported by the Natural Language Processing engine along with the two-character codes that you must use to name the folder.

  • German - de

  • English - en

  • Spanish - es

  • French - fr

  • Italian - it

  • Japanese - ja

  • Korean - ko

  • Dutch - nl

  • Portuguese - pt

  • Romanian - ro

  • Chinese - zh

If a commonly used word or phrase is not included in the dictionary, and the sentiment value that is generated does not match your expectations, you can create a local copy of the dictionary general.hsd file and edit it as needed.

Important All entries in the copied general.hsd are in alphabetic order. The format is Word or Phrase<tab>Value between -1 and 1..

Additionally, if a word or phrase is included in the dictionary, but its value does not match how that word or phrase used in your local language, you can modify the value as needed. For example, the phrase kiling it would produce a very negative sentiment because the verb is recognized instead of the intended adjective. Similar results are found with the phrase da bomb. If you encounter these phrases, or similar phrases frequently in your documents, consider adding them to your general.hsd file to influence the default negative sentiment.