Update app.py
Browse files
app.py
CHANGED
@@ -23,7 +23,7 @@ with open('my_dict.pickle', 'rb') as file:
|
|
23 |
dictionary = pickle.load(file)
|
24 |
|
25 |
def classify(text,labels):
|
26 |
-
output = classifier(text,
|
27 |
|
28 |
return output
|
29 |
|
@@ -36,10 +36,15 @@ if text:
|
|
36 |
|
37 |
output = classify(text,labels)
|
38 |
|
|
|
|
|
39 |
labels = list(dictionary[output])
|
40 |
|
41 |
output2 = classify(text,labels)
|
42 |
|
|
|
|
|
|
|
43 |
answer = dictionary[output][output2]
|
44 |
|
45 |
st.text(answer)
|
|
|
23 |
dictionary = pickle.load(file)
|
24 |
|
25 |
def classify(text,labels):
|
26 |
+
output = classifier(text, labels, multi_label=False)
|
27 |
|
28 |
return output
|
29 |
|
|
|
36 |
|
37 |
output = classify(text,labels)
|
38 |
|
39 |
+
output = output["labels"][0]
|
40 |
+
|
41 |
labels = list(dictionary[output])
|
42 |
|
43 |
output2 = classify(text,labels)
|
44 |
|
45 |
+
output2 = output2["labels"][0]
|
46 |
+
|
47 |
+
|
48 |
answer = dictionary[output][output2]
|
49 |
|
50 |
st.text(answer)
|