Skip to content

An app summarizes documents (pdf-txt) supported extractive and abstractive summarization.

License

Notifications You must be signed in to change notification settings

tawfikhammad/Summify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 

Repository files navigation

Summify

A FastAPI-based document summarization service that supports both extractive and abstractive summarization. It allows users to upload documents (PDF or text files) and receive summaries based on their preferred summarization approach.


Table of Contents

  1. Project Structure
  2. API Routes
  3. How to Use
  4. Installation
  5. Connect with Me

Project Structure

Summify/
├── src/                              
│   ├── assets/                       
│   │   └── test_cases/               
│   │       ├── nativepdf_ar.pdf
│   │       ├── nativepdf_fr.pdf
│   │       ├── scanned_ar1.pdf
│   │       ├── scanned_ar2.pdf
│   │       ├── scannedpdf_en.pdf
│   │       └── text.txt
│   ├── config/                       
│   │   ├── __init__.py
│   │   └── settings.py               
│   ├── controllers/                  
│   │   ├── __init__.py
│   │   ├── BaseController.py         
│   │   └── SummaryController.py      
│   ├── core/                         
│   │   ├── __init__.py
│   │   ├── file_parser.py            
│   │   └── summarizer.py             
│   ├── helpers/                      
│   │   ├── enums/                    
│   │   │   ├── __init__.py
|   |   |   ├── extraction_enums.py
|   |   |   ├── scan_enums.py
|   |   |   ├── summary_enums.py
|   |   |   └── validation_enums.py
│   │   ├── file_validation.py        
│   │   ├── lang_detection.py         
│   │   ├── scan_checker.py           
│   │   └── text_processing.py        
│   └── routes/                       
│       ├── __init__.py
|       ├── base.py
│       ├── summary.py                
│       └── schemas/                      
│           ├── __init__.py
│           └── upload_request.py                  
│                            
├── .env                              
├── .env.example                      
├── .gitignore                        
├── main.py                           
├── requirements.txt                  
├── LICENSE                           
└── README.md                         

API Routes

Get /welcome

For Welcome message

POST /data/summary/file

Summarize a document (PDF or text file).

Request:

  • Method: POST
  • Content-Type: multipart/form-data
  • Body:
    • file: The document to summarize (PDF or text file).
    • summ_approach: The summarization approach (abstractive or extractive).
    • max_length: The maximum length of the summary (required for abstractive).
    • sentences_num : The maximum sentence count of the summary (required for extractive).

Example Request:

curl -X POST "http://localhost:8000/data/summary/file" \
  -H "Content-Type: multipart/form-data" \
  -F "file=@document.pdf" \
  -F "summ_approach=abstractive" \
  -F "max_length=500"

Response:

{
  "summary": "generated summary of the document..."
}

How to Use

1. Install Dependencies

Make sure you have Python 3.8< 3.13> installed. Then, install the required dependencies:

pip install -r requirements.txt

2. Run the Application

Start the FastAPI server:

cd src
python main.py

The API will be available at http://localhost:8000.

3. Test the API

You can use tools like Postman to test the API. Refer to the API Routes section for examples.


Installation

Prerequisites

  • Python 3.8 - 3.12.8
  • Pip (Python package manager)

Steps

  1. Clone the repository:

    git clone https://github.com/tawfikhammad/Summify.git
    cd Summify
  2. Set up a virtual environment:

    conda create --name summify python=3.12.8
    conda activate summify
  3. Install dependencies:

    pip install -r requirements.txt
  4. Run the application:

    cd src
    python main.py

Connect with Me

If you have any questions, suggestions, or just want to connect, feel free to reach out to me on LinkedIn:

👉 Tawfik Hammad

Let’s connect and collaborate!


License

This project is licensed under the MIT License. See the LICENSE file for details.

About

An app summarizes documents (pdf-txt) supported extractive and abstractive summarization.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages