Giter VIP home page Giter VIP logo

kunal9922 / multilingual_railways_chatbot Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 62.14 MB

This repository contains the source code and resources for a Railways Chatbot built using a Large Language Model. The chatbot is designed to assist railway passengers by providing information on railways.

License: MIT License

Python 58.91% CSS 7.95% HTML 10.01% JavaScript 23.13%
django large-language-models natural-language-processing python website generative-ai

multilingual_railways_chatbot's Introduction

Multilingual_Railways_Chatbot

Overview

This repository contains the source code and resources for a railway's chatbot built using a Large Language Model. The chatbot is designed to assist railway passengers by providing information on train schedules, platform details, delays, and other related inquiries. It leverages a state-of-the-art large language model to understand natural language queries and deliver accurate responses.

Features

  • Natural Language Understanding: Utilizes advanced language processing to understand user queries conversationally.

  • Multilingual Support: Supports various languages to cater to diverse passenger needs.

  • Real-time Information: Provides up-to-date information on train schedules, delays, and platform changes.

  • Interactive Interface: Engages users in a chat-like interface for a seamless and user-friendly experience.

Getting Started

  1. Clone the Repository:
    git clone https://github.com/kunal9922/Multilingual_Railways_Chatbot.git
  2. Make an alias for Windows PowerShell
    New-Alias -Name python310 -value "yourPython3.10.exe path"
  3. Create a Python Virtual Environment
    python310 -m venv venvChatbotRailways
  4. Activate the virtual environment
    venvChatbotRailways\Scripts\activate

Voice-to-Text Transcriber Whisper also requires FFmpeg, an audio-processing library.

  1. Chocolatey a Windows package manager to install https://chocolatey.org/install

    choco install ffmpeg
  2. Homebrew a MacOS package manager to install https://brew.sh/

    brew install ffmpeg
  3. For Linux OS

    sudo apt update && sudo apt install ffmpeg
  4. Install Dependencies:

    pip install -r requirements.txt
  5. Shift to the Django Server Directory

    cd chatbotWebServer\
  6. Download the LLAMA-2-7B Model from https://huggingface.co/meta-llama Save the LLM model into this directory "\chatRailways\chatbotModule\models"

  7. Run the Django Server for the Chatbot:

    python manage.py runserver
  8. Interact with the Chatbot:

    • Open a web browser and go to http://localhost:8000 to interact with the chatbot through a simple web interface.

Contribution Guidelines

We welcome contributions! If you would like to contribute to the development of the Railways Chatbot (This project is continuously evolving).

License

This project is licensed under the MIT License.

Acknowledgments

Feel free to reach out with any questions or feedback!

Happy chatting! πŸš‚πŸ€–

Screenshots

Screenshot 2024-02-02 182717 Screenshot 2024-02-02 183214 Screenshot 2024-02-03 133452 Screenshot 2024-02-03 201811

Multilingual Speech-Driven Chatbot Interaction Demo Videos

englishChat.mp4
ItalianChat.mp4

Behavioral diagram

A web-based chatbot for train queries using Django. This UML Activity Diagram shows the steps and messages between a passenger, a chatbot, and a railway database. For example, the passenger asks "query about trains" and the chatbot replies with the answer.

railwaysChatbotFlow

Chatbot that can interact with CSV files

This diagram shows how to build a chatbot that can interact with CSV files. The chatbot extracts data content from a CSV file and converts it into embeddings using a vector store. Then, it builds a semantic index based on FAISS to perform semantic search on the data. The chatbot can answer user queries by converting them into query embeddings and searching for the most relevant answers in the knowledge base.

chatBot_arch

multilingual_railways_chatbot's People

Contributors

kunal9922 avatar mahhheshh avatar

Watchers

Kostas Georgiou avatar  avatar

multilingual_railways_chatbot's Issues

Implement Voice-to-Text Transcriber for Enhanced User Interaction

Description:
Currently, the chatbot primarily relies on text input from users. To enhance user interaction and accessibility, there is a need to integrate a voice-to-text transcriber. This feature would enable users to interact with the chatbot using spoken language, making the platform more inclusive.

