Gaëtan Caillaut commited on
Commit ·
8e8eb22
1
Parent(s): 46a70d6
update dataset to v0.2.1
Browse files
README.md
CHANGED
|
@@ -51,6 +51,19 @@ The dataset `entities` contains description for each Wikipedia pages.
|
|
| 51 |
"wikipedia_id": "Identifier of the Wikipedia page",
|
| 52 |
"wikipedia_url": "URL to the Wikipedia page",
|
| 53 |
"wikidata_url": "URL to the Wikidata page. Can be null.",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
"words": ["words", "in", "the", "sentence"],
|
| 55 |
"ner": ["ner", "labels", "of", "each", "words"],
|
| 56 |
"el": ["el", "labels", "of", "each", "words"]
|
|
|
|
| 51 |
"wikipedia_id": "Identifier of the Wikipedia page",
|
| 52 |
"wikipedia_url": "URL to the Wikipedia page",
|
| 53 |
"wikidata_url": "URL to the Wikidata page. Can be null.",
|
| 54 |
+
"sentences" : [
|
| 55 |
+
{
|
| 56 |
+
"text": "text of the current sentence",
|
| 57 |
+
"ner": ["list", "of", "ner", "labels"],
|
| 58 |
+
"mention_mappings": [
|
| 59 |
+
(start_of_first_mention, end_of_first_mention),
|
| 60 |
+
(start_of_second_mention, end_of_second_mention)
|
| 61 |
+
],
|
| 62 |
+
"el_wikidata_id": ["wikidata id of first mention", "wikidata id of second mention"],
|
| 63 |
+
"el_wikipedia_id": [wikipedia id of first mention, wikipedia id of second mention],
|
| 64 |
+
"el_wikipedia_title": ["wikipedia title of first mention", "wikipedia title of second mention"]
|
| 65 |
+
}
|
| 66 |
+
]
|
| 67 |
"words": ["words", "in", "the", "sentence"],
|
| 68 |
"ner": ["ner", "labels", "of", "each", "words"],
|
| 69 |
"el": ["el", "labels", "of", "each", "words"]
|
data/frwiki-20220901/corpus.jsonl.gz
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c354336bc135f7b9da4ab95f0ba727c45233001e2bd0f7c457f7b9dcc1c7d1af
|
| 3 |
+
size 3195634980
|
data/frwiki-20220901/corpus_abstracts.jsonl.gz
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3210691cc62dd2c17d41c5940cdecd19611431dd75a8f70f6e044597204383af
|
| 3 |
+
size 461618096
|
data/frwiki-20220901/corpus_mini.jsonl.gz
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:91414a72404a749999d1979ef089a4ab42a77d609220878e44c1a2f57e427c8d
|
| 3 |
+
size 138746
|
data/frwiki-20220901/entities.jsonl.gz
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0b0c6295842f38647d9e4330c150fc291d14e11987f779b3bb324d33802bf274
|
| 3 |
+
size 184935939
|
frwiki_el.py
CHANGED
|
@@ -45,7 +45,7 @@ class FrwikiElDataset(datasets.GeneratorBasedBuilder):
|
|
| 45 |
"""
|
| 46 |
"""
|
| 47 |
|
| 48 |
-
VERSION = datasets.Version("0.2.
|
| 49 |
|
| 50 |
# This is an example of a dataset with multiple configurations.
|
| 51 |
# If you don't want/need to define several sub-sets in your dataset,
|
|
@@ -77,7 +77,7 @@ class FrwikiElDataset(datasets.GeneratorBasedBuilder):
|
|
| 77 |
features = datasets.Features({
|
| 78 |
"name": datasets.Value("string"),
|
| 79 |
"wikidata_id": datasets.Value("string"),
|
| 80 |
-
"wikipedia_id": datasets.Value("
|
| 81 |
"wikipedia_url": datasets.Value("string"),
|
| 82 |
"wikidata_url": datasets.Value("string"),
|
| 83 |
"sentences": [{
|
|
@@ -85,7 +85,7 @@ class FrwikiElDataset(datasets.GeneratorBasedBuilder):
|
|
| 85 |
"ner": [datasets.Value("string")],
|
| 86 |
"mention_mappings": [[datasets.Value("int16")]],
|
| 87 |
"el_wikidata_id": [datasets.Value("string")],
|
| 88 |
-
"el_wikipedia_id": [datasets.Value("
|
| 89 |
"el_wikipedia_title": [datasets.Value("string")],
|
| 90 |
}]
|
| 91 |
})
|
|
@@ -93,7 +93,7 @@ class FrwikiElDataset(datasets.GeneratorBasedBuilder):
|
|
| 93 |
features = datasets.Features({
|
| 94 |
"name": datasets.Value("string"),
|
| 95 |
"wikidata_id": datasets.Value("string"),
|
| 96 |
-
"wikipedia_id": datasets.Value("
|
| 97 |
"wikipedia_url": datasets.Value("string"),
|
| 98 |
"wikidata_url": datasets.Value("string"),
|
| 99 |
"description": datasets.Value("string"),
|
|
@@ -139,9 +139,6 @@ class FrwikiElDataset(datasets.GeneratorBasedBuilder):
|
|
| 139 |
# This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
|
| 140 |
# The `key` is here for legacy reason (tfds) and is not important in itself.
|
| 141 |
|
| 142 |
-
def _identiy(x):
|
| 143 |
-
return x
|
| 144 |
-
|
| 145 |
# We need to use open before gzip.open in case the dataset is streamed
|
| 146 |
# https://github.com/huggingface/datasets/issues/2607#issuecomment-883219727
|
| 147 |
with gzip.open(open(path, 'rb'), "rt", encoding="UTF-8") as datafile:
|
|
|
|
| 45 |
"""
|
| 46 |
"""
|
| 47 |
|
| 48 |
+
VERSION = datasets.Version("0.2.1")
|
| 49 |
|
| 50 |
# This is an example of a dataset with multiple configurations.
|
| 51 |
# If you don't want/need to define several sub-sets in your dataset,
|
|
|
|
| 77 |
features = datasets.Features({
|
| 78 |
"name": datasets.Value("string"),
|
| 79 |
"wikidata_id": datasets.Value("string"),
|
| 80 |
+
"wikipedia_id": datasets.Value("int32"),
|
| 81 |
"wikipedia_url": datasets.Value("string"),
|
| 82 |
"wikidata_url": datasets.Value("string"),
|
| 83 |
"sentences": [{
|
|
|
|
| 85 |
"ner": [datasets.Value("string")],
|
| 86 |
"mention_mappings": [[datasets.Value("int16")]],
|
| 87 |
"el_wikidata_id": [datasets.Value("string")],
|
| 88 |
+
"el_wikipedia_id": [datasets.Value("int32")],
|
| 89 |
"el_wikipedia_title": [datasets.Value("string")],
|
| 90 |
}]
|
| 91 |
})
|
|
|
|
| 93 |
features = datasets.Features({
|
| 94 |
"name": datasets.Value("string"),
|
| 95 |
"wikidata_id": datasets.Value("string"),
|
| 96 |
+
"wikipedia_id": datasets.Value("int32"),
|
| 97 |
"wikipedia_url": datasets.Value("string"),
|
| 98 |
"wikidata_url": datasets.Value("string"),
|
| 99 |
"description": datasets.Value("string"),
|
|
|
|
| 139 |
# This method handles input defined in _split_generators to yield (key, example) tuples from the dataset.
|
| 140 |
# The `key` is here for legacy reason (tfds) and is not important in itself.
|
| 141 |
|
|
|
|
|
|
|
|
|
|
| 142 |
# We need to use open before gzip.open in case the dataset is streamed
|
| 143 |
# https://github.com/huggingface/datasets/issues/2607#issuecomment-883219727
|
| 144 |
with gzip.open(open(path, 'rb'), "rt", encoding="UTF-8") as datafile:
|