Datasets:
change 'id' to 'movieId'
Browse files
redial.py
CHANGED
@@ -37,21 +37,7 @@ class ReDIAL(datasets.GeneratorBasedBuilder):
|
|
37 |
name="SA",
|
38 |
description="For using the ReDIAL dataset to train sentiment analysis on movies in sentences",
|
39 |
features={
|
40 |
-
"
|
41 |
-
"movieName": datasets.Value("string"),
|
42 |
-
"messages": datasets.features.Sequence(datasets.Value("string")),
|
43 |
-
"senders": datasets.features.Sequence(datasets.Value("int32")),
|
44 |
-
"form": datasets.features.Sequence(
|
45 |
-
datasets.Value("int32"), length=6
|
46 |
-
)
|
47 |
-
},
|
48 |
-
# certain information(e.g. movie_occurrences) is model-specific, and we leave it for Dataset.map
|
49 |
-
),
|
50 |
-
RedialConfig(
|
51 |
-
name="SA_debug",
|
52 |
-
description="For using the ReDIAL dataset to train sentiment analysis on movies in sentences",
|
53 |
-
features={
|
54 |
-
"id": datasets.Value("int32"),
|
55 |
"movieName": datasets.Value("string"),
|
56 |
"messages": datasets.features.Sequence(datasets.Value("string")),
|
57 |
"senders": datasets.features.Sequence(datasets.Value("int32")),
|
@@ -170,12 +156,12 @@ class ReDIAL(datasets.GeneratorBasedBuilder):
|
|
170 |
if len(movieName) == 0:
|
171 |
continue
|
172 |
yield Idx, {
|
173 |
-
"
|
174 |
"movieName": movieName,
|
175 |
"messages": msgs,
|
176 |
"senders": senders,
|
177 |
"form": [init_q[id]["suggested"], init_q[id]["seen"], init_q[id]["liked"],
|
178 |
-
resp_q[id]["suggested"], resp_q[id]["seen"], resp_q[id]["liked"],]
|
179 |
}
|
180 |
Idx += 1
|
181 |
if Idx > 100 and "debug" in self.config.name:
|
|
|
37 |
name="SA",
|
38 |
description="For using the ReDIAL dataset to train sentiment analysis on movies in sentences",
|
39 |
features={
|
40 |
+
"movieId": datasets.Value("int32"),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
"movieName": datasets.Value("string"),
|
42 |
"messages": datasets.features.Sequence(datasets.Value("string")),
|
43 |
"senders": datasets.features.Sequence(datasets.Value("int32")),
|
|
|
156 |
if len(movieName) == 0:
|
157 |
continue
|
158 |
yield Idx, {
|
159 |
+
"movieId": int(id),
|
160 |
"movieName": movieName,
|
161 |
"messages": msgs,
|
162 |
"senders": senders,
|
163 |
"form": [init_q[id]["suggested"], init_q[id]["seen"], init_q[id]["liked"],
|
164 |
+
resp_q[id]["suggested"], resp_q[id]["seen"], resp_q[id]["liked"], ]
|
165 |
}
|
166 |
Idx += 1
|
167 |
if Idx > 100 and "debug" in self.config.name:
|