Method, system and computer program product for sentiment analysis
Methods, systems, and computer program product for automatically performing sentiment analysis on texts, such as telephone call transcripts and electronic written communications. Disclosed techniques include, inter alia, lexicon training, handling of negations and shifters, pruning of lexicons, confidence calculation for token orientation, supervised customization, lexicon mixing, and adaptive segmentation.
1. A method comprising:
receiving a text corpus comprising a plurality of n-gram tokens;
automatically applying a trained machine learning classifier to said text corpus, to generate a lexicon wherein each of said tokens has (a) a predicted sentiment orientation selected from the group consisting of positive, negative, and neutral, and (b) a confidence score; and
selecting a plurality of said tokens for manual adjustment of said sentiment orientation, wherein said selecting is based, at least in part on:
(i) said confidence score of each of said plurality of said tokens meeting a specified range, and
(ii) a distribution probability of said predicted sentiment orientations within said plurality of said tokens is equal to a distribution probability of said predicted sentiment orientations in said lexicon.
2. The method of claim 1 , wherein said machine learning classifier is further trained on a new training set comprising at least some of said selected plurality of said tokens.
3. The method of claim 1 , wherein said confidence score is calculated based, at least in part, on applying a heuristic which takes into account at least some of:
(i) a variance value of all of said sentiment orientations in said lexicon, and
(ii) a hyperbolic tangent function of the number of each of said tokens in said text corpus.
4. A system comprising:
a processor; and
a memory in communication with the processor, the memory storing instructions that, when executed by the processor causes the processor to:
receive a text corpus comprising a plurality of n-gram tokens;
automatically apply a trained machine learning classifier to said text corpus, to generate a lexicon wherein each of said tokens has (a) a predicted sentiment orientation selected from the group consisting of positive, negative, and neutral, and (b) a confidence score; and
select a plurality of said tokens for manual adjustment of said sentiment orientation, wherein said selecting is based, at least in part on:
(iii) said confidence score of each of said plurality of said tokens meeting a specified range, and
(iv) a distribution probability of said predicted sentiment orientations within said plurality of said tokens is equal to a distribution probability of said predicted sentiment orientations in said lexicon.
5. The system of claim 4 , wherein said machine learning classifier is further trained on a new training set comprising at least some of said selected plurality of said tokens.
6. The system of claim 4 , wherein said confidence score is calculated based, at least in part, on applying a heuristic which takes into account at least some of:
(iii) a variance value of all of said sentiment orientations in said lexicon, and
(iv) a hyperbolic tangent function of the number of each of said tokens in said text corpus.