tugstugi commited on
Commit
b20a84c
1 Parent(s): f86e9b3

initial commit

Browse files
README.md ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: "mn"
3
+ tags:
4
+ - mongolian
5
+ - cased
6
+ ---
7
+
8
+ # BERT-BASE-MONGOLIAN-CASED
9
+ [Link to Official Mongolian-BERT repo](https://github.com/tugstugi/mongolian-bert)
10
+
11
+ ## Model description
12
+ This repository contains pre-trained Mongolian [BERT](https://arxiv.org/abs/1810.04805) models trained by [tugstugi](https://github.com/tugstugi), [enod](https://github.com/enod) and [sharavsambuu](https://github.com/sharavsambuu).
13
+ Special thanks to [nabar](https://github.com/nabar) who provided 5x TPUs.
14
+
15
+ This repository is based on the following open source projects: [google-research/bert](https://github.com/google-research/bert/),
16
+ [huggingface/pytorch-pretrained-BERT](https://github.com/huggingface/pytorch-pretrained-BERT) and [yoheikikuta/bert-japanese](https://github.com/yoheikikuta/bert-japanese).
17
+
18
+ #### How to use
19
+
20
+ ```python
21
+ from transformers import pipeline, AutoTokenizer, BertForMaskedLM
22
+
23
+ tokenizer = AutoTokenizer.from_pretrained('tugstugi/bert-base-mongolian-cased')
24
+ model = BertForMaskedLM.from_pretrained('tugstugi/bert-base-mongolian-cased')
25
+
26
+ ## declare task ##
27
+ pipe = pipeline(task="fill-mask", model=model, tokenizer=tokenizer)
28
+
29
+ ## example ##
30
+ input_ = 'Миний [MASK] хоол идэх нь тун чухал.'
31
+
32
+ output_ = pipe(input_)
33
+ for i in range(len(output_)):
34
+ print(output_[i])
35
+
36
+ ## Output ##
37
+ # {'sequence': '[CLS] Миний хувьд хоол идэх нь тун чухал.[SEP]', 'score': 0.8734784722328186, 'token': 95, 'token_str': '▁хувьд'}
38
+ # {'sequence': '[CLS] Миний бодлоор хоол идэх нь тун чухал.[SEP]', 'score': 0.09788835793733597, 'token': 6320, 'token_str': '▁бодлоор'}
39
+ # {'sequence': '[CLS] Миний хүү хоол идэх нь тун чухал.[SEP]', 'score': 0.0027510314248502254, 'token': 590, 'token_str': '▁хүү'}
40
+ # {'sequence': '[CLS] Миний бие хоол идэх нь тун чухал.[SEP]', 'score': 0.0014857524074614048, 'token': 267, 'token_str': '▁бие'}
41
+ # {'sequence': '[CLS] Миний охин хоол идэх нь тун чухал.[SEP]', 'score': 0.0013575413031503558, 'token': 1116, 'token_str': '▁охин'}
42
+
43
+ ```
44
+
45
+
46
+ ## Training data
47
+ Mongolian Wikipedia and the 700 million word Mongolian news data set [[Pretraining Procedure](https://github.com/tugstugi/mongolian-bert#pre-training)]
48
+
49
+ ### BibTeX entry and citation info
50
+
51
+ ```bibtex
52
+ @misc{mongolian-bert,
53
+ author = {Tuguldur, Erdene-Ochir and Gunchinish, Sharavsambuu and Bataa, Enkhbold},
54
+ title = {BERT Pretrained Models on Mongolian Datasets},
55
+ year = {2019},
56
+ publisher = {GitHub},
57
+ journal = {GitHub repository},
58
+ howpublished = {\url{https://github.com/tugstugi/mongolian-bert/}}
59
+ }
60
+ ```
added_tokens.json ADDED
@@ -0,0 +1 @@
 
1
+ {"<pad>": 32000}
config.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "BertForMaskedLM"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "gradient_checkpointing": false,
7
+ "hidden_act": "gelu",
8
+ "hidden_dropout_prob": 0.1,
9
+ "hidden_size": 768,
10
+ "initializer_range": 0.02,
11
+ "intermediate_size": 3072,
12
+ "layer_norm_eps": 1e-12,
13
+ "max_position_embeddings": 512,
14
+ "model_type": "bert",
15
+ "num_attention_heads": 12,
16
+ "num_hidden_layers": 12,
17
+ "pad_token_id": 0,
18
+ "type_vocab_size": 2,
19
+ "vocab_size": 32000,
20
+ "tokenizer_class": "AlbertTokenizer"
21
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:986fdb83c734398c3ef14516879f6cbffa6571319cd50b48d6aab78c2f174b36
3
+ size 445016569
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]"}
spiece.model ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7316d915a97e6f879ab59e7bd8a2e27abe098ca96c4eee7a55fbb3196222b224
3
+ size 1000174
tf_model.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:30f0f144ce7a8ca6d888f0a81a63fdced5dc2bc3e6cfaada0e5b826d84746044
3
+ size 545136208
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
1
+ {"keep_accents": true, "do_lower_case": false}