Instructions to use nlpaueb/sec-bert-shape with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nlpaueb/sec-bert-shape with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="nlpaueb/sec-bert-shape")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForPreTraining tokenizer = AutoTokenizer.from_pretrained("nlpaueb/sec-bert-shape") model = AutoModelForPreTraining.from_pretrained("nlpaueb/sec-bert-shape", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -48,8 +48,8 @@ model = AutoModel.from_pretrained("nlpaueb/sec-bert-base")
|
|
| 48 |
|
| 49 |
## Pre-process Text
|
| 50 |
|
| 51 |
-
|
| 52 |
-
Below there is an example of how you can pre-process a simple sentence. This approach is quite simple
|
| 53 |
|
| 54 |
```python
|
| 55 |
import re
|
|
|
|
| 48 |
|
| 49 |
## Pre-process Text
|
| 50 |
|
| 51 |
+
To use SEC-BERT-SHAPE, you have to pre-process texts replacing every numerical token with the corresponding shape pseudo-token from a list of 214 predefined shape pseudo-tokens. If the numerical token does not correspond to any shape pseudo token we replace it with the [NUM] pseudo-token.
|
| 52 |
+
Below there is an example of how you can pre-process a simple sentence. This approach is quite simple; feel free to modify it as you see fit.
|
| 53 |
|
| 54 |
```python
|
| 55 |
import re
|