Skip to content
Jayesh desai edited this page Aug 19, 2021 · 23 revisions

Modular DBpedia Chatbot

Student: Jayesh Desai
Mentors: Andreas Both, Alexander Perevalov, Ram G Athreya, Ricardo Usbeck
Proposal: Google Summer of Code program

Final Application
Please note all code/commits created in this repository were part of GSoC 2021. Please find the full commit list here
Please find more information in the DBpedia forum and in the blog of the project for more detailed information.
If you want to setup this project you can follow the Instruction given in README.md file

Quick Links

Project Description

The Modern DBpedia chatbot with the functionality of the Qanary framework including its plug-and-play components and their optimization with additional features like create profiles, Rdf visualization, and others command like add components, etc.
Qanary is a methodology that allows to create, share and use components for Question Answering systems in an open ecosystem. It is part of the WDAqua research project which addresses the whole pipeline of question answering:
(1) understand a spoken question
(2) analyze the question’s text
(3) find data to answer the question
(4) present the answer(s).

Simple Conversational Flow

User - Hi  
Bot -  Greetings! I am the DBpedia bot, How can I assist?  
User - Show local list of components  
Bot - Currently, active components are NED-DBpediaSpotlight,QueryBuilderSimpleRealNameOfSuperHero,SparqlExecuter,OpenTapiocaNED,BirthDataQueryBuilder,WikidataQueryExecuter  
User - What is the real name of Batman?   
Bot- resource:http://dbpedia.org/resource/Batman answer: Bruce Wayne label: Batman  

How it works

Let us take the question “What is the real name of Superman?” as running example.
To ask this question to chatbot first you need to turn on following components
NED-DBpediaSpotlight,QueryBuilderSimpleRealNameOfSuperHero,SparqlExecuter
So basically, components play an important role here before asking any question you need to turn on component according to the question (To make it run remember the component list must be in order)
If you want to learn more about Qanary Question Answering components There are around 30+ Components Integrated into Qanary. or you can simply ask "list of active Qanary components" to get the list of the available component to use.

Screenshots

Graph Visualization

To understand more about how the Qanary system is working you can check out the graph using the below command
Here, Qanary provides key contributions on-top of the RDF vocabulary qa: the reference implementation of the Qanary methodology.
The Qanary vocabulary aims to define a vocabulary to express information that is generated during the execution of a Question Answering (QA) system on a question given as a speech, text input, or any other input.

Consider for example the question "Where and when was Ada Lovelace born?". Typical pieces of information generated by components (processing steps) of a QA system are the position of named entities (NE) (like "Barack Obama"), the relations of the ontology used to express the relational phrase in the question (that "born" refers to dbo:birthPlace), the expected answer (here: a date), and the generated SPARQL query. Other such information is the language of the question, possible ontologies that can be used to answer it, or if a question is a text or audio file.
Click on this link to see the demo graph.
you can have your own graph according to the question example is below

User - Where and when was Ada Lovelace born?
Bot - personLabel:Ada Lovelace birthplaceLabel:London birthdate:1815-12-10T00:00:00Z
User - show rdf graph
Bot - Go to this link to see RDF Visualization - https://rdfgraphvisualizations.herokuapp.com/visualize/example

List of some main intents

This section is divided into four types

  • Basic information
  • Configuration and internal information
  • Ask a KB-related question
  • Profile related Intents

Template for the examples is below
Example command
Intent name
Outcome

Basic information

Here is some of the basic information regarding chatbot and also this chatbot includes the use of Dialogflow smalltalks

Hello
[Default Welcome Intent]
Greetings! I am the DBpedia bot, How can I assist?

what can I do?
[Help_Intent]
Currently, You can ask me about what is DBpedia? or how to contribute to DBpedia?

What is DBpedia?
[DBpedia_Info]
DBpedia is a crowd-sourced community effort to extract structured information from Wikipedia and make this information available on the Web.

How to contribute?
[DBpedia_Contribute]
There are multiple ways to contribute to DBpedia You can: 1 - Look at open issues if you want to contribute to the codebase 2 - Improve Documentation 3 - Join the discussion on upcoming features, releases, and issues

Configuration and internal information

This part is all about configurations like how to add components, remove components, etc

(de-)activate components

Add sparql executer:
[Activate_component_intent]
succesfully Added SparqlExecuter you can add more components by saying Add and then name of the component.

Remove sparql executer:
[Deactivate_component_intent]
succesfully removed SparqlExecuter from components list

Reset component list (it adds default components and deletes all the components which are not part of default components):
[reset_list_of_components]
Components list are now empty

Delete all components:
[Empty component list]
Components list are now empty

Show components containing r:
[Component_startwith_Intent]
Components starting with r are ReMatch,RelNliodRel,RelationLinker2......

Get information about the current Qanary pipeline configuration

Tell me an order of components list:
[show_component_list]
currently, active components are SparqlExecuter,QueryBuilder

Ask a KB-related question (handed via Webhook to the Qanary backend)

What is the real name of hulk?:
[fallback]
resource:http://dbpedia.org/resource/Hulk answer:Robert Bruce Banner label:Hulk

Profile related Intents

Create sport profile:
[Create profile intent]
cricket Profile added successfully. Now to use this profile you can say start cricket to activate the profile.

Activate query builder to sport :
[Add components to profile]
Successfully Added QueryBuilder to cricket you can add more components by saying Add and then name of the component.

Deactivate query builder from sport :
[Remove component from profile]
Successfully removed QueryBuilder from the components list of cricket.

Start sport :
[Activate profile component]
sport Activated Successfully to know about active components use command 'list of active components'.

To add default components use the command:
start default component
default component Activated Successfully to know about active components use command 'list of active components'.

To see a list of components of a specific profile:
show components of sport
Component information from profile
sport contains QueryBuilder

Tools and Technologies

  • DialogFlow
  • Node js
  • Python
  • SPARQL