Update README.md
Browse files
README.md
CHANGED
|
@@ -1,40 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
-
|
| 7 |
-
-
|
| 8 |
-
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
model-index:
|
| 13 |
-
- name: general_text_summarizer_cpu
|
| 14 |
-
results:
|
| 15 |
-
- task:
|
| 16 |
-
name: Summarization
|
| 17 |
-
type: summarization
|
| 18 |
-
metrics:
|
| 19 |
-
- name: Rouge1
|
| 20 |
-
type: rouge
|
| 21 |
-
value: 36.61
|
| 22 |
-
- name: Rouge2
|
| 23 |
-
type: rouge
|
| 24 |
-
value: 16.51
|
| 25 |
-
- name: Rougel
|
| 26 |
-
type: rouge
|
| 27 |
-
value: 26.24
|
| 28 |
---
|
| 29 |
|
| 30 |
-
##
|
|
|
|
|
|
|
| 31 |
|
| 32 |
-
|
| 33 |
-
It is designed to generate concise and coherent summaries for articles, reports, blog posts, and other long-form text.
|
| 34 |
|
| 35 |
-
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
| 37 |
|
|
|
|
|
|
|
|
|
|
| 38 |
## Intended uses
|
| 39 |
|
| 40 |
This model can summarize:
|
|
|
|
| 1 |
+
# 🧠 General Text Summarizer
|
| 2 |
+
|
| 3 |
+
This model is a fine-tuned version of [sshleifer/distilbart-cnn-12-6](https://huggingface.co/sshleifer/distilbart-cnn-12-6), trained to generate **concise and fluent summaries** of general English text — including **news articles, essays, stories, and blog posts**.
|
| 4 |
+
|
| 5 |
---
|
| 6 |
+
|
| 7 |
+
## 🚀 Model Description
|
| 8 |
+
|
| 9 |
+
- **Base model:** DistilBART (CNN/DailyMail)
|
| 10 |
+
- **Framework:** 🤗 Transformers (PyTorch)
|
| 11 |
+
- **Training goal:** Summarize text across multiple domains (not limited to one topic)
|
| 12 |
+
- **Device optimized:** CPU & Apple M-series chips (MPS compatible)
|
| 13 |
+
|
| 14 |
+
This model is suitable for lightweight summarization tasks on laptops or limited-resource machines.
|
| 15 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
---
|
| 17 |
|
| 18 |
+
## 🧾 Example Usage
|
| 19 |
+
|
| 20 |
+
from transformers import pipeline
|
| 21 |
|
| 22 |
+
summarizer = pipeline("summarization", model="Fathi7ma/general_text_summarizer_cpu")
|
|
|
|
| 23 |
|
| 24 |
+
text = """
|
| 25 |
+
Climate change continues to affect weather patterns across the globe.
|
| 26 |
+
Scientists warn that without immediate action, rising temperatures may lead
|
| 27 |
+
to irreversible damage to ecosystems and human livelihoods.
|
| 28 |
+
"""
|
| 29 |
|
| 30 |
+
summary = summarizer(text, max_length=80, min_length=25, do_sample=False)
|
| 31 |
+
print(summary[0]['summary_text'])
|
| 32 |
+
|
| 33 |
## Intended uses
|
| 34 |
|
| 35 |
This model can summarize:
|