Update README.md
Browse files
README.md
CHANGED
@@ -14,10 +14,13 @@ Here is how to use this model to get a summary of a given text in PyTorch:
|
|
14 |
|
15 |
```python
|
16 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
|
|
17 |
tokenizer = AutoTokenizer.from_pretrained("TalTechNLP/mBART-ERRnews")
|
18 |
model = AutoModelForSeq2SeqLM.from_pretrained("TalTechNLP/mBART-ERRnews")
|
|
|
19 |
text = "Riigikogu rahanduskomisjon võttis esmaspäeval maha riigieelarvesse esitatud investeeringuettepanekutest siseministeeriumi investeeringud koolidele ja lasteaedadele, sest komisjoni hinnangul ei peaks siseministeerium tegelema investeeringutega väljaspoole oma vastutusala. Komisjoni esimees Aivar Kokk ütles, et komisjon lähtus otsuse tegemisel riigikontrolör Janar Holmi soovitusest ja seadustest."
|
20 |
inputs = tokenizer(text, return_tensors='pt', max_length=1024)
|
|
|
21 |
summary_ids = model.generate(inputs['input_ids'])
|
22 |
summary = [tokenizer.decode(g, skip_special_tokens=True, clean_up_tokenization_spaces=False) for g in summary_ids]
|
23 |
```
|
@@ -30,7 +33,7 @@ Estonian news story transcripts and summaries.
|
|
30 |
### Training
|
31 |
|
32 |
The model was trained on 2 cloud GPUs with a batch size of 16 for 16 epochs. The optimizer
|
33 |
-
used is Adam with a learning rate of 5e-05,
|
34 |
|
35 |
## Evaluation results
|
36 |
|
|
|
14 |
|
15 |
```python
|
16 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
17 |
+
|
18 |
tokenizer = AutoTokenizer.from_pretrained("TalTechNLP/mBART-ERRnews")
|
19 |
model = AutoModelForSeq2SeqLM.from_pretrained("TalTechNLP/mBART-ERRnews")
|
20 |
+
|
21 |
text = "Riigikogu rahanduskomisjon võttis esmaspäeval maha riigieelarvesse esitatud investeeringuettepanekutest siseministeeriumi investeeringud koolidele ja lasteaedadele, sest komisjoni hinnangul ei peaks siseministeerium tegelema investeeringutega väljaspoole oma vastutusala. Komisjoni esimees Aivar Kokk ütles, et komisjon lähtus otsuse tegemisel riigikontrolör Janar Holmi soovitusest ja seadustest."
|
22 |
inputs = tokenizer(text, return_tensors='pt', max_length=1024)
|
23 |
+
|
24 |
summary_ids = model.generate(inputs['input_ids'])
|
25 |
summary = [tokenizer.decode(g, skip_special_tokens=True, clean_up_tokenization_spaces=False) for g in summary_ids]
|
26 |
```
|
|
|
33 |
### Training
|
34 |
|
35 |
The model was trained on 2 cloud GPUs with a batch size of 16 for 16 epochs. The optimizer
|
36 |
+
used is Adam with a learning rate of 5e-05, betas of 0.9 and 0.999.
|
37 |
|
38 |
## Evaluation results
|
39 |
|