Transformers
PyTorch
Arabic
encoder-decoder
text2text-generation
AraBERT
BERT
BERT2BERT
MSA
Arabic Text Summarization
Arabic News Title Generation
Arabic Paraphrasing
Run this model with HF Jobs
Run malmarjeh/bert2bert on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/malmarjeh/bert2bert. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/malmarjeh/bert2bert on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use malmarjeh/bert2bert with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use malmarjeh/bert2bert with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("malmarjeh/bert2bert") model = AutoModelForSeq2SeqLM.from_pretrained("malmarjeh/bert2bert", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Quick Links
An Arabic abstractive text summarization model
A BERT2BERT-based model whose parameters are initialized with AraBERT weights and which has been fine-tuned on a dataset of 84,764 paragraph-summary pairs.
Paper: Arabic abstractive text summarization using RNN-based and transformer-based architectures.
Dataset: link.
The model can be used as follows:
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
from arabert.preprocess import ArabertPreprocessor
model_name="malmarjeh/bert2bert"
preprocessor = ArabertPreprocessor(model_name="")
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
pipeline = pipeline("text2text-generation",model=model,tokenizer=tokenizer)
text = "شهدت مدينة طرابلس، مساء أمس الأربعاء، احتجاجات شعبية وأعمال شغب لليوم الثالث على التوالي، وذلك بسبب تردي الوضع المعيشي والاقتصادي. واندلعت مواجهات عنيفة وعمليات كر وفر ما بين الجيش اللبناني والمحتجين استمرت لساعات، إثر محاولة فتح الطرقات المقطوعة، ما أدى إلى إصابة العشرات من الطرفين."
text = preprocessor.preprocess(text)
result = pipeline(text,
pad_token_id=tokenizer.eos_token_id,
num_beams=3,
repetition_penalty=3.0,
max_length=200,
length_penalty=1.0,
no_repeat_ngram_size = 3)[0]['generated_text']
result
>>> 'مواجهات في طرابلس لليوم الثالث على التوالي'
Contact:
- Downloads last month
- 194
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("malmarjeh/bert2bert") model = AutoModelForSeq2SeqLM.from_pretrained("malmarjeh/bert2bert", device_map="auto")