Update app.py
Browse files
app.py
CHANGED
@@ -4,12 +4,11 @@ import transformers
|
|
4 |
from transformers import pipeline, TokenClassificationPipeline, BertForTokenClassification , AutoTokenizer , TextClassificationPipeline , AutoModelForSequenceClassification
|
5 |
|
6 |
st.header("Knowledge extraction on Endocrine disruptors")
|
7 |
-
st.
|
8 |
-
st.
|
9 |
x = st.text_area('Entre you text on EDCs:')
|
10 |
|
11 |
-
|
12 |
-
x += "."
|
13 |
#model.to("cpu")
|
14 |
tokenizer = AutoTokenizer.from_pretrained("dmis-lab/biobert-large-cased-v1.1", truncation = True, padding=True, model_max_length=512,)
|
15 |
model_checkpoint = BertForTokenClassification.from_pretrained("dexay/Ner2HgF", )
|
@@ -20,6 +19,9 @@ token_classifier = pipeline("token-classification", tokenizer = tokenizer,model=
|
|
20 |
|
21 |
st.text("Knowledge extraction is in progress ...")
|
22 |
|
|
|
|
|
|
|
23 |
biotext = x
|
24 |
|
25 |
#split document or text into sentences
|
|
|
4 |
from transformers import pipeline, TokenClassificationPipeline, BertForTokenClassification , AutoTokenizer , TextClassificationPipeline , AutoModelForSequenceClassification
|
5 |
|
6 |
st.header("Knowledge extraction on Endocrine disruptors")
|
7 |
+
st.write("This tool lets you extract relation triples concerning interactions between: endocrine disrupting chemicals, hormones, receptors and cancers.")
|
8 |
+
st.twrite("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.")
|
9 |
x = st.text_area('Entre you text on EDCs:')
|
10 |
|
11 |
+
|
|
|
12 |
#model.to("cpu")
|
13 |
tokenizer = AutoTokenizer.from_pretrained("dmis-lab/biobert-large-cased-v1.1", truncation = True, padding=True, model_max_length=512,)
|
14 |
model_checkpoint = BertForTokenClassification.from_pretrained("dexay/Ner2HgF", )
|
|
|
19 |
|
20 |
st.text("Knowledge extraction is in progress ...")
|
21 |
|
22 |
+
if x and x[-1] not in ".?:":
|
23 |
+
x += "."
|
24 |
+
|
25 |
biotext = x
|
26 |
|
27 |
#split document or text into sentences
|