Instructions to use cardiffnlp/twitter-roberta-base-mar2020 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cardiffnlp/twitter-roberta-base-mar2020 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("fill-mask", model="cardiffnlp/twitter-roberta-base-mar2020")# Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("cardiffnlp/twitter-roberta-base-mar2020") model = AutoModelForMaskedLM.from_pretrained("cardiffnlp/twitter-roberta-base-mar2020") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -23,7 +23,7 @@ If you're interested in retaining verified users which were also retained during
|
|
| 23 |
```python
|
| 24 |
def preprocess(text):
|
| 25 |
preprocessed_text = []
|
| 26 |
-
for t in text.split():
|
| 27 |
if len(t) > 1:
|
| 28 |
t = '@user' if t[0] == '@' and t.count('@') == 1 else t
|
| 29 |
t = 'http' if t.startswith('http') else t
|
|
|
|
| 23 |
```python
|
| 24 |
def preprocess(text):
|
| 25 |
preprocessed_text = []
|
| 26 |
+
for t in text.split():
|
| 27 |
if len(t) > 1:
|
| 28 |
t = '@user' if t[0] == '@' and t.count('@') == 1 else t
|
| 29 |
t = 'http' if t.startswith('http') else t
|