Created
January 25, 2019 15:15
-
-
Save martinthenext/e30ae18916b4f21394ffc94bf341e9e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.metrics.pairwise import cosine_similarity | |
similarity = cosine_similarity(question_repr, sentence_repr) | |
ranks = (-similarity).argsort(axis=None) | |
context_sentences[ranks[0]] | |
'During the middle of 2010, iPhone sales overtook those of the iPod.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment