Hostname: page-component-76d6cb85b7-vdhp9 Total loading time: 0 Render date: 2026-07-14T06:59:31.038Z Has data issue: false hasContentIssue false

Neural Arabic singular-to-plural conversion using a pretrained Character-BERT and a fused transformer

Published online by Cambridge University Press:  11 October 2023

Azzam Radman
Affiliation:
Computer Information Systems, Jordan University of Science and Technology, Irbid, Jordan
Mohammed Atros
Affiliation:
Computer Information Systems, Jordan University of Science and Technology, Irbid, Jordan
Rehab Duwairi*
Affiliation:
Computer Information Systems, Jordan University of Science and Technology, Irbid, Jordan
*
Corresponding author: Rehab Duwairi; Email: rehab@just.edu.jo
Rights & Permissions [Opens in a new window]

Abstract

Morphological re-inflection generation is one of the most challenging tasks in the natural language processing (NLP) domain, especially with morphologically rich, low-resource languages like Arabic. In this research, we investigate the ability of transformer-based models in the singular-to-plural Arabic noun conversion task. We start with pretraining a Character-BERT model on a masked language modeling task using 1,134,950 Arabic words and then adopting the fusion technique to transfer the knowledge gained by the pretrained model to a full encoder–decoder transformer model, in one of the proposed settings. The second proposed setting directly fuses the output Character-BERT embeddings into the decoder. We then analyze and compare the performance of the two architectures and provide an interpretability section in which we track the features of attention with respect to the model. We perform the interpretation on both the macro and micro levels, providing some individual examples. Moreover, we provide a thorough error analysis showing the strengths and weaknesses of the proposed framework. To the best of our knowledge, this is the first effort in the Arabic NLP domain that adopts the development of an end-to-end fused-transformer deep learning model to address the problem of singular-to-plural conversion.

Information

Type
Article
Creative Commons
Creative Common License - CCCreative Common License - BYCreative Common License - NC
This is an Open Access article, distributed under the terms of the Creative Commons Attribution-NonCommercial licence (http://creativecommons.org/licenses/by-nc/4.0/), which permits non-commercial re-use, distribution, and reproduction in any medium, provided the original article is properly cited. The written permission of Cambridge University Press must be obtained prior to any commercial use.
Copyright
© The Author(s), 2023. Published by Cambridge University Press
Figure 0

Table 1. Examples of the different Arabic re-inflected plural forms

Figure 1

Figure 1. The first proposed framework – fused architecture. The figure shows CBERT (left) which is used to produce the contextualized token embeddings, the encoder (middle) that receives the inputs from the outputs of CBERT and the singular form, and the decoder (right) that receives the inputs from the plural form, the CBERT outputs, and the encoder outputs.

Figure 2

Figure 2. The second proposed framework – direct architecture. The figure shows CBERT (left) which is used to produce the contextualized token embeddings and the decoder (right) that receives the inputs from the plural form embeddings and the encoder outputs.

Figure 3

Table 2. Results of the fused and direct architectures on the test set under the three different cases. The readings are out of 600 which is the total number of samples in the test set

Figure 4

Table 3. Results of the fused and direct architectures on the validation set under the three different cases. The readings are out of 343 which is the total number of samples in the validation set

Figure 5

Figure 3. Training progress over 100 epochs. Upper graph shows the decrease in the loss value where only the loss of the training set is weighted based on the reversed frequencies of the tokens in the training set, giving the padding token a weight of zero. The loss of the validation set is not weighted and becomes more realistic as the training progresses and the prediction of the padding token diminishes. The lower left and right figures show the increase in the top one accuracy and top five accuracy metrics, respectively.

Figure 6

Table 4. Distribution of the predictions over the Levenshtein distances and the three plural forms for the best-performing model (fused - Case 2)

Figure 7

Table 5. Irregular plural form analysis. The readings are represented as (validation set readings and test set readings)

Figure 8

Figure 4. Distribution of plural forms over Levenshtein distance scores.

Figure 9

Table 6. Regular feminine plural form analysis. The readings are represented as (validation set readings and test set readings)

Figure 10

Table 7. Regular masculine plural form analysis. The readings are represented as (validation set readings and test set readings)

Figure 11

Table 8. Examples of incorrect plurals generated by the model, but they are comprehensible by humans. IR: irregular, RF: regular feminine, RM: regular masculine

Figure 12

Table 9. Examples of incorrect plurals that are difficult to comprehend by humans

Figure 13

Figure 5. Parallel coordinate plots showing the mean absolute gradient values for each position in the input sequence “”–“*ryEp” when predicting each position in the generated sequence “”–“*rA}E”. A plot for each part in the proposed model is shown: CBERT (top), encoder (middle), and decoder (bottom). This is one example where the model perfectly generates the plural irregular form for a singular word.

Figure 14

Figure 6. Parallel coordinate plots showing the mean absolute gradient values for each position in the input sequence “”–“mbEwv” when predicting each position in the generated sequence “”–“mbEwvyn”. A plot for each part in the proposed model is shown: CBERT (top), encoder (middle), and decoder (bottom). This is one example where the model perfectly generates the plural masculine form for a singular word.

Figure 15

Figure 7. Parallel coordinate plots showing the mean absolute gradient values for each position in the input sequence “”–“wjhp” when predicting each position in the generated sequence “”–“wjhAt”. A plot for each part in the proposed model is shown: CBERT (top), encoder (middle), and decoder (bottom). This is one example where the model perfectly generates the plural feminine form for a singular word.

Figure 16

Figure 8. Heat maps showing the mean absolute gradient values for each position in the input sequences of all the data when predicting each position in the generated sequences. A plot for each part in the proposed model is shown: CBERT (right), encoder (middle), and decoder (left). The first row shows the three heat maps of the average of the all data. The second row shows the three heat maps of the samples predicted with zero Levenshtein distance; the values are presented as the mean of the heat maps of these samples. The third row shows the three heat maps of the samples predicted with five Levenshtein distance; the values are presented as the mean of the heat maps of these samples.