GithubHelp home page GithubHelp logo

rafsunsheikh / ask_uon Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 86 KB

An Chatbot web application for interacting with university website

Home Page: https://rafsunsheikh116.medium.com/building-a-web-application-embedding-texts-from-web-links-and-creating-an-interactive-chat-ea5dd66cf623

License: MIT License

Python 100.00%
chatbot large-language-models

ask_uon's Introduction

Chat with the University

Welcome to the "Chat with the University" application! This application allows users to interact with an AI model to get information about various university topics. It uses Streamlit for the web interface, LangChain for embeddings and conversation management, and HuggingFace models for language generation.

Features

  • Interactive Chat: Users can ask questions about various university topics.
  • Topic-Based Retrieval: The application supports multiple topics by using pre-built vector stores.
  • Advanced AI Model: Leverages HuggingFace models for natural language understanding and generation.

Requirements

To run this application, you will need:

  • Python 3.8 or higher
  • Streamlit
  • LangChain
  • HuggingFace Transformers
  • PyTorch
  • Additional libraries (see requirements.txt)

Installation

  1. Clone the Repository

    git clone https://github.com/your-username/chat-with-the-university.git
    cd chat-with-the-university
  2. Create a Virtual Environment

    python -m venv venv
    source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
  3. Install Dependencies

    pip install -r requirements.txt
  4. Set Up API Keys

    Create a .streamlit/secrets.toml file in the project directory and add your HuggingFace API key:

    [general]
    HUGGINGFACEHUB_API_KEY = "your_huggingface_api_key_here"

Usage

  1. Run the Streamlit App

    streamlit run app.py
  2. Interact with the App

    Open your browser and navigate to http://localhost:8501. You will see the chat interface where you can ask questions about university topics.

  3. Select a Topic

    Use the sidebar to select a topic related to your query. The application will load the appropriate vector store and process your questions.

Application Structure

  • main_2.py: Main Streamlit application file that handles user input and interaction.
  • requirements.txt: Lists all Python package dependencies.
  • htmlTemplates.py: Contains HTML templates for styling chat messages.
  • preprocess_embedding.py: Script used to create and save FAISS vector stores from web content.

Code Overview

  • main_2.py: Manages the Streamlit app interface and integrates with LangChain for conversational retrieval.

    • Loads API keys.
    • Provides functions to handle user input and manage chat history.
    • Sets up vector stores and conversation chains based on selected topics.
  • preprocess_embedding.py: Handles the creation and storage of FAISS vector stores.

    • Retrieves and processes web content.
    • Splits content into chunks and embeds it.
    • Saves vector stores locally for efficient retrieval.

Contributing

Feel free to open issues or submit pull requests if you have suggestions or improvements. Please follow the project's code of conduct and contribution guidelines.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For any questions or feedback, please contact [email protected].

ask_uon's People

Contributors

rafsunsheikh avatar

Watchers

Kostas Georgiou avatar  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.