Update app.py
Browse files
app.py
CHANGED
@@ -29,7 +29,7 @@ submit = form.form_submit_button('Submit')
|
|
29 |
|
30 |
if submit and len(x) != 0:
|
31 |
#model.to("cpu")
|
32 |
-
st.
|
33 |
|
34 |
tokenizer = AutoTokenizer.from_pretrained("dmis-lab/biobert-large-cased-v1.1", truncation = True, padding=True, model_max_length=512,)
|
35 |
model_checkpoint = BertForTokenClassification.from_pretrained("dexay/Ner2HgF", )
|
@@ -253,6 +253,7 @@ if submit and len(x) != 0:
|
|
253 |
for e in edccanbis:
|
254 |
if e[-1]== ["B-EDC","B-CANCER"]:
|
255 |
edccann += [[e[0],e[1],e[2]]]
|
|
|
256 |
|
257 |
elif e[-1]== ["B-EDC","B-HORMONE"]:
|
258 |
edchorm += [[e[0],e[1],e[2]]]
|
@@ -282,6 +283,7 @@ if submit and len(x) != 0:
|
|
282 |
with zipfile.ZipFile("allcsvs.zip", "w") as zipf:
|
283 |
if edccancsv:
|
284 |
zipf.write(edccancsv)
|
|
|
285 |
if edcrecepcsv:
|
286 |
zipf.write(edcrecepcsv)
|
287 |
if edchormcsv:
|
@@ -290,6 +292,7 @@ if submit and len(x) != 0:
|
|
290 |
zipf.write(hormcancsv)
|
291 |
if hormrecepcsv:
|
292 |
zipf.write(hormrecepcsv)
|
|
|
293 |
|
294 |
for e in edccanbis:
|
295 |
edccan += [[e[3],e[0]+" ["+e[-1][0][2:]+"]", e[1]+" ["+e[-1][1][2:]+"]",e[2]]]
|
|
|
29 |
|
30 |
if submit and len(x) != 0:
|
31 |
#model.to("cpu")
|
32 |
+
st.write("Execution in progress ... It may take a while, please be patient.")
|
33 |
|
34 |
tokenizer = AutoTokenizer.from_pretrained("dmis-lab/biobert-large-cased-v1.1", truncation = True, padding=True, model_max_length=512,)
|
35 |
model_checkpoint = BertForTokenClassification.from_pretrained("dexay/Ner2HgF", )
|
|
|
253 |
for e in edccanbis:
|
254 |
if e[-1]== ["B-EDC","B-CANCER"]:
|
255 |
edccann += [[e[0],e[1],e[2]]]
|
256 |
+
st.write("am in edcann")
|
257 |
|
258 |
elif e[-1]== ["B-EDC","B-HORMONE"]:
|
259 |
edchorm += [[e[0],e[1],e[2]]]
|
|
|
283 |
with zipfile.ZipFile("allcsvs.zip", "w") as zipf:
|
284 |
if edccancsv:
|
285 |
zipf.write(edccancsv)
|
286 |
+
st.write("am in zip")
|
287 |
if edcrecepcsv:
|
288 |
zipf.write(edcrecepcsv)
|
289 |
if edchormcsv:
|
|
|
292 |
zipf.write(hormcancsv)
|
293 |
if hormrecepcsv:
|
294 |
zipf.write(hormrecepcsv)
|
295 |
+
zipf.close()
|
296 |
|
297 |
for e in edccanbis:
|
298 |
edccan += [[e[3],e[0]+" ["+e[-1][0][2:]+"]", e[1]+" ["+e[-1][1][2:]+"]",e[2]]]
|