sumith27/Flash_Text_Summarizer
0
Document Q&A System with Phi-2
This application allows you to load documents, process them, and ask questions about their content. It uses Microsoft's Phi-2 model for generating answers.
Features
- Support for PDF, DOCX, TXT, and CSV files
- URL content extraction
- Text input option
- Document chunking with configurable parameters
- BGE embeddings for better retrieval accuracy
- Chroma vector database for efficient searching
- Microsoft Phi-2 model for answer generation
Installation
- Clone this repository or download the code
- Install the required packages:
pip install -r requirements.txtUsage
Run the application with Streamlit:
streamlit run app.pyWorkflow
- Upload documents, provide URLs, or paste text
- Click "Process Documents" to analyze and index the content
- Ask questions about the documents
- Get AI-generated answers based on the document content
Technical Details
- Document Processing: Extracts and cleans text from various sources
- Chunking: Uses RecursiveCharacterTextSplitter from LangChain
- Embeddings: BAAI/bge-small-en-v1.5 embeddings for optimal retrieval
- Vector Database: Chroma for efficient similarity search
- Answer Generation: Microsoft's Phi-2 (2.7B parameters) for high-quality answers
Requirements
- Python 3.8+
- 8+ GB RAM recommended
- GPU recommended but not required
Customization
You can adjust several parameters in the application:
- Chunk size and overlap for document splitting
- Number of results to display
- Various model parameters
License
This project is open source and available under the MIT License.
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
