Skip to content
Snippets Groups Projects
Commit abf4a7c6 authored by snigdha's avatar snigdha
Browse files

updated readme

parent 83164867
No related branches found
No related tags found
No related merge requests found
...@@ -51,8 +51,8 @@ ...@@ -51,8 +51,8 @@
<file leaf-file-name="README.md" pinned="false" current-in-tab="true"> <file leaf-file-name="README.md" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/README.md"> <entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="480"> <state relative-caret-position="360">
<caret line="32" column="63" selection-start-line="32" selection-start-column="63" selection-end-line="32" selection-end-column="63" /> <caret line="24" column="0" selection-start-line="24" selection-start-column="0" selection-end-line="24" selection-end-column="0" />
<folding /> <folding />
</state> </state>
</provider> </provider>
...@@ -489,12 +489,12 @@ ...@@ -489,12 +489,12 @@
<workItem from="1480638593636" duration="502000" /> <workItem from="1480638593636" duration="502000" />
<workItem from="1480639104215" duration="1864000" /> <workItem from="1480639104215" duration="1864000" />
<workItem from="1480641007400" duration="133000" /> <workItem from="1480641007400" duration="133000" />
<workItem from="1480641193493" duration="238000" /> <workItem from="1480641193493" duration="435000" />
</task> </task>
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="3188000" /> <option name="totallyTimeSpent" value="3385000" />
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="0" y="22" width="1906" height="970" extended-state="0" /> <frame x="0" y="22" width="1906" height="970" extended-state="0" />
...@@ -688,8 +688,8 @@ ...@@ -688,8 +688,8 @@
</entry> </entry>
<entry file="file://$PROJECT_DIR$/README.md"> <entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="480"> <state relative-caret-position="360">
<caret line="32" column="63" selection-start-line="32" selection-start-column="63" selection-end-line="32" selection-end-column="63" /> <caret line="24" column="0" selection-start-line="24" selection-start-column="0" selection-end-line="24" selection-end-column="0" />
<folding /> <folding />
</state> </state>
</provider> </provider>
......
This class takes a sentence as input and outputs its 'happiness'. This class takes a sentence as input and outputs its 'happiness'.
Happiness is a categorical variables that takes values: Happiness is a categorical variables that takes values:
1 when the overall sentiment of the sentence is positive 1 when the overall sentiment of the sentence is positive
-1 when the overall sentiment of the sentence is negative -1 when the overall sentiment of the sentence is negative
0 when the overall sentiment of the sentence is neutral 0 when the overall sentiment of the sentence is neutral
The code uses two lexicons for sentiment computation: The code uses two lexicons for sentiment computation:
1) BingLiu's lexicon at http://www.cs.uic.edu/~liub/FBS/sentiment-analysis.html 1) BingLiu's lexicon at http://www.cs.uic.edu/~liub/FBS/sentiment-analysis.html
Please cite one of the following two papers: Please cite one of the following two papers:
Minqing Hu and Bing Liu. "Mining and Summarizing Customer Reviews." Minqing Hu and Bing Liu(2004). Mining and Summarizing Customer Reviews. Proceedings of
Proceedings of the ACM SIGKDD International Conference on Knowledge the ACM SIGKDD International Conference on Knowledge Discovery and Data Mining
Discovery and Data Mining (KDD-2004), Aug 22-25, 2004, Seattle, (KDD-2004), Aug 22-25, 2004, Seattle, Washington, USA.
Washington, USA,
Bing Liu, Minqing Hu and Junsheng Cheng. "Opinion Observer: Analyzing Bing Liu, Minqing Hu and Junsheng Cheng (2005). Opinion Observer: Analyzing and Comparing Opinions on the Web.
and Comparing Opinions on the Web." Proceedings of the 14th Proceedings of the 14th International World Wide Web conference (WWW-2005), May 10-14, 2005, Chiba, Japan.
International World Wide Web conference (WWW-2005), May 10-14,
2005, Chiba, Japan.
2) MPQA lexicon 2) MPQA lexicon
Please cite: Please cite:
Theresa Wilson, Janyce Wiebe and Paul Hoffmann (2005). Recognizing Contextual Theresa Wilson, Janyce Wiebe and Paul Hoffmann (2005). Recognizing Contextual
...@@ -30,11 +33,17 @@ Please cite: ...@@ -30,11 +33,17 @@ Please cite:
Example of how to use this class Example of how to use this class
public void demo() throws Exception{ public void demo() throws Exception{
SentimentHandler sentimentHandler = new SentimentHandler(); SentimentHandler sentimentHandler = new SentimentHandler();
String sent = "She thought she was not happy."; String sent = "She thought she was not happy.";
Pair<Integer, Integer> happ = sentimentHandler.getHappiness(sent); Pair<Integer, Integer> happ = sentimentHandler.getHappiness(sent);
System.out.println("Happiness according to BingLiu Lexicon: "+happ.getFirst()); System.out.println("Happiness according to BingLiu Lexicon: "+happ.getFirst());
System.out.println("Happiness according to MPQA Lexicon: "+happ.getSecond()); System.out.println("Happiness according to MPQA Lexicon: "+happ.getSecond());
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment