-
Notifications
You must be signed in to change notification settings - Fork 61
/
config.py
187 lines (134 loc) · 4.44 KB
/
config.py
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
class Config:
model = "SVM"
runs = 1 # No. of runs of experiments
# Training modes
use_context = False # whether to use context information or not (default false)
use_author = False # add author one-hot encoding in the input
use_bert = True # if False, uses glove pooling
use_target_text = False
use_target_audio = False # adds audio target utterance features.
use_target_video = False # adds video target utterance features.
speaker_independent = False # speaker independent experiments
embedding_dim = 300 # GloVe embedding size
word_embedding_path = "/home/sacastro/glove.840B.300d.txt"
max_sent_length = 20
max_context_length = 4 # Maximum sentences to take in context
num_classes = 2 # Binary classification of sarcasm
svm_c = 10.0
svm_scale = True
fold = None
class SpeakerDependentTConfig(Config):
use_target_text = True
svm_c = 1.0
class SpeakerDependentAConfig(Config):
use_target_audio = True
svm_c = 1.0
class SpeakerDependentVConfig(Config):
use_target_video = True
svm_c = 1.0
class SpeakerDependentTAConfig(Config):
use_target_text = True
use_target_audio = True
svm_c = 1.0
class SpeakerDependentTVConfig(Config):
use_target_text = True
use_target_video = True
svm_c = 10.0
class SpeakerDependentAVConfig(Config):
use_target_audio = True
use_target_video = True
svm_c = 30.0
class SpeakerDependentTAVConfig(Config):
use_target_text = True
use_target_audio = True
use_target_video = True
svm_c = 10.0
class SpeakerDependentTPlusContext(SpeakerDependentTConfig):
use_context = True
svm_c = 1.0
class SpeakerDependentTPlusAuthor(SpeakerDependentTConfig):
use_author = True
svm_c = 10.0
class SpeakerDependentTVPlusContext(SpeakerDependentTVConfig):
use_context = True
svm_c = 10.0
class SpeakerDependentTVPlusAuthor(SpeakerDependentTVConfig):
use_author = True
svm_c = 10.0
class SpeakerIndependentTConfig(Config):
svm_scale = False
use_target_text = True
svm_c = 10.0
speaker_independent = True
class SpeakerIndependentAConfig(Config):
svm_scale = False
use_target_audio = True
svm_c = 1000.0
speaker_independent = True
class SpeakerIndependentVConfig(Config):
svm_scale = False
use_target_video = True
svm_c = 30.0
speaker_independent = True
class SpeakerIndependentTAConfig(Config):
svm_scale = False
use_target_text = True
use_target_audio = True
svm_c = 500.0
speaker_independent = True
class SpeakerIndependentTVConfig(Config):
svm_scale = False
use_target_text = True
use_target_video = True
svm_c = 10.0
speaker_independent = True
class SpeakerIndependentAVConfig(Config):
svm_scale = False
use_target_audio = True
use_target_video = True
svm_c = 500.0
speaker_independent = True
class SpeakerIndependentTAVConfig(Config):
svm_scale = False
use_target_text = True
use_target_audio = True
use_target_video = True
svm_c = 1000.0
speaker_independent = True
class SpeakerIndependentTPlusContext(SpeakerIndependentTConfig):
use_context = True
svm_c = 10.0
class SpeakerIndependentTPlusAuthor(SpeakerIndependentTConfig):
use_author = True
svm_c = 10.0
class SpeakerIndependentTAPlusContext(SpeakerIndependentTAConfig):
use_context = True
svm_c = 1000.0
class SpeakerIndependentTAPlusAuthor(SpeakerIndependentTAConfig):
use_author = True
svm_c = 1000.0
CONFIG_BY_KEY = {
"": Config(),
"t": SpeakerDependentTConfig(),
"a": SpeakerDependentAConfig(),
"v": SpeakerDependentVConfig(),
"ta": SpeakerDependentTAConfig(),
"tv": SpeakerDependentTVConfig(),
"av": SpeakerDependentAVConfig(),
"tav": SpeakerDependentTAVConfig(),
"t-c": SpeakerDependentTPlusContext(),
"t-author": SpeakerDependentTPlusAuthor(),
"tv-c": SpeakerDependentTVPlusContext(),
"tv-author": SpeakerDependentTVPlusAuthor(),
"i-t": SpeakerIndependentTConfig(),
"i-a": SpeakerIndependentAConfig(),
"i-v": SpeakerIndependentVConfig(),
"i-ta": SpeakerIndependentTAConfig(),
"i-tv": SpeakerIndependentTVConfig(),
"i-av": SpeakerIndependentAVConfig(),
"i-tav": SpeakerIndependentTAVConfig(),
"i-t-c": SpeakerIndependentTPlusContext(),
"i-t-author": SpeakerIndependentTPlusAuthor(),
"i-ta-c": SpeakerIndependentTAPlusContext(),
"i-ta-author": SpeakerIndependentTAPlusAuthor(),
}