used native setfit head
Browse files- README.md +4 -2
- config_setfit.json +2 -2
- model_head.pkl +2 -2
README.md
CHANGED
|
@@ -95,7 +95,8 @@ classifier.to(device);
|
|
| 95 |
mentions = ["working class people", "highly-educated professionals", "people without a stable job"]
|
| 96 |
|
| 97 |
# Get predictions
|
| 98 |
-
|
|
|
|
| 99 |
print(predictions)
|
| 100 |
|
| 101 |
# Map predictions to labels
|
|
@@ -124,7 +125,8 @@ model = SentenceTransformer(model_name, device=device)
|
|
| 124 |
mentions = ["working class people", "highly-educated professionals", "people without a stable job"]
|
| 125 |
|
| 126 |
# Compute mention embeddings
|
| 127 |
-
|
|
|
|
| 128 |
````
|
| 129 |
|
| 130 |
## Training Details
|
|
|
|
| 95 |
mentions = ["working class people", "highly-educated professionals", "people without a stable job"]
|
| 96 |
|
| 97 |
# Get predictions
|
| 98 |
+
with torch.no_grad():
|
| 99 |
+
predictions = classifier.predict(mentions)
|
| 100 |
print(predictions)
|
| 101 |
|
| 102 |
# Map predictions to labels
|
|
|
|
| 125 |
mentions = ["working class people", "highly-educated professionals", "people without a stable job"]
|
| 126 |
|
| 127 |
# Compute mention embeddings
|
| 128 |
+
with torch.no_grad():
|
| 129 |
+
embeddings = model.encode(mentions)
|
| 130 |
````
|
| 131 |
|
| 132 |
## Training Details
|
config_setfit.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
{
|
|
|
|
| 2 |
"labels": [
|
| 3 |
"economic__class_membership",
|
| 4 |
"economic__ecology_of_group",
|
|
@@ -6,6 +7,5 @@
|
|
| 6 |
"economic__employment_status",
|
| 7 |
"economic__income_wealth_economic_status",
|
| 8 |
"economic__occupation_profession"
|
| 9 |
-
]
|
| 10 |
-
"normalize_embeddings": true
|
| 11 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"normalize_embeddings": true,
|
| 3 |
"labels": [
|
| 4 |
"economic__class_membership",
|
| 5 |
"economic__ecology_of_group",
|
|
|
|
| 7 |
"economic__employment_status",
|
| 8 |
"economic__income_wealth_economic_status",
|
| 9 |
"economic__occupation_profession"
|
| 10 |
+
]
|
|
|
|
| 11 |
}
|
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:022006403a97ce3c6eb9c994cfb2c789aedf7b15a5da2978868f0b9afa439697
|
| 3 |
+
size 19962
|