DanielSc4 commited on
Commit
78cc4b7
·
1 Parent(s): 2f307bd

fix download `en_core_web_sm`

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -1,5 +1,6 @@
1
  import gradio as gr
2
 
 
3
  import pandas as pd
4
  import matplotlib.pyplot as plt
5
  import numpy as np
@@ -115,6 +116,7 @@ def main(choose_context):
115
  df_topic_keywords
116
 
117
  # Define function to predict topic for a given text document.
 
118
  nlp = spacy.load('en_core_web_sm', disable=['parser', 'ner'])
119
  def predict_topic(text, nlp=nlp):
120
  global sent_to_words
 
1
  import gradio as gr
2
 
3
+ import os
4
  import pandas as pd
5
  import matplotlib.pyplot as plt
6
  import numpy as np
 
116
  df_topic_keywords
117
 
118
  # Define function to predict topic for a given text document.
119
+ os.system("python -m spacy download en_core_web_sm")
120
  nlp = spacy.load('en_core_web_sm', disable=['parser', 'ner'])
121
  def predict_topic(text, nlp=nlp):
122
  global sent_to_words