Difference between revisions of "Text Mining: Sentiment Classifier"

From OnnoWiki
Jump to navigation Jump to search
Line 9: Line 9:
 
* SentiWordNet http://sentiwordnet.isti.cnr.it
 
* SentiWordNet http://sentiwordnet.isti.cnr.it
  
How to Install
+
==Cara Install==
  
Shell command
+
Perintah shell
  
python setup.py install
+
python setup.py install
  
Documentation
+
==Dokumen==
 
+
    http://readthedocs.org/docs/sentiment_classifier/en/latest/
+
http://readthedocs.org/docs/sentiment_classifier/en/latest/
 
     Try Online
 
     Try Online
  
Script Usage
+
==Penggunaan==
  
Shell Commands:
+
Perintah shell
  
 
  senti_classifier -c file/with/review.txt
 
  senti_classifier -c file/with/review.txt
  
Python Usage
+
==Penggunaan Python==
  
Shell Commands
+
Perintah shell
  
 
  cd sentiment_classifier/src/senti_classifier/
 
  cd sentiment_classifier/src/senti_classifier/
 
  python senti_classifier.py -c reviews.txt
 
  python senti_classifier.py -c reviews.txt
  
Library Usage
+
==Penggunaan Library==
  
 
  from senti_classifier import senti_classifier
 
  from senti_classifier import senti_classifier
Line 39: Line 39:
 
  pos_score, neg_score = senti_classifier.polarity_scores(sentences)
 
  pos_score, neg_score = senti_classifier.polarity_scores(sentences)
 
  print pos_score, neg_score
 
  print pos_score, neg_score
 
 
 
  
  

Revision as of 09:21, 3 February 2017

Sentiment Classifier menggunakan Word Sense Disambiguation menggunakan WordNet dan statistik terjadinya kata dari corpus movie review NLTK. Mengklasifikasikan ke dalam kategori positif dan negatif.


Persyaratan

Cara Install

Perintah shell

python setup.py install

Dokumen

http://readthedocs.org/docs/sentiment_classifier/en/latest/
   Try Online

Penggunaan

Perintah shell

senti_classifier -c file/with/review.txt

Penggunaan Python

Perintah shell

cd sentiment_classifier/src/senti_classifier/
python senti_classifier.py -c reviews.txt

Penggunaan Library

from senti_classifier import senti_classifier
sentences = ['The movie was the worst movie', 'It was the worst acting by the actors']
pos_score, neg_score = senti_classifier.polarity_scores(sentences)
print pos_score, neg_score


Referensi