Giter VIP home page Giter VIP logo

constitution-chatbot's Introduction

Constituition Chat

Commandline chatbot to learn about the constituition of ghana!

This chatbot helps you learn about the constituion of ghana, it can answer any questions that relates to the 1996 constituition of Ghana. Have fun!.

Requirements

  1. Python3 (https://www.python.org/)
  2. pipenv (https://pipenv.pypa.io/en/latest/)
  3. Azure OpenAI keys (https://azure.microsoft.com/)

Running Locally

  1. clone the repo
  2. run pipenv install
  3. run pipenv shell
  4. run pipenv run python3 app.py

Usage example

How can I become a citizen of Ghana?

How it works

  1. PyPdfLoaderReads reads the document from the path provided into array of documents, where each document contains the page content and metadata with page number,and splits them into chunks.
  2. The pdf chunks are then passed into chromadb which creats embeddings for them using the AzureOpenAIEmbeddings.
  3. When a prompt is received, the prompt is passed to chromadb which them creates embeddings and does a similarity check to retrieve results that correspond to the prompt
  4. The results together with the prompt is then passed to the llm using "rlm/rag-prompt" to make sense out of it and the response is printed to the screen.

Note

This project can be adapted for any use case, just change the pdf file to any pdf of your choice and you will have the same functionality. enjoy!

If you have any feature reaquest, feel free to reach out to me or contribute!

Contributing

  1. Fork the repo
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

constitution-chatbot's People

Contributors

lamepic avatar

Watchers

 avatar

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.