Update README.md
Browse files
README.md
CHANGED
|
@@ -18,38 +18,3 @@ The general architecture and experimental results of PhoBERT can be found in our
|
|
| 18 |
|
| 19 |
For further information or requests, please go to [PhoBERT's homepage](https://github.com/VinAIResearch/PhoBERT)!
|
| 20 |
|
| 21 |
-
### Installation <a name="install2"></a>
|
| 22 |
-
- Python 3.6+, and PyTorch 1.1.0+ (or TensorFlow 2.0+)
|
| 23 |
-
- Install `transformers`:
|
| 24 |
-
- `git clone https://github.com/huggingface/transformers.git`
|
| 25 |
-
- `cd transformers`
|
| 26 |
-
- `pip3 install --upgrade .`
|
| 27 |
-
|
| 28 |
-
### Pre-trained models <a name="models2"></a>
|
| 29 |
-
|
| 30 |
-
Model | #params | Arch. | Pre-training data
|
| 31 |
-
---|---|---|---
|
| 32 |
-
`vinai/phobert-base` | 135M | base | 20GB of texts
|
| 33 |
-
`vinai/phobert-large` | 370M | large | 20GB of texts
|
| 34 |
-
|
| 35 |
-
### Example usage <a name="usage2"></a>
|
| 36 |
-
|
| 37 |
-
```python
|
| 38 |
-
import torch
|
| 39 |
-
from transformers import AutoModel, AutoTokenizer
|
| 40 |
-
|
| 41 |
-
phobert = AutoModel.from_pretrained("vinai/phobert-base")
|
| 42 |
-
tokenizer = AutoTokenizer.from_pretrained("vinai/phobert-base")
|
| 43 |
-
|
| 44 |
-
# INPUT TEXT MUST BE ALREADY WORD-SEGMENTED!
|
| 45 |
-
line = "Tôi là sinh_viên trường đại_học Công_nghệ ."
|
| 46 |
-
|
| 47 |
-
input_ids = torch.tensor([tokenizer.encode(line)])
|
| 48 |
-
|
| 49 |
-
with torch.no_grad():
|
| 50 |
-
features = phobert(input_ids) # Models outputs are now tuples
|
| 51 |
-
|
| 52 |
-
## With TensorFlow 2.0+:
|
| 53 |
-
# from transformers import TFAutoModel
|
| 54 |
-
# phobert = TFAutoModel.from_pretrained("vinai/phobert-base")
|
| 55 |
-
```
|
|
|
|
| 18 |
|
| 19 |
For further information or requests, please go to [PhoBERT's homepage](https://github.com/VinAIResearch/PhoBERT)!
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|