Skip to content

apurva-honrao/Headstarter-hackathon

Repository files navigation

Categorized Complaints App

This Ruby on Rails App reads and stores complaints submitted on the main page into a categorized database using RAG.

Built With

  • Ruby on Rails
  • Python
  • PostgreSQL
  • Hugging Face API
  • Pinecone

Getting Started

Here are the dependencies/ that need to be installed to run this app:

  1. Ruby on Rails
    Ruby on Rails Installation Guide

  2. PostgreSQL
    PostgreSQL Installation Guide

  3. Python 3 & Python3-Virtual Environment
    Python Installation Guide'

Setting Up the Virtual Environment

Before installing Python dependencies, set up a virtual environment to manage them:

  1. Create a Virtual Environment Navigate to the project directory and create a virtual environment:
python3 -m venv venv
  1. Activate the Virtual Environment On macOS/Linux:
source venv/bin/activate

on Windows:

venv\Scripts\activate
  1. Install Python Dependencies With the virtual environment activated, install the necessary dependencies:
   cd flask_app/
   pip install Flask
   # This install all the RAG model dependencies
   pip install langchain langchain-community openai tiktoken pinecone-client langchain_pinecone unstructured pdfminer==20191125 pdfminer.six==20221105 pillow_heif unstructured_inference youtube-transcript-api pytube sentence-transformers

Running the app

After installing the needed dependencies, follow these steps to get started with the application:

  1. Clone the Repository
    First, clone this repository to your local machine using Git:

    git clone https://github.com/apurva-honrao/Headstarter-hackathon.git
    
    
  2. Navigate to the Project Directory
    Change to the project directory:

    cd Headstarter-hackathon
  3. Install all RubyonRails dependencies

    bundle install
  4. Initiate the Postgresql database:

    rails db:create
    rails db:migrate
  5. Then and run the Ruby on Rails app:

    rails server
  6. open up a different shell and Run the Flask app
    Open a terminal and navigate to the project directory:

    cd flask_app/
    ./app.py
  7. Now that the app is running, navigate to 'localhost:3000/complaints/new' port where it is running and enter your complaint. This is stored in the PostGres database which can be viewed by going back to the directory and running:

    rails console
  8. Then in the console, run:

    Complaint.all

You should be able to see the complaints stored in the database here with their respective categories.

Acknowledgement

(back to top)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •