File size: 1,836 Bytes
8c78e63
0c9b99b
 
 
 
8c78e63
0c9b99b
8c78e63
 
 
 
0c9b99b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
title: Text Summarization
emoji: πŸ“
colorFrom: blue
colorTo: indigo
sdk: gradio
sdk_version: 3.35.2
app_file: app.py
pinned: false
---

# πŸ“ Text Summarization with Transformers

This Hugging Face Space demonstrates how to perform text summarization using a pre-trained model from the `transformers` library. It provides a simple interface to generate a concise summary from a longer text document.

This project is part of a portfolio showcasing foundational AI/ML skills. It highlights the ability to leverage powerful, pre-trained models for common Natural Language Processing (NLP) tasks.

## πŸš€ How to Use the Demo

1.  **Enter Text:** Paste the long-form text you want to summarize into the "Original Text" input box.
2.  **Generate Summary:** Click the **"Summarize"** button.
3.  **View Result:** The generated summary will appear in the "Summarized Text" box on the right.

## 🧠 Model Information

This demo uses the [`sshleifer/distilbart-cnn-12-6`](https://huggingface.co/sshleifer/distilbart-cnn-12-6) model, a sequence-to-sequence model fine-tuned on the CNN/DailyMail dataset for summarization. It is a distilled version of the BART model, making it faster and more efficient while retaining high performance.

## πŸ› οΈ Technical Details

-   **Framework:** The interactive demo is built with [Gradio](https://www.gradio.app/).
-   **Library:** The core summarization logic is powered by the Hugging Face [`transformers`](https://huggingface.co/docs/transformers/index) library.
-   **Hardware:** The application is configured to leverage a GPU if one is available, which significantly speeds up the summarization process.
-   **Workflow:** The project follows a standard development workflow, including dependency management (`requirements.txt`), refactoring for testability, and unit testing (`unittest`).