jbraha commited on
Commit
25894ff
1 Parent(s): 53ce71f

fix examples

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -23,7 +23,7 @@ def unpack(result):
23
  output[labels[res['label']]] = res['score']
24
  return output
25
 
26
- def add_to_table(result, output):
27
  highest = (max(result, key=result.get), result[max(result, key=result.get)])
28
  result.pop(max(result, key=result.get))
29
  output.append([input, highest[0], highest[1], max(result, key=result.get),
@@ -75,7 +75,7 @@ for string in strings:
75
  result = classifier(string)
76
  result = result[0]
77
  result = unpack(result)
78
- add_to_table(result, output)
79
 
80
  st.table(output)
81
 
@@ -85,7 +85,7 @@ if st.button('Analyze'):
85
  result = result[0]
86
  if option == 'Fine-Tuned':
87
  result = unpack(result)
88
- add_to_table(result, output)
89
  # st.table(output)
90
  else:
91
  st.write(result)
 
23
  output[labels[res['label']]] = res['score']
24
  return output
25
 
26
+ def add_to_table(input, result, output):
27
  highest = (max(result, key=result.get), result[max(result, key=result.get)])
28
  result.pop(max(result, key=result.get))
29
  output.append([input, highest[0], highest[1], max(result, key=result.get),
 
75
  result = classifier(string)
76
  result = result[0]
77
  result = unpack(result)
78
+ add_to_table(string, result, output)
79
 
80
  st.table(output)
81
 
 
85
  result = result[0]
86
  if option == 'Fine-Tuned':
87
  result = unpack(result)
88
+ add_to_table(input, result, output)
89
  # st.table(output)
90
  else:
91
  st.write(result)