Datasets:

Modalities:
Text
Languages:
English
ArXiv:
Libraries:
Datasets
License:

Convert dataset to Parquet

#2
by nlp-mark - opened
Files changed (43) hide show
  1. .gitignore +0 -1
  2. README.md +90 -0
  3. dataset/2020.dev.json +0 -0
  4. dataset/2020.test.json +0 -0
  5. dataset/2020.train.json +0 -0
  6. dataset/2021.dev.json +0 -0
  7. dataset/2021.test.json +0 -0
  8. dataset/2021.train.json +0 -0
  9. dataset/extra/2020.extra00.json +0 -0
  10. dataset/extra/2020.extra01.json +0 -0
  11. dataset/extra/2020.extra02.json +0 -0
  12. dataset/extra/2020.extra03.json +0 -0
  13. dataset/extra/2020.extra04.json +0 -0
  14. dataset/extra/2020.extra05.json +0 -0
  15. dataset/extra/2020.extra06.json +0 -0
  16. dataset/extra/2020.extra07.json +0 -0
  17. dataset/extra/2020.extra08.json +0 -0
  18. dataset/extra/2021.extra00.json +0 -0
  19. dataset/extra/2021.extra01.json +0 -0
  20. dataset/extra/2021.extra02.json +0 -0
  21. dataset/extra/2021.extra03.json +0 -0
  22. dataset/extra/2021.extra04.json +0 -0
  23. dataset/extra/2021.extra05.json +0 -0
  24. dataset/extra/2021.extra06.json +0 -0
  25. dataset/extra/2021.extra07.json +0 -0
  26. dataset/extra/2021.extra08.json +0 -0
  27. dataset/extra/2021.extra09.json +0 -0
  28. dataset/label.json +0 -1
  29. dataset/random.dev.json +0 -0
  30. dataset/random.train.json +0 -0
  31. get_model_list.py +0 -89
  32. tweetner7.py +0 -85
  33. tweetner7/extra_2020-00000-of-00001.parquet +3 -0
  34. tweetner7/extra_2021-00000-of-00001.parquet +3 -0
  35. tweetner7/test_2020-00000-of-00001.parquet +3 -0
  36. tweetner7/test_2021-00000-of-00001.parquet +3 -0
  37. tweetner7/train_2020-00000-of-00001.parquet +3 -0
  38. tweetner7/train_2021-00000-of-00001.parquet +3 -0
  39. tweetner7/train_all-00000-of-00001.parquet +3 -0
  40. tweetner7/train_random-00000-of-00001.parquet +3 -0
  41. tweetner7/validation_2020-00000-of-00001.parquet +3 -0
  42. tweetner7/validation_2021-00000-of-00001.parquet +3 -0
  43. tweetner7/validation_random-00000-of-00001.parquet +3 -0
.gitignore DELETED
@@ -1 +0,0 @@
1
- metric_files
 
 
README.md CHANGED
@@ -12,6 +12,96 @@ task_categories:
12
  task_ids:
13
  - named-entity-recognition
14
  pretty_name: TweetNER7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  ---
16
 
17
  # Dataset Card for "tner/tweetner7"
 
12
  task_ids:
13
  - named-entity-recognition
14
  pretty_name: TweetNER7
