Commit ·
11471c0
1
Parent(s): 07ff426
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ehdwns1516/bart_finetuned_xsum
|
| 2 |
+
|
| 3 |
+
* This model has been trained as a [xsum dataset](https://huggingface.co/datasets/xsum).
|
| 4 |
+
* Input text what you want to summarize.
|
| 5 |
+
|
| 6 |
+
review generator DEMO: [Ainize DEMO](https://main-text-summarizer-ehdwns1516.endpoint.ainize.ai/)
|
| 7 |
+
|
| 8 |
+
review generator API: [Ainize API](https://ainize.web.app/redirect?git_repo=https://github.com/ehdwns1516/text_summarizer)
|
| 9 |
+
|
| 10 |
+
## Overview
|
| 11 |
+
|
| 12 |
+
Language model: [facebook/bart-large](https://huggingface.co/facebook/bart-large)
|
| 13 |
+
|
| 14 |
+
Language: English
|
| 15 |
+
|
| 16 |
+
Training data: [xsum dataset](https://huggingface.co/datasets/xsum)
|
| 17 |
+
|
| 18 |
+
Code: See [Ainize Workspace](https://ainize.ai/workspace/create?imageId=hnj95592adzr02xPTqss&git=https://github.com/ehdwns1516/bart_finetuned_xsum-notebook)
|
| 19 |
+
|
| 20 |
+
## Usage
|
| 21 |
+
## In Transformers
|
| 22 |
+
|
| 23 |
+
```
|
| 24 |
+
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
| 25 |
+
|
| 26 |
+
tokenizer = AutoTokenizer.from_pretrained("ehdwns1516/bart_finetuned_xsum")
|
| 27 |
+
|
| 28 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("ehdwns1516/bart_finetuned_xsum")
|
| 29 |
+
|
| 30 |
+
summarizer = pipeline(
|
| 31 |
+
"summarization",
|
| 32 |
+
model="ehdwns1516/bart_finetuned_xsum",
|
| 33 |
+
tokenizer=tokenizer
|
| 34 |
+
)
|
| 35 |
+
|
| 36 |
+
context = "your context"
|
| 37 |
+
|
| 38 |
+
result = dict()
|
| 39 |
+
result[0] = summarizer(context)[0]
|
| 40 |
+
```
|