Spaces:
Sleeping
Sleeping
Davide Fiocco
commited on
Commit
·
ec73fe0
1
Parent(s):
f84eaa9
Remove try block for debugging
Browse files
app.py
CHANGED
@@ -14,24 +14,20 @@ labels = st.text_input("Enter comma-separated labels:")
|
|
14 |
|
15 |
if st.button("Calculate labels"):
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
table = table.loc[table["text"].apply(len) > 10].reset_index(drop=True).head(50)
|
21 |
|
22 |
-
|
23 |
-
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
|
29 |
-
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
except:
|
34 |
-
st.error("File load didn't work. Make sure you upload a file containing a `text` column and a set of comma-separated labels is provided")
|
35 |
|
36 |
|
37 |
|
|
|
14 |
|
15 |
if st.button("Calculate labels"):
|
16 |
|
17 |
+
labels_list = labels.split(",")
|
18 |
+
table = pd.read_excel(data)
|
19 |
+
table = table.loc[table["text"].apply(len) > 10].reset_index(drop=True).head(50)
|
|
|
20 |
|
21 |
+
prog_bar = st.progress(0)
|
22 |
+
preds = []
|
23 |
|
24 |
+
for i in range(len(table)):
|
25 |
+
preds.append(classifier(table.loc[i, "text"], labels)["labels"][0])
|
26 |
+
prog_bar.progress((i + 1)/len(table))
|
27 |
|
28 |
+
table["label"] = preds
|
29 |
|
30 |
+
st.table(table[["text", "label"]])
|
|
|
|
|
|
|
31 |
|
32 |
|
33 |
|