skip-thoughts icon indicating copy to clipboard operation
skip-thoughts copied to clipboard

example usage of `nn_words()`

Open ceteri opened this issue 8 years ago • 2 comments

Do you have an example usage of nn_words, i.e., as shown in "Table 3: Nearest neighbours of words after vocabulary expansion" in the paper?

It's not clear how to prepare the parameters to pass in -

Many thanks,

ceteri avatar Oct 26 '16 18:10 ceteri

def nn_words(table, wordvecs, query, k=10)

'table' is either "model['utable]" or "model['btable']" - I'm not sure what the difference is off the top of my head. 'wordvecs' is the output of "word_features(table)", so either "word_features(model['utable'])" or "word_features(model['btable'])" 'query' is a single word of your choosing.

This should work: skipthoughts(model['utable'], word_features['utable'], 'dog')

Good luck!

danielricks avatar Nov 11 '16 17:11 danielricks

Here's an example of use for other methods as well: https://github.com/danielricks/penseur

danielricks avatar Nov 11 '16 17:11 danielricks