15
+ dataset_info:
16
+ config_name: tweetner7
17
+ features:
18
+ - name: tokens
19
+ sequence: string
20
+ - name: tags
21
+ sequence:
22
+ class_label:
23
+ names:
24
+ '0': B-corporation
25
+ '1': B-creative_work
26
+ '2': B-event
27
+ '3': B-group
28
+ '4': B-location
29
+ '5': B-person
30
+ '6': B-product
31
+ '7': I-corporation
32
+ '8': I-creative_work
33
+ '9': I-event
34
+ '10': I-group
35
+ '11': I-location
36
+ '12': I-person
37
+ '13': I-product
38
+ '14': O
39
+ - name: id
40
+ dtype: string
41
+ - name: date
42
+ dtype: string
43
+ splits:
44
+ - name: test_2020
45
+ num_bytes: 321795
46
+ num_examples: 576
47
+ - name: test_2021
48
+ num_bytes: 1623780
49
+ num_examples: 2807
50
+ - name: validation_2020
51
+ num_bytes: 326081
52
+ num_examples: 576
53
+ - name: validation_2021
54
+ num_bytes: 178182
55
+ num_examples: 310
56
+ - name: train_2020
57
+ num_bytes: 2626368
58
+ num_examples: 4616
59
+ - name: train_2021
60
+ num_bytes: 1435751
61
+ num_examples: 2495
62
+ - name: train_all
63
+ num_bytes: 4062119
64
+ num_examples: 7111
65
+ - name: validation_random
66
+ num_bytes: 331436
67
+ num_examples: 576
68
+ - name: train_random
69
+ num_bytes: 2662006
70
+ num_examples: 4616
71
+ - name: extra_2020
72
+ num_bytes: 47946026
73
+ num_examples: 87880
74
+ - name: extra_2021
75
+ num_bytes: 52161850
76
+ num_examples: 93594
77
+ download_size: 26085172
78
+ dataset_size: 113675394
79
+ configs:
80
+ - config_name: tweetner7
81
+ data_files:
82
+ - split: test_2020
83
+ path: tweetner7/test_2020-*
84
+ - split: test_2021
85
+ path: tweetner7/test_2021-*
86
+ - split: validation_2020
87
+ path: tweetner7/validation_2020-*
88
+ - split: validation_2021
89
+ path: tweetner7/validation_2021-*
90
+ - split: train_2020
91
+ path: tweetner7/train_2020-*
92
+ - split: train_2021
93
+ path: tweetner7/train_2021-*
94
+ - split: train_all
95
+ path: tweetner7/train_all-*
96
+ - split: validation_random
97
+ path: tweetner7/validation_random-*
98
+ - split: train_random
99
+ path: tweetner7/train_random-*
100
+ - split: extra_2020
101
+ path: tweetner7/extra_2020-*
102
+ - split: extra_2021
103
+ path: tweetner7/extra_2021-*
104
+ default: true
105
  ---
106
 
107
  # Dataset Card for "tner/tweetner7"
dataset/2020.dev.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/2020.test.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/2020.train.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/2021.dev.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/2021.test.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/2021.train.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/extra/2020.extra00.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/extra/2020.extra01.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/extra/2020.extra02.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/extra/2020.extra03.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/extra/2020.extra04.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/extra/2020.extra05.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/extra/2020.extra06.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/extra/2020.extra07.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/extra/2020.extra08.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/extra/2021.extra00.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/extra/2021.extra01.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/extra/2021.extra02.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/extra/2021.extra03.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/extra/2021.extra04.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/extra/2021.extra05.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/extra/2021.extra06.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/extra/2021.extra07.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/extra/2021.extra08.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/extra/2021.extra09.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/label.json DELETED
@@ -1 +0,0 @@
1
- {"B-corporation": 0, "B-creative_work": 1, "B-event": 2, "B-group": 3, "B-location": 4, "B-person": 5, "B-product": 6, "I-corporation": 7, "I-creative_work": 8, "I-event": 9, "I-group": 10, "I-location": 11, "I-person": 12, "I-product": 13, "O": 14}
 
 
dataset/random.dev.json DELETED
The diff for this file is too large to render. See raw diff
 
dataset/random.train.json DELETED
The diff for this file is too large to render. See raw diff
 
