nhanv commited on
Commit
fbe59a2
1 Parent(s): 27e7bc5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +62 -0
README.md CHANGED
@@ -12,6 +12,68 @@ Bert4news is used for a toolkit Vietnames(segmentation and Named Entity Recognit
12
 
13
  **[BERT](https://github.com/google-research/bert)** (from Google Research and the Toyota Technological Institute at Chicago) released with the paper [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://arxiv.org/abs/1810.04805).
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  We use word sentencepiece, use basic bert tokenization and same config with bert base with lowercase = False.
16
 
17
  You can download trained model:
 
12
 
13
  **[BERT](https://github.com/google-research/bert)** (from Google Research and the Toyota Technological Institute at Chicago) released with the paper [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://arxiv.org/abs/1810.04805).
14
 
15
+
16
+ # Vietnamese toolkit with bert
17
+ ViNLP is a system annotation for Vietnamese, it use pretrain [Bert4news](https://github.com/bino282/bert4news/) to fine-turning to NLP problems in Vietnamese components of wordsegmentation,Named entity recognition (NER) and achieve high accuravy.
18
+
19
+ ### Installation
20
+ ```bash
21
+ git clone https://github.com/bino282/ViNLP.git
22
+ cd ViNLP
23
+ python setup.py develop build
24
+ ```
25
+
26
+ ### Test Segmentation
27
+ The model achieved F1 score : 0.984 on VLSP 2013 dataset
28
+
29
+ |Model | F1 |
30
+ |--------|-----------|
31
+ | **BertVnTokenizer** | 98.40 |
32
+ | **DongDu** | 96.90 |
33
+ | **JvnSegmenter-Maxent** | 97.00 |
34
+ | **JvnSegmenter-CRFs** | 97.06 |
35
+ | **VnTokenizer** | 97.33 |
36
+ | **UETSegmenter** | 97.87 |
37
+ | **VnTokenizer** | 97.33 |
38
+ | **VnCoreNLP (i.e. RDRsegmenter)** | 97.90 |
39
+
40
+
41
+ ``` bash
42
+ from ViNLP import BertVnTokenizer
43
+ tokenizer = BertVnTokenizer()
44
+ sentences = tokenizer.split(["Tổng thống Donald Trump ký sắc lệnh cấm mọi giao dịch của Mỹ với ByteDance và Tecent - chủ sở hữu của 2 ứng dụng phổ biến TikTok và WeChat sau 45 ngày nữa."])
45
+ print(sentences[0])
46
+ ```
47
+ ``` bash
48
+ Tổng_thống Donald_Trump ký sắc_lệnh cấm mọi giao_dịch của Mỹ với ByteDance và Tecent - chủ_sở_hữu của 2 ứng_dụng phổ_biến TikTok và WeChat sau 45 ngày nữa .
49
+
50
+ ```
51
+
52
+ ### Test Named Entity Recognition
53
+ The model achieved F1 score VLSP 2018 for all named entities including nested entities : 0.786
54
+
55
+ |Model | F1 |
56
+ |--------|-----------|
57
+ | **BertVnNer** | 78.60 |
58
+ | **VNER Attentive Neural Network** | 77.52 |
59
+ | **vietner CRF (ngrams + word shapes + cluster + w2v)** | 76.63 |
60
+ | **ZA-NER BiLSTM** | 74.70 |
61
+
62
+ ``` bash
63
+ from ViNLP import BertVnNer
64
+ bert_ner_model = BertVnNer()
65
+ sentence = "Theo SCMP, báo cáo của CSIS với tên gọi Định hình Tương lai Chính sách của Mỹ với Trung Quốc cũng cho thấy sự ủng hộ tương đối rộng rãi của các chuyên gia về việc cấm Huawei, tập đoàn viễn thông khổng lồ của Trung Quốc"
66
+ entities = bert_ner_model.annotate([sentence])
67
+ print(entities)
68
+
69
+ ```
70
+ ``` bash
71
+ [{'ORGANIZATION': ['SCMP', 'CSIS', 'Huawei'], 'LOCATION': ['Mỹ', 'Trung Quốc']}]
72
+
73
+ ```
74
+
75
+
76
+
77
  We use word sentencepiece, use basic bert tokenization and same config with bert base with lowercase = False.
78
 
79
  You can download trained model: