Skip to content

Varun0818/rag-text-summarizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Here's a clean and professional README.md file for your Text Summarizer using RAG-like Pipeline project:


# 🧠 Text Summarizer using RAG-like Pipeline

This project is a **text summarization tool** that intelligently compresses large documents into concise summaries. It combines **semantic chunk retrieval** using Sentence-BERT and FAISS with **abstractive summarization** powered by BART, following a RAG (Retrieval-Augmented Generation) inspired architecture.

---

## 🚀 Features

- 🔍 **Semantic Chunking**: Splits large text into overlapping chunks.
- 🤖 **Embedding & Retrieval**: Uses Sentence-BERT with FAISS for finding relevant chunks.
-**Abstractive Summarization**: Summarizes the most relevant content using Facebook's BART model.
-**GPU Support**: Automatically uses GPU if available for faster performance.
- 🧩 **Modular Codebase**: Easy to customize and extend.

---

## 📁 Project Structure

Text_summarizer/ ├── summarizer.py # Main pipeline script ├── text.txt # Input text file to be summarized ├── requirements.txt # Python dependencies └── README.md # Project documentation


---

## 📦 Installation

1. Clone the repository:

```bash
git clone https://github.com/your-username/text-summarizer-rag.git
cd text-summarizer-rag
  1. Create a virtual environment (optional but recommended):
python -m venv venv
venv\Scripts\activate  # On Windows
  1. Install the dependencies:
pip install -r requirements.txt

🛠️ Usage

  1. Place your input text in the text.txt file.
  2. Run the summarizer:
python summarizer.py
  1. The script will output a concise summary of the input text.

⚙️ Configuration

You can change the following constants in summarizer.py:

CHUNK_SIZE = 500             # Size of each text chunk
CHUNK_OVERLAP = 100          # Overlap between chunks
TOP_K = 5                    # Number of top relevant chunks to summarize
MAX_SUMMARY_LENGTH = 512     # Max length of generated summary
MIN_SUMMARY_LENGTH = 150     # Min length of generated summary

🧠 Models Used


📌 To-Do / Ideas for Future

  • Add Streamlit/Gradio UI
  • Enable question-based summarization (true RAG-style QA)
  • Support PDF or DOCX input
  • Improve chunking using token-based NLP

🤝 Contributing

Pull requests are welcome! For major changes, please open an issue first.


📄 License

This project is licensed under the MIT License.


📬 Contact

For questions, feedback, or collaboration:

Varun
🔗 https://github.com/Varun0818


---

About

RAG-powered text summarizer using FAISS, Sentence-BERT, and BART.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages