Christopher Capobianco commited on
Commit
6dd9bd4
·
1 Parent(s): f868684

Install spacy module en_core_web_sm from inside the app

Browse files
Files changed (1) hide show
  1. projects/01_Document_Classifier.py +2 -0
projects/01_Document_Classifier.py CHANGED
@@ -5,10 +5,12 @@ import spacy
5
  import en_core_web_sm
6
  import re
7
  import os
 
8
 
9
  # Function to Load the Spacy tokenizer
10
  @st.cache_data
11
  def load_nlp():
 
12
  return spacy.load('en_core_web_sm')
13
 
14
  # Function to Initialze the OCR Engine
 
5
  import en_core_web_sm
6
  import re
7
  import os
8
+ import subprocess
9
 
10
  # Function to Load the Spacy tokenizer
11
  @st.cache_data
12
  def load_nlp():
13
+ subprocess.run(["python", "-m", "spacy", "download", "en_core_web_sm"])
14
  return spacy.load('en_core_web_sm')
15
 
16
  # Function to Initialze the OCR Engine