8/31/2020
This experiment uses the Wikipedia API and the Tensorflow.js QnA model to provide answers to natural language questions.
To use, simply enter a topic, a question about it, and press Get answer!
to get an answer from Wikipedia! The results might not be always correct, but they do work most of the time.
Topic: wikipedia
. Question: who runs it?
Answer: wikimedia foundation
Topic: hacker news
. Question: what is it?
Answer: a social news website
Topic: hacker news
. Question: who runs it?
Answer: paul graham's investment fund
Topic: beethoven
. Question: when did he die?
Answer: 1827
The next feature I'd like to implement is topic extraction, so that instead of entering tensorflow
as topic and asking the question what is it?
, you can ask what is tensorflow?
.
If you want to copy this experiment, you'll need to install @tensorflow/tfjs
and @tensorflow-models/qna
. Make sure you use qna
version 1.0.0-alpha1
, as version 1.0.0
returns far worse results. You can read more about it in this issue.