Update app.py
Browse files
app.py
CHANGED
@@ -14,18 +14,33 @@ st.header("Knowledge extraction on Endocrine disruptors")
|
|
14 |
st.write("This tool lets you extract relation triples concerning interactions between: endocrine disrupting chemicals, hormones, receptors and cancers.")
|
15 |
st.write("It is the result of an end of studies project within ESI school and dedicated to biomedical researchers looking to extract precise information about the subject without digging into long publications.")
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
form = st.form(key='my-form')
|
18 |
x = form.text_area('Enter text', height=250)
|
19 |
submit = form.form_submit_button('Submit')
|
20 |
|
|
|
|
|
|
|
|
|
21 |
if submit and len(x) != 0:
|
22 |
#model.to("cpu")
|
23 |
st.text("Execution is in progress ...")
|
24 |
-
|
25 |
-
|
|
|
|
|
26 |
|
27 |
|
28 |
-
model_re = AutoModelForSequenceClassification.from_pretrained("dexay/reDs3others", )
|
29 |
token_classifier = pipeline("token-classification", tokenizer = tokenizer,model=model_checkpoint, )
|
30 |
|
31 |
|
|
|
14 |
st.write("This tool lets you extract relation triples concerning interactions between: endocrine disrupting chemicals, hormones, receptors and cancers.")
|
15 |
st.write("It is the result of an end of studies project within ESI school and dedicated to biomedical researchers looking to extract precise information about the subject without digging into long publications.")
|
16 |
|
17 |
+
|
18 |
+
@st.cache
|
19 |
+
def load_models():
|
20 |
+
tokenizer = AutoTokenizer.from_pretrained("dmis-lab/biobert-large-cased-v1.1", truncation = True, padding=True, model_max_length=512,)
|
21 |
+
model_checkpoint = BertForTokenClassification.from_pretrained("dexay/Ner2HgF", )
|
22 |
+
|
23 |
+
model_re = AutoModelForSequenceClassification.from_pretrained("dexay/reDs3others", )
|
24 |
+
|
25 |
+
|
26 |
+
|
27 |
form = st.form(key='my-form')
|
28 |
x = form.text_area('Enter text', height=250)
|
29 |
submit = form.form_submit_button('Submit')
|
30 |
|
31 |
+
|
32 |
+
|
33 |
+
|
34 |
+
|
35 |
if submit and len(x) != 0:
|
36 |
#model.to("cpu")
|
37 |
st.text("Execution is in progress ...")
|
38 |
+
|
39 |
+
load_models()
|
40 |
+
|
41 |
+
|
42 |
|
43 |
|
|
|
44 |
token_classifier = pipeline("token-classification", tokenizer = tokenizer,model=model_checkpoint, )
|
45 |
|
46 |
|