EkhiAzur commited on
Commit
3659c6a
1 Parent(s): b797cc6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
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
- return {"Gai":prediction["score"], "Ez gai": 1-prediction["score"]}
 
 
 
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