sotosbarl commited on
Commit
456648d
·
1 Parent(s): 967da44

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -19,9 +19,16 @@ with open('chapter_titles.pkl', 'rb') as file:
19
 
20
  def classify(text):
21
  output = classifier(text, titles_astiko, multi_label=True)
22
- # output = output['sequence']
 
 
 
 
 
 
 
23
  # output = output[0:10]
24
- return output
25
 
26
 
27
  text = st.text_input('Enter some text:') # Input field for new text
 
19
 
20
  def classify(text):
21
  output = classifier(text, titles_astiko, multi_label=True)
22
+ labels = output['labels']
23
+ scores = output['scores']
24
+ return_labels = []
25
+ for i in range(len(scores)):
26
+ if scores[i] > 0.99:
27
+ return_labels.append(labels[i])
28
+ else:
29
+ break
30
  # output = output[0:10]
31
+ return return_labels
32
 
33
 
34
  text = st.text_input('Enter some text:') # Input field for new text