Datasets:
Tasks:
Token Classification
Sub-tasks:
named-entity-recognition
Languages:
Finnish
Size:
10K<n<100K
License:
Commit
•
f4cf93b
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 +140 -0
- dataset_infos.json +1 -0
- dummy/1.0.0/dummy_data.zip +3 -0
- turku_ner_corpus.py +140 -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,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
annotations_creators:
|
3 |
+
- expert-generated
|
4 |
+
language_creators:
|
5 |
+
- expert-generated
|
6 |
+
languages:
|
7 |
+
- fi
|
8 |
+
licenses:
|
9 |
+
- cc-by-nc-sa-4-0
|
10 |
+
multilinguality:
|
11 |
+
- monolingual
|
12 |
+
size_categories:
|
13 |
+
- 10K<n<100K
|
14 |
+
source_datasets:
|
15 |
+
- original
|
16 |
+
task_categories:
|
17 |
+
- structure-prediction
|
18 |
+
task_ids:
|
19 |
+
- named-entity-recognition
|
20 |
+
---
|
21 |
+
|
22 |
+
# Dataset Card Creation Guide
|
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:** https://turkunlp.org/fin-ner.html
|
50 |
+
- **Repository:** https://github.com/TurkuNLP/turku-ner-corpus/
|
51 |
+
- **Paper:** https://www.aclweb.org/anthology/2020.lrec-1.567/
|
52 |
+
- **Leaderboard:** [If the dataset supports an active leaderboard, add link here]()
|
53 |
+
- **Point of Contact:** {jouni.a.luoma,mhtoin,maria.h.pyykonen,mavela,sampo.pyysalo}@utu.f
|
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 |
+
## Dataset Creation
|
81 |
+
|
82 |
+
### Curation Rationale
|
83 |
+
|
84 |
+
[More Information Needed]
|
85 |
+
|
86 |
+
### Source Data
|
87 |
+
|
88 |
+
[More Information Needed]
|
89 |
+
|
90 |
+
#### Initial Data Collection and Normalization
|
91 |
+
|
92 |
+
[More Information Needed]
|
93 |
+
|
94 |
+
#### Who are the source language producers?
|
95 |
+
|
96 |
+
[More Information Needed]
|
97 |
+
|
98 |
+
### Annotations
|
99 |
+
|
100 |
+
[More Information Needed]
|
101 |
+
|
102 |
+
#### Annotation process
|
103 |
+
|
104 |
+
[More Information Needed]
|
105 |
+
|
106 |
+
#### Who are the annotators?
|
107 |
+
|
108 |
+
[More Information Needed]
|
109 |
+
|
110 |
+
### Personal and Sensitive Information
|
111 |
+
|
112 |
+
[More Information Needed]
|
113 |
+
|
114 |
+
## Considerations for Using the Data
|
115 |
+
|
116 |
+
### Social Impact of Dataset
|
117 |
+
|
118 |
+
[More Information Needed]
|
119 |
+
|
120 |
+
### Discussion of Biases
|
121 |
+
|
122 |
+
[More Information Needed]
|
123 |
+
|
124 |
+
### Other Known Limitations
|
125 |
+
|
126 |
+
[More Information Needed]
|
127 |
+
|
128 |
+
## Additional Information
|
129 |
+
|
130 |
+
### Dataset Curators
|
131 |
+
|
132 |
+
[More Information Needed]
|
133 |
+
|
134 |
+
### Licensing Information
|
135 |
+
|
136 |
+
[More Information Needed]
|
137 |
+
|
138 |
+
### Citation Information
|
139 |
+
|
140 |
+
[More Information Needed]
|
dataset_infos.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"default": {"description": "An open, broad-coverage corpus for Finnish named entity recognition presented in Luoma et al. (2020) A Broad-coverage Corpus for Finnish Named Entity Recognition.\n", "citation": "@inproceedings{luoma-etal-2020-broad,\ntitle = \"A Broad-coverage Corpus for {F}innish Named Entity Recognition\",\nauthor = {Luoma, Jouni and Oinonen, Miika and Pyyk{\"o}nen, Maria and Laippala, Veronika and Pyysalo, Sampo},\nbooktitle = \"Proceedings of The 12th Language Resources and Evaluation Conference\",\nyear = \"2020\",\nurl = \"https://www.aclweb.org/anthology/2020.lrec-1.567\",\npages = \"4615--4624\",\n}\n", "homepage": "https://github.com/klintan/swedish-ner-corpus", "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": 13, "names": ["B-DATE", "B-EVENT", "B-LOC", "B-ORG", "B-PER", "B-PRO", "I-DATE", "I-EVENT", "I-LOC", "I-ORG", "I-PER", "I-PRO", "O"], "names_file": null, "id": null, "_type": "ClassLabel"}, "length": -1, "id": null, "_type": "Sequence"}}, "post_processed": null, "supervised_keys": null, "builder_name": "turku_ner_corpus", "config_name": "default", "version": {"version_str": "1.0.0", "description": null, "major": 1, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 3257447, "num_examples": 12217, "dataset_name": "turku_ner_corpus"}, "validation": {"name": "validation", "num_bytes": 364223, "num_examples": 1364, "dataset_name": "turku_ner_corpus"}, "test": {"name": "test", "num_bytes": 416644, "num_examples": 1555, "dataset_name": "turku_ner_corpus"}}, "download_checksums": {"https://github.com/TurkuNLP/turku-ner-corpus/archive/v1.0.tar.gz": {"num_bytes": 1659911, "checksum": "c02dbca228431b17d90acfa67ad722cf81828b263a791de79fc578c478b1fb35"}}, "download_size": 1659911, "post_processing_size": null, "dataset_size": 4038314, "size_in_bytes": 5698225}}
|
dummy/1.0.0/dummy_data.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e9ad7c95fc1a8a70913639c16f151d05c5edb893f26554059a88fd7d089f9c37
|
3 |
+
size 1911
|
turku_ner_corpus.py
ADDED
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
import os
|
18 |
+
|
19 |
+
import datasets
|
20 |
+
|
21 |
+
|
22 |
+
_DESCRIPTION = """\
|
23 |
+
An open, broad-coverage corpus for Finnish named entity recognition presented in Luoma et al. (2020) A Broad-coverage Corpus for Finnish Named Entity Recognition.
|
24 |
+
"""
|
25 |
+
_HOMEPAGE_URL = "https://turkunlp.org/fin-ner.html"
|
26 |
+
_URL = "https://github.com/TurkuNLP/turku-ner-corpus/archive/v1.0.tar.gz"
|
27 |
+
_CITATION = """\
|
28 |
+
@inproceedings{luoma-etal-2020-broad,
|
29 |
+
title = "A Broad-coverage Corpus for {F}innish Named Entity Recognition",
|
30 |
+
author = {Luoma, Jouni and Oinonen, Miika and Pyyk{\"o}nen, Maria and Laippala, Veronika and Pyysalo, Sampo},
|
31 |
+
booktitle = "Proceedings of The 12th Language Resources and Evaluation Conference",
|
32 |
+
year = "2020",
|
33 |
+
url = "https://www.aclweb.org/anthology/2020.lrec-1.567",
|
34 |
+
pages = "4615--4624",
|
35 |
+
}
|
36 |
+
"""
|
37 |
+
|
38 |
+
|
39 |
+
class TurkuNERCorpus(datasets.GeneratorBasedBuilder):
|
40 |
+
VERSION = datasets.Version("1.0.0")
|
41 |
+
|
42 |
+
def _info(self):
|
43 |
+
return datasets.DatasetInfo(
|
44 |
+
description=_DESCRIPTION,
|
45 |
+
features=datasets.Features(
|
46 |
+
{
|
47 |
+
"id": datasets.Value("string"),
|
48 |
+
"tokens": datasets.Sequence(datasets.Value("string")),
|
49 |
+
"ner_tags": datasets.Sequence(
|
50 |
+
datasets.features.ClassLabel(
|
51 |
+
names=[
|
52 |
+
"B-DATE",
|
53 |
+
"B-EVENT",
|
54 |
+
"B-LOC",
|
55 |
+
"B-ORG",
|
56 |
+
"B-PER",
|
57 |
+
"B-PRO",
|
58 |
+
"I-DATE",
|
59 |
+
"I-EVENT",
|
60 |
+
"I-LOC",
|
61 |
+
"I-ORG",
|
62 |
+
"I-PER",
|
63 |
+
"I-PRO",
|
64 |
+
"O",
|
65 |
+
]
|
66 |
+
)
|
67 |
+
),
|
68 |
+
},
|
69 |
+
),
|
70 |
+
supervised_keys=None,
|
71 |
+
homepage=_HOMEPAGE_URL,
|
72 |
+
citation=_CITATION,
|
73 |
+
)
|
74 |
+
|
75 |
+
def _split_generators(self, dl_manager):
|
76 |
+
path = dl_manager.download_and_extract(_URL)
|
77 |
+
return [
|
78 |
+
datasets.SplitGenerator(
|
79 |
+
name=datasets.Split.TRAIN,
|
80 |
+
gen_kwargs={"data_path": path, "data_type": "train"},
|
81 |
+
),
|
82 |
+
datasets.SplitGenerator(
|
83 |
+
name=datasets.Split.VALIDATION,
|
84 |
+
gen_kwargs={"data_path": path, "data_type": "valid"},
|
85 |
+
),
|
86 |
+
datasets.SplitGenerator(
|
87 |
+
name=datasets.Split.TEST,
|
88 |
+
gen_kwargs={"data_path": path, "data_type": "test"},
|
89 |
+
),
|
90 |
+
]
|
91 |
+
|
92 |
+
def _generate_examples(self, data_path, data_type):
|
93 |
+
if data_type == "train":
|
94 |
+
data_path = os.path.join(data_path, "turku-ner-corpus-1.0/data/conll/train.tsv")
|
95 |
+
elif data_type == "valid":
|
96 |
+
data_path = os.path.join(data_path, "turku-ner-corpus-1.0/data/conll/dev.tsv")
|
97 |
+
elif data_type == "test":
|
98 |
+
data_path = os.path.join(data_path, "turku-ner-corpus-1.0/data/conll/test.tsv")
|
99 |
+
else:
|
100 |
+
raise Exception("data_type not understood")
|
101 |
+
|
102 |
+
sentence_counter = 0
|
103 |
+
with open(data_path, encoding="utf-8") as f:
|
104 |
+
current_words = []
|
105 |
+
current_labels = []
|
106 |
+
for row in f:
|
107 |
+
row = row.rstrip()
|
108 |
+
row_split = row.split("\t")
|
109 |
+
if len(row_split) == 2:
|
110 |
+
token, label = row_split
|
111 |
+
current_words.append(token)
|
112 |
+
current_labels.append(label)
|
113 |
+
else:
|
114 |
+
if not current_words:
|
115 |
+
continue
|
116 |
+
assert len(current_words) == len(current_labels), "word len doesnt match label length"
|
117 |
+
sentence = (
|
118 |
+
sentence_counter,
|
119 |
+
{
|
120 |
+
"id": str(sentence_counter),
|
121 |
+
"tokens": current_words,
|
122 |
+
"ner_tags": current_labels,
|
123 |
+
},
|
124 |
+
)
|
125 |
+
sentence_counter += 1
|
126 |
+
current_words = []
|
127 |
+
current_labels = []
|
128 |
+
yield sentence
|
129 |
+
|
130 |
+
# if something remains:
|
131 |
+
if current_words:
|
132 |
+
sentence = (
|
133 |
+
sentence_counter,
|
134 |
+
{
|
135 |
+
"id": str(sentence_counter),
|
136 |
+
"tokens": current_words,
|
137 |
+
"ner_tags": current_labels,
|
138 |
+
},
|
139 |
+
)
|
140 |
+
yield sentence
|