Xiangyang Liu
commited on
Commit
·
d8bd9c0
1
Parent(s):
a32d6b6
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ElasticBERT-LARGE
|
| 2 |
+
|
| 3 |
+
## Model description
|
| 4 |
+
|
| 5 |
+
This is an implementation of the `large` version of ElasticBERT.
|
| 6 |
+
|
| 7 |
+
[**Towards Efficient NLP: A Standard Evaluation and A Strong Baseline**](https://arxiv.org/pdf/2110.07038.pdf)
|
| 8 |
+
|
| 9 |
+
Xiangyang Liu, Tianxiang Sun, Junliang He, Lingling Wu, Xinyu Zhang, Hao Jiang, Zhao Cao, Xuanjing Huang, Xipeng Qiu
|
| 10 |
+
|
| 11 |
+
## Code link
|
| 12 |
+
|
| 13 |
+
[**fastnlp/elasticbert**](https://github.com/fastnlp/ElasticBERT)
|
| 14 |
+
|
| 15 |
+
## Usage
|
| 16 |
+
```python
|
| 17 |
+
>>> from transformers import BertTokenizer as ElasticBertTokenizer
|
| 18 |
+
>>> from models.configuration_elasticbert import ElasticBertConfig
|
| 19 |
+
>>> from models.modeling_elasticbert import ElasticBertForSequenceClassification
|
| 20 |
+
>>> num_output_layers = 1
|
| 21 |
+
>>> config = ElasticBertConfig.from_pretrained('fnlp/elasticbert-large', num_output_layers=num_output_layers )
|
| 22 |
+
>>> tokenizer = ElasticBertTokenizer.from_pretrained('fnlp/elasticbert-large')
|
| 23 |
+
>>> model = ElasticBertForSequenceClassification.from_pretrained('fnlp/elasticbert-large', config=config)
|
| 24 |
+
>>> input_ids = tokenizer.encode('The actors are fantastic .', return_tensors='pt')
|
| 25 |
+
>>> outputs = model(input_ids)
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
## Citation
|
| 29 |
+
|
| 30 |
+
```bibtex
|
| 31 |
+
@article{liu2021elasticbert,
|
| 32 |
+
author = {Xiangyang Liu and
|
| 33 |
+
Tianxiang Sun and
|
| 34 |
+
Junliang He and
|
| 35 |
+
Lingling Wu and
|
| 36 |
+
Xinyu Zhang and
|
| 37 |
+
Hao Jiang and
|
| 38 |
+
Zhao Cao and
|
| 39 |
+
Xuanjing Huang and
|
| 40 |
+
Xipeng Qiu},
|
| 41 |
+
title = {Towards Efficient {NLP:} {A} Standard Evaluation and {A} Strong Baseline},
|
| 42 |
+
journal = {CoRR},
|
| 43 |
+
volume = {abs/2110.07038},
|
| 44 |
+
year = {2021},
|
| 45 |
+
url = {https://arxiv.org/abs/2110.07038},
|
| 46 |
+
eprinttype = {arXiv},
|
| 47 |
+
eprint = {2110.07038},
|
| 48 |
+
timestamp = {Fri, 22 Oct 2021 13:33:09 +0200},
|
| 49 |
+
biburl = {https://dblp.org/rec/journals/corr/abs-2110-07038.bib},
|
| 50 |
+
bibsource = {dblp computer science bibliography, https://dblp.org}
|
| 51 |
+
}
|
| 52 |
+
```
|