KoichiYasuoka commited on
Commit
b6f78de
1 Parent(s): 99c5f1f

initial release

Browse files
README.md ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - "th"
4
+ tags:
5
+ - "thai"
6
+ - "token-classification"
7
+ - "pos"
8
+ - "wikipedia"
9
+ - "dependency-parsing"
10
+ datasets:
11
+ - "universal_dependencies"
12
+ license: "apache-2.0"
13
+ pipeline_tag: "token-classification"
14
+ widget:
15
+ - text: "หลายหัวดีกว่าหัวเดียว"
16
+ ---
17
+
18
+ # deberta-base-thai-upos
19
+
20
+ ## Model Description
21
+
22
+ This is a DeBERTa(V2) model pre-trained on Thai Wikipedia texts for POS-tagging and dependency-parsing, derived from [deberta-base-thai](https://huggingface.co/KoichiYasuoka/deberta-base-thai). Every word is tagged by [UPOS](https://universaldependencies.org/u/pos/) (Universal Part-Of-Speech).
23
+
24
+ ## How to Use
25
+
26
+ ```py
27
+ import torch
28
+ from transformers import AutoTokenizer,AutoModelForTokenClassification
29
+ tokenizer=AutoTokenizer.from_pretrained("KoichiYasuoka/deberta-base-thai-upos")
30
+ model=AutoModelForTokenClassification.from_pretrained("KoichiYasuoka/deberta-base-thai-upos")
31
+ s="หลายหัวดีกว่าหัวเดียว"
32
+ t=tokenizer.tokenize(s)
33
+ p=[model.config.id2label[q] for q in torch.argmax(model(tokenizer.encode(s,return_tensors="pt"))["logits"],dim=2)[0].tolist()[1:-1]]
34
+ print(list(zip(t,p)))
35
+ ```
36
+
37
+ or
38
+
39
+ ```
40
+ import esupar
41
+ nlp=esupar.load("KoichiYasuoka/deberta-base-thai-upos")
42
+ print(nlp("หลายหัวดีกว่าหัวเดียว"))
43
+ ```
44
+
45
+ ## See Also
46
+
47
+ [esupar](https://github.com/KoichiYasuoka/esupar): Tokenizer POS-tagger and Dependency-parser with BERT/RoBERTa/DeBERTa models
48
+
config.json ADDED
The diff for this file is too large to render. See raw diff
 
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:044ad832967f2512af20bc4d4adfa0113ca8624c127c32a541c4ee6f5fb2126e
3
+ size 351871347
special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"bos_token": "[CLS]", "eos_token": "[SEP]", "unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]"}
spm.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b
3
+ size 1
supar.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8d266897f2090e6af16505b741bf6bcb099b3bfdf1a001f1d0da167a5f6d0198
3
+ size 397671211
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"do_lower_case": false, "bos_token": "[CLS]", "eos_token": "[SEP]", "unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]", "split_by_punct": true, "keep_accents": true, "model_max_length": 512, "tokenizer_class": "DebertaV2TokenizerFast"}