lalital commited on
Commit
d0b7493
1 Parent(s): 72b531d

Add README.md

Browse files
Files changed (1) hide show
  1. README.md +109 -0
README.md ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # WangchanBERTa base model: `wangchanberta-base-wiki-newmm`
2
+
3
+ <br>
4
+
5
+ Pretrained RoBERTa BASE model on Thai Wikipedia corpus.
6
+ The script and documentation can be found at [this reposiryory](https://github.com/vistec-AI/thai2transformers).
7
+ <br>
8
+
9
+ ## Model description
10
+
11
+ <br>
12
+
13
+ The architecture of the pretrained model is based on RoBERTa [[Liu et al., 2019]](https://arxiv.org/abs/1907.11692).
14
+
15
+ <br>
16
+
17
+
18
+
19
+ ## Intended uses & limitations
20
+
21
+ <br>
22
+
23
+ You can use the pretrained model for masked language modeling (i.e. predicting a mask token in the input text). In addition, we also provide finetuned models for multiclass/multilabel text classification and token classification task.
24
+
25
+ <br>
26
+
27
+ **Multiclass text classification**
28
+
29
+
30
+ - `wisesight_sentiment`
31
+
32
+ 4-class text classification task (`positive`, `neutral`, `negative`, and `question`) based on social media posts and tweets.
33
+
34
+ - `wongnai_reivews`
35
+
36
+ Users' review rating classification task (scale is ranging from 1 to 5)
37
+
38
+ - `generated_reviews_enth` : (`review_star` as label)
39
+
40
+ Generated users' review rating classification task (scale is ranging from 1 to 5).
41
+
42
+ **Multilabel text classification**
43
+
44
+ - `prachathai67k`
45
+
46
+ Thai topic classification with 12 labels based on news article corpus from prachathai.com. The detail is described in this [page](https://huggingface.co/datasets/prachathai67k).
47
+
48
+
49
+
50
+
51
+ **Token classification**
52
+
53
+ - `thainer`
54
+
55
+ Named-entity recognition tagging with 13 named-entities as descibed in this [page](https://huggingface.co/datasets/thainer).
56
+
57
+ - `lst20` : NER NER and POS tagging
58
+
59
+ Named-entity recognition tagging with 10 named-entities and Part-of-Speech tagging with 16 tags as descibed in this [page](https://huggingface.co/datasets/lst20).
60
+
61
+ <br>
62
+
63
+ ## How to use
64
+
65
+ <br>
66
+
67
+ The getting started notebook of WangchanBERTa model can be found at this [Colab notebook](https://colab.research.google.com/drive/15GdAgMcTxhWfDia0OB76F1l0fKZ059Ez?usp=sharing#scrollTo=eVlb6CEDmYi3)
68
+
69
+ <br>
70
+
71
+ ## Training data
72
+
73
+ `wangchanberta-base-wiki-newmm` model was pretrained on Thai Wikipedia. Specifically, we use the Wikipedia dump articles on 20 August 2020 (dumps.wikimedia.org/thwiki/20200820/). We opt out lists, and tables.
74
+
75
+ ### Preprocessing
76
+
77
+ Texts are preprocessed with the following rules:
78
+
79
+ - Replace non-breaking space, zero-width non-breaking space, and soft hyphen with spaces.
80
+ - Remove an empty parenthesis that occur right after the title of the first paragraph.
81
+ - Replace spaces wtth <_>.
82
+
83
+ <br>
84
+
85
+
86
+ Regarding the vocabulary, we use wordl-level token from [PyThaiNLP](https://github.com/PyThaiNLP/pythainlp)'s dictionary-based tokenizer namedly `newmm`. The total number of word-level tokens in the vocabulary is 97,982.
87
+
88
+
89
+ We sample sentences contigously to have the length of at most 512 tokens. For some sentences that overlap the boundary of 512 tokens, we split such sentence with an additional token as document separator. This is the same approach as proposed by [[Liu et al., 2019]](https://arxiv.org/abs/1907.11692) (called "FULL-SENTENCES").
90
+
91
+ Regarding the masking procedure, for each sequence, we sampled 15% of the tokens and replace them with<mask>token.Out of the 15%, 80% is replaced with a<mask>token, 10% is left unchanged and 10% is replaced with a random token.
92
+
93
+ <br>
94
+
95
+ **Train/Val/Test splits**
96
+
97
+ We split sequencially 944,782 sentences for training set, 24,863 sentences for validation set and 24,862 sentences for test set.
98
+
99
+ <br>
100
+
101
+ **Pretraining**
102
+
103
+ The model was trained on 32 V100 GPUs for 31,250 steps with the batch size of 8,192 (16 mini batches per device with 16 accumulation steps) and a sequence length of 512 tokens. The optimizer we used is Adam with the learning rate of $7e-4$, $\beta_1 = 0.9$, $\beta_2= 0.98$ and $\epsilon = 1e-6$. The learning rate is warmed up for the first 1250 steps and linearly decayed to zero. The model checkpoint with minimum validation loss will be selected as the best model checkpoint.
104
+
105
+ <br>
106
+
107
+ **BibTeX entry and citation info**
108
+
109
+ [Coming Soon]