medicalner / functions.py
Wilame Lima
First commit
dafb744
raw
history blame contribute delete
306 Bytes
from config import *
@st.cache_resource
def load_pipeline():
"""
Load the pipeline
"""
return pipeline("token-classification", model=MODEL_PATH)
@st.cache_data
def annotate(entity):
"""
Annotate the text
"""
return (entity["word"].replace('▁',''), entity["entity"])