ReviewSense leverages retrieval-augmented generation with LoRA fine-tuning to extract actionable insights from large-scale product review datasets. Built with LangGraph for agentic workflows and Pinecone for vector search, it provides intelligent product analysis through category-specific sentiment classification.
- Note that the reviewsense_pipeline.py file takes less than 5 minutes to run, so there is no unit test file
- The Script contains several Unit Test Questions.
- GPU usage is recommended for faster inference. Cloud deployment is also recommended.
- For running the advanced RAG Agent with Lora Fine Tuned Model, use the reviewsense_frontend.py, where you can input questions and model at your choice, or if you want to compare them
- Just use [docker run -it reviewsense python reviewsense_frontend.py] command and the front end system will run
- The data is provided as final_review_chunked_df.csv
- Download the data as in the name as final_review_chunked_df.csv
- If you change the name of the dataset, remember to change it as well in the dockerfile as well as in the code to avoid running into any issue.
- The projects require you to have an OPENAI API KEY to access OpenAI's GPT-3.5-turbo API and a Pinecone API Key. Thus, it is recommended to create an (.env) file in your root directory.
- Add you API Key In this plain text form
- OPENAI_API_KEY=your_api_key_here and PINECONE_API_KEY=your_api_key_here
- Remember to build your .env in the folder that you transfer to docker to ensure no error.
- Use load_dotenv() to read in these key.
- Remember that the data is included in the dockerfile as the line
- COPY final_review_chunked_df.csv /app/
- Note that there is a .env file in the dockerfile that is expected to have. You can remove that if you find it is not there
- If you change the name of the dataset, remember to change it as well in the dockerfile to avoid running into any issue.
Build your Docker image:
docker build -t reviewsense .Check if the image was successfully created by running:
docker imagesThis command will list all available images. Look for your image name in the output.
To start a container from your image:
docker run -it reviewsense /bin/bashThis opens an interactive session inside the container.
If you want to run the whole code (reviewsense_pipeline.py)
docker run -it reviewsenseIf you want to run the Front End (reviewsense_frontend.py)
docker run -it reviewsense python reviewsense_frontend.pyTo remove an image you no longer need:
-
Find the Image ID
docker images
-
Delete the Image
docker rmi image_id
If the image is in use, you may need to force delete it:
docker rmi -f image_id