File size: 306 Bytes
dafb744
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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"])