Skip to content
/ wikibot Public

A minimalistic chatbot implemented in Python that can retrieve information from Wikipedia based on keywords provided by a user.

License

Notifications You must be signed in to change notification settings

CH6832/wikibot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WikiBot

📰 About the project

A minimalistic ChatBot implemented in Python that can retrieve information from Wikipedia based on keywords provided by a user.

How it works

The chatbot operates by first receiving user input through a text input field in a web interface. Upon receiving the input, it normalizes the text by converting it to lowercase and removing punctuation.

The normalized input is then checked against a conversation history to see if there's a pre-existing response. If not found, the chatbot queries the Wikipedia API to fetch relevant information based on the input.

This information is then cached for future use. The bot responds to the user with the fetched data or a default message if no relevant information is found. The conversation history, consisting of user inputs and bot responses, is stored in a file for reference. Additionally, the chat interface displays the conversation history, with user and bot messages displayed in separate chat bubbles.

The chatbot continuously interacts with users in this manner, dynamically fetching information and updating the conversation history as needed.

Content overview

.
├── docs/ - project documentation
├── img/ - images for the README.md
├── static/ - contains stylesheets
├── templates/ - contains the html templates
├── tests/ - contains unit tests
├── chatbot.py - program entry point
├── CODE_OF_CONDUCT.md - project code of conduct
├── COPYRIGHT - project copyright
├── LICENSE - license text
├── README.md - relevant information about the project
└── requirements.txt - requirements to run the project

🏃 Getting started

Prerequisites and example usage

  1. Clone the project and extract the folder:
git clone https://github.com/CH6832/chatbot.git
  1. Open the entire project in an IDE of your choice.

  2. Run the app:

python3 chatbot.py
  1. the open the link in your browser and start interacting with it:

Chatbot starting page

Generate documentation

  1. Create a docs\ folder:
mkdir docs
  1. Move into the folder:
cd docs
  1. Initialize a WikiBot project:
sphinx-quickstart
  1. Fill the .rst files with content, e.g. index.rst:
.. WikiBot documentation master file, created by
   sphinx-quickstart on Thu May 30 21:14:20 2024.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Welcome to WikiBot's documentation!
===================================

.. toctree::
   :maxdepth: 2
   :caption: Contents:

   installation
   usage
   api
   contributing

Introduction
============

WikiBot is a minimalistic chatbot implemented in Python that retrieves information from Wikipedia based on keywords provided by a user. This bot uses Flask for the web interface and interacts with the Wikipedia API to fetch relevant data.

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
  1. Generate the documentation:
make html

📚 Resources used to create this project

🔖 License

This project is licensed under the terms of the MIT License.

©️ Copyright

See the COPYRIGHT file for copyright and licensing details.

About

A minimalistic chatbot implemented in Python that can retrieve information from Wikipedia based on keywords provided by a user.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages