Skip to content

BanisharifM/NLP_COMS_579

Repository files navigation

NLP_COMS_579

RAG - Natural Language Processing Project for the COMS_579 in Spring 2024


This project demonstrates how to upload and index PDF files in a Weaviate vector database using LlamaIndex. The project includes a script (upload.py) that chunks the content of PDF files, embeds them using a pre-trained language model, and stores the resulting vectors in Weaviate.


Final Video Link

RAG System User Interface

Dockerization of the Project

The initial step involved containerizing the project using Docker to ensure consistency across different development and production environments.

image image

Server Acquisition and Deployment

  • Purchased a Ubuntu VPS (Virtual Private Server).
  • Deployed the Dockerized project on this server for testing and production.
image

CI/CD Integration

  • Set up Continuous Integration and Continuous Deployment (CI/CD) pipelines on GitHub.
  • Configured automated deployments to streamline development workflows and enhance deployment efficiency.
image image

Docker Hub Integration

  • Created a new repository on Docker Hub to store Docker images.
  • Linked this repository to our VPS using secret variables in GitHub, which included Docker Hub credentials (username, password) and URL.
image

Security and Access Configuration

  • Configured additional repository secrets on GitHub to establish a secure SSH connection to the VPS, enabling safe access and management of the server directly from GitHub workflows.
image

Setup

  1. Copy the .env.example file to a new file named .env.
  2. Fill in the WCS_CLUSTER_URL and WCS_API_KEY values in the .env file with your own Weaviate cluster URL and API key.

Running the Container

To run the Docker container with the default settings, use the following command:

docker-compose up --build

If you want to specify a different PDF file, you can set the PDF_FILE environment variable when running the container. For example, to use a file named Documents/SAM.pdf, use the following command:

PDF_FILE=Documents/SAM.pdf docker-compose up --build

Demo 1 Video Link

Demo 1 Video

Set up a virtual environment OpenAI

Running the command below will create a virtual environment named "openai-env" inside the current folder you have selected in your terminal / command line:

python -m venv openai-env

Once you’ve created the virtual environment, you need to activate it. On Windows, run:

openai-env\Scripts\activate

On Unix or MacOS, run:

source openai-env/bin/activate

Running the Query

To run the Query part and ask question, use the following command:

python -W ignore  query.py --question="What is SAM?"

or

python -W ignore  query.py --question="What is Mask ambiguity? write the answer in 10 words"

Demo 2 Video Link

Demo 2 Video



Contributors

BanisharifM/
Mahdi Banisharif
Sadegh-Jafari
Sadegh Jafari

About

Natural Language Processing Project

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages