Skip to content

rrichajalota/dbpedia-warmup-tasks

Repository files navigation

Dbpedia Warm-Up Tasks

Arabic number to Roman number Chatbot

Run the script as: python chatbot_warmup_task.py

Example Snippet

Hi! This is a simple chatbot which translates arabic numbers to roman numbers.

Enter your query (press e to exit): Convert 23 into roman number
XXII

Enter your query (press e to exit): Convert 23, 34 and 760
XXIII XXXIV DCCLX

Enter your query (press e to exit): 42, 8, 90
XLII VIII XC

Enter your query (press e to exit): Hey!
Invalid query

Working of the bot

The bot accepts a query from the user. It extracts numbers from the query and converts them into their corresponding roman number. If there are no numbers in the query, it prompts the user to enter a valid query!


Access QA system via API

About: This is a telegram bot which accesses the QA system of WolframAlpha.
To run this bot, a telegram account would be required. Make a new bot by sending the message "/newbot" to @BotFather on telegram. Store the token received in a secrets.py file (in the same directory where question_answering_bot.py is stored). This token will be used to access the Telegram Bot API.

Now, to access WolframApha's API, get registered on the site and request for a new APP_ID. Store the APP_ID in the secrets.py file where bot's token was saved.

Finally, run the script as: python question_answering_bot.py from the terminal.

Dependencies to be installed:

  • requests
  • urllib

Example Snippet

Start the conversation with the bot by typing:
q: /start

Hi! I'm a simple Question-Answering bot. Ask me anything you want to or type /commands to check which commands I accept!

q: /commands

Type:
/history - to see your search queries
/bothistory - to see what others searched for

q: What is Brexit?

Looking for a short answer..
No short answer available
Let me search for a descriptive one..
Image of Query Response

The bot supports inline queries as well, which means from any other chat we can call the bot with its username and ask our query. Eg. @QuesAns_bot President
Snippet of Inline Query:
Image of Inline Query

Releases

No releases published

Packages

No packages published

Languages