Update README.md
Browse files
README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
---
|
2 |
datasets:
|
3 |
- ElKulako/stocktwits-crypto
|
|
|
4 |
|
5 |
---
|
6 |
|
@@ -15,15 +16,15 @@ CryptoBERT was trained with a max sequence length of 128. Technically, it can ha
|
|
15 |
|
16 |
# Classification Example
|
17 |
```python
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
|
28 |
|
29 |
```
|
|
|
1 |
---
|
2 |
datasets:
|
3 |
- ElKulako/stocktwits-crypto
|
4 |
+
language: english
|
5 |
|
6 |
---
|
7 |
|
|
|
16 |
|
17 |
# Classification Example
|
18 |
```python
|
19 |
+
from transformers import TextClassificationPipeline, AutoModelForSequenceClassification, AutoTokenizer
|
20 |
+
from datasets import load_dataset
|
21 |
+
dataset_name = "ElKulako/stocktwits-crypto"
|
22 |
+
dataset = load_dataset(dataset_name)
|
23 |
+
model_name = "ElKulako/cryptobert"
|
24 |
+
tokenizer_ = AutoTokenizer.from_pretrained(model_name, use_fast=True)
|
25 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_name, num_labels = 3)
|
26 |
+
pipe = TextClassificationPipeline(model=model, tokenizer=tokenizer, batch_size=64, max_length=64, truncation=True, padding = 'max_length')
|
27 |
+
preds = pipe(df_posts)
|
28 |
|
29 |
|
30 |
```
|