-
Notifications
You must be signed in to change notification settings - Fork 60
/
readme.txt
111 lines (66 loc) · 3.41 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
*****************************************************
Joint Sentiment-Topic (JST) Model
*****************************************************
(C) Copyright 2013, Chenghua Lin and Yulan He
Written by Chenghua Lin, University of Aberdeen, [email protected], part of code
is from http://gibbslda.sourceforge.net/.
This file is part of JST implementation.
JST is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your
option) any later version.
JST is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
------------------------------------------------------------------------
This is a C++ implementation of the joint sentiment-topic (JST) model for
sentiment classification and extracting sentiment-bearing topics from text copara.
------------------------------------------------------------------------
TABLE OF CONTENTS
A. COMPILING
B. ESTIMATION
C. INFERENCE
D. Data format
E. References
------------------------------------------------------------------------
A. COMPILING
Type "make" in a shell.
------------------------------------------------------------------------
B. ESTIMATION
Estimate the model by executing:
jst -est -config YOUR-PATH/train.properties
Outputs of jst estimation include the following files:
<iter>.others // contains model parameter settings
<iter>.pi // contains the per-document sentiment distributions
<iter>.phi // contains the sentiment specific topic-word distributions
<iter>.theta // contains the per-document sentiment specific topic proportions
<iter>.tassign // contains the sentiment label and topic assignments for words in training data
------------------------------------------------------------------------
C. INFERENCE
To perform inference on a different set of data (in the same format as
for estimation), execute:
jst -inf -config YOUR-PATH/test.properties
Outputs of jst inference include the following files:
<modelName_iter>.newothers
<modelName_iter>.newpi
<modelName_iter>.newphi
<modelName_iter>.newtheta
<modelName_iter>.newtassign
------------------------------------------------------------------------
D. Data format
(1) The input data format for estimation/inference is as follows, where each line is one document, preceded by the document ID.
[Doc_1 name] [token_1] [token_2] ... [token_N]
:
:
[Doc_M name] [token_1] [token_2] ... [token_N]
(2) Sentiment lexicon (mpqa.constraint)
[word] [neu prior prob.] [pos prior prob.] [neg prior prob.]
------------------------------------------------------------------------
E. References
[1] Lin, C., He, Y., Everson, R. and Reuger, S. Weakly-supervised Joint Sentiment-Topic Detection from Text, IEEE Transactions on Knowledge and Data Engineering (TKDE), 2011.
[2] Lin, C. and He, Y. Joint Sentiment/Topic Model for Sentiment Analysis, In Proceedings of the 18th ACM Conference on Information and Knowl- edge Management (CIKM), Hong Kong, China, 2009.