Spaces:
Runtime error
Runtime error
final bugfix
Browse files
app.py
CHANGED
|
@@ -42,6 +42,11 @@ def main(choose_context):
|
|
| 42 |
data = concat_comments(df.sup_comment, df.comment)
|
| 43 |
|
| 44 |
data_words = list(sent_to_words(data))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
nlp = spacy.load("en_core_web_sm", disable=["parser", "ner"])
|
| 46 |
data_lemmatized = lemmatization(data_words, allowed_postags=["NOUN", "ADJ"]) #select noun and verb
|
| 47 |
|
|
@@ -116,9 +121,6 @@ def main(choose_context):
|
|
| 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 |
-
print('en_core_web_sm downloaded')
|
| 121 |
-
nlp = spacy.load('en_core_web_sm', disable=['parser', 'ner'])
|
| 122 |
def predict_topic(text, nlp=nlp):
|
| 123 |
global sent_to_words
|
| 124 |
global lemmatization
|
|
|
|
| 42 |
data = concat_comments(df.sup_comment, df.comment)
|
| 43 |
|
| 44 |
data_words = list(sent_to_words(data))
|
| 45 |
+
|
| 46 |
+
print('downloading en_core_web_sm')
|
| 47 |
+
os.system("python -m spacy download en_core_web_sm")
|
| 48 |
+
print('en_core_web_sm downloaded')
|
| 49 |
+
|
| 50 |
nlp = spacy.load("en_core_web_sm", disable=["parser", "ner"])
|
| 51 |
data_lemmatized = lemmatization(data_words, allowed_postags=["NOUN", "ADJ"]) #select noun and verb
|
| 52 |
|
|
|
|
| 121 |
df_topic_keywords
|
| 122 |
|
| 123 |
# Define function to predict topic for a given text document.
|
|
|
|
|
|
|
|
|
|
| 124 |
def predict_topic(text, nlp=nlp):
|
| 125 |
global sent_to_words
|
| 126 |
global lemmatization
|