File size: 967 Bytes
0a6fdfd
 
 
 
 
 
 
 
 
 
 
 
5c6b8c5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---
title: RAGsystem
emoji: 🌍
colorFrom: green
colorTo: blue
sdk: gradio
sdk_version: 5.25.2
app_file: app.py
pinned: false
short_description: RAG System with Phi-2
---

# PDF RAG System with Phi-2

This application allows you to upload PDF documents and ask questions about their content. It uses a Retrieval-Augmented Generation (RAG) pipeline with the Phi-2 language model.

## Features

- PDF document upload and processing
- Text and table extraction from PDFs
- Hybrid search combining vector embeddings and BM25
- Query expansion for better search results
- Streaming response generation

## How to Use

1. Upload your PDF files
2. Process the documents
3. Ask questions about the content
4. Adjust retrieval and generation parameters as needed

## Technical Details

- Uses Phi-2 language model via llama.cpp
- Sentence Transformers for document embeddings
- FAISS for vector search
- BM25 for keyword search
- Hybrid retrieval with configurable weighting