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"])