nlp-assignment / README.md
xoa-the-noob
added python_version
aa01e39

A newer version of the Gradio SDK is available: 6.10.0

Upgrade
metadata
title: NLP Assignment RAG App
emoji: 🧠
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 4.44.0
app_file: main.py
pinned: false
python_version: '3.12'
app_build_command: uv sync

NLP Assignment – Research Paper RAG Assistant

This app retrieves and summarizes academic papers related to your research query using a Retrieval-Augmented Generation (RAG) pipeline built with:

  • FAISS vector search (index.faiss, index.pkl)
  • SentenceTransformer CrossEncoder reranker
  • Google Gemini (via LangChain) as the LLM
  • Gradio UI frontend
  • uv package manager (modern, fast, Python-native)

πŸš€ How to Run Locally

You can run this project locally using uv (recommended) or plain Python.

🧩 Prerequisites

  • Python 3.12 or higher
  • uv installed:
  pip install uv
  1. Clone the repository
git clone https://huggingface.co/spaces/njayman/nlp-assignment
cd nlp-assignment
  1. Add your FAISS index files

Make sure your FAISS index folder is structured like this:

faiss_index/
β”œβ”€β”€ index.faiss
└── index.pkl
  1. Set up environment

Set your Gemini API key (replace with your own key):

Linux/macOS:

export GOOGLE_API_KEY="your_google_api_key_here"

Windows (PowerShell):

$env:GOOGLE_API_KEY="your_google_api_key_here"

Or add a .env file

GOOGLE_API_KEY="your_google_api_key_here"
  1. Create a virtual env and install dependencies using uv
uv venv
uv sync
  1. Run the Gradio app
uv run main.py

Then open the link printed in your terminal β€” usually:

http://127.0.0.1:7860