Difference between revisions of "Orange: Sentiment Analysis"

From OnnoWiki
Jump to navigation Jump to search
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
  
 +
Widget Sentiment Analysis akan memprediksi sentiment dari text.
  
Predict sentiment from text.
+
==Input==
  
Inputs
+
Corpus: A collection of documents.
  
    Corpus: A collection of documents.
+
==Output==
  
Outputs
+
Corpus: A corpus with information on the sentiment of each document.
  
    Corpus: A corpus with information on the sentiment of each document.
+
Widget Sentiment Analysis memprediksi sentiment untuk setiap dokumen di corpus. Widget Sentiment Analysis menggunakan modul sentimen Liu Hu dan Vader dari NLTK. Kedua-nya adalah lexicon-based. Untuk Liu Hu, kita dapat memilih versi English atau Slovenian.
  
Sentiment Analysis predicts sentiment for each document in a corpus. It uses Liu Hu and Vader sentiment modules from NLTK. Both of them are lexicon-based. For Liu Hu, you can choose English or Slovenian version.
+
[[File:SentimentAnalysis-stamped.png|center|400px|thumb]]
  
[[File:SentimentAnalysis-stamped.png|center|200px|thumb]]
+
* Method:
 
+
** Liu Hu: lexicon-based sentiment analysis (supports English and Slovenian)
    Method:
+
** Vader: lexicon- and rule-based sentiment analysis
        Liu Hu: lexicon-based sentiment analysis (supports English and Slovenian)
+
* Produce a report.
        Vader: lexicon- and rule-based sentiment analysis
+
* If Auto commit is on, sentiment-tagged corpus is communicated automatically. Alternatively press Commit.
    Produce a report.
 
    If Auto commit is on, sentiment-tagged corpus is communicated automatically. Alternatively press Commit.
 
  
 
==Contoh==
 
==Contoh==
  
Sentiment Analysis can be used for constructing additional features with sentiment prediction from corpus. First, we load Election-2016-tweets.tab in Corpus. Then we connect Corpus to Sentiment Analysis. The widget will append 4 new features for Vader method: positive score, negative score, neutral score and compound (combined score).
+
Widget Sentiment Analysis dapat digunakan untuk membangun feature tambahan dengan prediksi sentimen dari corpus. Untuk mencoba ini, kita load Election-2016-tweets.tab menggunakan widget Corpus. Kemudian sambungkan widget Corpus ke widget Sentiment Analysis. Widget Sentiment Analysis akan menambahkan 4 feature baru dari Vader method: positive score, negative score, neutral score dan compound (combined score).
 
 
We can observe new features in a Data Table, where we sorted the compound by score. Compound represents the total sentiment of a tweet, where -1 is the most negative and 1 the most positive.
 
  
[[File:Sentiment-DataTable.png|center|200px|thumb]]
+
Kita dapat amati feature baru ini di widget Data Table, dimana kita simpan compound sebagai score. Compound merepresentasikan total sentiment dari tweet, dimana -1 adalah paling negatif dan 1 paling positif..
  
Now let us visualize the data. We have some features we are currently not interested in, so we will remove them with Select Columns.
+
[[File:Sentiment-DataTable.png|center|400px|thumb]]
  
[[File:Sentiment-SelectColumns.png|center|200px|thumb]]
+
Sebelum melakukan visualisasi, beberapa feature yang tidak kita inginkan dapat dibuang menggunakan widget Select Columns.
  
Then we will make our corpus a little smaller, so it will be easier to visualize. Pass the data to Data Sampler and retain a random 10% of the tweets.
+
[[File:Sentiment-SelectColumns.png|center|400px|thumb]]
  
[[File:Sentiment-DataSampler.png|center|200px|thumb]]
+
Sehingga corpus kita lebih kecil, sehingga lebih mudah memvisualisasikan. Kirimkan dapat ke widget Data Sampler dan simpan hanya 10% random tweet saja.
  
Now pass the filtered corpus to Heat Map. Use Merge by k-means to merge tweets with the same polarity into one line. Then use Cluster by rows to create a clustered visualization where similar tweets are grouped together. Click on a cluster to select a group of tweets - we selected the negative cluster.
+
[[File:Sentiment-DataSampler.png|center|400px|thumb]]
  
