File size: 734 Bytes
cbf1a0e
ba9e424
cbf1a0e
599afaf
 
cbf1a0e
 
 
 
 
 
 
 
 
 
ba9e424
 
cbf1a0e
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import spacy_streamlit
import streamlit as st
import typer
from scripts.torch_ner_model import build_torch_ner_model
from scripts.torch_ner_pipe import make_torch_entity_recognizer


def main(models: str = None, default_text: str = None):
    models = "training_trf/model-best"
    test = "The patient had surgery."
    models = [name.strip() for name in models.split(",")]
    labels = ["person", "problem", "pronoun", "test", "treatment"]
    spacy_streamlit.visualize(
        models, default_text, visualizers=["ner"], ner_labels=labels
    )
    st.title('NER Predictor')
    st.header('Enter the characteristics of the diamond:')


if __name__ == "__main__":
    try:
        typer.run(main)
    except SystemExit:
        pass