Question-answering bot with DialogFlow and Wikidata backend

Louis de Bruijn, Ana Roman, Gaetana Ruggiero, Toki Wong | Nov. 3, 2019 | #question-answering #nlu #wikidata #sparql #chatbot

As a group project for one of the university courses we build a question-answering system on the Academy Awards (Oscars). The QA answering chatbot uses Google DialogFlow, a natural-language understanding (NLU) model that processes text and returns user intents. There are eight custom user intents:

Returns the movie that won the Oscar in a given year.

- Which movie won the oscars in 2003?
- Tell me the movie that won the oscars in 2010?

Returns the male and female Oscar winners for a given year.

- Who won the oscars in 2014?
- Give me the film that won the oscar in 2011
- Who won the oscars from 2003 to 2005?

Returns the Oscar winning director for a given year.

- Who is the oscar winner for best director in 2006?
- Who was the best director in 2003?

Returns the release date for a given movie.

- When was Selma released?

Returns the director for a given movie.

- Who is the director of The Terminator?

Returns the duration for a given movie.

- How many minutes does Django last?

Returns the genre for a given movie.

- Can you tell me of which genre is the movie Interstellar?

Returns the cast for a given movie.

- Who is in the cast of Batman?


These user intents are mapped to SPARQL queries that query a Wikidata movies database. When the answer is retrieved it returns it using a custom natural language generation (NLG) module and returned to the front-end interface below.

An important part of Natural Language is disambiguation, the act of interpreting an author's intended use of a word that has multiple meanings. In the context of movies, it is important to disambiguate which movie is meant as there might be multiple sequels for each movie title. Whenever our database returns multiple titles, we handle disambiguation by returning a dropdown menu in which the user can choose the movie that he or she intended.

Ask any question below about movies and see if our bot can provide you with an answer.

interact_wikidata()

Interact with our bot by typing in the field below.

This app makes use of Google DialogFlow and the Wikidata SPARQL query service.