Datasets:
boragokbakan
commited on
Commit
·
6764963
1
Parent(s):
7eca433
generate
Browse files- entity_disambiguation.py +7 -0
entity_disambiguation.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
from typing import List
|
2 |
|
3 |
import datasets
|
@@ -87,3 +88,9 @@ class EntityDisambiguation(datasets.GeneratorBasedBuilder):
|
|
87 |
|
88 |
def _info(self) -> datasets.DatasetInfo:
|
89 |
return datasets.DatasetInfo(description="Entity Disambiguation dataset", features=self.config.features)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import json
|
2 |
from typing import List
|
3 |
|
4 |
import datasets
|
|
|
88 |
|
89 |
def _info(self) -> datasets.DatasetInfo:
|
90 |
return datasets.DatasetInfo(description="Entity Disambiguation dataset", features=self.config.features)
|
91 |
+
|
92 |
+
def _generate_examples(self, filepath: str, split: str):
|
93 |
+
with open(filepath, encoding="utf-8") as f:
|
94 |
+
for line in f:
|
95 |
+
row = json.loads(line)
|
96 |
+
yield row["id"], row
|