--- title: Nlp3 emoji: 📉 colorFrom: pink colorTo: yellow sdk: gradio sdk_version: 6.11.0 app_file: app.py pinned: false license: mit short_description: medical rag system (nlp assignment 3) --- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference # MedRAG — Hybrid RAG Question-Answering System **NLP with Deep Learning — Mini-Project 1** A production-grade Retrieval-Augmented Generation (RAG) system over PubMed medical abstracts. ## Architecture | Component | Choice | |-----------|--------| | Corpus | MedRAG/pubmed — 200 abstracts → 500+ chunks | | Vector DB | Pinecone (Serverless, Hybrid Index) | | Dense Embeddings | `all-MiniLM-L6-v2` | | Sparse Retrieval | BM25 (fitted on corpus) | | Re-ranking | `cross-encoder/ms-marco-MiniLM-L-6-v2` | | LLM Generation | OpenRouter (`openrouter/auto`) | | Evaluation | LLM-as-a-Judge (Faithfulness + Relevancy) | | UI | Gradio on HF Spaces | ## Required Secrets Set these in **Settings → Variables and Secrets**: - `PINECONE_API_KEY` — your Pinecone API key - `OPENROUTER_API_KEY` — your OpenRouter API key ## Files to Upload - `app.py` — main application - `requirements.txt` — dependencies - `bm25_params.json` — pre-fitted BM25 parameters (generated in Colab)