kiddothe2b
commited on
Update eu_debates.py
Browse files- eu_debates.py +5 -8
eu_debates.py
CHANGED
@@ -44,7 +44,6 @@ class EUDebatesConfig(datasets.BuilderConfig):
|
|
44 |
Args:
|
45 |
data_url: `string`, url to download the zip file from
|
46 |
data_file: `string`, filename for data set
|
47 |
-
url: `string`, url for information about the data set
|
48 |
**kwargs: keyword arguments forwarded to super.
|
49 |
"""
|
50 |
super(EUParliamentsConfig, self).__init__(version=datasets.Version("1.0.0", ""), **kwargs)
|
@@ -57,11 +56,9 @@ class EUDebates(datasets.GeneratorBasedBuilder):
|
|
57 |
|
58 |
BUILDER_CONFIGS = [
|
59 |
EUParliamentsConfig(
|
60 |
-
name="
|
61 |
-
data_url=os.path.join(MAIN_PATH, "
|
62 |
-
citation=textwrap.dedent(
|
63 |
-
"""N/A"""
|
64 |
-
),
|
65 |
),
|
66 |
]
|
67 |
|
@@ -100,8 +97,8 @@ class EUDebates(datasets.GeneratorBasedBuilder):
|
|
100 |
for id_, row in enumerate(f):
|
101 |
data = json.loads(row)
|
102 |
example = {
|
103 |
-
"text": data["text"],
|
104 |
-
"translated_text": data["translated_text"],
|
105 |
"speaker_party": data["speaker_party"],
|
106 |
"speaker_role": data["speaker_role"],
|
107 |
"speaker_name": data["speaker_name"],
|
|
|
44 |
Args:
|
45 |
data_url: `string`, url to download the zip file from
|
46 |
data_file: `string`, filename for data set
|
|
|
47 |
**kwargs: keyword arguments forwarded to super.
|
48 |
"""
|
49 |
super(EUParliamentsConfig, self).__init__(version=datasets.Version("1.0.0", ""), **kwargs)
|
|
|
56 |
|
57 |
BUILDER_CONFIGS = [
|
58 |
EUParliamentsConfig(
|
59 |
+
name="eu_debates",
|
60 |
+
data_url=os.path.join(MAIN_PATH, "eu_debates.zip"),
|
61 |
+
citation=textwrap.dedent(MAIN_CITATION),
|
|
|
|
|
62 |
),
|
63 |
]
|
64 |
|
|
|
97 |
for id_, row in enumerate(f):
|
98 |
data = json.loads(row)
|
99 |
example = {
|
100 |
+
"text": data["text"] if 'text' in data else None,
|
101 |
+
"translated_text": data["translated_text"] if 'translated_text' in data else None,
|
102 |
"speaker_party": data["speaker_party"],
|
103 |
"speaker_role": data["speaker_role"],
|
104 |
"speaker_name": data["speaker_name"],
|