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