Spaces:
Runtime error
Runtime error
Victoria Slocum
commited on
Commit
·
edd6a32
1
Parent(s):
c8d67a4
fix: noun chunks
Browse files
app.py
CHANGED
@@ -63,7 +63,7 @@ def token(text, attributes, model):
|
|
63 |
def random_vectors(text, model):
|
64 |
nlp = spacy.load(model + "_md")
|
65 |
doc = nlp(text)
|
66 |
-
n_chunks = [chunk for chunk in doc.noun_chunks]
|
67 |
words = [tok for tok in doc if not tok.is_stop and tok.pos_ not in [
|
68 |
'PUNCT', "PROPN"]]
|
69 |
str_list = n_chunks + words
|
|
|
63 |
def random_vectors(text, model):
|
64 |
nlp = spacy.load(model + "_md")
|
65 |
doc = nlp(text)
|
66 |
+
n_chunks = [chunk for chunk in doc.noun_chunks if doc.noun_chunks]
|
67 |
words = [tok for tok in doc if not tok.is_stop and tok.pos_ not in [
|
68 |
'PUNCT', "PROPN"]]
|
69 |
str_list = n_chunks + words
|