diff --git a/website/docs/tutorials/mark-adverbs.jade b/website/docs/tutorials/mark-adverbs.jade index ca3061f81..03799b7dd 100644 --- a/website/docs/tutorials/mark-adverbs.jade +++ b/website/docs/tutorials/mark-adverbs.jade @@ -78,7 +78,7 @@ p A simple work-around is to average the vectors of several words, and use that +code. >>> say_verbs = ['pleaded', 'confessed', 'remonstrated', 'begged', 'bragged', 'confided', 'requested'] >>> say_vector = sum(nlp.vocab[verb].vector for verb in say_verbs) / len(say_verbs) - >>> words.sort(key=lambda w: cosine(w.vector * say_vector)) + >>> words.sort(key=lambda w: cosine(w.vector, say_vector)) >>> words.reverse() >>> print('1-20', ', '.join(w.orth_ for w in words[0:20])) 1-20 bragged, remonstrated, enquired, demurred, sighed, mused, intimated, retorted, entreated, motioned, ranted, confided, countersued, gestured, implored, interceded, muttered, marvelled, bickered, despaired