Created
November 9, 2017 17:41
-
-
Save EntilZha/480349d4fc82a4a37b0f944576294895 to your computer and use it in GitHub Desktop.
Running Qanta Models
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 qanta.guesser.tfidf import TfidfGuesser | |
guesser = TfidfGuesser.load('output/guesser/qanta.guesser.tfidf.TfidfGuesser') | |
questions = [ | |
"Name this first president of the united states", | |
"This man invented the theory of general relativity" | |
] | |
n_guesses = 1 | |
guesses = guesser.guess(questions, n_guesses) | |
print(guesses) |
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 qanta.guesser.tfidf import TfidfGuesser | |
guesser = TfidfGuesser.load('output/guesser/qanta.guesser.tfidf.TfidfGuesser') | |
guesser.web_api() |
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
pip install httpie | |
http --form POST http://0.0.0.0:5000/api/answer_question text='Name this first president of the united states' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment