imvladikon
commited on
Commit
โข
51b722d
1
Parent(s):
76970d0
Update README.md
Browse files
README.md
CHANGED
@@ -2,4 +2,29 @@
|
|
2 |
language:
|
3 |
- he
|
4 |
pipeline_tag: summarization
|
5 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
language:
|
3 |
- he
|
4 |
pipeline_tag: summarization
|
5 |
+
---
|
6 |
+
|
7 |
+
|
8 |
+
```python
|
9 |
+
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, SummarizationPipeline
|
10 |
+
|
11 |
+
|
12 |
+
model_name = "imvladikon/het5_small_summarization"
|
13 |
+
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
14 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
15 |
+
summarizer = SummarizationPipeline(model=model, tokenizer=tokenizer)
|
16 |
+
```
|
17 |
+
|
18 |
+
example
|
19 |
+
```python
|
20 |
+
text = """
|
21 |
+
ืฆืจืคืช ืืืฉืืื ืืืขืืจ: ืืืืจ ืืจืืขื ืืืื ืฉื ืขืืืืชืื ืืืืืื ืืื ืืชืคืจืขืื ืืืืืืช ืืืืืืื ืืื ืจืืื ืฆืจืคืช, ืืืื (ืฉืืช) ืืชืงืืืื ืืืืืืชื ืฉื ืื ืขืจ ืืืื'ืืจืื, ื ืืื ืื ื-17, ืฉื ืืจื ืืืืืช ืขื ืืื ืฉืืืจ ืืืืจ ืฉื ืืฉื ืืื ืืืช ืจืื. ืืืงืฉืช ืืฉืคืืชื, ืืืืืืื ืืชืงืืืื ืืืืจืืข ืืฆืืืฆืื ืฉืื ืืฉืชืชืคื ืื ื ืืฉืคืื ืืืืจืื ืืืื. ืืืืจ ืฉืืจืื ื ืฉื ื ืืื ืืืฆื ืืืืกืื ืืขืืจ ื ืื ืืจ, ืืืคืื ืงืจืื "ืืขืฉืืืช ืฆืืง ืขืืืจื".ืืืงืืื, ืืืฉืืจื ืืฆืจืคืชืืช ื ืขืจืืช ืืืืฉื ืืืืืืืช ืืขืฉืจืืช ืืืงืืื ืืจืืื ืืืืื ื, ืืฉืืืืื ืืืืื ื ืขืฆืจื 1,300 ืื ื ืืื. ืืฉืจื ืืคื ืื ืืฆืจืคืชื ืืืืืข ืื ืืืืื ืืืืจืืขืื ืืืฆืชื 1,350 ืืื ืจืื, ื-234 ืืฆืชืืช ืฉื ืืื ืื. ืืื ืื, ืขื ืคื ืื ืชืื ืื ื ืืจื ื ืืง ื-200 ืืจืืื ืงื ืืืช, 200 ืกืืคืจืืจืงืืื ื-250 ืกื ืืคื ืื ืง.
|
22 |
+
""".strip()
|
23 |
+
summarizer(text,
|
24 |
+
max_length=50,
|
25 |
+
num_beams=4,
|
26 |
+
no_repeat_ngram_size=2,
|
27 |
+
early_stopping=True)[0]["summary_text"]
|
28 |
+
#ืืืืจ ืืจืืขื ืืืื ืฉื ืขืืืืชืื ืืืืืื ืืื ืืชืคืจืขืื ืืืืืืช ืืืืืืื ืืื ืจืืื ืฆืจืคืช, ืืืืืืชื ืฉื ื ืืื ืื ื-17 ืืชืงืืืื ืืืืจืืข ืืฆืืืฆื
|
29 |
+
```
|
30 |
+
|