ruanchaves commited on
Commit
9d9acca
·
1 Parent(s): bcac309

descriptions

Browse files
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -33,6 +33,11 @@ This box presents a detailed breakdown of the evaluation for each model.
33
  (Esta caixa apresenta um detalhamento da avaliação para cada modelo.)
34
  """ }
35
 
 
 
 
 
 
36
  score_descriptions = {
37
  0: "Negative: The answer is not suitable for the provided question.",
38
  1: "Positive: The answer is suitable for the provided question.",
@@ -96,9 +101,10 @@ def predict(s1, s2, chosen_model):
96
  final_description = description + "\n \n" + description_pt
97
  return final_description
98
 
99
- scores = { get_description(k):v for k,v in enumerate(logits) }
100
-
101
- return scores
 
102
 
103
 
104
  inputs = [
@@ -108,7 +114,8 @@ inputs = [
108
  ]
109
 
110
  outputs = [
111
- gr.Label(label="Result")
 
112
  ]
113
 
114
 
 
33
  (Esta caixa apresenta um detalhamento da avaliação para cada modelo.)
34
  """ }
35
 
36
+ short_score_descriptions = {
37
+ 0: "Unsuitable",
38
+ 1: "Suitable"
39
+ }
40
+
41
  score_descriptions = {
42
  0: "Negative: The answer is not suitable for the provided question.",
43
  1: "Positive: The answer is suitable for the provided question.",
 
101
  final_description = description + "\n \n" + description_pt
102
  return final_description
103
 
104
+ max_pos = logits.index(max(logits))
105
+ markdown_description = get_description(max_pos)
106
+ scores = { short_score_descriptions[k]:v for k,v in enumerate(logits) }
107
+ return scores, markdown_description
108
 
109
 
110
  inputs = [
 
114
  ]
115
 
116
  outputs = [
117
+ gr.Label(label="Result"),
118
+ gr.Markdown()
119
  ]
120
 
121