wzkariampuzha commited on
Commit
80b9099
1 Parent(s): 971a385

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -41,11 +41,6 @@ extract_diseases = st.sidebar.checkbox("Extract Rare Diseases", value=False)
41
 
42
  @st.cache
43
  def load_models():
44
- #Load spaCy models
45
- # nlp = spacy.load('en_core_web_lg')
46
- nlpSci = spacy.load("en_ner_bc5cdr_md")
47
- nlpSci2 = spacy.load('en_ner_bionlp13cg_md')
48
-
49
  # load the tokenizer
50
  with open('tokenizer.pickle', 'rb') as handle:
51
  classify_tokenizer = pickle.load(handle)
@@ -60,7 +55,10 @@ def load_models():
60
 
61
  with st.spinner('Loading Epidemiology Models and Dependencies...'):
62
  nlpSci, nlpSci2, classify_tokenizer, classify_model, NER_pipeline, entity_classes, GARD_dict, max_length = load_models()
 
63
  nlp = spacy.load('en_core_web_lg')
 
 
64
  classify_model_vars = (nlp, nlpSci, nlpSci2, classify_model, classify_tokenizer)
65
  st.success('All Models and Dependencies Loaded!')
66
 
 
41
 
42
  @st.cache
43
  def load_models():
 
 
 
 
 
44
  # load the tokenizer
45
  with open('tokenizer.pickle', 'rb') as handle:
46
  classify_tokenizer = pickle.load(handle)
 
55
 
56
  with st.spinner('Loading Epidemiology Models and Dependencies...'):
57
  nlpSci, nlpSci2, classify_tokenizer, classify_model, NER_pipeline, entity_classes, GARD_dict, max_length = load_models()
58
+ #Load spaCy models which cannot be cached due to hash function error
59
  nlp = spacy.load('en_core_web_lg')
60
+ nlpSci = spacy.load("en_ner_bc5cdr_md")
61
+ nlpSci2 = spacy.load('en_ner_bionlp13cg_md')
62
  classify_model_vars = (nlp, nlpSci, nlpSci2, classify_model, classify_tokenizer)
63
  st.success('All Models and Dependencies Loaded!')
64