Commit
·
ec635cd
1
Parent(s):
e112f5a
Update parquet files
Browse files- .DS_Store +0 -0
- .gitattributes +0 -16
- data/.DS_Store +0 -0
- data/Finding_dev.conll +0 -0
- data/Finding_test.conll +0 -0
- data/Finding_train.conll +0 -0
- finding.py +0 -102
- finding/finding-test.parquet +0 -0
- finding/finding-train.parquet +0 -0
- finding/finding-validation.parquet +0 -0
.DS_Store
DELETED
|
Binary file (6.15 kB)
|
|
|
.gitattributes
DELETED
|
@@ -1,16 +0,0 @@
|
|
| 1 |
-
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
| 2 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 3 |
-
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 6 |
-
*.tar.gz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 8 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 9 |
-
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 10 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 11 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 12 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 15 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 16 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data/.DS_Store
DELETED
|
Binary file (6.15 kB)
|
|
|
data/Finding_dev.conll
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/Finding_test.conll
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/Finding_train.conll
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
finding.py
DELETED
|
@@ -1,102 +0,0 @@
|
|
| 1 |
-
import datasets
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
logger = datasets.logging.get_logger(__name__)
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
_CITATION = """\
|
| 8 |
-
|
| 9 |
-
"""
|
| 10 |
-
|
| 11 |
-
_DESCRIPTION = """\
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
"""
|
| 15 |
-
|
| 16 |
-
_URL = "https://huggingface.co/datasets/mrojas/finding/resolve/main/data/"
|
| 17 |
-
_TRAINING_FILE = "Finding_train.conll"
|
| 18 |
-
_DEV_FILE = "Finding_dev.conll"
|
| 19 |
-
_TEST_FILE = "Finding_test.conll"
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
class FindingConfig(datasets.BuilderConfig):
|
| 23 |
-
"""BuilderConfig for Finding"""
|
| 24 |
-
|
| 25 |
-
def __init__(self, **kwargs):
|
| 26 |
-
"""BuilderConfig for Finding.
|
| 27 |
-
Args:
|
| 28 |
-
**kwargs: keyword arguments forwarded to super.
|
| 29 |
-
"""
|
| 30 |
-
super(FindingConfig, self).__init__(**kwargs)
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
class Finding(datasets.GeneratorBasedBuilder):
|
| 34 |
-
"""Finding dataset."""
|
| 35 |
-
|
| 36 |
-
BUILDER_CONFIGS = [
|
| 37 |
-
FindingConfig(name="finding", version=datasets.Version("1.0.0"), description="Finding dataset"),
|
| 38 |
-
]
|
| 39 |
-
|
| 40 |
-
def _info(self):
|
| 41 |
-
return datasets.DatasetInfo(
|
| 42 |
-
description=_DESCRIPTION,
|
| 43 |
-
features=datasets.Features(
|
| 44 |
-
{
|
| 45 |
-
"tokens": datasets.Sequence(datasets.Value("string")),
|
| 46 |
-
"ner_tags": datasets.Sequence(
|
| 47 |
-
datasets.features.ClassLabel(
|
| 48 |
-
names=[
|
| 49 |
-
"O",
|
| 50 |
-
"B-Finding",
|
| 51 |
-
"I-Finding",
|
| 52 |
-
]
|
| 53 |
-
)
|
| 54 |
-
),
|
| 55 |
-
}
|
| 56 |
-
),
|
| 57 |
-
supervised_keys=None,
|
| 58 |
-
homepage="",
|
| 59 |
-
citation=_CITATION,
|
| 60 |
-
)
|
| 61 |
-
|
| 62 |
-
def _split_generators(self, dl_manager):
|
| 63 |
-
"""Returns SplitGenerators."""
|
| 64 |
-
urls_to_download = {
|
| 65 |
-
"train": f"{_URL}{_TRAINING_FILE}",
|
| 66 |
-
"dev": f"{_URL}{_DEV_FILE}",
|
| 67 |
-
"test": f"{_URL}{_TEST_FILE}",
|
| 68 |
-
}
|
| 69 |
-
downloaded_files = dl_manager.download_and_extract(urls_to_download)
|
| 70 |
-
|
| 71 |
-
return [
|
| 72 |
-
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
|
| 73 |
-
datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"]}),
|
| 74 |
-
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files["test"]}),
|
| 75 |
-
]
|
| 76 |
-
|
| 77 |
-
def _generate_examples(self, filepath):
|
| 78 |
-
logger.info("⏳ Generating examples from = %s", filepath)
|
| 79 |
-
with open(filepath, encoding="utf-8") as f:
|
| 80 |
-
id_ = 0
|
| 81 |
-
tokens = []
|
| 82 |
-
ner_tags = []
|
| 83 |
-
for line in f:
|
| 84 |
-
if line == "" or line == "\n":
|
| 85 |
-
if tokens:
|
| 86 |
-
yield id_, {
|
| 87 |
-
"tokens": tokens,
|
| 88 |
-
"ner_tags": ner_tags,
|
| 89 |
-
}
|
| 90 |
-
id_ += 1
|
| 91 |
-
tokens = []
|
| 92 |
-
ner_tags = []
|
| 93 |
-
else:
|
| 94 |
-
# conll2003 tokens are space separated
|
| 95 |
-
splits = line.split(" ")
|
| 96 |
-
tokens.append(splits[0])
|
| 97 |
-
ner_tags.append(splits[1].rstrip())
|
| 98 |
-
# last example
|
| 99 |
-
yield id_, {
|
| 100 |
-
"tokens": tokens,
|
| 101 |
-
"ner_tags": ner_tags,
|
| 102 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
finding/finding-test.parquet
ADDED
|
Binary file (76.2 kB). View file
|
|
|
finding/finding-train.parquet
ADDED
|
Binary file (609 kB). View file
|
|
|
finding/finding-validation.parquet
ADDED
|
Binary file (69.3 kB). View file
|
|
|