Jayan12321 commited on
Commit
8cd6bf6
·
verified ·
1 Parent(s): 97c87b2

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +29 -18
README.md CHANGED
@@ -1,26 +1,37 @@
1
  ---
2
- title: BioMed Clinical Intelligence & Oncology RAG Engine
3
- emoji: 🧬
4
  colorFrom: blue
5
- colorTo: green
6
- sdk: static
 
 
7
  pinned: true
8
- tags:
9
- - rag
10
- - biomedicine
11
- - oncology
12
- - clinical-trials
13
- - hybrid-search
14
  ---
15
 
16
- # 🧬 BioMed Clinical Intelligence & Oncology Literature RAG Engine
17
 
18
- Interactive clinical intelligence engine delivering hybrid biomedical semantic search over peer-reviewed oncology literature (PubMed/PMC) and ClinicalTrials.gov registries.
 
 
 
 
 
19
 
20
- ## 🎯 Architecture Highlights
21
- * **Hybrid Semantic Retrieval:** Dense vector cosine similarity blended with BM25 lexical keyword matching.
22
- * **Citation-Grounded Synthesis:** Strict evidence attribution with direct PubMed PMIDs and ClinicalTrials.gov NCT identifiers.
23
- * **Biomedical Safety Guardrails:** Automated intent classification that rejects direct medical diagnosis prompts while preserving academic literature inquiry.
 
24
 
25
- Designed & deployed by **[Jayan Gupta](https://huggingface.co/Jayan12321)** (Kaggle: [jayangupta00](https://www.kaggle.com/jayangupta00)).
26
- Complementary Kaggle Dataset: [Biomedical Oncology Literature & Clinical Trials](https://www.kaggle.com/datasets/jayangupta00/biomedical-oncology-literature).
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: RAG Engine
3
+ emoji: 🧠
4
  colorFrom: blue
5
+ colorTo: indigo
6
+ sdk: streamlit
7
+ sdk_version: 1.36.0
8
+ app_file: app.py
9
  pinned: true
 
 
 
 
 
 
10
  ---
11
 
12
+ # RAG Engine 🧠
13
 
14
+ A modular, educational **Retrieval-Augmented Generation (RAG)** system built to demonstrate core RAG principles:
15
+ 1. **Document Ingestion & Chunking** (sliding window with overlap)
16
+ 2. **Dense Vector Embeddings** (cosine similarity search)
17
+ 3. **Sparse BM25 Keyword Search** (lexical matching for exact terms)
18
+ 4. **Hybrid Retrieval with Reciprocal Rank Fusion (RRF)**
19
+ 5. **Context-Augmented Generation** with source citations
20
 
21
+ ### 💻 Live Interactive Demo
22
+ Use the tabs on the left to:
23
+ - **💬 Ask Question**: Query the knowledge base with real-time source grounding and faithfulness scoring.
24
+ - **🔬 Pipeline Inspector**: Directly observe the raw output of Vector Search vs. BM25 Search vs. RRF Rank Fusion.
25
+ - **📚 Knowledge Base**: Inspect loaded documents or upload custom text/PDF files to index them immediately.
26
 
27
+ ### 📐 Architecture
28
+ - **Chunking**: ~400-word passages with 50-word overlap to balance semantic focus and boundary continuity.
29
+ - **Embeddings**: Deterministic token hash embeddings by default (100% offline, zero-dependency), compatible with HuggingFace SentenceTransformers.
30
+ - **Hybrid Fusion**: Merges dense and sparse ranks via Reciprocal Rank Fusion:
31
+ RRF(d) = \sum_{m} \frac{w_m}{60 + \text{rank}_m(d)}
32
+ - **Generation**: Formats grounded context into system prompts. Provides extractive summaries on CPU or full LLM generation when an API key is provided.
33
+
34
+ ### 🛠️ Transparency & Code
35
+ - **Author**: Jayan Gupta
36
+ - **Source Code & Unit Tests**: [GitHub Repository](https://github.com/JayanGupta/RAG-Engine)
37
+ - **Design Philosophy**: Simple, clean Python without heavy abstraction layers or type boilerplate.