fixed sense2vec blog post code

it was not working - variable `tokens` does not exist; now it is fine
This commit is contained in:
Piotr Migdał 2016-07-06 15:09:49 +02:00 committed by GitHub
parent b1d06ff9e9
commit 3cd88c82b8

View File

@ -37,7 +37,7 @@ p Here's how the current pre-processing function looks, at the time of writing.
# Merge them into single tokens
ent.merge(ent.root.tag_, ent.text, ent.label_)
token_strings = []
for token in tokens:
for token in doc:
text = token.text.replace(' ', '_')
tag = token.ent_type_ or token.pos_
token_strings.append('%s|%s' % (text, tag))