Commit
·
79f665b
1
Parent(s):
e86f0c1
Update from amine
Browse files- README.md +54 -0
- config.json +28 -0
- pytorch_model.bin +3 -0
- tf_model.h5 +3 -0
- tokenizer_config.json +1 -0
- vocab.txt +0 -0
README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: multilingual
|
| 3 |
+
|
| 4 |
+
datasets: wikipedia
|
| 5 |
+
|
| 6 |
+
license: apache-2.0
|
| 7 |
+
|
| 8 |
+
widget:
|
| 9 |
+
- text: "Google generated 46 billion [MASK] in revenue."
|
| 10 |
+
- text: "Paris is the capital of [MASK]."
|
| 11 |
+
- text: "Algiers is the largest city in [MASK]."
|
| 12 |
+
- text: "Paris est la [MASK] de la France."
|
| 13 |
+
- text: "Paris est la capitale de la [MASK]."
|
| 14 |
+
- text: "L'élection américaine a eu [MASK] en novembre 2020."
|
| 15 |
+
- text: "تقع سويسرا في [MASK] أوروبا"
|
| 16 |
+
- text: "إسمي محمد وأسكن في [MASK]."
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# bert-base-10lang-cased
|
| 20 |
+
|
| 21 |
+
We are sharing smaller versions of [bert-base-multilingual-cased](https://huggingface.co/bert-base-multilingual-cased) that handle a custom number of languages.
|
| 22 |
+
|
| 23 |
+
Unlike [distilbert-base-multilingual-cased](https://huggingface.co/distilbert-base-multilingual-cased), our versions give exactly the same representations produced by the original model which preserves the original accuracy.
|
| 24 |
+
|
| 25 |
+
This model handles the following languages: english, french, spanish, german, chinese, arabic, russian, portuguese, italian, and urdu. It produces the same representations as [bert-base-multilingual-cased](https://huggingface.co/bert-base-multilingual-cased) while being 22.5% smaller in size.
|
| 26 |
+
|
| 27 |
+
For more information please visit our paper: [Load What You Need: Smaller Versions of Multilingual BERT](https://www.aclweb.org/anthology/2020.sustainlp-1.16.pdf).
|
| 28 |
+
|
| 29 |
+
## How to use
|
| 30 |
+
|
| 31 |
+
```python
|
| 32 |
+
from transformers import AutoTokenizer, AutoModel
|
| 33 |
+
|
| 34 |
+
tokenizer = AutoTokenizer.from_pretrained("Geotrend/bert-base-10lang-cased")
|
| 35 |
+
model = AutoModel.from_pretrained("Geotrend/bert-base-10lang-cased")
|
| 36 |
+
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
To generate other smaller versions of multilingual transformers please visit [our Github repo](https://github.com/Geotrend-research/smaller-transformers).
|
| 40 |
+
|
| 41 |
+
### How to cite
|
| 42 |
+
|
| 43 |
+
```bibtex
|
| 44 |
+
@inproceedings{smallermbert,
|
| 45 |
+
title={Load What You Need: Smaller Versions of Multilingual BERT},
|
| 46 |
+
author={Abdaoui, Amine and Pradel, Camille and Sigel, Grégoire},
|
| 47 |
+
booktitle={SustaiNLP / EMNLP},
|
| 48 |
+
year={2020}
|
| 49 |
+
}
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
## Contact
|
| 53 |
+
|
| 54 |
+
Please contact [email protected] for any question, feedback or request.
|
config.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "new-models/bert-base-10lang-cased",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"BertForMaskedLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_probs_dropout_prob": 0.1,
|
| 7 |
+
"directionality": "bidi",
|
| 8 |
+
"gradient_checkpointing": false,
|
| 9 |
+
"hidden_act": "gelu",
|
| 10 |
+
"hidden_dropout_prob": 0.1,
|
| 11 |
+
"hidden_size": 768,
|
| 12 |
+
"initializer_range": 0.02,
|
| 13 |
+
"intermediate_size": 3072,
|
| 14 |
+
"layer_norm_eps": 1e-12,
|
| 15 |
+
"max_position_embeddings": 512,
|
| 16 |
+
"model_type": "bert",
|
| 17 |
+
"num_attention_heads": 12,
|
| 18 |
+
"num_hidden_layers": 12,
|
| 19 |
+
"pad_token_id": 0,
|
| 20 |
+
"pooler_fc_size": 768,
|
| 21 |
+
"pooler_num_attention_heads": 12,
|
| 22 |
+
"pooler_num_fc_layers": 3,
|
| 23 |
+
"pooler_size_per_head": 128,
|
| 24 |
+
"pooler_type": "first_token_transform",
|
| 25 |
+
"position_embedding_type": "absolute",
|
| 26 |
+
"type_vocab_size": 2,
|
| 27 |
+
"vocab_size": 67318
|
| 28 |
+
}
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f13183cec2e8467dfcaa10181954923192d238a42c60f4b4e1b1948288351186
|
| 3 |
+
size 551326544
|
tf_model.h5
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:173f8ae0ea06432a465fa42762c8d1e1f3d36876b9cf89374ee21a5acf40281d
|
| 3 |
+
size 759906104
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"do_lower_case": false, "model_max_length": 512}
|
vocab.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|