Analyze the polarity of a text. A maximum entropy classifier is used to determine tone of the text as positive or negative using the OpenNLP library.
Model training data used was first published in Bo Pang and Lillian Lee, "A Sentimental Education: Sentiment Analysis Using Subjectivity Summarization Based on Minimum Cuts", Proceedings of the ACL, 2004.
The training data of the provided model is best suited to assess the polarity for reviews as opposed to freestanding text.
Example: The function better assesses positives and negatives from movie or product reviews rather than Twitter and Facebook posts.
This function works very well for reviews to determine if the review was positive or negative. Below are examples of this function used on product reviews.
|Product A||ANALYZE_POLARITY returns|
|My 6 year old daughter wanted to learn to use bake and this is the perfect tool! She able was this product immediately! The pans are textured, so nothing seemed to slip. The handles are a good size for little hands.||positive|
|This product was too weak to for its intended use. Even on the highest setting it did not perform the job I needed it to. This might be useful if you are using it for light work but it definitely is not a heavy duty item.||negative|