used native setfit head
Browse files- README.md +4 -2
- config_setfit.json +2 -2
- model_head.pkl +2 -2
README.md
CHANGED
|
@@ -99,7 +99,8 @@ classifier.to(device);
|
|
| 99 |
mentions = ["working class people", "highly-educated professionals", "people without a stable job"]
|
| 100 |
|
| 101 |
# Get predictions
|
| 102 |
-
|
|
|
|
| 103 |
print(predictions)
|
| 104 |
|
| 105 |
# Map predictions to labels
|
|
@@ -128,7 +129,8 @@ model = SentenceTransformer(model_name, device=device)
|
|
| 128 |
mentions = ["working class people", "highly-educated professionals", "people without a stable job"]
|
| 129 |
|
| 130 |
# Compute mention embeddings
|
| 131 |
-
|
|
|
|
| 132 |
````
|
| 133 |
|
| 134 |
## Training Details
|
|
|
|
| 99 |
mentions = ["working class people", "highly-educated professionals", "people without a stable job"]
|
| 100 |
|
| 101 |
# Get predictions
|
| 102 |
+
with torch.no_grad():
|
| 103 |
+
predictions = classifier.predict(mentions)
|
| 104 |
print(predictions)
|
| 105 |
|
| 106 |
# Map predictions to labels
|
|
|
|
| 129 |
mentions = ["working class people", "highly-educated professionals", "people without a stable job"]
|
| 130 |
|
| 131 |
# Compute mention embeddings
|
| 132 |
+
with torch.no_grad():
|
| 133 |
+
embeddings = model.encode(mentions)
|
| 134 |
````
|
| 135 |
|
| 136 |
## Training Details
|
config_setfit.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"labels": [
|
| 3 |
"noneconomic__age",
|
| 4 |
"noneconomic__crime",
|
|
@@ -10,6 +11,5 @@
|
|
| 10 |
"noneconomic__place_location",
|
| 11 |
"noneconomic__religion",
|
| 12 |
"noneconomic__shared_values_mentalities"
|
| 13 |
-
]
|
| 14 |
-
"normalize_embeddings": true
|
| 15 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"normalize_embeddings": true,
|
| 3 |
"labels": [
|
| 4 |
"noneconomic__age",
|
| 5 |
"noneconomic__crime",
|
|
|
|
| 11 |
"noneconomic__place_location",
|
| 12 |
"noneconomic__religion",
|
| 13 |
"noneconomic__shared_values_mentalities"
|
| 14 |
+
]
|
|
|
|
| 15 |
}
|
model_head.pkl
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:08e357b2020d40ddff8e26feae50c6b609c50049f075421a9a2f75134ee3eb53
|
| 3 |
+
size 32266
|