Update app.py
Browse files
app.py
CHANGED
@@ -12,9 +12,9 @@ classifier = pipeline("zero-shot-classification", model="MoritzLaurer/mDeBERTa-v
|
|
12 |
|
13 |
# with open('chapter_titles.pkl', 'rb') as file:
|
14 |
# titles_astiko = pickle.load(file)
|
15 |
-
labels1 = ["κληρονομικό", "ακίνητα", "διαζύγιο"]
|
16 |
-
# labels2 = ["αποδοχή κληρονομιάς", "αποποίηση", "διαθήκη"]
|
17 |
-
# labels3 = ["μίσθωση", "κυριότητα", "έξωση", "απλήρωτα νοίκια"]
|
18 |
|
19 |
|
20 |
# titles_astiko = ["γάμος", "αλλοδαπός", "φορολογία", "κληρονομικά", "στέγη", "οικογενειακό", "εμπορικό","κλοπή","απάτη"]
|
@@ -32,27 +32,26 @@ text = st.text_input('Enter some text:') # Input field for new text
|
|
32 |
|
33 |
if text:
|
34 |
|
35 |
-
|
36 |
|
37 |
-
|
38 |
|
39 |
-
|
40 |
|
41 |
-
|
42 |
|
43 |
-
|
44 |
|
45 |
-
|
46 |
|
47 |
|
48 |
-
|
49 |
|
50 |
-
|
51 |
-
|
52 |
|
53 |
-
|
54 |
|
55 |
|
56 |
-
|
57 |
-
st.text(output)
|
58 |
|
|
|
12 |
|
13 |
# with open('chapter_titles.pkl', 'rb') as file:
|
14 |
# titles_astiko = pickle.load(file)
|
15 |
+
# labels1 = ["κληρονομικό", "ακίνητα", "διαζύγιο"]
|
16 |
+
# # labels2 = ["αποδοχή κληρονομιάς", "αποποίηση", "διαθήκη"]
|
17 |
+
# # labels3 = ["μίσθωση", "κυριότητα", "έξωση", "απλήρωτα νοίκια"]
|
18 |
|
19 |
|
20 |
# titles_astiko = ["γάμος", "αλλοδαπός", "φορολογία", "κληρονομικά", "στέγη", "οικογενειακό", "εμπορικό","κλοπή","απάτη"]
|
|
|
32 |
|
33 |
if text:
|
34 |
|
35 |
+
labels = list(dictionary)
|
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(output)
|
51 |
+
st.text(output2)
|
52 |
|
53 |
+
st.text(answer)
|
54 |
|
55 |
|
56 |
+
|
|
|
57 |
|