Skip to content

Instantly share code, notes, and snippets.

@EntilZha

EntilZha/guess.py

Created Nov 9, 2017
Embed
What would you like to do?
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