From 603a3f40c5d8d9abb5cbf416069398d9a5ca0814 Mon Sep 17 00:00:00 2001 From: Pokey Rule Date: Wed, 26 Oct 2016 15:23:36 +0100 Subject: [PATCH] Fix small bug in code of mark-adverbs tutorial --- website/docs/tutorials/mark-adverbs.jade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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