KoichiYasuoka
commited on
Commit
•
c60ae79
1
Parent(s):
d95fa2a
initial release
Browse files- README.md +44 -0
- config.json +134 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +7 -0
- supar.model +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +15 -0
- vocab.txt +0 -0
README.md
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- "vi"
|
4 |
+
tags:
|
5 |
+
- "vietnamese"
|
6 |
+
- "token-classification"
|
7 |
+
- "pos"
|
8 |
+
- "dependency-parsing"
|
9 |
+
datasets:
|
10 |
+
- "universal_dependencies"
|
11 |
+
license: "cc-by-sa-4.0"
|
12 |
+
pipeline_tag: "token-classification"
|
13 |
+
widget:
|
14 |
+
- text: "Hai cái đầu thì tốt hơn một."
|
15 |
+
---
|
16 |
+
|
17 |
+
# bert-base-vietnamese-upos
|
18 |
+
|
19 |
+
## Model Description
|
20 |
+
|
21 |
+
This is a BERT model pre-trained on Vietnamese texts for POS-tagging and dependency-parsing, derived from [vibert-base-cased](https://huggingface.co/FPTAI/vibert-base-cased). Every word is tagged by [UPOS](https://universaldependencies.org/u/pos/)(Universal Part-Of-Speech).
|
22 |
+
|
23 |
+
## How to Use
|
24 |
+
|
25 |
+
```py
|
26 |
+
from transformers import AutoTokenizer,AutoModelForTokenClassification,TokenClassificationPipeline
|
27 |
+
tokenizer=AutoTokenizer.from_pretrained("KoichiYasuoka/bert-base-vietnamese-upos")
|
28 |
+
model=AutoModelForTokenClassification.from_pretrained("KoichiYasuoka/bert-base-vietnamese-upos")
|
29 |
+
pipeline=TokenClassificationPipeline(tokenizer=tokenizer,model=model,aggregation_strategy="simple")
|
30 |
+
nlp=lambda x:[(x[t["start"]:t["end"]],t["entity_group"]) for t in pipeline(x)]
|
31 |
+
print(nlp("Hai cái đầu thì tốt hơn một."))
|
32 |
+
```
|
33 |
+
|
34 |
+
or
|
35 |
+
|
36 |
+
```py
|
37 |
+
import esupar
|
38 |
+
nlp=esupar.load("KoichiYasuoka/bert-base-vietnamese-upos")
|
39 |
+
print(nlp("Hai cái đầu thì tốt hơn một."))
|
40 |
+
```
|
41 |
+
|
42 |
+
## See Also
|
43 |
+
|
44 |
+
[esupar](https://github.com/KoichiYasuoka/esupar): Tokenizer POS-tagger and Dependency-parser with BERT/RoBERTa/DeBERTa models
|
config.json
ADDED
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"BertForTokenClassification"
|
4 |
+
],
|
5 |
+
"attention_probs_dropout_prob": 0.1,
|
6 |
+
"classifier_dropout": null,
|
7 |
+
"directionality": "bidi",
|
8 |
+
"hidden_act": "gelu",
|
9 |
+
"hidden_dropout_prob": 0.1,
|
10 |
+
"hidden_size": 768,
|
11 |
+
"id2label": {
|
12 |
+
"0": "ADJ",
|
13 |
+
"1": "ADP",
|
14 |
+
"2": "ADV",
|
15 |
+
"3": "AUX",
|
16 |
+
"4": "B-ADJ",
|
17 |
+
"5": "B-ADP",
|
18 |
+
"6": "B-ADV",
|
19 |
+
"7": "B-AUX",
|
20 |
+
"8": "B-DET",
|
21 |
+
"9": "B-INTJ",
|
22 |
+
"10": "B-NOUN",
|
23 |
+
"11": "B-NUM",
|
24 |
+
"12": "B-PART",
|
25 |
+
"13": "B-PRON",
|
26 |
+
"14": "B-PROPN",
|
27 |
+
"15": "B-PUNCT",
|
28 |
+
"16": "B-SCONJ",
|
29 |
+
"17": "B-SYM",
|
30 |
+
"18": "B-VERB",
|
31 |
+
"19": "B-X",
|
32 |
+
"20": "CCONJ",
|
33 |
+
"21": "DET",
|
34 |
+
"22": "I-ADJ",
|
35 |
+
"23": "I-ADP",
|
36 |
+
"24": "I-ADV",
|
37 |
+
"25": "I-AUX",
|
38 |
+
"26": "I-DET",
|
39 |
+
"27": "I-INTJ",
|
40 |
+
"28": "I-NOUN",
|
41 |
+
"29": "I-NUM",
|
42 |
+
"30": "I-PART",
|
43 |
+
"31": "I-PRON",
|
44 |
+
"32": "I-PROPN",
|
45 |
+
"33": "I-PUNCT",
|
46 |
+
"34": "I-SCONJ",
|
47 |
+
"35": "I-SYM",
|
48 |
+
"36": "I-VERB",
|
49 |
+
"37": "I-X",
|
50 |
+
"38": "INTJ",
|
51 |
+
"39": "NOUN",
|
52 |
+
"40": "NUM",
|
53 |
+
"41": "PART",
|
54 |
+
"42": "PRON",
|
55 |
+
"43": "PROPN",
|
56 |
+
"44": "PUNCT",
|
57 |
+
"45": "SCONJ",
|
58 |
+
"46": "SYM",
|
59 |
+
"47": "VERB",
|
60 |
+
"48": "X"
|
61 |
+
},
|
62 |
+
"initializer_range": 0.02,
|
63 |
+
"intermediate_size": 3072,
|
64 |
+
"label2id": {
|
65 |
+
"ADJ": 0,
|
66 |
+
"ADP": 1,
|
67 |
+
"ADV": 2,
|
68 |
+
"AUX": 3,
|
69 |
+
"B-ADJ": 4,
|
70 |
+
"B-ADP": 5,
|
71 |
+
"B-ADV": 6,
|
72 |
+
"B-AUX": 7,
|
73 |
+
"B-DET": 8,
|
74 |
+
"B-INTJ": 9,
|
75 |
+
"B-NOUN": 10,
|
76 |
+
"B-NUM": 11,
|
77 |
+
"B-PART": 12,
|
78 |
+
"B-PRON": 13,
|
79 |
+
"B-PROPN": 14,
|
80 |
+
"B-PUNCT": 15,
|
81 |
+
"B-SCONJ": 16,
|
82 |
+
"B-SYM": 17,
|
83 |
+
"B-VERB": 18,
|
84 |
+
"B-X": 19,
|
85 |
+
"CCONJ": 20,
|
86 |
+
"DET": 21,
|
87 |
+
"I-ADJ": 22,
|
88 |
+
"I-ADP": 23,
|
89 |
+
"I-ADV": 24,
|
90 |
+
"I-AUX": 25,
|
91 |
+
"I-DET": 26,
|
92 |
+
"I-INTJ": 27,
|
93 |
+
"I-NOUN": 28,
|
94 |
+
"I-NUM": 29,
|
95 |
+
"I-PART": 30,
|
96 |
+
"I-PRON": 31,
|
97 |
+
"I-PROPN": 32,
|
98 |
+
"I-PUNCT": 33,
|
99 |
+
"I-SCONJ": 34,
|
100 |
+
"I-SYM": 35,
|
101 |
+
"I-VERB": 36,
|
102 |
+
"I-X": 37,
|
103 |
+
"INTJ": 38,
|
104 |
+
"NOUN": 39,
|
105 |
+
"NUM": 40,
|
106 |
+
"PART": 41,
|
107 |
+
"PRON": 42,
|
108 |
+
"PROPN": 43,
|
109 |
+
"PUNCT": 44,
|
110 |
+
"SCONJ": 45,
|
111 |
+
"SYM": 46,
|
112 |
+
"VERB": 47,
|
113 |
+
"X": 48
|
114 |
+
},
|
115 |
+
"layer_norm_eps": 1e-12,
|
116 |
+
"max_position_embeddings": 512,
|
117 |
+
"model_type": "bert",
|
118 |
+
"num_attention_heads": 12,
|
119 |
+
"num_hidden_layers": 12,
|
120 |
+
"output_past": true,
|
121 |
+
"pad_token_id": 0,
|
122 |
+
"pooler_fc_size": 768,
|
123 |
+
"pooler_num_attention_heads": 12,
|
124 |
+
"pooler_num_fc_layers": 3,
|
125 |
+
"pooler_size_per_head": 128,
|
126 |
+
"pooler_type": "first_token_transform",
|
127 |
+
"position_embedding_type": "absolute",
|
128 |
+
"tokenizer_class": "BertTokenizerFast",
|
129 |
+
"torch_dtype": "float32",
|
130 |
+
"transformers_version": "4.22.1",
|
131 |
+
"type_vocab_size": 2,
|
132 |
+
"use_cache": true,
|
133 |
+
"vocab_size": 38168
|
134 |
+
}
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d39af228b8bf4fc9cc073b1c799bea7251ebb29fa791d0b6e2c1c748fb404511
|
3 |
+
size 459276273
|
special_tokens_map.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cls_token": "[CLS]",
|
3 |
+
"mask_token": "[MASK]",
|
4 |
+
"pad_token": "[PAD]",
|
5 |
+
"sep_token": "[SEP]",
|
6 |
+
"unk_token": "[UNK]"
|
7 |
+
}
|
supar.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:85e540952e65c6a3a6f19084f41a5a5423aa0df4bc2bce5af69e795f4f580d05
|
3 |
+
size 509894565
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cls_token": "[CLS]",
|
3 |
+
"do_basic_tokenize": true,
|
4 |
+
"do_lower_case": false,
|
5 |
+
"mask_token": "[MASK]",
|
6 |
+
"model_max_length": 512,
|
7 |
+
"never_split": null,
|
8 |
+
"pad_token": "[PAD]",
|
9 |
+
"sep_token": "[SEP]",
|
10 |
+
"special_tokens_map_file": null,
|
11 |
+
"strip_accents": false,
|
12 |
+
"tokenize_chinese_chars": true,
|
13 |
+
"tokenizer_class": "BertTokenizerFast",
|
14 |
+
"unk_token": "[UNK]"
|
15 |
+
}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|