get_model_list.py DELETED
@@ -1,89 +0,0 @@
1
- import json
2
- import os
3
- import requests
4
-
5
- import pandas as pd
6
-
7
- dataset_link = "[`tweetner7`](https://huggingface.co/datasets/tner/tweetner7)"
8
- metric_dir = 'metric_files'
9
- os.makedirs(metric_dir, exist_ok=True)
10
-
11
-
12
- def lm_link(_model): return f"[`{_model}`](https://huggingface.co/{_model})"
13
-
14
-
15
- def model_link(_model, _type): return f"[`tner/{_model}-tweetner7-{_type}`](https://huggingface.co/tner/{_model}-tweetner7-{_type})"
16
-
17
-
18
- def download(_model, _type):
19
- url = f"https://huggingface.co/tner/{_model}-tweetner7-{_type}/raw/main/eval"
20
- filename = f"{metric_dir}/{_model}-{_type}.json"
21
- print(url, filename)
22
- try:
23
- with open(filename) as f:
24
- return json.load(f)
25
- except Exception:
26
- tmp = {}
27
- for metric in ["metric.test_2021", "metric.test_2020", "metric_span.test_2021", "metric_span.test_2020"]:
28
- year = metric[-4:]
29
- if metric not in tmp:
30
- _metric = json.loads(requests.get(f"{url}/{metric}.json").content)
31
- if '_span' in metric:
32
- tmp[f"Entity-Span F1 ({year})"] = round(100 * _metric["micro/f1"], 2)
33
- else:
34
- tmp[f"Micro F1 ({year})"] = round(100 * _metric["micro/f1"], 2)
35
- tmp[f"Macro F1 ({year})"] = round(100 * _metric["macro/f1"], 2)
36
- tmp.update({f"F1 ({year})/{k}": round(100 * v['f1'], 2) for k, v in _metric["per_entity_metric"].items()})
37
- with open(filename, "w") as f:
38
- json.dump(tmp, f)
39
- return tmp
40
-
41
-
42
- lms = [
43
- "roberta-large",
44
- "roberta-base",
45
- "cardiffnlp/twitter-roberta-base-2019-90m",
46
- "cardiffnlp/twitter-roberta-base-dec2020",
47
- "cardiffnlp/twitter-roberta-base-dec2021"
48
- "vinai/bertweet-large",
49
- "vinai/bertweet-base",
50
- "bert-large",
51
- "bert-base"
52
- ]
53
-
54
- types = [
55
- ["all", "continuous", "2021", "2020"],
56
- ["random"],
57
- [
58
- "selflabel2020",
59
- "selflabel2021",
60
- "2020-selflabel2020-all",
61
- "2020-selflabel2021-all",
62
- "selflabel2020-continuous",
63
- "selflabel2021-continuous"
64
- ]
65
- ]
66
-
67
-
68
- for tt in types:
69
- metrics = []
70
- for t in tt:
71
- for lm in lms:
72
-
73
- if 'selflabel' in t and lm != "roberta-large":
74
- continue
75
- _lm_link = lm_link(lm)
76
- lm = os.path.basename(lm)
77
- _model_link = model_link(lm, t)
78
- __metric = {
79
- "Model (link)": model_link(lm, t),
80
- "Data": dataset_link,
81
- "Language Model": _lm_link
82
- }
83
- __metric.update(download(lm, t))
84
- metrics.append(__metric)
85
-
86
- df = pd.DataFrame(metrics)
87
- print(tt)
88
- print(df.to_markdown(index=False))
89
- print()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
tweetner7.py DELETED
@@ -1,85 +0,0 @@
1
- """ NER dataset compiled by T-NER library https://github.com/asahi417/tner/tree/master/tner """
2
- import json
3
- from itertools import chain
4
- import datasets
5
-
6
- logger = datasets.logging.get_logger(__name__)
7
- _DESCRIPTION = """[TweetNER7](TBA)"""
8
- _NAME = "tweetner7"
9
- _VERSION = "1.0.4"
10
- _CITATION = """
11
- TBA
12
- """
13
-
14
- _HOME_PAGE = "https://github.com/asahi417/tner"
15
- _URL = f'https://huggingface.co/datasets/tner/{_NAME}/raw/main/dataset'
16
- _URLS = {
17
- # str(datasets.Split.TEST): [f'{_URL}/2021.test.json'],
18
- # str(datasets.Split.VALIDATION): [f'{_URL}/2020.dev.json'],
19
- # str(datasets.Split.TRAIN): [f'{_URL}/2020.train.json'],
20
- f'{str(datasets.Split.TEST)}_2020': [f'{_URL}/2020.test.json'],
21
- f'{str(datasets.Split.TEST)}_2021': [f'{_URL}/2021.test.json'],
22
- # f'{str(datasets.Split.TEST)}_all': [f'{_URL}/2020.test.json', f'{_URL}/2021.test.json'],
23
- f'{str(datasets.Split.VALIDATION)}_2020': [f'{_URL}/2020.dev.json'],
24
- f'{str(datasets.Split.VALIDATION)}_2021': [f'{_URL}/2021.dev.json'],
25
- # f'{str(datasets.Split.VALIDATION)}_all': [f'{_URL}/2020.dev.json', f'{_URL}/2021.dev.json'],
26
- f'{str(datasets.Split.TRAIN)}_2020': [f'{_URL}/2020.train.json'],
27
- f'{str(datasets.Split.TRAIN)}_2021': [f'{_URL}/2021.train.json'],
28
- f'{str(datasets.Split.TRAIN)}_all': [f'{_URL}/2020.train.json', f'{_URL}/2021.train.json'],
29
- f'{str(datasets.Split.VALIDATION)}_random': [f'{_URL}/random.dev.json'],
30
- f'{str(datasets.Split.TRAIN)}_random': [f'{_URL}/random.train.json'],
31
- f'extra_2020': [f'{_URL}/extra/2020.extra{i:02d}.json' for i in range(9)],
32
- f'extra_2021': [f'{_URL}/extra/2021.extra{i:02d}.json' for i in range(10)]
33
- }
34
-
35
-
36
- class TweetNER7Config(datasets.BuilderConfig):
37
- """BuilderConfig"""
38
-
39
- def __init__(self, **kwargs):
40
- """BuilderConfig.
41
-
42
- Args:
43
- **kwargs: keyword arguments forwarded to super.
44
- """
45
- super(TweetNER7Config, self).__init__(**kwargs)
46
-
47
-
48
- class TweetNER7(datasets.GeneratorBasedBuilder):
49
- """Dataset."""
50
-
51
- BUILDER_CONFIGS = [
52
- TweetNER7Config(name=_NAME, version=datasets.Version(_VERSION), description=_DESCRIPTION),
53
- ]
54
-
55
- def _split_generators(self, dl_manager):
56
- downloaded_file = dl_manager.download_and_extract(_URLS)
57
- return [datasets.SplitGenerator(name=i, gen_kwargs={"filepaths": downloaded_file[i]}) for i in _URLS.keys()]
58
-
59
- def _generate_examples(self, filepaths):
60
- _key = 0
61
- for filepath in filepaths:
62
- logger.info(f"generating examples from = {filepath}")
63
- with open(filepath, encoding="utf-8") as f:
64
- _list = [i for i in f.read().split('\n') if len(i) > 0]
65
- for i in _list:
66
- data = json.loads(i)
67
- yield _key, data
68
- _key += 1
69
-
70
- def _info(self):
71
- names = ['B-corporation', 'B-creative_work', 'B-event', 'B-group', 'B-location', 'B-person', 'B-product', 'I-corporation', 'I-creative_work', 'I-event', 'I-group', 'I-location', 'I-person', 'I-product', 'O']
72
- return datasets.DatasetInfo(
73
- description=_DESCRIPTION,
74
- features=datasets.Features(
75
- {
76
- "tokens": datasets.Sequence(datasets.Value("string")),
77
- "tags": datasets.Sequence(datasets.features.ClassLabel(names=names)),
78
- "id": datasets.Value("string"),
79
- "date": datasets.Value("string")
80
- }
81
- ),
82
- supervised_keys=None,
83
- homepage=_HOME_PAGE,
84
- citation=_CITATION,
85
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
tweetner7/extra_2020-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:74b896201ddadefc288235999ab698b4c4843b6c33a7cecc8db815319a5ae5ba
3
+ size 10586484
tweetner7/extra_2021-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:36c58058654dc011ef9ecefb38eeb1b8ce8778b7fd592ad9ebfc65da6c4c1c2a
3
+ size 11715210
tweetner7/test_2020-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4e82137f2f7cb7bd865acc45ca3b6252632ce96cae639c0556b58004b8394f6b
3
+ size 94531
tweetner7/test_2021-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:52a294ff9c254154593d6d87d92dfbdec7a43749a9308e1beb84a086b1dd9f3a
3
+ size 446138
tweetner7/train_2020-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3444a6df0c71de488c5d587a79bc37440af7229874627962fcb8569c6541d257
3
+ size 720978
tweetner7/train_2021-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:14354a7ee09e1bc9b8d12b45e3560782a1aa99e5d2843f2a9ede3c109c45fd97
3
+ size 398654
tweetner7/train_all-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9442204d03379afe3d687e825fce65dcedbf72d3bbfaf0249c3d20a5d47ffa14
3
+ size 1119928
tweetner7/train_random-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9c93aa44a52b959d10903bfe8652cfd28c79505022c913b1d622fafb8ab94c48
3
+ size 751018
tweetner7/validation_2020-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e0ae0978dc167e81e15e29996cb451687bce19fe979c96e7bcb7107dac3b47e6
3
+ size 96596
tweetner7/validation_2021-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0eb1f48078faa07cc6a78772d07b83cea03464c82381d23016a798bf74d0aa84
3
+ size 56363
tweetner7/validation_random-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1e07d8ce2cb62e5705aeebd4586efa8537f6152c50aa94decaac79e2ab0b68d0
3
+ size 99272