Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1 +1,8 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from sentence_transformers import CrossEncoder
|
2 |
+
model = CrossEncoder('cross-encoder/nli-deberta-v3-large')
|
3 |
+
scores = model.predict([('A man is eating pizza', 'A man eats something'), ('A black race car starts up in front of a crowd of people.', 'A man is driving down a lonely road.')])
|
4 |
+
|
5 |
+
#Convert scores to labels
|
6 |
+
label_mapping = ['contradiction', 'entailment', 'neutral']
|
7 |
+
labels = [label_mapping[score_max] for score_max in scores.argmax(axis=1)]
|
8 |
+
print("label", labels)
|