Objective:
Enable voice input functionality for the chatbot, allowing users to speak queries and receive responses.

Proposed Solution:
Integrate a reliable and open-source voice-to-text transcriber into the chatbot infrastructure. This enhancement aims to improve user experience and accessibility, accommodating a broader audience with diverse needs.

Benefits:

  1. Accessibility: Users with varying abilities can interact with the chatbot using voice commands.
  2. User-Friendly: Enhances the overall user experience by providing an additional input method.
  3. Inclusivity: Broadens the user base by catering to individuals who prefer or require voice input.

Additional Information:

  • Technology Stack: [python, whisper]

Feature Request - Text-to-Voice Support for Chatbot Responses

Issue Description:

Overview:
Currently, our chatbot responses are limited to text-based output. To enhance user experience and accessibility, we propose the implementation of text-to-voice (TTS) support for chatbot responses. This feature would enable the chatbot to convert its textual replies into voice, making it more inclusive for users with visual impairments and providing an alternative communication channel.

Integration of the Text-to-Voice Engine:
Integrate a reliable and efficient text-to-voice engine that supports multiple languages.
Ensure compatibility with popular TTS APIs or libraries.

Address potential challenges related to voice synthesis, such as maintaining naturalness, clarity, and coherence in different languages.
Benefits:

LLM Prompt Template to Prevent Hallucinations

Problem
Large Language Models (LLMs) sometimes generate incorrect answers due to vague prompts, leading to hallucinations. The chatbot should only answer railway-related queries otherwise, chatbot should politely refuse to answer.

Solution
Implement a built-in prompt template for LLM:

  • Clear Instructions: Guide users on effective prompt structure.
  • Relevant Context: Include placeholders for context-specific details.
  • Guidelines: Educate users on context importance.

Benefits

  • Improved model performance.
  • Enhanced user experience.
  • Increased trust.

How You Can Help

  • Contribute: Share thoughts and discuss.
  • Collaborate: Suggest prompt structures.
  • Advocate: Upvote and encourage community involvement.
  • Code: the Prompt template and integrate into the project

Resources
YouTube Video
LangChain Prompt Doc

Let’s enhance LLMs together! πŸš€

Virtual environment files are on the GitHub

Issue Description:

Python virtual environment files are on GitHub's remote repo, and they should not be on GitHub's remote repo because virtual environment files are system-specific and not independent if anyone clones the project. It will lead him into trouble.

Expected Behavior:

Virtual environment files should not be in the remote repository.

Actual Behavior:

Virtual environment files are in the remote repository.

How to resolve this issue

We should include the ".gitignore" file and add the virtual environment folder path in the ".gitignore" file of the project so that these virtual environment files must be untracked and also not be on the remote repository.

Improve Chatbot Responses for Natural Language Input

Description:
Currently, the chatbot responses appear to be fragmented, showing as single words, affecting the overall user experience. Additionally, there is an opportunity to enhance response generation by providing responses in natural language, corresponding to the user's input.

Steps to Reproduce:

  1. Engage in a conversation with the chatbot.
  2. Observe the format and content of the chatbot responses.

Expected Behavior:

  • Chatbot responses should be presented in coherent sentences or phrases.
  • Responses should be generated in a natural language format that corresponds to the user's input.

Actual Behavior:

  • Responses is in one word, leading to a less-than-optimal user experience and less understanding for the user.
  • The chatbot responses may not fully utilize natural language constructs.

Proposed Solution:
Enhance the response generation algorithm by integrating an open-source Large Language Model. By leveraging such models, we can achieve more contextually relevant and natural language responses that align with the user's input. This improvement aims to provide a more coherent and user-friendly conversational experience.

Screenshots:
Screenshot 2024-01-01 152754

Need a basic HTML template

If the Railways chatbot should be available on the web, we need an HTML web page. Where users can interact with the chatbot.
I initially proposed a simple web page's wireframe design made from Figma.

chatbot_template_wireframe

Anyone can make this simple webpage easily and contribute to this project.
Well, creativity is always to be welcomed. 🀠

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.