Datasets:
Tasks:
Token Classification
Sub-tasks:
named-entity-recognition
Languages:
English
Size:
1K<n<10K
License:
Commit
•
90b00f6
0
Parent(s):
Update files from the datasets library (from 1.2.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.2.0
- .gitattributes +27 -0
- README.md +145 -0
- dataset_infos.json +1 -0
- dummy/ncbi_disease/1.0.0/dummy_data.zip +3 -0
- ncbi_disease.py +143 -0
.gitattributes
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
20 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
+
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- expert-generated
|
4 |
+
language_creators:
|
5 |
+
- expert-generated
|
6 |
+
languages:
|
7 |
+
- en
|
8 |
+
licenses:
|
9 |
+
- unknown
|
10 |
+
multilinguality:
|
11 |
+
- monolingual
|
12 |
+
size_categories:
|
13 |
+
- 1K<n<10K
|
14 |
+
source_datasets:
|
15 |
+
- original
|
16 |
+
task_categories:
|
17 |
+
- structure-prediction
|
18 |
+
task_ids:
|
19 |
+
- named-entity-recognition
|
20 |
+
---
|
21 |
+
|
22 |
+
# Dataset Card for [Dataset Name]
|
23 |
+
|
24 |
+
## Table of Contents
|
25 |
+
- [Dataset Card for [Dataset Name]](#dataset-card-for-dataset-name)
|
26 |
+
- [Table of Contents](#table-of-contents)
|
27 |
+
- [Dataset Description](#dataset-description)
|
28 |
+
- [Dataset Summary](#dataset-summary)
|
29 |
+
- [Supported Tasks and Leaderboards](#supported-tasks-and-leaderboards)
|
30 |
+
- [Languages](#languages)
|
31 |
+
- [Dataset Structure](#dataset-structure)
|
32 |
+
- [Data Instances](#data-instances)
|
33 |
+
- [Data Fields](#data-fields)
|
34 |
+
- [Data Splits](#data-splits)
|
35 |
+
- [Dataset Creation](#dataset-creation)
|
36 |
+
- [Curation Rationale](#curation-rationale)
|
37 |
+
- [Source Data](#source-data)
|
38 |
+
- [Initial Data Collection and Normalization](#initial-data-collection-and-normalization)
|
39 |
+
- [Who are the source language producers?](#who-are-the-source-language-producers)
|
40 |
+
- [Annotations](#annotations)
|
41 |
+
- [Annotation process](#annotation-process)
|
42 |
+
- [Who are the annotators?](#who-are-the-annotators)
|
43 |
+
- [Personal and Sensitive Information](#personal-and-sensitive-information)
|
44 |
+
- [Considerations for Using the Data](#considerations-for-using-the-data)
|
45 |
+
- [Social Impact of Dataset](#social-impact-of-dataset)
|
46 |
+
- [Discussion of Biases](#discussion-of-biases)
|
47 |
+
- [Other Known Limitations](#other-known-limitations)
|
48 |
+
- [Additional Information](#additional-information)
|
49 |
+
- [Dataset Curators](#dataset-curators)
|
50 |
+
- [Licensing Information](#licensing-information)
|
51 |
+
- [Citation Information](#citation-information)
|
52 |
+
|
53 |
+
## Dataset Description
|
54 |
+
|
55 |
+
- **Homepage:** [NCBI](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3951655/)
|
56 |
+
- **Repository:** [Github](https://github.com/spyysalo/ncbi-disease)
|
57 |
+
- **Paper:**
|
58 |
+
- **Leaderboard:**
|
59 |
+
- **Point of Contact:**
|
60 |
+
|
61 |
+
### Dataset Summary
|
62 |
+
|
63 |
+
[More Information Needed]
|
64 |
+
|
65 |
+
### Supported Tasks and Leaderboards
|
66 |
+
|
67 |
+
[More Information Needed]
|
68 |
+
|
69 |
+
### Languages
|
70 |
+
|
71 |
+
[More Information Needed]
|
72 |
+
|
73 |
+
## Dataset Structure
|
74 |
+
|
75 |
+
### Data Instances
|
76 |
+
|
77 |
+
[More Information Needed]
|
78 |
+
|
79 |
+
### Data Fields
|
80 |
+
|
81 |
+
- `id`: Sentence identifier.
|
82 |
+
- `tokens`: Array of tokens composing a sentence.
|
83 |
+
- `ner_tags`: Array of tags, where `0` indicates no disease mentioned, `1` signals the first token of a disease and `2` the subsequent disease tokens.
|
84 |
+
|
85 |
+
### Data Splits
|
86 |
+
|
87 |
+
[More Information Needed]
|
88 |
+
|
89 |
+
## Dataset Creation
|
90 |
+
|
91 |
+
### Curation Rationale
|
92 |
+
|
93 |
+
[More Information Needed]
|
94 |
+
|
95 |
+
### Source Data
|
96 |
+
|
97 |
+
#### Initial Data Collection and Normalization
|
98 |
+
|
99 |
+
[More Information Needed]
|
100 |
+
|
101 |
+
#### Who are the source language producers?
|
102 |
+
|
103 |
+
[More Information Needed]
|
104 |
+
|
105 |
+
### Annotations
|
106 |
+
|
107 |
+
#### Annotation process
|
108 |
+
|
109 |
+
[More Information Needed]
|
110 |
+
|
111 |
+
#### Who are the annotators?
|
112 |
+
|
113 |
+
[More Information Needed]
|
114 |
+
|
115 |
+
### Personal and Sensitive Information
|
116 |
+
|
117 |
+
[More Information Needed]
|
118 |
+
|
119 |
+
## Considerations for Using the Data
|
120 |
+
|
121 |
+
### Social Impact of Dataset
|
122 |
+
|
123 |
+
[More Information Needed]
|
124 |
+
|
125 |
+
### Discussion of Biases
|
126 |
+
|
127 |
+
[More Information Needed]
|
128 |
+
|
129 |
+
### Other Known Limitations
|
130 |
+
|
131 |
+
[More Information Needed]
|
132 |
+
|
133 |
+
## Additional Information
|
134 |
+
|
135 |
+
### Dataset Curators
|
136 |
+
|
137 |
+
[More Information Needed]
|
138 |
+
|
139 |
+
### Licensing Information
|
140 |
+
|
141 |
+
[More Information Needed]
|
142 |
+
|
143 |
+
### Citation Information
|
144 |
+
|
145 |
+
[More Information Needed]
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"ncbi_disease": {"description": "This paper presents the disease name and concept annotations of the NCBI disease corpus, a collection of 793 PubMed\nabstracts fully annotated at the mention and concept level to serve as a research resource for the biomedical natural\nlanguage processing community. Each PubMed abstract was manually annotated by two annotators with disease mentions\nand their corresponding concepts in Medical Subject Headings (MeSH\u00ae) or Online Mendelian Inheritance in Man (OMIM\u00ae).\nManual curation was performed using PubTator, which allowed the use of pre-annotations as a pre-step to manual annotations.\nFourteen annotators were randomly paired and differing annotations were discussed for reaching a consensus in two\nannotation phases. In this setting, a high inter-annotator agreement was observed. Finally, all results were checked\nagainst annotations of the rest of the corpus to assure corpus-wide consistency.\n\nFor more details, see: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3951655/\n\nThe original dataset can be downloaded from: https://www.ncbi.nlm.nih.gov/CBBresearch/Dogan/DISEASE/NCBI_corpus.zip\nThis dataset has been converted to CoNLL format for NER using the following tool: https://github.com/spyysalo/standoff2conll\nNote: there is a duplicate document (PMID 8528200) in the original data, and the duplicate is recreated in the converted data.\n", "citation": "@article{dougan2014ncbi,\n title={NCBI disease corpus: a resource for disease name recognition and concept normalization},\n author={Dogan, Rezarta Islamaj and Leaman, Robert and Lu, Zhiyong},\n journal={Journal of biomedical informatics},\n volume={47},\n pages={1--10},\n year={2014},\n publisher={Elsevier}\n}\n", "homepage": "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3951655/", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "ner_tags": {"feature": {"num_classes": 3, "names": ["O", "B-Disease", "I-Disease"], "names_file": null, "id": null, "_type": "ClassLabel"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "builder_name": "ncbi_disease", "config_name": "ncbi_disease", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 2355516, "num_examples": 5433, "dataset_name": "ncbi_disease"}, "validation": {"name": "validation", "num_bytes": 413900, "num_examples": 924, "dataset_name": "ncbi_disease"}, "test": {"name": "test", "num_bytes": 422842, "num_examples": 941, "dataset_name": "ncbi_disease"}}, "download_checksums": {"https://github.com/spyysalo/ncbi-disease/raw/master/conll/train.tsv": {"num_bytes": 1140476, "checksum": "5f87b0de649eccff21e6d6e49e304aace808056ecae55225ea31602192517be9"}, "https://github.com/spyysalo/ncbi-disease/raw/master/conll/devel.tsv": {"num_bytes": 200352, "checksum": "b4e1e7efcc2a35047bf2f3d281648357470e674f555d4a26a0049ac37d59cc61"}, "https://github.com/spyysalo/ncbi-disease/raw/master/conll/test.tsv": {"num_bytes": 205664, "checksum": "8f088ce45dc4746592188f9e69de3d89d87f3bb8f0ed8c4a287d018123fa148d"}}, "download_size": 1546492, "post_processing_size": null, "dataset_size": 3192258, "size_in_bytes": 4738750}}
|
dummy/ncbi_disease/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2966e8cee74b58e19b3415bf5376f14dd8dc9e3cfc8e40f9399c62a0aa2dde02
|
3 |
+
size 577
|
ncbi_disease.py
ADDED
@@ -0,0 +1,143 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
# Copyright 2020 HuggingFace Datasets Authors.
|
3 |
+
#
|
4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
+
# you may not use this file except in compliance with the License.
|
6 |
+
# You may obtain a copy of the License at
|
7 |
+
#
|
8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
+
#
|
10 |
+
# Unless required by applicable law or agreed to in writing, software
|
11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
+
# See the License for the specific language governing permissions and
|
14 |
+
# limitations under the License.
|
15 |
+
|
16 |
+
# Lint as: python3
|
17 |
+
"""NCBI disease corpus: a resource for disease name recognition and concept normalization"""
|
18 |
+
|
19 |
+
import logging
|
20 |
+
|
21 |
+
import datasets
|
22 |
+
|
23 |
+
|
24 |
+
_CITATION = """\
|
25 |
+
@article{dougan2014ncbi,
|
26 |
+
title={NCBI disease corpus: a resource for disease name recognition and concept normalization},
|
27 |
+
author={Dogan, Rezarta Islamaj and Leaman, Robert and Lu, Zhiyong},
|
28 |
+
journal={Journal of biomedical informatics},
|
29 |
+
volume={47},
|
30 |
+
pages={1--10},
|
31 |
+
year={2014},
|
32 |
+
publisher={Elsevier}
|
33 |
+
}
|
34 |
+
"""
|
35 |
+
|
36 |
+
_DESCRIPTION = """\
|
37 |
+
This paper presents the disease name and concept annotations of the NCBI disease corpus, a collection of 793 PubMed
|
38 |
+
abstracts fully annotated at the mention and concept level to serve as a research resource for the biomedical natural
|
39 |
+
language processing community. Each PubMed abstract was manually annotated by two annotators with disease mentions
|
40 |
+
and their corresponding concepts in Medical Subject Headings (MeSH®) or Online Mendelian Inheritance in Man (OMIM®).
|
41 |
+
Manual curation was performed using PubTator, which allowed the use of pre-annotations as a pre-step to manual annotations.
|
42 |
+
Fourteen annotators were randomly paired and differing annotations were discussed for reaching a consensus in two
|
43 |
+
annotation phases. In this setting, a high inter-annotator agreement was observed. Finally, all results were checked
|
44 |
+
against annotations of the rest of the corpus to assure corpus-wide consistency.
|
45 |
+
|
46 |
+
For more details, see: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3951655/
|
47 |
+
|
48 |
+
The original dataset can be downloaded from: https://www.ncbi.nlm.nih.gov/CBBresearch/Dogan/DISEASE/NCBI_corpus.zip
|
49 |
+
This dataset has been converted to CoNLL format for NER using the following tool: https://github.com/spyysalo/standoff2conll
|
50 |
+
Note: there is a duplicate document (PMID 8528200) in the original data, and the duplicate is recreated in the converted data.
|
51 |
+
"""
|
52 |
+
|
53 |
+
_HOMEPAGE = "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3951655/"
|
54 |
+
_URL = "https://github.com/spyysalo/ncbi-disease/raw/master/conll/"
|
55 |
+
_TRAINING_FILE = "train.tsv"
|
56 |
+
_DEV_FILE = "devel.tsv"
|
57 |
+
_TEST_FILE = "test.tsv"
|
58 |
+
|
59 |
+
|
60 |
+
class NCBIDiseaseConfig(datasets.BuilderConfig):
|
61 |
+
"""BuilderConfig for NCBIDisease"""
|
62 |
+
|
63 |
+
def __init__(self, **kwargs):
|
64 |
+
"""BuilderConfig for NCBIDisease.
|
65 |
+
Args:
|
66 |
+
**kwargs: keyword arguments forwarded to super.
|
67 |
+
"""
|
68 |
+
super(NCBIDiseaseConfig, self).__init__(**kwargs)
|
69 |
+
|
70 |
+
|
71 |
+
class NCBIDisease(datasets.GeneratorBasedBuilder):
|
72 |
+
"""NCBIDisease dataset."""
|
73 |
+
|
74 |
+
BUILDER_CONFIGS = [
|
75 |
+
NCBIDiseaseConfig(name="ncbi_disease", version=datasets.Version("1.0.0"), description="NCBIDisease dataset"),
|
76 |
+
]
|
77 |
+
|
78 |
+
def _info(self):
|
79 |
+
return datasets.DatasetInfo(
|
80 |
+
description=_DESCRIPTION,
|
81 |
+
features=datasets.Features(
|
82 |
+
{
|
83 |
+
"id": datasets.Value("string"),
|
84 |
+
"tokens": datasets.Sequence(datasets.Value("string")),
|
85 |
+
"ner_tags": datasets.Sequence(
|
86 |
+
datasets.features.ClassLabel(
|
87 |
+
names=[
|
88 |
+
"O",
|
89 |
+
"B-Disease",
|
90 |
+
"I-Disease",
|
91 |
+
]
|
92 |
+
)
|
93 |
+
),
|
94 |
+
}
|
95 |
+
),
|
96 |
+
supervised_keys=None,
|
97 |
+
homepage=_HOMEPAGE,
|
98 |
+
citation=_CITATION,
|
99 |
+
)
|
100 |
+
|
101 |
+
def _split_generators(self, dl_manager):
|
102 |
+
"""Returns SplitGenerators."""
|
103 |
+
urls_to_download = {
|
104 |
+
"train": f"{_URL}{_TRAINING_FILE}",
|
105 |
+
"dev": f"{_URL}{_DEV_FILE}",
|
106 |
+
"test": f"{_URL}{_TEST_FILE}",
|
107 |
+
}
|
108 |
+
downloaded_files = dl_manager.download_and_extract(urls_to_download)
|
109 |
+
|
110 |
+
return [
|
111 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
|
112 |
+
datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"]}),
|
113 |
+
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files["test"]}),
|
114 |
+
]
|
115 |
+
|
116 |
+
def _generate_examples(self, filepath):
|
117 |
+
logging.info("⏳ Generating examples from = %s", filepath)
|
118 |
+
with open(filepath, encoding="utf-8") as f:
|
119 |
+
guid = 0
|
120 |
+
tokens = []
|
121 |
+
ner_tags = []
|
122 |
+
for line in f:
|
123 |
+
if line.startswith("-DOCSTART-") or line == "" or line == "\n":
|
124 |
+
if tokens:
|
125 |
+
yield guid, {
|
126 |
+
"id": str(guid),
|
127 |
+
"tokens": tokens,
|
128 |
+
"ner_tags": ner_tags,
|
129 |
+
}
|
130 |
+
guid += 1
|
131 |
+
tokens = []
|
132 |
+
ner_tags = []
|
133 |
+
else:
|
134 |
+
# tokens are tab separated
|
135 |
+
splits = line.split("\t")
|
136 |
+
tokens.append(splits[0])
|
137 |
+
ner_tags.append(splits[1].rstrip())
|
138 |
+
# last example
|
139 |
+
yield guid, {
|
140 |
+
"id": str(guid),
|
141 |
+
"tokens": tokens,
|
142 |
+
"ner_tags": ner_tags,
|
143 |
+
}
|