Nathan Butters commited on
Commit
af2e26f
1 Parent(s): 7c4b588

fix spacy download

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -1,12 +1,16 @@
1
  #Import the libraries we know we'll need for the Generator.
2
  import pandas as pd, spacy, nltk, numpy as np, re, os
3
  from spacy.matcher import Matcher
 
4
 
5
  #Attempting to fix the issue with spacy model in a more intuitive way.
6
- script = "python -m spacy download en_core_web_lg"
7
- os.system("bash -c '%s'" % script)
 
 
 
 
8
  nlp = spacy.load("en_core_web_lg")
9
- from nltk.corpus import wordnet
10
 
11
  #Import the libraries to support the model and predictions.
12
  from transformers import AutoTokenizer, AutoModelForSequenceClassification, TextClassificationPipeline
 
1
  #Import the libraries we know we'll need for the Generator.
2
  import pandas as pd, spacy, nltk, numpy as np, re, os
3
  from spacy.matcher import Matcher
4
+ from nltk.corpus import wordnet
5
 
6
  #Attempting to fix the issue with spacy model in a more intuitive way.
7
+ try:
8
+ nlp = spacy.load("en_core_web_lg")
9
+ except:
10
+ script = "python -m spacy download en_core_web_lg"
11
+ os.system("bash -c '%s'" % script)
12
+
13
  nlp = spacy.load("en_core_web_lg")
 
14
 
15
  #Import the libraries to support the model and predictions.
16
  from transformers import AutoTokenizer, AutoModelForSequenceClassification, TextClassificationPipeline