Skip to content

Commit

Permalink
Bugfix in remove features in demonstrator.py
Browse files Browse the repository at this point in the history
  • Loading branch information
severinsimmler committed Nov 8, 2017
1 parent 0eae394 commit 0fcc5a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion demonstrator/demonstrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ def upload_file():
hapax = preprocessing.find_hapax_legomena(doc_term_matrix)
features = set(stopwords).union(hapax)
print("Removing stopwords and hapax legomena from corpus ...")
doc_term_matrix = preprocessing.remove_features(features, doc_term_matrix)
features = [token for token in features if token in doc_term_matrix.columns]
doc_term_matrix = doc_term_matrix.drop(features, axis=1)
doc_term_arr = doc_term_matrix.as_matrix().astype(int)
print("Accessing corpus vocabulary ...")
corpus_vocabulary = doc_term_matrix.columns
Expand Down

0 comments on commit 0fcc5a1

Please sign in to comment.