Skip to main content
QUICK REVIEW

[Paper Review] FaBERT: Pre-training BERT on Persian Blogs

Mostafa Masumi, Seyed Soroush Majd|arXiv (Cornell University)|Feb 9, 2024
Peer-to-Peer Network TechnologiesComputer Science3 citations
TL;DR

FaBERT is a BERT-base model pre-trained exclusively on the cleaned HmBlogs corpus, a diverse collection of formal and informal Persian blog texts. It achieves state-of-the-art or top-tier performance across 12 downstream NLP tasks, including sentiment analysis, NER, and question answering, despite a smaller vocabulary size, demonstrating the effectiveness of curated, stylistically varied Persian text for pre-training.

ABSTRACT

We introduce FaBERT, a Persian BERT-base model pre-trained on the HmBlogs corpus, encompassing both informal and formal Persian texts. FaBERT is designed to excel in traditional Natural Language Understanding (NLU) tasks, addressing the intricacies of diverse sentence structures and linguistic styles prevalent in the Persian language. In our comprehensive evaluation of FaBERT on 12 datasets in various downstream tasks, encompassing Sentiment Analysis (SA), Named Entity Recognition (NER), Natural Language Inference (NLI), Question Answering (QA), and Question Paraphrasing (QP), it consistently demonstrated improved performance, all achieved within a compact model size. The findings highlight the importance of utilizing diverse and cleaned corpora, such as HmBlogs, to enhance the performance of language models like BERT in Persian Natural Language Processing (NLP) applications. FaBERT is openly accessible at https://huggingface.co/sbunlp/fabert

Motivation & Objective

  • To develop a high-performing, efficient Persian BERT-base model tailored for diverse linguistic styles in Persian NLP.
  • To address the limitations of existing models in handling informal Persian, including slang, flexible syntax, and cultural references.
  • To evaluate the impact of pre-training on a curated, diverse corpus of Persian blogs on downstream NLP performance.
  • To provide a publicly accessible, compact, and high-performing alternative to larger multilingual or monolingual models for Persian NLP.

Proposed method

  • Pre-trained a BERT-base model (12 layers, 12 attention heads) from scratch on the HmBlogs corpus, a cleaned dataset of Persian blog texts.
  • Utilized standard BERT pre-training objectives: Masked Language Modeling (MLM) and Next Sentence Prediction (NSP) for contextual representation learning.
  • Employed a subword tokenizer (Byte-Pair Encoding) tailored to the Persian language and optimized for vocabulary size and input compression.
  • Selected a vocabulary size half that of ParsBERT to reduce model size while maintaining performance, achieving comparable tokenization efficiency.
  • Fine-tuned the model on 12 diverse downstream tasks, including sentiment analysis, NER, NLI, QA, and question paraphrasing.
  • Conducted extensive ablation and comparison studies using multiple tokenizers and baselines (e.g., mBERT, XLM-R, ParsBERT) to evaluate input length and performance trade-offs.
Figure 1: Train and Validation MLM loss in pre-training
Figure 1: Train and Validation MLM loss in pre-training

Experimental results

Research questions

  • RQ1Can a BERT-base model pre-trained on a curated, diverse corpus of Persian blogs outperform existing models in downstream NLP tasks?
  • RQ2How does the choice of pre-training corpus—specifically informal and formal Persian blogs—affect model generalization and performance?
  • RQ3To what extent does a smaller vocabulary size impact model efficiency and performance compared to larger-vocabulary counterparts?
  • RQ4How does FaBERT compare to multilingual and other monolingual Persian models in tasks like question answering and named entity recognition?
  • RQ5What is the impact of tokenizer design on input sequence length and model performance on long-form Persian texts?

Key findings

  • FaBERT outperformed all baselines in nine out of twelve downstream tasks, including sentiment analysis, NER, and question paraphrasing.
  • In the PCoQA conversational QA dataset, FaBERT achieved a +2.55% higher F1 score than competing models, demonstrating strong performance on complex, contextually dependent questions.
  • Despite having a vocabulary size half that of ParsBERT, FaBERT achieved comparable input compression, with median token counts of 28 (MirasOpinion), 62 (FarsTail), 119.5 (ParsiNLU RC), and 189 (PQuAD).
  • FaBERT achieved a F1 score of 84.3 on PQuAD, closely matching human performance, and outperformed XLM-R in this task, though XLM-R slightly led in overall F1.
  • The model’s performance on the PQuAD dataset was robust across both answerable and unanswerable questions, indicating strong reasoning and abstention capabilities.
  • The HmBlogs corpus, rich in stylistic diversity, significantly enhanced FaBERT’s ability to generalize across formal and informal Persian, proving critical for high performance.
Figure 2: Token count distribution across tokenizers for the PQuAD dataset
Figure 2: Token count distribution across tokenizers for the PQuAD dataset

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.