initial commit
Browse files
app.py
CHANGED
|
@@ -7,10 +7,22 @@ import streamlit as st
|
|
| 7 |
from accord_nlp.information_extraction.convertor import entity_pairing, graph_building
|
| 8 |
from accord_nlp.information_extraction.ie_pipeline import InformationExtractor
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
@st.cache_resource
|
| 12 |
def init():
|
| 13 |
-
return InformationExtractor(
|
|
|
|
|
|
|
| 14 |
|
| 15 |
|
| 16 |
st.set_page_config(
|
|
|
|
| 7 |
from accord_nlp.information_extraction.convertor import entity_pairing, graph_building
|
| 8 |
from accord_nlp.information_extraction.ie_pipeline import InformationExtractor
|
| 9 |
|
| 10 |
+
ner_args = {
|
| 11 |
+
"labels_list": ["O", "B-quality", "B-property", "I-property", "I-quality", "B-object", "I-object", "B-value", "I-value"],
|
| 12 |
+
"use_multiprocessing": False,
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
re_args = {
|
| 16 |
+
"labels_list": ["selection", "necessity", "none", "greater", "part-of", "equal", "greater-equal", "less-equal", "not-part-of", "less"],
|
| 17 |
+
"special_tags": ["<e1>", "<e2>"], # Should be either begin_tag or end_tag
|
| 18 |
+
"use_multiprocessing": False,
|
| 19 |
+
}
|
| 20 |
|
| 21 |
@st.cache_resource
|
| 22 |
def init():
|
| 23 |
+
return InformationExtractor(
|
| 24 |
+
ner_model_info=('roberta', 'ACCORD-NLP/ner-roberta-large', ner_args),
|
| 25 |
+
re_model_info=('roberta', 'ACCORD-NLP/re-roberta-large', re_args))
|
| 26 |
|
| 27 |
|
| 28 |
st.set_page_config(
|