Spaces:
Runtime error
Runtime error
Fixes XNLI labels
Browse files
app.py
CHANGED
@@ -54,9 +54,9 @@ def load_model_pair_classification(text, model_url_pair_classification):
|
|
54 |
tokenizer = AutoTokenizer.from_pretrained(model_url)
|
55 |
nlp = pipeline("text-classification", model=model, tokenizer=tokenizer)
|
56 |
result = nlp(f"{text}</s>")
|
57 |
-
if result[0]["label"] == "
|
58 |
return f"Entailment: {result[0]['score']:02f}"
|
59 |
-
if result[0]["label"] == "
|
60 |
return f"Neutral: {result[0]['score']:02f}"
|
61 |
return f"Contradiction: {result[0]['score']:02f}"
|
62 |
|
|
|
54 |
tokenizer = AutoTokenizer.from_pretrained(model_url)
|
55 |
nlp = pipeline("text-classification", model=model, tokenizer=tokenizer)
|
56 |
result = nlp(f"{text}</s>")
|
57 |
+
if result[0]["label"] == "entailment":
|
58 |
return f"Entailment: {result[0]['score']:02f}"
|
59 |
+
if result[0]["label"] == "neutral":
|
60 |
return f"Neutral: {result[0]['score']:02f}"
|
61 |
return f"Contradiction: {result[0]['score']:02f}"
|
62 |
|