JP-SystemsX
commited on
Commit
•
e50ec9b
1
Parent(s):
61585e0
Switch from JSON to Parquet format init
Browse files- .gitignore +3 -0
- super_eurlex.py +4 -4
.gitignore
CHANGED
@@ -1,3 +1,6 @@
|
|
1 |
|
2 |
.idea/
|
3 |
requirements.txt
|
|
|
|
|
|
|
|
1 |
|
2 |
.idea/
|
3 |
requirements.txt
|
4 |
+
parquet_converter.py
|
5 |
+
text_data3/
|
6 |
+
meta_data3/
|
super_eurlex.py
CHANGED
@@ -91,8 +91,8 @@ class SuperEurlexConfig(datasets.BuilderConfig):
|
|
91 |
self.features = features
|
92 |
self.language = language
|
93 |
self.sector = sector
|
94 |
-
self.text_data_url = f"text_data/{language}/{sector}.
|
95 |
-
self.meta_data_url = f"meta_data/{sector}.
|
96 |
self.citation = citation
|
97 |
self.url = url
|
98 |
|
@@ -178,10 +178,10 @@ class SuperEurlex(datasets.GeneratorBasedBuilder):
|
|
178 |
print(sector)
|
179 |
|
180 |
print("Reading Text Data...")
|
181 |
-
text_data = pd.
|
182 |
text_data['celex_id'] = text_data['celex_id'].apply(lambda x: x[0] if isinstance(x,list) else x)
|
183 |
print("Reading Meta Data...")
|
184 |
-
meta_data = pd.
|
185 |
meta_data['celex_id'] = meta_data['celex_id'].apply(lambda x: x[0] if isinstance(x, list) else x)
|
186 |
print("Combining Text & Meta Data...")
|
187 |
combined_data = pd.merge(text_data, meta_data, on='celex_id')
|
|
|
91 |
self.features = features
|
92 |
self.language = language
|
93 |
self.sector = sector
|
94 |
+
self.text_data_url = f"text_data/{language}/{sector}.parquet"
|
95 |
+
self.meta_data_url = f"meta_data/{sector}.parquet"
|
96 |
self.citation = citation
|
97 |
self.url = url
|
98 |
|
|
|
178 |
print(sector)
|
179 |
|
180 |
print("Reading Text Data...")
|
181 |
+
text_data = pd.read_parquet(text)#, lines=True)
|
182 |
text_data['celex_id'] = text_data['celex_id'].apply(lambda x: x[0] if isinstance(x,list) else x)
|
183 |
print("Reading Meta Data...")
|
184 |
+
meta_data = pd.read_parquet(meta)#, lines=True)
|
185 |
meta_data['celex_id'] = meta_data['celex_id'].apply(lambda x: x[0] if isinstance(x, list) else x)
|
186 |
print("Combining Text & Meta Data...")
|
187 |
combined_data = pd.merge(text_data, meta_data, on='celex_id')
|