-
Notifications
You must be signed in to change notification settings - Fork 2
marble‐processor‐simple
Miguel Fernandes edited this page Apr 29, 2017
·
7 revisions
Processor.
This processor assigns a polarity value to each message related to a specific topic.
To calculate this value, it uses a bag-of-words approach, based on the senticnet 3 corpus. The steps performed are the following:
- The message is split into sentences, using the following regular expression as delimiter:
[\\.,;!?]
. - For each sentence, groups of 4 to 1 words are created, and looked up in the senticnet corpus to get the polarity value.
- If the word previous to a group matches
no[t]?
, the result is reversed. - All polarity values are added up, and represent the polarity of the sentence.
- The total polarity of a message is the average of all the sentence's polarities.
The senticnet corpus needs to be loaded into marble before the first time use of this processor.
- Download the corpus here, in its xml version.
- Load it sending a POST request to the url:
http://<server>:<port>/api/update_senticnet
with a single parameter called file
with the corpus contents.
ignoreNeutralSentences: Ignores sentences with neutral (0) polarity in the average calculation.
{
"name": "processor-simple",
"options": {
"ignoreNeutralSentences": true
}
}