update readme.md
Browse files
README.md
CHANGED
@@ -1,3 +1,31 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
language:
|
4 |
+
- en
|
5 |
+
metrics:
|
6 |
+
- rouge
|
7 |
+
base_model: google/pegasus-cnn_dailymail
|
8 |
+
---
|
9 |
+
|
10 |
+
### Pegasus-based Text Summarization Model
|
11 |
+
Model Name: pegsus-text-summarization
|
12 |
+
|
13 |
+
### Model Description
|
14 |
+
This model is a fine-tuned version of the Pegasus model, specifically adapted for the task of text summarization. It is trained on the SAMSum dataset, which is designed for summarizing conversations.
|
15 |
+
|
16 |
+
### Usage
|
17 |
+
This model can be used to generate concise summaries of input text, particularly for conversational text or dialogue-based inputs.
|
18 |
+
|
19 |
+
### How to Use
|
20 |
+
You can use this model with the Hugging Face transformers library. Below is an example code snippet:
|
21 |
+
|
22 |
+
from transformers import PegasusForConditionalGeneration, PegasusTokenizer
|
23 |
+
|
24 |
+
model_name = "ailm/pegsus-text-summarization"
|
25 |
+
model = PegasusForConditionalGeneration.from_pretrained(model_name)
|
26 |
+
tokenizer = PegasusTokenizer.from_pretrained(model_name)
|
27 |
+
|
28 |
+
text = "Your input text here"
|
29 |
+
tokens = tokenizer(text, truncation=True, padding="longest", return_tensors="pt")
|
30 |
+
summary = model.generate(**tokens)
|
31 |
+
print(tokenizer.decode(summary[0], skip_special_tokens=True))
|