Wikia / ask-fandom

Your semantic data-based assistant from Wikia
MIT License
7 stars 1 forks source link

ask_fandom: fallback to AnswersWikiIntent #16

Closed macbre closed 5 years ago

macbre commented 5 years ago

Use answers.wikia.com as a fallback when the question is not understood (i.e. no intent is selected) or when selected intent does not know the answer.

This is a temporary solution before we index answer wikis' questions.

An example

INFO:flask.app:Question: Do I need a passport to travel to Italy?
INFO:get_intent:Parsing question: Do I need a passport to travel to Italy?
INFO:get_intent:Parsed and filtered question: [('NP', ''), ('VB', 'need'), ('NP', 'a passport'), ('NN', 'passport'), ('TO', 'to'), ('VB', 'travel'), ('TO', 'to'), ('NP', 'Italy')]
INFO:get_intent:Filtered words of the question: {'NP': 'a passport', 'VB': 'travel', 'NN': 'passport', 'TO': 'to'}
INFO:get_intent:Available intents: ['PersonFactIntent', 'EpisodeFactIntent', 'WoWGroupsMemberIntent', 'FootballPlayerFactIntent', 'AnswersWikiIntent']
INFO:root:Trying PersonFactIntent ...
INFO:root:Trying EpisodeFactIntent ...
INFO:root:Trying WoWGroupsMemberIntent ...
INFO:root:Trying FootballPlayerFactIntent ...
INFO:root:Trying AnswersWikiIntent ...
INFO:AnswersWikiIntent:You've asked: 'Do I need a passport to travel to Italy?' ({})
INFO:AnswersWikiIntent:Got the wikitext from <Do I need a passport to travel to Italy>: Yes, you need passport to travel in Italy unless you are the citizen of the Italy.

[[Category:Travel]]
[[Category:Italy]]
[[Category:Answered questions]]

Resolves #12