Datasets:

Sub-tasks: parsing
Languages: Chinese
Multilinguality: monolingual
Size Categories: 1K<n<10K
Language Creators: found
Annotations Creators: crowdsourced
Source Datasets: original
License:
system HF staff commited on
Commit
0a0f653
0 Parent(s):

Update files from the datasets library (from 1.2.0)

Browse files

Release notes: https://github.com/huggingface/datasets/releases/tag/1.2.0

Files changed (5) hide show
  1. .gitattributes +27 -0
  2. README.md +144 -0
  3. amttl.py +146 -0
  4. dataset_infos.json +1 -0
  5. dummy/amttl/1.0.0/dummy_data.zip +3 -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,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ annotations_creators:
3
+ - crowdsourced
4
+ language_creators:
5
+ - found
6
+ languages:
7
+ - zh
8
+ licenses:
9
+ - mit
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
+ - parsing
20
+ ---
21
+
22
+ # Dataset Card for AMTTL
23
+
24
+ ## Table of Contents
25
+ - [Dataset Description](#dataset-description)
26
+ - [Dataset Summary](#dataset-summary)
27
+ - [Supported Tasks](#supported-tasks-and-leaderboards)
28
+ - [Languages](#languages)
29
+ - [Dataset Structure](#dataset-structure)
30
+ - [Data Instances](#data-instances)
31
+ - [Data Fields](#data-instances)
32
+ - [Data Splits](#data-instances)
33
+ - [Dataset Creation](#dataset-creation)
34
+ - [Curation Rationale](#curation-rationale)
35
+ - [Source Data](#source-data)
36
+ - [Annotations](#annotations)
37
+ - [Personal and Sensitive Information](#personal-and-sensitive-information)
38
+ - [Considerations for Using the Data](#considerations-for-using-the-data)
39
+ - [Social Impact of Dataset](#social-impact-of-dataset)
40
+ - [Discussion of Biases](#discussion-of-biases)
41
+ - [Other Known Limitations](#other-known-limitations)
42
+ - [Additional Information](#additional-information)
43
+ - [Dataset Curators](#dataset-curators)
44
+ - [Licensing Information](#licensing-information)
45
+ - [Citation Information](#citation-information)
46
+
47
+ ## Dataset Description
48
+
49
+ - **Homepage:** [Github](https://github.com/adapt-sjtu/AMTTL/tree/master/medical_data)
50
+ - **Repository:** [Github](https://github.com/adapt-sjtu/AMTTL/tree/master/medical_data)
51
+ - **Paper:** [Aclweb](http://aclweb.org/anthology/C18-1307)
52
+ - **Leaderboard:**
53
+ - **Point of Contact:**
54
+
55
+ ### Dataset Summary
56
+
57
+ [More Information Needed]
58
+
59
+ ### Supported Tasks and Leaderboards
60
+
61
+ [More Information Needed]
62
+
63
+ ### Languages
64
+
65
+ [More Information Needed]
66
+
67
+ ## Dataset Structure
68
+
69
+ ### Data Instances
70
+
71
+ [More Information Needed]
72
+
73
+ ### Data Fields
74
+
75
+ [More Information Needed]
76
+
77
+ ### Data Splits
78
+
79
+ [More Information Needed]
80
+
81
+ ## Dataset Creation
82
+
83
+ ### Curation Rationale
84
+
85
+ [More Information Needed]
86
+
87
+ ### Source Data
88
+
89
+ #### Initial Data Collection and Normalization
90
+
91
+ [More Information Needed]
92
+
93
+ #### Who are the source language producers?
94
+
95
+ [More Information Needed]
96
+
97
+ ### Annotations
98
+
99
+ #### Annotation process
100
+
101
+ [More Information Needed]
102
+
103
+ #### Who are the annotators?
104
+
105
+ [More Information Needed]
106
+
107
+ ### Personal and Sensitive Information
108
+
109
+ [More Information Needed]
110
+
111
+ ## Considerations for Using the Data
112
+
113
+ ### Social Impact of Dataset
114
+
115
+ [More Information Needed]
116
+
117
+ ### Discussion of Biases
118
+
119
+ [More Information Needed]
120
+
121
+ ### Other Known Limitations
122
+
123
+ [More Information Needed]
124
+
125
+ ## Additional Information
126
+
127
+ ### Dataset Curators
128
+
129
+ [More Information Needed]
130
+
131
+ ### Licensing Information
132
+
133
+ [More Information Needed]
134
+
135
+ ### Citation Information
136
+ ```bibtex
137
+ @inproceedings{xing2018adaptive,
138
+ title={Adaptive multi-task transfer learning for Chinese word segmentation in medical text},
139
+ author={Xing, Junjie and Zhu, Kenny and Zhang, Shaodian},
140
+ booktitle={Proceedings of the 27th International Conference on Computational Linguistics},
141
+ pages={3619--3630},
142
+ year={2018}
143
+ }
144
+ ```
amttl.py ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ """Introduction to AMTTL CWS Dataset"""
18
+
19
+ import logging
20
+
21
+ import datasets
22
+
23
+
24
+ _CITATION = """\
25
+ @inproceedings{xing2018adaptive,
26
+ title={Adaptive multi-task transfer learning for Chinese word segmentation in medical text},
27
+ author={Xing, Junjie and Zhu, Kenny and Zhang, Shaodian},
28
+ booktitle={Proceedings of the 27th International Conference on Computational Linguistics},
29
+ pages={3619--3630},
30
+ year={2018}
31
+ }
32
+ """
33
+
34
+ _DESCRIPTION = """\
35
+ Chinese word segmentation (CWS) trained from open source corpus faces dramatic performance drop
36
+ when dealing with domain text, especially for a domain with lots of special terms and diverse
37
+ writing styles, such as the biomedical domain. However, building domain-specific CWS requires
38
+ extremely high annotation cost. In this paper, we propose an approach by exploiting domain-invariant
39
+ knowledge from high resource to low resource domains. Extensive experiments show that our mode
40
+ achieves consistently higher accuracy than the single-task CWS and other transfer learning
41
+ baselines, especially when there is a large disparity between source and target domains.
42
+
43
+ This dataset is the accompanied medical Chinese word segmentation (CWS) dataset.
44
+ The tags are in BIES scheme.
45
+
46
+ For more details see https://www.aclweb.org/anthology/C18-1307/
47
+ """
48
+
49
+ _URL = "https://raw.githubusercontent.com/adapt-sjtu/AMTTL/master/medical_data/"
50
+ _TRAINING_FILE = "forum_train.txt"
51
+ _DEV_FILE = "forum_dev.txt"
52
+ _TEST_FILE = "forum_test.txt"
53
+
54
+
55
+ class AmttlConfig(datasets.BuilderConfig):
56
+ """BuilderConfig for AMTTL"""
57
+
58
+ def __init__(self, **kwargs):
59
+ """BuilderConfig for AMTTL.
60
+
61
+ Args:
62
+ **kwargs: keyword arguments forwarded to super.
63
+ """
64
+ super(AmttlConfig, self).__init__(**kwargs)
65
+
66
+
67
+ class Amttl(datasets.GeneratorBasedBuilder):
68
+ """AMTTL Chinese Word Segmentation dataset."""
69
+
70
+ BUILDER_CONFIGS = [
71
+ AmttlConfig(
72
+ name="amttl",
73
+ version=datasets.Version("1.0.0"),
74
+ description="AMTTL medical Chinese word segmentation dataset",
75
+ ),
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
+ "tags": datasets.Sequence(
86
+ datasets.features.ClassLabel(
87
+ names=[
88
+ "B",
89
+ "I",
90
+ "E",
91
+ "S",
92
+ ]
93
+ )
94
+ ),
95
+ }
96
+ ),
97
+ supervised_keys=None,
98
+ homepage="https://www.aclweb.org/anthology/C18-1307/",
99
+ citation=_CITATION,
100
+ )
101
+
102
+ def _split_generators(self, dl_manager):
103
+ """Returns SplitGenerators."""
104
+ urls_to_download = {
105
+ "train": f"{_URL}{_TRAINING_FILE}",
106
+ "dev": f"{_URL}{_DEV_FILE}",
107
+ "test": f"{_URL}{_TEST_FILE}",
108
+ }
109
+ downloaded_files = dl_manager.download_and_extract(urls_to_download)
110
+
111
+ return [
112
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloaded_files["train"]}),
113
+ datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["dev"]}),
114
+ datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files["test"]}),
115
+ ]
116
+
117
+ def _generate_examples(self, filepath):
118
+ logging.info("⏳ Generating examples from = %s", filepath)
119
+ with open(filepath, encoding="utf-8") as f:
120
+ guid = 0
121
+ tokens = []
122
+ tags = []
123
+ for line in f:
124
+ line_stripped = line.strip()
125
+ if line_stripped == "":
126
+ if tokens:
127
+ yield guid, {
128
+ "id": str(guid),
129
+ "tokens": tokens,
130
+ "tags": tags,
131
+ }
132
+ guid += 1
133
+ tokens = []
134
+ tags = []
135
+ else:
136
+ splits = line_stripped.split("\t")
137
+ if len(splits) == 1:
138
+ splits.append("O")
139
+ tokens.append(splits[0])
140
+ tags.append(splits[1])
141
+ # last example
142
+ yield guid, {
143
+ "id": str(guid),
144
+ "tokens": tokens,
145
+ "tags": tags,
146
+ }
dataset_infos.json ADDED
@@ -0,0 +1 @@
 
1
+ {"amttl": {"description": "Chinese word segmentation (CWS) trained from open source corpus faces dramatic performance drop\nwhen dealing with domain text, especially for a domain with lots of special terms and diverse\nwriting styles, such as the biomedical domain. However, building domain-specific CWS requires\nextremely high annotation cost. In this paper, we propose an approach by exploiting domain-invariant\nknowledge from high resource to low resource domains. Extensive experiments show that our mode\nachieves consistently higher accuracy than the single-task CWS and other transfer learning\nbaselines, especially when there is a large disparity between source and target domains.\n\nThis dataset is the accompanied medical Chinese word segmentation (CWS) dataset.\nThe tags are in BIES scheme.\n\nFor more details see https://www.aclweb.org/anthology/C18-1307/\n", "citation": "@inproceedings{xing2018adaptive,\n title={Adaptive multi-task transfer learning for Chinese word segmentation in medical text},\n author={Xing, Junjie and Zhu, Kenny and Zhang, Shaodian},\n booktitle={Proceedings of the 27th International Conference on Computational Linguistics},\n pages={3619--3630},\n year={2018}\n}\n", "homepage": "https://www.aclweb.org/anthology/C18-1307/", "license": "", "features": {"id": {"dtype": "string", "id": null, "_type": "Value"}, "tokens": {"feature": {"dtype": "string", "id": null, "_type": "Value"}, "length": -1, "id": null, "_type": "Sequence"}, "tags": {"feature": {"num_classes": 4, "names": ["B", "I", "E", "S"], "names_file": null, "id": null, "_type": "ClassLabel"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "builder_name": "amttl", "config_name": "amttl", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 1132212, "num_examples": 3063, "dataset_name": "amttl"}, "validation": {"name": "validation", "num_bytes": 324374, "num_examples": 822, "dataset_name": "amttl"}, "test": {"name": "test", "num_bytes": 328525, "num_examples": 908, "dataset_name": "amttl"}}, "download_checksums": {"https://raw.githubusercontent.com/adapt-sjtu/AMTTL/master/medical_data/forum_train.txt": {"num_bytes": 434357, "checksum": "9819373963ea04d1d28844d5bc83b6b0332fad8b5f2e73092bcfc58dc6d6292a"}, "https://raw.githubusercontent.com/adapt-sjtu/AMTTL/master/medical_data/forum_dev.txt": {"num_bytes": 124973, "checksum": "1a2eb461b98d2a9160baad7f76d003cc0917b998e8283bcffa52b71224dd9d17"}, "https://raw.githubusercontent.com/adapt-sjtu/AMTTL/master/medical_data/forum_test.txt": {"num_bytes": 126204, "checksum": "aea1a8cf244cd565e94bd193a1eef7a10b16eeb0b6fbb6ed1d2fefbd55360dd6"}}, "download_size": 685534, "post_processing_size": null, "dataset_size": 1785111, "size_in_bytes": 2470645}}
dummy/amttl/1.0.0/dummy_data.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8e8c6397fff4bbfd7c2d515a90028d6fedbc9982929f64c304a49ebf29fd559e
3
+ size 568