hplisiecki
commited on
Commit
•
b4945dc
1
Parent(s):
19b7ffa
Update README.md
Browse files
README.md
CHANGED
@@ -59,22 +59,19 @@ A 10-fold cross-validation showed high reliability across different emotional di
|
|
59 |
You can use the model and tokenizer as follows:
|
60 |
|
61 |
```python
|
62 |
-
from transformers import AutoTokenizer
|
63 |
import torch
|
64 |
|
65 |
# Load the tokenizer
|
66 |
tokenizer = AutoTokenizer.from_pretrained("hplisiecki/polemo-intensity")
|
67 |
|
68 |
# Load the model
|
69 |
-
model =
|
70 |
-
|
71 |
-
# Define emotion columns
|
72 |
-
emotion_columns = ['Happiness', 'Sadness', 'Anger', 'Disgust', 'Fear', 'Pride', 'Valence', 'Arousal']
|
73 |
|
74 |
# Test the model with a sample input
|
75 |
inputs = tokenizer("This is a test input.", return_tensors="pt")
|
76 |
-
outputs = model(
|
77 |
|
78 |
# Print out the emotion ratings
|
79 |
-
for emotion, rating in zip(
|
80 |
print(f"{emotion}: {rating.item()}")
|
|
|
59 |
You can use the model and tokenizer as follows:
|
60 |
|
61 |
```python
|
62 |
+
from transformers import AutoTokenizer
|
63 |
import torch
|
64 |
|
65 |
# Load the tokenizer
|
66 |
tokenizer = AutoTokenizer.from_pretrained("hplisiecki/polemo-intensity")
|
67 |
|
68 |
# Load the model
|
69 |
+
model = Model.from_pretrained("hplisiecki/polemo-intensity")
|
|
|
|
|
|
|
70 |
|
71 |
# Test the model with a sample input
|
72 |
inputs = tokenizer("This is a test input.", return_tensors="pt")
|
73 |
+
outputs = model(inputs['input_ids'], inputs['attention_mask'])
|
74 |
|
75 |
# Print out the emotion ratings
|
76 |
+
for emotion, rating in zip(['Happiness', 'Sadness', 'Anger', 'Disgust', 'Fear', 'Pride', 'Valence', 'Arousal'], outputs):
|
77 |
print(f"{emotion}: {rating.item()}")
|