KoichiYasuoka commited on
Commit
3026b6a
1 Parent(s): b2f409d

initial release

Browse files
README.md ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - "ko"
4
+ tags:
5
+ - "korean"
6
+ - "token-classification"
7
+ - "pos"
8
+ - "dependency-parsing"
9
+ datasets:
10
+ - "universal_dependencies"
11
+ license: "apache-2.0"
12
+ pipeline_tag: "token-classification"
13
+ widget:
14
+ - text: "홍시 맛이 나서 홍시라 생각한다."
15
+ - text: "紅柹 맛이 나서 紅柹라 生覺한다."
16
+ ---
17
+
18
+ # deberta-base-korean-upos
19
+
20
+ ## Model Description
21
+
22
+ This is a RoBERTa model pre-trained on Korean texts for POS-tagging and dependency-parsing, derived from [deberta-v3-base-korean](https://huggingface.co/team-lucid/deberta-v3-base-korean). Every word (어절) is tagged by [UPOS](https://universaldependencies.org/u/pos/)(Universal Part-Of-Speech).
23
+
24
+ ## How to Use
25
+
26
+ ```py
27
+ from transformers import AutoTokenizer,AutoModelForTokenClassification,TokenClassificationPipeline
28
+ tokenizer=AutoTokenizer.from_pretrained("KoichiYasuoka/deberta-base-korean-upos")
29
+ model=AutoModelForTokenClassification.from_pretrained("KoichiYasuoka/deberta-base-korean-upos")
30
+ pipeline=TokenClassificationPipeline(tokenizer=tokenizer,model=model,aggregation_strategy="simple")
31
+ nlp=lambda x:[(x[t["start"]:t["end"]],t["entity_group"]) for t in pipeline(x)]
32
+ print(nlp("홍시 맛이 나서 홍시라 생각한다."))
33
+ ```
34
+
35
+ or
36
+
37
+ ```py
38
+ import esupar
39
+ nlp=esupar.load("KoichiYasuoka/deberta-base-korean-upos")
40
+ print(nlp("홍시 맛이 나서 홍시라 생각한다."))
41
+ ```
42
+
43
+ ## See Also
44
+
45
+ [esupar](https://github.com/KoichiYasuoka/esupar): Tokenizer POS-tagger and Dependency-parser with BERT/RoBERTa/DeBERTa models
config.json ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "DebertaV2ForTokenClassification"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "hidden_act": "gelu",
7
+ "hidden_dropout_prob": 0.1,
8
+ "hidden_size": 768,
9
+ "id2label": {
10
+ "0": "ADJ",
11
+ "1": "ADP",
12
+ "2": "ADV",
13
+ "3": "AUX",
14
+ "4": "B-ADJ",
15
+ "5": "B-ADP",
16
+ "6": "B-ADV",
17
+ "7": "B-AUX",
18
+ "8": "B-CCONJ",
19
+ "9": "B-DET",
20
+ "10": "B-INTJ",
21
+ "11": "B-NOUN",
22
+ "12": "B-NUM",
23
+ "13": "B-PART",
24
+ "14": "B-PRON",
25
+ "15": "B-PROPN",
26
+ "16": "B-PUNCT",
27
+ "17": "B-SCONJ",
28
+ "18": "B-SYM",
29
+ "19": "B-VERB",
30
+ "20": "B-X",
31
+ "21": "CCONJ",
32
+ "22": "DET",
33
+ "23": "I-ADJ",
34
+ "24": "I-ADP",
35
+ "25": "I-ADV",
36
+ "26": "I-AUX",
37
+ "27": "I-CCONJ",
38
+ "28": "I-DET",
39
+ "29": "I-INTJ",
40
+ "30": "I-NOUN",
41
+ "31": "I-NUM",
42
+ "32": "I-PART",
43
+ "33": "I-PRON",
44
+ "34": "I-PROPN",
45
+ "35": "I-PUNCT",
46
+ "36": "I-SCONJ",
47
+ "37": "I-SYM",
48
+ "38": "I-VERB",
49
+ "39": "I-X",
50
+ "40": "INTJ",
51
+ "41": "NOUN",
52
+ "42": "NUM",
53
+ "43": "NUM+PUNCT",
54
+ "44": "PART",
55
+ "45": "PRON",
56
+ "46": "PROPN",
57
+ "47": "PUNCT",
58
+ "48": "SCONJ",
59
+ "49": "SYM",
60
+ "50": "VERB",
61
+ "51": "X"
62
+ },
63
+ "initializer_range": 0.02,
64
+ "intermediate_size": 3072,
65
+ "label2id": {
66
+ "ADJ": 0,
67
+ "ADP": 1,
68
+ "ADV": 2,
69
+ "AUX": 3,
70
+ "B-ADJ": 4,
71
+ "B-ADP": 5,
72
+ "B-ADV": 6,
73
+ "B-AUX": 7,
74
+ "B-CCONJ": 8,
75
+ "B-DET": 9,
76
+ "B-INTJ": 10,
77
+ "B-NOUN": 11,
78
+ "B-NUM": 12,
79
+ "B-PART": 13,
80
+ "B-PRON": 14,
81
+ "B-PROPN": 15,
82
+ "B-PUNCT": 16,
83
+ "B-SCONJ": 17,
84
+ "B-SYM": 18,
85
+ "B-VERB": 19,
86
+ "B-X": 20,
87
+ "CCONJ": 21,
88
+ "DET": 22,
89
+ "I-ADJ": 23,
90
+ "I-ADP": 24,
91
+ "I-ADV": 25,
92
+ "I-AUX": 26,
93
+ "I-CCONJ": 27,
94
+ "I-DET": 28,
95
+ "I-INTJ": 29,
96
+ "I-NOUN": 30,
97
+ "I-NUM": 31,
98
+ "I-PART": 32,
99
+ "I-PRON": 33,
100
+ "I-PROPN": 34,
101
+ "I-PUNCT": 35,
102
+ "I-SCONJ": 36,
103
+ "I-SYM": 37,
104
+ "I-VERB": 38,
105
+ "I-X": 39,
106
+ "INTJ": 40,
107
+ "NOUN": 41,
108
+ "NUM": 42,
109
+ "NUM+PUNCT": 43,
110
+ "PART": 44,
111
+ "PRON": 45,
112
+ "PROPN": 46,
113
+ "PUNCT": 47,
114
+ "SCONJ": 48,
115
+ "SYM": 49,
116
+ "VERB": 50,
117
+ "X": 51
118
+ },
119
+ "layer_norm_eps": 1e-07,
120
+ "max_position_embeddings": 512,
121
+ "max_relative_positions": -1,
122
+ "model_type": "deberta-v2",
123
+ "norm_rel_ebd": "layer_norm",
124
+ "num_attention_heads": 12,
125
+ "num_hidden_layers": 12,
126
+ "pad_token_id": 0,
127
+ "pooler_dropout": 0,
128
+ "pooler_hidden_act": "gelu",
129
+ "pooler_hidden_size": 768,
130
+ "pos_att_type": [
131
+ "p2c",
132
+ "c2p"
133
+ ],
134
+ "position_biased_input": false,
135
+ "position_buckets": 256,
136
+ "relative_attention": true,
137
+ "share_att_key": true,
138
+ "task_specific_params": {
139
+ "upos_multiword": {
140
+ "NUM+PUNCT": {
141
+ "515": [
142
+ "5",
143
+ "15"
144
+ ]
145
+ }
146
+ }
147
+ },
148
+ "tokenizer_class": "DebertaV2TokenizerFast",
149
+ "torch_dtype": "float32",
150
+ "transformers_version": "4.34.1",
151
+ "type_vocab_size": 0,
152
+ "vocab_size": 64100
153
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4d5713197a0c2693b64f4a626e59ff6ff3cd35afbfa15ea443fb88c7220d79c5
3
+ size 538945393
special_tokens_map.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "[CLS]",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "cls_token": {
10
+ "content": "[CLS]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "eos_token": {
17
+ "content": "[SEP]",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "mask_token": {
24
+ "content": "[MASK]",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "pad_token": {
31
+ "content": "[PAD]",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ },
37
+ "sep_token": {
38
+ "content": "[SEP]",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false
43
+ },
44
+ "unk_token": {
45
+ "content": "[UNK]",
46
+ "lstrip": false,
47
+ "normalized": false,
48
+ "rstrip": false,
49
+ "single_word": false
50
+ }
51
+ }
supar.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e0b9ee4ad4d19cce25befb5dfe309d301e2b9673bfdffcb0f20b3238960daa75
3
+ size 600467177
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "[CLS]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "[SEP]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "[UNK]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "64000": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "bos_token": "[CLS]",
45
+ "clean_up_tokenization_spaces": true,
46
+ "cls_token": "[CLS]",
47
+ "do_lower_case": false,
48
+ "eos_token": "[SEP]",
49
+ "mask_token": "[MASK]",
50
+ "pad_token": "[PAD]",
51
+ "sep_token": "[SEP]",
52
+ "split_by_punct": false,
53
+ "tokenizer_class": "DebertaV2TokenizerFast",
54
+ "unk_token": "[UNK]"
55
+ }