Update encoder model card
Browse files
README.md
CHANGED
|
@@ -28,6 +28,7 @@ weights_path = weights_path_for("encoder")
|
|
| 28 |
download_weights(
|
| 29 |
"encoder",
|
| 30 |
weights_path,
|
|
|
|
| 31 |
dict_path=DriverConfig.files.dictionary_file_path,
|
| 32 |
)
|
| 33 |
|
|
@@ -38,10 +39,10 @@ from sentimentizer.tokenizer import get_trained_tokenizer
|
|
| 38 |
model = get_trained_model(device="cpu")
|
| 39 |
tokenizer = get_trained_tokenizer()
|
| 40 |
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
```
|
| 46 |
|
| 47 |
## Files
|
|
|
|
| 28 |
download_weights(
|
| 29 |
"encoder",
|
| 30 |
weights_path,
|
| 31 |
+
repo_id="ryeyoo/sentimentizer-encoder",
|
| 32 |
dict_path=DriverConfig.files.dictionary_file_path,
|
| 33 |
)
|
| 34 |
|
|
|
|
| 39 |
model = get_trained_model(device="cpu")
|
| 40 |
tokenizer = get_trained_tokenizer()
|
| 41 |
|
| 42 |
+
probs = model.predict_text('amazing food great service')
|
| 43 |
+
for label, prob in sorted(probs.items(), key=lambda x: -x[1]):
|
| 44 |
+
print(f'{label}: {prob:.4f}')
|
| 45 |
+
# e.g. positive: 0.8300, neutral: 0.1200, negative: 0.0500
|
| 46 |
```
|
| 47 |
|
| 48 |
## Files
|