How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
# Warning: Pipeline type "summarization" is no longer supported in transformers v5.
# You must load the model directly (see below) or downgrade to v4.x with:
# 'pip install "transformers<5.0.0'
from transformers import pipeline

pipe = pipeline("summarization", model="m3hrdadfi/bert2bert-fa-news-headline")
# Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

tokenizer = AutoTokenizer.from_pretrained("m3hrdadfi/bert2bert-fa-news-headline")
model = AutoModelForSeq2SeqLM.from_pretrained("m3hrdadfi/bert2bert-fa-news-headline")
Quick Links

A Bert2Bert model on VoA Persian Corpus (a medium-sized corpus of 7.9 million words, 2003-2008) generates headlines. The model achieved a 25.30 ROUGE-2 score.

For more detail, please follow the News Headline Generation repo.

Eval results

The following table summarizes the ROUGE scores obtained by the Bert2Bert model.

% Precision Recall FMeasure
ROUGE-1 43.78 45.52 43.54
ROUGE-2 24.50 25.30* 24.24
ROUGE-L 41.20 42.22 40.76

Questions?

Post a Github issue on the News Headline Generation repo.

Downloads last month
9
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support