Downloads · 30 days
20
2% of all-time downloads
rowjak/bert-indonesian-news-summarization
bert-indonesian-news-summarization is a summarization model from rowjak. Use it when you need a shorter version of a longer text. It is set up for transformers.
This model is fine-tuned based on the original BERT2BERT Indonesian Summarization model.
Downloads · 30 days
20
2% of all-time downloads
All-time downloads
1.1K
Public
Parameters
250M
999 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors999 MB · 100%
From the Hugging Face model README
This model is fine-tuned based on the original BERT2BERT Indonesian Summarization model.
This model was fine-tuned using the Liputan6_ID dataset, which contains Indonesian news articles. The model is optimized for summarizing domain-specific texts from the Liputan6 dataset.
from transformers import BertTokenizer, EncoderDecoderModel
tokenizer = BertTokenizer.from_pretrained("rowjak/bert-indonesian-news-summarization")
tokenizer.bos_token = tokenizer.cls_token
tokenizer.eos_token = tokenizer.sep_token
model = EncoderDecoderModel.from_pretrained("rowjak/bert-indonesian-news-summarization")
#
ARTICLE = ""
# generate summary
input_ids = tokenizer.encode(ARTICLE, return_tensors='pt')
summary_ids = model.generate(input_ids,
max_length=125,
num_beams=2,
repetition_penalty=2.5,
length_penalty=1.0,
early_stopping=True,
no_repeat_ngram_size=2,
use_cache=True)
summary_text = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
print(summary_text)
Output:
---