Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,10 @@ classifier = pipeline("text-classification", tokenizer=tokenizer, model=model, m
|
|
18 |
|
19 |
def prozesatu(testua):
|
20 |
prediction = prozesatu.classifier(testua)[0]
|
21 |
-
|
|
|
|
|
|
|
22 |
#return 'C1:{}. Probabilitatea:{:.2f}'.format(prediction["label"], round(prediction["score"], 2))
|
23 |
|
24 |
prozesatu.classifier = classifier
|
|
|
18 |
|
19 |
def prozesatu(testua):
|
20 |
prediction = prozesatu.classifier(testua)[0]
|
21 |
+
if prediction["label"]=="GAI":
|
22 |
+
return {"Gai":prediction["score"], "Ez gai": 1-prediction["score"]}
|
23 |
+
else:
|
24 |
+
return {"Gai":1-prediction["score"], "Ez gai": prediction["score"]}
|
25 |
#return 'C1:{}. Probabilitatea:{:.2f}'.format(prediction["label"], round(prediction["score"], 2))
|
26 |
|
27 |
prozesatu.classifier = classifier
|