Commit ·
ba5db94
1
Parent(s): 763e962
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import torch
|
| 2 |
import tensorflow as tf
|
| 3 |
from transformers import RobertaTokenizer, RobertaModel
|
|
@@ -13,4 +22,6 @@ def roberta(x):
|
|
| 13 |
output = model(**encoded_input)
|
| 14 |
scores = output[0][0].detach().numpy()
|
| 15 |
scores = tf.nn.softmax(scores)
|
| 16 |
-
return scores.numpy()[1]
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: "mit"
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
This model takes text (up to a few sentences) and predicts to what extent it contains empathy.
|
| 6 |
+
|
| 7 |
+
Example classification:
|
| 8 |
+
|
| 9 |
+
```python
|
| 10 |
import torch
|
| 11 |
import tensorflow as tf
|
| 12 |
from transformers import RobertaTokenizer, RobertaModel
|
|
|
|
| 22 |
output = model(**encoded_input)
|
| 23 |
scores = output[0][0].detach().numpy()
|
| 24 |
scores = tf.nn.softmax(scores)
|
| 25 |
+
return scores.numpy()[1]
|
| 26 |
+
|
| 27 |
+
```
|