Skip to content

Instantly share code, notes, and snippets.

@EntilZha
Created November 9, 2017 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EntilZha/480349d4fc82a4a37b0f944576294895 to your computer and use it in GitHub Desktop.
Save EntilZha/480349d4fc82a4a37b0f944576294895 to your computer and use it in GitHub Desktop.
Running Qanta Models
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)
from qanta.guesser.tfidf import TfidfGuesser
guesser = TfidfGuesser.load('output/guesser/qanta.guesser.tfidf.TfidfGuesser')
guesser.web_api()
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