[[File:Sentiment-HeatMap.png|center|200px|thumb]]
+
Selanjutkan, kirim corpus yang sudah di filter ke widget Heat Map. Gunakan Merge by k-means untuk menggabungkan tweet dengan polaritas yang sama dalam satu kalimat. Kemudian gunakan Cluster by rows untuk membuat sebuah clustered visualization dimana tweet yang sama di kumpulkan menjadi satu. Klik pada sebuah cluster untuk memilih sebuah group dari tweet - misalnya, kita memilih negatif cluster.
  
To observe the selected subset, pass the tweets to Corpus Viewer.
+
[[File:Sentiment-HeatMap.png|center|400px|thumb]]
  
[[File:Sentiment-CorpusViewer.png|center|200px|thumb]]
+
Untuk mengamati subnet yang di pilih, kirim tweet tersebut ke widget Corpus Viewer.
  
 +
[[File:Sentiment-CorpusViewer.png|center|400px|thumb]]
  
[[File:Sentiment-workflow.png|center|200px|thumb]]
+
Keseluruhan workflow dapat dilihat di bawah ini.
  
 +
[[File:Sentiment-workflow.png|center|600px|thumb]]
  
 
==Referensi==
 
==Referensi==

Latest revision as of 18:06, 11 April 2020

Sumber: https://orange3-text.readthedocs.io/en/latest/widgets/sentimentanalysis.html


Widget Sentiment Analysis akan memprediksi sentiment dari text.

Input

Corpus: A collection of documents.

Output

Corpus: A corpus with information on the sentiment of each document.

Widget Sentiment Analysis memprediksi sentiment untuk setiap dokumen di corpus. Widget Sentiment Analysis menggunakan modul sentimen Liu Hu dan Vader dari NLTK. Kedua-nya adalah lexicon-based. Untuk Liu Hu, kita dapat memilih versi English atau Slovenian.

SentimentAnalysis-stamped.png
  • Method:
    • Liu Hu: lexicon-based sentiment analysis (supports English and Slovenian)
    • Vader: lexicon- and rule-based sentiment analysis
  • Produce a report.
  • If Auto commit is on, sentiment-tagged corpus is communicated automatically. Alternatively press Commit.

Contoh

Widget Sentiment Analysis dapat digunakan untuk membangun feature tambahan dengan prediksi sentimen dari corpus. Untuk mencoba ini, kita load Election-2016-tweets.tab menggunakan widget Corpus. Kemudian sambungkan widget Corpus ke widget Sentiment Analysis. Widget Sentiment Analysis akan menambahkan 4 feature baru dari Vader method: positive score, negative score, neutral score dan compound (combined score).

Kita dapat amati feature baru ini di widget Data Table, dimana kita simpan compound sebagai score. Compound merepresentasikan total sentiment dari tweet, dimana -1 adalah paling negatif dan 1 paling positif..

Sentiment-DataTable.png

Sebelum melakukan visualisasi, beberapa feature yang tidak kita inginkan dapat dibuang menggunakan widget Select Columns.

Sentiment-SelectColumns.png

Sehingga corpus kita lebih kecil, sehingga lebih mudah memvisualisasikan. Kirimkan dapat ke widget Data Sampler dan simpan hanya 10% random tweet saja.

Sentiment-DataSampler.png

Selanjutkan, kirim corpus yang sudah di filter ke widget Heat Map. Gunakan Merge by k-means untuk menggabungkan tweet dengan polaritas yang sama dalam satu kalimat. Kemudian gunakan Cluster by rows untuk membuat sebuah clustered visualization dimana tweet yang sama di kumpulkan menjadi satu. Klik pada sebuah cluster untuk memilih sebuah group dari tweet - misalnya, kita memilih negatif cluster.

Sentiment-HeatMap.png

Untuk mengamati subnet yang di pilih, kirim tweet tersebut ke widget Corpus Viewer.

Sentiment-CorpusViewer.png

Keseluruhan workflow dapat dilihat di bawah ini.

Sentiment-workflow.png

Referensi

Hutto, C.J. and E. E. Gilbert (2014). VADER: A Parsimonious Rule-based Model for Sentiment Analysis of Social Media Text. Eighth International Conference on Weblogs and Social Media (ICWSM-14). Ann Arbor, MI, June 2014.

Hu, Minqing and Bing Liu (2004). Mining opinion features in customer reviews. In Proceedings of AAAI Conference on Artificial Intelligence, vol. 4, pp. 755–760. Available online.

Kadunc, Klemen and Marko Robnik-Šikonja (2016). Analiza mnenj s pomočjo strojnega učenja in slovenskega leksikona sentimenta. Conference on Language Technologies & Digital Humanities, Ljubljana (in Slovene). Available online.


Referensi

Pranala Menarik