Update README.md
Browse files
README.md
CHANGED
|
@@ -30,7 +30,6 @@ The following provides the code to implement the task of detecting personality f
|
|
| 30 |
```python
|
| 31 |
# install these packages before importing them (transformers, PyTorch)
|
| 32 |
# install these packages before importing them (transformers, PyTorch)
|
| 33 |
-
|
| 34 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
| 35 |
import torch
|
| 36 |
|
|
@@ -61,18 +60,19 @@ predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)
|
|
| 61 |
predicted_scores = predictions[0].tolist()
|
| 62 |
|
| 63 |
|
| 64 |
-
trait_names = ["
|
| 65 |
|
| 66 |
|
| 67 |
for trait, score in zip(trait_names, predicted_scores):
|
| 68 |
print(f"{trait}: {score:.4f}")
|
| 69 |
|
| 70 |
##"output":
|
| 71 |
-
#
|
| 72 |
-
#
|
| 73 |
-
#
|
| 74 |
-
#
|
| 75 |
-
#
|
|
|
|
| 76 |
|
| 77 |
|
| 78 |
```
|
|
|
|
| 30 |
```python
|
| 31 |
# install these packages before importing them (transformers, PyTorch)
|
| 32 |
# install these packages before importing them (transformers, PyTorch)
|
|
|
|
| 33 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
| 34 |
import torch
|
| 35 |
|
|
|
|
| 60 |
predicted_scores = predictions[0].tolist()
|
| 61 |
|
| 62 |
|
| 63 |
+
trait_names = ["agreeableness", "openness", "conscientiousness", "extraversion", "neuroticism"]
|
| 64 |
|
| 65 |
|
| 66 |
for trait, score in zip(trait_names, predicted_scores):
|
| 67 |
print(f"{trait}: {score:.4f}")
|
| 68 |
|
| 69 |
##"output":
|
| 70 |
+
#agreeableness: 0.2138
|
| 71 |
+
#openness: 0.2890
|
| 72 |
+
#conscientiousness: 0.1921
|
| 73 |
+
#extraversion: 0.1307
|
| 74 |
+
#neuroticism: 0.1744
|
| 75 |
+
|
| 76 |
|
| 77 |
|
| 78 |
```
|