CoolFace
Apppublic

sumith27/Flash_Text_Summarizer

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes
App README

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

  1. 1.Clone this repository or download the code
  2. 2.Install the required packages:
bash
pip install -r requirements.txt

Usage

Run the application with Streamlit:

bash
streamlit run app.py

Workflow

  1. 1.Upload documents, provide URLs, or paste text
  2. 2.Click "Process Documents" to analyze and index the content
  3. 3.Ask questions about the documents
  4. 4.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