Datasets:
Tasks:
Token Classification
Sub-tasks:
named-entity-recognition
Languages:
English
Size:
100K<n<1M
License:
Commit
•
6c33dc8
1
Parent(s):
deed5ea
Update nyt_ingredients.py
Browse files- nyt_ingredients.py +8 -1
nyt_ingredients.py
CHANGED
@@ -39,6 +39,11 @@ Black pepper, to taste
|
|
39 |
|
40 |
_URL = "https://github.com/nytimes/ingredient-phrase-tagger"
|
41 |
|
|
|
|
|
|
|
|
|
|
|
42 |
import json
|
43 |
|
44 |
|
@@ -102,10 +107,12 @@ class NYTIngedients(datasets.GeneratorBasedBuilder):
|
|
102 |
|
103 |
def _split_generators(self, dl_manager):
|
104 |
"""Returns SplitGenerators."""
|
|
|
|
|
105 |
return [
|
106 |
datasets.SplitGenerator(
|
107 |
name=datasets.Split.TRAIN,
|
108 |
-
gen_kwargs={"filepath": "nyt-ingredients.crf.jsonl"},
|
109 |
),
|
110 |
]
|
111 |
|
|
|
39 |
|
40 |
_URL = "https://github.com/nytimes/ingredient-phrase-tagger"
|
41 |
|
42 |
+
|
43 |
+
_URLS = {
|
44 |
+
"train": "https://huggingface.co/datasets/napsternxg/nyt_ingredients/resolve/main/nyt-ingredients.crf.jsonl"
|
45 |
+
}
|
46 |
+
|
47 |
import json
|
48 |
|
49 |
|
|
|
107 |
|
108 |
def _split_generators(self, dl_manager):
|
109 |
"""Returns SplitGenerators."""
|
110 |
+
urls = _URLS[self.config.name]
|
111 |
+
data_dir = dl_manager.download_and_extract(urls)
|
112 |
return [
|
113 |
datasets.SplitGenerator(
|
114 |
name=datasets.Split.TRAIN,
|
115 |
+
gen_kwargs={"filepath": f"{data_dir}/nyt-ingredients.crf.jsonl"},
|
116 |
),
|
117 |
]
|
118 |
|