A deep learning approach for Named Entity Recognition in Urdu language
Paper · 2024 · Rimsha Anam, Muhammad Waqas Anwar, Muhammad Hasan Jamal et al.
Summary
An Urdu name can look like an ordinary word, and a city name can be part of the name of a university. Finding the right label means reading the surrounding words and deciding where the name begins and ends. Urdu offers no capitalization cue, and spelling and spacing can vary. Anam and colleagues study named entity recognition in this setting. They ask how well a system can learn to identify people, organizations, places and other entities from annotated Urdu text when its representation of words includes information about the characters inside them.
The authors use pretrained FastText and Floret word embeddings, numerical representations that draw on recurring character sequences within words. They clean and tokenize each corpus, represent its words with one embedding family at a time, and train recurrent networks to use the resulting sequences. They compare networks that read a sentence in one direction with ones that read it in both directions. They also test whether adding a gated recurrent unit or a conditional random field improves the predictions. The former processes the sequence of word representations again. The latter scores possible sequences of labels jointly.
On the test portions of the four benchmarks, the highest reported macro F-scores were 0.97 on IJCNLP, 0.96 on Jahangir, 0.98 on MKPUCIT and 0.98 on UNER. A bidirectional long short-term memory network followed by a gated recurrent unit, abbreviated BiLSTM-GRU, reached the highest reported score on each corpus, with ties on Jahangir. It used Floret on IJCNLP, Jahangir and UNER. On MKPUCIT, the largest corpus in the study, it reached 0.98 with FastText and 0.85 with Floret. The selected configurations also scored above the earlier results the authors tabulated for each benchmark.
The authors report test-token classification error rates from 1.24% on UNER to 3.63% on IJCNLP. Their manual review found errors involving rare names, abbreviations, words from other languages, token boundaries, ambiguous multiword names and mistakes in the training labels. The results show how well the system works on held-out portions of these benchmarks. The authors point out that those portions can still contain entities familiar from training, leaving open how well the approach would transfer to a new domain or recognize names unlike those seen before.
Deep dive: A deep learning approach for Named Entity Recognition in Urdu language
Anam and colleagues test how FastText and Floret embeddings help recurrent networks identify names and other entities in Urdu text. · about 37 minutes to read
The problem and its context
An entity has both a boundary and a type
Named entity recognition is a form of information extraction. Given a sentence, the recognizer identifies the parts that refer to entities of interest and assigns a category to each. The category inventory depends on the dataset. Person, organization and location recur throughout the paper. Some datasets also distinguish times, dates, numbers or designations. A system trained on one of those inventories learns to answer the question posed by its annotations. A corpus that includes a designation label asks it to make a distinction that a corpus restricted to people, organizations and locations leaves outside its labeling scheme.
A downstream application can use both parts of the prediction. A question answering system can use the category when looking for a person or a place. In information retrieval, extracting the complete name can help establish what a query refers to. Entity linking also depends on having a mention to resolve. If a recognizer stops halfway through an organization’s name, a later component may receive the name of a city where it was expecting the name of an institution. If it finds the whole expression and assigns the wrong category, the boundary is useful but the type can still send the application in the wrong direction.
The authors use Maqbool to show why recognizing familiar spellings is insufficient. The form can serve as a personal name. In another sentence it conveys that someone is famous. The written form alone can therefore support different readings, and the rest of the sentence helps settle which one applies. Names composed of several words introduce a related decision. Karachi can denote a place by itself, while Karachi University denotes an institution. The letters in Karachi provide evidence about the city. The word that follows provides evidence about the larger expression and the category it should receive.
Some cases raise a further question about what the annotations are meant to capture. The phrase Karachi University contains a form that can independently name a location. A corpus could ask for the organization as a single mention, or it could require recognition of both the encompassing organization and the location inside it. The former can be evaluated by checking the tags assigned across the organization’s name. The latter requires a way to represent overlapping mentions. The paper discusses nesting as a challenge, and this distinction matters when judging what its sequence tagger has shown.
Why Urdu makes these decisions difficult
The paper describes Urdu as a right-to-left language written in an Arabic script. It lacks the upper-case and lower-case distinction that can make a name stand out in English. A recognizer must therefore rely on other clues, including neighboring words and features of the written form itself. Urdu also permits variation in word order. The authors note that sentences with similar meanings can be arranged differently, so a clue that occurs in a particular position in one sentence may lie elsewhere in another.
Urdu morphology adds a different source of variation. Related written forms can share part of their spelling and have different roles in the sentence. The paper illustrates this with Lahore and Lahori. Lahore names a city. The derived form Lahori, in the use the authors describe, refers to people associated with the city and falls outside the named-entity category they are illustrating. A recognizer benefits from learning that the forms are related, but the shared characters are only part of the evidence. It also has to learn when a change in form or use calls for a change in the label.
Spelling differences complicate this further. The authors give Saif as a name with alternative written forms, connected to characters that can sound alike. They also discuss typing mistakes made when characters look similar or have variant forms. Spelling variation can make instances of the same name look like different vocabulary items. In the opposite direction, shared spelling can bring together items that should receive different labels. A word representation that can exploit partial matches addresses the first problem. Evidence from the sentence is needed for the second.
Abbreviations bring together problems of spelling and segmentation. The paper uses LDA, short for Lahore Development Authority, as an example of an English abbreviation written in Urdu. A recognizer cannot count on the form matching the entry it would find in an English dictionary. Spaces or special characters may also interrupt the expression. The first decision is how to turn that spelling into usable input. The next is whether the surrounding sentence and the resulting representation provide enough evidence to recognize an organization. The authors treat input cleanup and classification as distinct parts of that process.
These challenges arise in a setting where the authors describe labeled resources as scarce. Manually covering every form of a name or every pattern in which it occurs takes linguistic expertise. Learning the distinctions from examples also depends on what the annotations contain. If a category occurs rarely, the system has fewer examples of its spelling, context and boundaries. A large token count by itself tells a reader little about how frequently a particular type of entity appears, how many different names occur within it, or whether the annotations draw consistent distinctions.
What earlier Urdu recognizers used as evidence
In the paper’s account, rule-based systems combine grammatical or lexical patterns with resources such as dictionaries, affix lists and gazetteers. A gazetteer is a list of names that helps a recognizer assign types to expressions it already knows. Singh and colleagues used handcrafted patterns and lexical resources to recognize names and other entities in Urdu news. Anam and colleagues highlight a consequence of imposing a fixed matching window. Names longer than the permitted window could be split, and some dates written over several words were treated as several separate items. The rules could be clear enough to inspect while still making the wrong boundary decision.
The paper also describes Riaz’s rules for the Becker-Riaz corpus, a collection of news stories. The recognizer used lexical indications and a gazetteer to identify categories that included people, locations and organizations. The authors emphasize its dependence on the corpus and the assembled vocabulary. A list built around one collection is especially useful for names that recur there. When the input changes, a new name or a different convention for writing the same name may remove the very cue on which the rule depends. The paper presents the effort of rebuilding and adapting those resources as a cost of rule-based approaches.
Earlier supervised systems learned from annotated corpora. They used methods such as a hidden Markov model, maximum entropy classification or a conditional random field. The distinction from a purely rule-driven recognizer was that the rules of prediction could be learned from examples. The choice of features still mattered. Earlier systems used such signals as neighboring words, character patterns, whether a word was rare, lists of known names and part-of-speech tagging. A part-of-speech tag describes a word’s grammatical role and can help a recognizer tell a name from an ordinary use of a similar-looking form.
The experiments reviewed by the authors show how closely those systems could depend on their supporting features. One hidden Markov approach compared tagging conventions that marked different positions inside a mention. The study then added syntax, name lists and part-of-speech information to the convention that marked mention endings. Anam and colleagues note that the supporting grammatical tagger struggled with different writing styles. A separate maximum entropy study used character affixes to help predict rare words. In both cases, the tagging method, the form of the input evidence and the labels being predicted all influenced the outcome.
Hybrid work tried to combine the strengths of learning and rules. The paper reviews a system by Mukund and colleagues that used bootstrapping to enlarge the training data, conditional random fields for several stages and handcrafted rules for a final stage. Information about words and their grammatical roles helped train the recognizer. Ambiguous rules still caused problems with person and location tags. The review also covers work that combined linguistic rules and supervised features across several South Asian languages. The amount of Urdu data and the level of detail reported about it limited what could be inferred about transfer.
Deep learning changed where some of the features came from. Earlier Urdu studies had already supplied neural networks with representations such as Word2vec, Txt2vec and GloVe. Some compared convolutional networks, which operate on local groups of inputs, with recurrent networks, which carry a state through a sequence. Other work combined a bidirectional recurrent network with self-attention and a conditional random field. The paper thus starts from a field that already used learned word representations and sentence-level context. Its experiment is about which sub-word representations work with which recurrent configurations on the available Urdu benchmarks.
The motivation for the new comparison is easiest to see by separating the evidence inside a word from the evidence around it. A word-level vocabulary entry can encode information acquired during pretraining, but a spelling that appears rarely may have a weak entry or fall outside the vocabulary. Character sequences shared with other forms offer another source of evidence. Even a useful numerical representation of the word leaves the sentence-level decision open. A recognizer still has to decide whether the word is being used as a name, whether it belongs to a longer name, and which label the surrounding expression supports.
The method, step by step
From prepared text to a label sequence
The system takes a sentence and makes a label prediction at each word position. Its work begins with tokenization, the division of a text into units the recognizer will process. Here those units are words. During dataset preparation, the authors correct some spacing, remove punctuation, filter duplicate words and handle cases where a word and a label have become entangled. They also handle single-letter forms and remove unnecessary spaces and special characters associated with some abbreviations. These operations prepare text and annotations for training. The resulting token boundaries determine where the tagger can make a prediction.
Spacing is part of the recognition problem because a label must be aligned with a position in the input. If spacing breaks an abbreviation into unintended pieces, the tagger has to classify those pieces as separate inputs. If words and annotations are run together, it may receive the wrong spelling or learn from the wrong label. The authors describe adding and removing spaces to improve the structure of multiword entities. Their procedure takes existing annotated corpora and makes them usable by a word-by-word tagger, preserving the distinction between the word presented as evidence and the annotation used to supervise it.
Some categories were too infrequent for the authors’ training setup. They used oversampling for designation in IJCNLP and UNER. Oversampling here means selecting existing instances of the minority class at random and replicating them so that the class is presented more often. It changes the frequency with which the system sees those instances. The spellings and contexts represented by the copied material remain the same. This is relevant to interpreting designation results, since exposure to training examples and the diversity of those examples are separate properties.
Each prepared token is then encoded as a vector, a list of numbers. The authors compare what happens when the same kind of sequence tagger receives vectors made with FastText or Floret. The word vectors go into an LSTM or its bidirectional counterpart. That stage can support the predictions on its own or pass its output to a gated recurrent unit or conditional random field. These choices create six architectures for each embedding family. Across the comparisons, a sentence always begins as a sequence of prepared words and ends as a sequence of predicted tags.
How the Urdu tagger processes a sentence
The steps in order.
FastText and Floret represent the insides of words
The authors introduce embeddings by contrasting them with one-hot representations. A one-hot vector assigns an input word its own coordinate, marked with 1, with 0 at the other coordinates. That suffices to identify the word. Two spellings related by an affix still occupy unrelated coordinates in the input scheme. An embedding can express similarities across words through patterns in their vectors. The recurrent tagger therefore receives information beyond the identity of the vocabulary item at a position.
FastText uses character n-grams, contiguous runs of characters of a specified length. The paper describes the FastText word representation as a sum of the vectors associated with the generated parts. A form that is uncommon as an entire word can share some character sequences with more frequent words. Those recurring pieces contribute evidence to its representation. The underlying principle is described in Enriching Word Vectors with Subword Information. For the Urdu task, the appeal is that a derived form or spelling variant can share useful features with familiar forms even when the complete spellings have different frequencies.
A character n-gram is a piece of a written form. The recurring pieces can supply clues about roots or affixes, and a substring can be useful to the recognizer without corresponding to a linguistic unit in its own right. The authors illustrate the motivation with examples of forms that have related spellings. Whether a similarity helps depends on the tagging decision. For Lahore and Lahori it can expose the relationship between the forms, while the annotated training data must still teach the network when their uses call for different labels.
Floret retains the sub-word approach and changes how the vectors are stored. The paper describes FastText as using separate storage for vocabulary words and hashed character sequences. Floret stores words and their character sequences together in a shared hash table and represents entries using multiple hashes. Hashing maps an item to storage locations, so several items can share storage. Using multiple locations gives a word or character sequence a combination of entries from which to build its representation. The authors present this as a way to compress the storage required by the embeddings.
This storage comparison has to be read alongside the experiment’s input size. The recurrent networks use embedding vectors with 300 dimensions. A shared storage scheme can reduce the table needed to supply those vectors while leaving their dimensionality at the input to the tagger unchanged. The paper compares tagging scores from the two pretrained resources. Its account of compression explains how Floret is constructed and why it might be attractive, while the precision and recall experiments answer a separate question about its use for Urdu tagging.
The authors generate the features for each prepared dataset with publicly available pretrained Urdu embeddings. A custom Python script writes the vectors into text files for training. The benchmark datasets are publicly available as the Urdu NER Datasets collection. Pretraining and task supervision make different contributions here. The vector files supply an initial representation of the words. The annotated corpus supplies the examples that teach the recurrent network which labels follow from those representations in an Urdu sentence.
The paper discusses the character n-gram window in both the feature extraction and tuning accounts. The feature discussion describes testing from three to six, while the tuning discussion describes the range as three to five. Both identify five as the selected value. This window concerns the word representation. The recurrent stage handles the order of the word vectors in the sentence. A wider character window and a longer stretch of sentence context are different changes to the system, even though both affect what information reaches the final prediction.
The first recurrent layer carries context between words
A recurrent network reads inputs in sequence and carries forward a hidden state, a vector representing information retained from the inputs it has processed. In an Urdu sentence, the vector for a single token enters the network alongside information carried from earlier positions. The resulting state can represent something about the token’s surroundings as well as its spelling. The authors choose gated recurrent architectures because a simple recurrent network can have trouble learning dependencies between positions far apart in a sequence. They describe this training difficulty in terms of the vanishing gradient problem, in which the signal used to update parameters can weaken over repeated steps.
Long short-term memory, or LSTM, gives the recurrent layer a cell state and uses gates to control its updates. A gate supplies element-by-element weights for the information passing through it. The input gate controls how much of a new candidate enters the cell. The forget gate controls how much of the old cell survives. The output gate controls how much stored information is exposed through the hidden state. That state is then available to the next position and to whatever stage uses the recurrent output to predict a tag.
iₜ = σ(Wᵢ [hₜ₋₁, xₜ] + bᵢ)
Here iₜ is the input-gate vector at position t. The vector xₜ is the current input, and hₜ₋₁ is the hidden state from the preceding recurrent step. The brackets and comma indicate that the vectors are joined in order. Wᵢ is the learned input-gate weight matrix, and bᵢ is its learned bias vector. The plus sign adds the bias to the weighted input, and σ is the sigmoid activation that supplies the gate values.
fₜ = σ(Wբ [hₜ₋₁, xₜ] + bբ)
The vector fₜ is the forget gate at step t. The subscript բ on Wբ and bբ denotes the forget gate, whose learned matrix and bias act on the joined previous hidden state hₜ₋₁ and current input xₜ. The plus sign adds the bias, and σ converts the resulting values into gate weights. These weights determine how much of each element of the previous cell state is kept.
Oₜ = σ(Wₒ [hₜ₋₁, xₜ] + bₒ)
Oₜ is the output-gate vector at position t. Wₒ is its learned weight matrix and bₒ its learned bias. The brackets join the preceding hidden state hₜ₋₁ to the current input xₜ. The plus sign adds the bias to the result of applying the matrix. The sigmoid σ produces weights for the information that will be exposed as the current hidden state.
C′ₜ = tanh(W꜀ [hₜ₋₁, xₜ] + b꜀)
C′ₜ is the candidate cell content at step t, and the prime marks it as the candidate. W꜀ and b꜀ are the learned weights and bias for forming that candidate. The brackets join hₜ₋₁, the previous hidden state, with xₜ, the input at the current step. The bias is added with +, and tanh is the hyperbolic tangent activation applied to form the candidate values.
Cₜ = fₜ ⊙ Cₜ₋₁ + iₜ ⊙ C′ₜ
Cₜ is the updated cell state at position t. Cₜ₋₁ is the previous cell state, and C′ₜ is the new candidate. fₜ is the forget gate, and iₜ is the input gate. The symbol ⊙ means multiplication of corresponding vector elements. The plus sign adds the retained part of the old cell state to the admitted part of the candidate.
hₜ = Oₜ ⊙ tanh(Cₜ)
hₜ is the hidden state the LSTM exposes at position t. Cₜ is the updated cell state, tanh transforms its values, and Oₜ is the output gate. The symbol ⊙ again denotes multiplication element by element. The paper describes the gates, cell and hidden state as vectors of the same size, allowing each gate value to control its corresponding element.
A forward LSTM builds its state from positions it has already read, so its representation of a word draws on the prefix of the sentence leading to that position. A bidirectional LSTM, or BiLSTM, combines that pass with a separate recurrent pass starting at the other end. The representation at a given position can then draw on words to either side in sequence order. The authors report using 150 dimensions for each directional pass, giving a 300-dimensional representation. This width is a setting of the bidirectional recurrent layer, while the separately reported 300-dimensional embedding is the input representation of the word.
For an entity such as Iqbal Park, the benefit of bidirectionality is concrete. Information about Park is available when representing Iqbal in the backward pass. When representing Park, the forward pass has already processed Iqbal. A later prediction stage therefore has access to information about the combination at both positions. The network still needs annotated examples that teach it the relevant distinction. Reading in both directions makes the evidence accessible, while the mapping from that evidence to a location or person label is learned during training.
A second layer can refine word states or score tag sequences
The first extension evaluated by the authors is a gated recurrent unit, or GRU. It uses an update gate to mix old and new information and a reset gate to regulate the contribution of the preceding state when forming a candidate. It carries a hidden state that also serves as its memory. In the stacked architecture, the inputs to the GRU are the sequence of representations already produced by the LSTM or BiLSTM. The additional layer can therefore learn which parts of that sequence to preserve as it works toward the final token labels.
yₜ = σ(Wᵧ [hₜ₋₁, xₜ] + bᵧ)
yₜ is the GRU update gate at step t. The brackets join the previous GRU state hₜ₋₁ and the current layer input xₜ. Wᵧ is the learned matrix that acts on the joined vectors, and bᵧ is the learned bias added with +. The sigmoid σ supplies the weights used to combine the previous state and the candidate state.
rₜ = σ(Wᵣ [hₜ₋₁, xₜ] + bᵣ)
rₜ is the reset gate at position t. Its learned matrix and bias are Wᵣ and bᵣ. The bracketed input contains hₜ₋₁, the previous hidden state, and xₜ, the current input to the GRU. The plus sign adds the bias, and σ maps the result to gate weights. These weights control which parts of the preceding hidden state contribute to the candidate.
h′ₜ = tanh(W꜀ [rₜ ⊙ hₜ₋₁, xₜ] + b)
h′ₜ is the candidate hidden state at position t. The reset gate rₜ modifies the previous state hₜ₋₁ by elementwise multiplication, denoted by ⊙. The bracketed expression joins that modified state with input vector xₜ. W꜀ and b are the learned candidate weights and bias in this GRU equation. The plus sign adds the bias, and tanh transforms the resulting vector into the new candidate.
hₜ = (1 − yₜ) ⊙ hₜ₋₁ + yₜ ⊙ h′ₜ
hₜ is the GRU’s updated state at position t, hₜ₋₁ is its previous state, and h′ₜ is the candidate. yₜ is the update gate. Subtracting its elements from 1 gives the complementary weights for the previous state. The symbol ⊙ denotes elementwise multiplication, and the plus sign combines the weighted previous and candidate states. The paper’s update expresses the state as this mixture of carried and newly computed information.
The other extension is a conditional random field, or CRF. Its role is to choose a sequence of tags using both the word evidence provided by the recurrent layer and evidence about which labels tend to occur together. A label can be plausible at a single position and fit poorly with the labels on neighboring positions. A CRF can favor a labeling whose transitions are more plausible across the sentence. The paper describes this stage in terms of conditional probabilities over possible tag sequences, with the word sequence supplying the condition. It cites Bidirectional LSTM-CRF for sequence tagging for this combination of recurrent information and sequence labeling.
The two extensions intervene at different stages of the prediction. The GRU reads and updates the internal word representations. The CRF scores the final labeling jointly. The authors test a plain LSTM, an LSTM with a GRU and an LSTM with a CRF. They make the corresponding comparisons starting from a BiLSTM. Testing each architecture with each embedding lets the reader ask whether a change helps with the surrounding setup held fixed, as well as which complete configuration gets the highest score on a corpus.
Training settings and scoring
The authors train with Keras and report a split of 70–20-10% for each corpus, in training, testing and validation order. The training partition is used to fit the network. The validation partition provides a check during development, and the test partition supplies the reported evaluation. The setup gives 12 experiments per corpus and 48 in all. The available ingredients in each run are a prepared dataset, one pretrained embedding family and one of the recurrent architectures.
The reported training settings include 10 epochs, a batch size of 32, the Adam optimizer and a learning rate of 0.001. An epoch is a pass through the training data, and a batch is the group of examples used to make an update. The learning rate controls the size of the steps used to adjust the weights. The authors use dropout of 0.5 in selected layers as regularization. Dropout restricts the network’s reliance on particular activations during training by randomly suppressing them. The settings also list categorical crossentropy and the softmax and ReLU activations. The validation split is listed as 0.1.
The paper uses precision, recall and F-score to describe the quality of the predictions. Precision asks how many predicted positives were correct. Recall asks how many annotated positives the system recovered. For a category such as organization, calling a location an organization creates a false positive for organization. Missing an organization creates a false negative for that category. The metrics make these failures visible from different directions.
P = Tₚ / (Tₚ + Fₚ)
P is precision. Tₚ counts true positives, the correctly identified positive instances, and Fₚ counts false positives, the instances incorrectly predicted as positive. The plus sign sums those counts to give all predicted positives. The slash divides the correct positive predictions by that total.
R = Tₚ / (Tₚ + Fₙ)
R is recall. Tₚ is the count of true positives, and Fₙ counts false negatives, the annotated positives missed by the tagger. The plus sign adds the recovered and missed positives to give the total annotated positives. The slash gives the recovered share of that total.
F = 2 × (P × R) / (P + R)
F is the F-score, the harmonic mean of precision and recall. P and R are the precision and recall defined above. The multiplication signs combine their product with the factor 2. The slash divides by their sum, denoted by P + R. The score gives weight to both finding positives and getting the positive predictions right. A setting with high precision and low recall can consequently have a lower F-score than a setting that balances the two.
For the architecture comparison, the authors calculate scores by entity type and report macro averages. Macro averaging gives each included type the same influence regardless of how many examples it has. The paper uses this because the category counts are uneven. The reported macro F-score aggregates the class-level F-scores, so the displayed macro precision and recall serve as accompanying measurements. Applying the F-score equation to the two displayed macro values would answer a different aggregation question.
Experiments and results
The benchmarks cover different tagging tasks
IJCNLP contains 40,408 tokens across 1,097 sentences, with 1,115 unique named entities. Its label inventory includes people, organizations and locations, as well as designations, times and numbers. The paper describes it as the first publicly available Urdu dataset of this kind. It is also one of the corpora in which the authors oversampled the designation class. Its combination of a relatively small annotated collection and a broader inventory makes equal weighting of entity classes particularly relevant when reading the results.
The Jahangir corpus contains 31,860 tokens, 1,315 sentences and 1,526 unique named entities. It includes dates and times alongside the shared categories of person, organization and location. A label inventory that distinguishes dates from times gives the tagger additional decisions to make on expressions outside the core name categories. The Jahangir and IJCNLP results therefore refer to different groups of classes even when they use the same architecture and the same split proportions.
MKPUCIT is an extension of the KPU-NE corpus and draws on Newslink.pk. It contains 926,776 tokens, 36,215 sentences and 99,718 unique named entities. The annotation covers the three shared categories of person, organization and location. The authors describe the collection as distinct in size, domains, categories and distribution. Its size gives the networks a different training setting from the other benchmarks. Its narrower category inventory also means a macro average there covers fewer kinds of classification decisions.
UNER contains 48,673 tokens across 1,744 sentences and has 4,621 unique named entities. It draws on BBC Urdu news and covers seven types, including dates, times, numbers and designations in addition to people, locations and organizations. The authors describe it as well structured and requiring little preparation, although they did oversample its designation class. The combination of varied labels and a relatively orderly corpus is worth keeping in mind when interpreting its strong results.
For each dataset, the plain LSTM and BiLSTM supply internal baselines for the additions of GRU and CRF. Those comparisons come from the authors’ own experimental setup. A separate comparison places the authors’ selected configurations alongside earlier published results on the corresponding benchmarks. The named dataset is shared within each of those comparisons. The paper describes the new runs with its own preprocessing, split and averaging procedure, so the earlier reported numbers are best read as published benchmarks associated with the dataset.
IJCNLP and Jahangir
On the IJCNLP test split, BiLSTM-GRU with Floret achieves macro precision of 0.96, recall of 0.97 and an F-score of 0.97. With FastText, the same architecture reports precision of 0.97, recall of 0.93 and an F-score of 0.95. The highest FastText F-score in the authors’ IJCNLP comparison is 0.96 from the plain BiLSTM. The top result on this corpus therefore combines a representation change and a recurrent extension that is helpful with that representation. The FastText result shows why the performance of the extension needs to be read in context.
For IJCNLP, the authors’ comparison with earlier work lists a Word2vec recurrent network and a BiLSTM with convolutional character features at 0.65 F-score each. A forward recurrent system with Txt2vec is listed at 0.61. The authors describe a 32% F-score improvement on IJCNLP in their comparison. The F-scores themselves are the clearest basis for reading the scale of the reported result, as they identify the exact values placed side by side on this benchmark.
Urdu tagging systems compared on IJCNLP F-score
The Floret configuration leads the earlier results listed for this benchmark.
The numbers
| System or setting | F-score |
|---|---|
| Recurrent network with Word2vec | 0.65 |
| LSTM with forward recurrence and Txt2vec | 0.61 |
| BiLSTM-CNN with Word2vec and character features | 0.65 |
| BiLSTM-GRU with Floret (this paper) | 0.97 |
The Jahangir test results show more ties at the top. BiLSTM-GRU with Floret reaches macro precision of 0.95, recall of 0.97 and an F-score of 0.96. Floret paired with either the plain BiLSTM or BiLSTM-CRF also reaches 0.96 F-score. The plain BiLSTM with FastText reaches the same F-score. The GRU configuration appears in the authors’ comparison with previous work and in their error analysis, but more than one configuration reaches the highest displayed score. Macro precision and recall supply additional details about settings that share the same F-score.
BiLSTM-CRF on Jahangir illustrates the importance of comparing the embedding families within the same architecture. With FastText it reports macro precision of 0.88 and macro recall and F-score of 0.79. The Floret version reports macro precision of 0.95, recall of 0.97 and F-score of 0.96. The simpler BiLSTM reaches 0.96 F-score with either representation. For these runs, the span of results for the CRF combination is wider than the span for the simpler architecture. The result makes the embedding choice consequential for one setting even when it makes little difference to the reported F-score for another.
Macro F-score on Jahangir with and without CRF
The bidirectional CRF configuration differs across embeddings while the plain bidirectional network ties.
The numbers
| System or setting | Macro F-score |
|---|---|
| FastText BiLSTM | 0.96 |
| FastText BiLSTM-CRF | 0.79 |
| Floret BiLSTM | 0.96 |
| Floret BiLSTM-CRF | 0.96 |
| Floret BiLSTM-GRU (this paper) | 0.96 |
For Jahangir, the earlier Txt2vec recurrent system is listed at 0.80 F-score. A bidirectional GRU with convolutional character features and Word2vec reports 0.84 in the comparison. The selected Floret and BiLSTM-GRU configuration is listed at 0.96. The paper describes a 12% improvement in F-score for the benchmark. The comparison indicates how the authors’ full pipeline fares against the published systems they selected. It combines changes in the word input, the recurrent architecture and the way the data are prepared.
MKPUCIT and UNER
On the MKPUCIT test split, BiLSTM-GRU achieves macro precision of 0.97, recall of 0.98 and F-score of 0.98 with FastText. With Floret, the same architecture reports 0.83 precision, 0.86 recall and 0.85 F-score. A straightforward LSTM and an LSTM-CRF both reach 0.97 F-score with FastText. The plain BiLSTM with Floret also reaches 0.85 F-score. The same embedding family leads with every matched architecture on this dataset, making the MKPUCIT result broader than an isolated win for the selected configuration.
Macro F-score on MKPUCIT by embedding and bidirectional architecture
FastText leads in each matched comparison and reaches the highest score with the GRU layer.
The numbers
| System or setting | Macro F-score |
|---|---|
| Floret BiLSTM | 0.85 |
| FastText BiLSTM | 0.96 |
| Floret BiLSTM-CRF | 0.50 |
| FastText BiLSTM-CRF | 0.91 |
| Floret BiLSTM-GRU | 0.85 |
| FastText BiLSTM-GRU (this paper) | 0.98 |
The earlier MKPUCIT results listed by the authors include a recurrent network at 0.77 F-score with Word2vec. An attention-based BiLSTM-CRF reports 0.93 with Word2vec, 0.92 with FastText and 0.91 with GloVe. These scores give the earlier system its own embedding comparison, with a different ordering of the resources than the ordering seen in the new system. Against the published scores in the table, the authors report a 5% improvement in F-score for their FastText and BiLSTM-GRU result.
On the UNER test split, BiLSTM-GRU with Floret reports macro precision of 0.97, recall of 0.99 and F-score of 0.98. The other Floret architectures all report an F-score of 0.97. With FastText, the plain BiLSTM reaches 0.97, and the BiLSTM-GRU reports 0.95. The authors’ observation about tightly grouped UNER performance corresponds especially well to the Floret runs. The comparison across embeddings still contains cases where the simpler recurrent architecture equals or leads the extended one.
The earlier UNER results in the paper’s comparison are 0.81 F-score for a forward recurrent architecture using Txt2vec and 0.87 for a bidirectional GRU with convolution and Word2vec. The authors report an 11% improvement in F-score for their selected Floret configuration. As on the other corpora, those earlier systems offer a point of comparison for the result. The internal experiments, with a common experimental setup, offer the more direct comparison for deciding whether adding a particular layer helps.
The selected UNER and MKPUCIT systems share the headline test F-score of 0.98. They achieve it with different embeddings and on different label inventories. The corresponding precision and recall values give a fuller picture, as do the results of the simpler architectures on each corpus. Reporting just the peak would hide the fact that a plain bidirectional system comes close on UNER and that the alternative embedding is much weaker on MKPUCIT. The paper’s full set of runs reveals both patterns.
What the errors look like
For each corpus the authors draw a confusion matrix for the selected configuration on the test data. A confusion matrix cross-tabulates the annotated label and predicted label, making it possible to see which classes are mistaken for which others. They report token classification error rates of 3.63% for IJCNLP, 1.52% for Jahangir, 1.74% for MKPUCIT and 1.24% for UNER. The test-token error rate describes the frequency of wrong token classifications. The macro F-score describes performance averaged over entity types, which gives infrequent types equal weight.
Two domain experts examined the errors manually. They found training examples too sparse for some uncommon entities, difficulties with single-letter tokens and abbreviations, trouble with words from other languages, incorrect tokenization, ambiguous names extending across several words, and errors in the training labels. These categories point to different sources of failure. A weak representation can contribute to an error on an unfamiliar name. If the input is segmented incorrectly, the recognizer can receive the wrong pieces of the name. A mistaken training label can teach it an incorrect association even when it has received the intended token.
The paper describes Yar Khan as a person misclassified as a location. The authors connect this to the presence of Rahim Yar Khan, the name of a city, in the data. The example illustrates how shared words can pull predictions in the wrong direction even though sharing information across forms is one reason to use embeddings. In a correctly labeled sentence, the evidence for a person has to outweigh the association suggested by the longer place name. Access to neighboring words gives the system a means of making that distinction, and the example records a case where its prediction still went wrong.
The analysis describes other errors where part of a name suggests a category different from that of the complete expression. Peshawar is a valid place name, but the mention Peshawar University denotes an organization. The authors found the city component classified as a location inside the university name. They also describe a person label assigned to the first part of Islamabad and an organization, Peoples Party, confused with a person. The confusion matrices bring together such disagreements at the label level. The examples show why an apparently clear local word cue can make the full mention harder to classify.
What the ablations show
Testing architecture changes against a plain recurrent layer
The paper supplies controlled comparisons of embeddings and recurrent configurations, loss curves for the selected runs, and a manual error analysis, with no separate ablation that removes sub-word information or disables an individual gate. The comparisons answer how the selected components behave in the tested pipeline. Because the experiments start from plain LSTM and BiLSTM, they let a reader follow the effect of adding either recurrent processing or joint sequence decoding within a corpus and embedding condition.
IJCNLP with Floret is a case where the changes line up in the same direction. Its plain LSTM reports a test macro F-score of 0.95, its plain BiLSTM reaches 0.96, and its BiLSTM-GRU reaches 0.97. The bidirectional input makes both sides of a word available, and the added GRU performs another pass over the learned representations. The sequence of scores is consistent with a benefit from those changes in this setting. The experiment does not trace which particular words, contexts or stretches of sentence account for it.
Changing the starting representation changes that pattern. On IJCNLP with FastText, the plain BiLSTM reports a macro F-score of 0.96 and the BiLSTM-GRU reports 0.95. On UNER with the same embedding, the plain bidirectional version reaches 0.97 and the version with GRU reports 0.95. Meanwhile, MKPUCIT with FastText gives the GRU extension its strongest result. BiLSTM-GRU is the architecture common to the selected configurations, while the internal comparisons show that adding a GRU to a given bidirectional tagger has a result that depends on the corpus and input representation.
Joint label decoding also has a conditional effect. On MKPUCIT with FastText, a plain BiLSTM reaches a test macro F-score of 0.96, and the CRF extension reports 0.91. With Floret, the corresponding F-scores are 0.85 and 0.50. On IJCNLP with Floret, both the plain and CRF-extended BiLSTM report 0.96. On Jahangir with Floret, those settings both report 0.96 again, even though their displayed precision and recall differ. The experiments show that the ability to model tag transitions does not by itself guarantee a higher measured score.
The authors suggest that the GRU combination is simpler because it dispenses with CRF decoding. They connect that design to shorter training and suitability for the largest benchmark. The F-scores on MKPUCIT favor BiLSTM-GRU among the tested configurations using FastText. A runtime explanation would require timing or resource measurements under matched training conditions. Similarly, the performance drop for some CRF settings identifies where the alternative performed poorly, while leaving open whether the result arose from the representations, tuning or the interaction of the layers.
Changing the embedding changes the outcome
The fairest embedding comparison within the experiment holds the corpus and recurrent architecture fixed. BiLSTM-GRU then favors Floret on IJCNLP, Jahangir and UNER, and it favors FastText on MKPUCIT. Floret is part of the selected configuration on most of the benchmarks, and the strongest MKPUCIT result belongs to FastText. The paper’s broad description of Floret as the best choice for automatic features needs that qualification from its own results. Even within the same corpus, the benefit of the embedding can change with the recurrent architecture.
Both embeddings represent character sequences. The comparison therefore tests two complete pretrained representations with different storage approaches. It cannot isolate the contribution of character information relative to whole-word representations. Earlier results involving Word2vec, Txt2vec or character features show how other systems performed, but those comparisons also change the architecture or the evaluation procedure. They cannot determine how much of the gain would remain if the embedding alone were exchanged in the authors’ pipeline.
The n-gram tuning provides a narrower observation. The authors report trying several window sizes and choosing five. They do not present the score at each size or show whether different corpora prefer different values. That supports the selection as a reported setting, with the shape of the response to the window size left open. It is also hard to establish from the aggregate results whether five improved the encoding of rare affixes, captured longer spelling patterns, or happened to work well with the other settings in use.
Loss curves and error cases offer different checks
The authors plot training and validation loss for the selected configuration on each corpus. These curves track the objective being optimized during fitting and its behavior on validation data. A comparison with curves from other architectures would be needed to judge whether the same training pattern is specific to the selected settings. As presented, the plots document those runs. Their role differs from the test F-scores, which describe tagging performance on the test partition after training.
The confusion matrices and manual review reveal distinctions that the aggregate scores conceal. Useful neighboring words can help the tagger assign a location to Iqbal Park, while a place word inside Peshawar University can still draw a location label away from the full organization. The examples concern contextual ambiguity and boundary decisions. They do not isolate which layer contributed to the correct or incorrect outcome. The review is most informative about where mistakes remain visible after the authors choose a high-scoring architecture.
The expert review also puts data problems beside prediction problems. An abbreviation fragmented by tokenization presents a different obstacle from a familiar spelling used in an ambiguous sentence. An incorrect training label presents a different obstacle again. The paper identifies examples of those mechanisms but gives no frequency breakdown by cause. The available evidence supports the existence of several recurring difficulties and identifies concrete cases, while their relative contribution to the reported error rates remains unresolved.
Limitations
Limits the authors identify
The authors caution that Floret is likely to work best for entities that resemble forms encountered during pretraining. A sub-word system can supply a vector for a spelling by drawing on its component sequences. Assigning the correct entity class requires that those components and the surrounding text contain evidence the tagger has learned to use. An unfamiliar name can share character patterns with several categories or occur in a context unlike the training examples. The paper’s own error review finds sparse training representation for uncommon names.
The authors also distinguish within-corpus testing from testing in a new domain. Their corpora are drawn from news sources and can contain material on several subjects. A training and test split taken from one corpus can include familiar names and similar contexts on both sides. The authors point out that the test partition may therefore give the recognizer little exposure to genuinely unseen entities. A corpus with diverse subject matter can still be an easier transfer setting than training on one set of domains and testing on a wholly different one.
Their proposed next steps respond to those limits. They discuss augmenting the data, exploring embeddings tailored to domains, combining several pretrained embeddings and using larger, more varied training collections. They also propose building a cross-domain Urdu benchmark with material from areas such as history, science and sports, along with a broader inventory of entities. These are plans described in the conclusion. The study’s measurements come from the four existing benchmarks and their reported splits.
A further limitation emerges in the reported examples. The authors’ approach is intended to reduce problems with spelling variation, compounds, abbreviations and contextual ambiguity. The annotation and preprocessing have to support those distinctions in the first place. Their manual review catches some segmentation and labeling problems, including in the training material. The reported error rates therefore reflect the complete pipeline, including the quality and conventions of the data on which it was trained and assessed.
Limits visible in the evaluation
The headline results compare systems trained and evaluated within each corpus. The paper does not report a split that separates entities by identity, a test grouped by whether a name is absent from the training data, or a test grouped by whether the pretrained embeddings encountered related forms. An annotated name could be uncommon in supervised training while still being familiar to a pretrained embedding. Conversely, a name can be representable through its character sequences while remaining difficult to type. The aggregate metrics cannot distinguish these cases.
The comparison with earlier work is informative about published scores, with more limited support for causal claims. A shared benchmark name gives the comparison a common point of reference. The earlier systems and the new runs differ in their representation, architecture or documented evaluation procedure. Some earlier studies reviewed in the paper used cross-validation, while the new experiments have a specified train, test and validation split. The paper does not establish that every earlier result was obtained by rerunning the system on the new partitions and preprocessing. The improvement figures are thus comparisons with listed results, and the evidence for the value of individual changes comes from the internal experiments.
The paper reports point estimates and describes gains over earlier systems as significant. It leaves variation across random seeds, alternative splits and training runs unmeasured in the results it presents. That matters particularly for runs with equal displayed scores or closely spaced scores. Jahangir is a direct example because several configurations reach the same reported macro F-score. The table supports identifying them as tied at the reported precision. It gives no basis for assigning a reliable advantage to the selected setting across repeated training runs.
Details of data preparation also limit reproducibility and the interpretation of the test scores. Oversampling increases how frequently the designation class appears, and the paper identifies the corpora where it was used. The description does not specify the timing of replication relative to partitioning or how related examples were grouped across the partitions. That detail would determine whether all copies stay on the training side and whether the test partition preserves its original distribution. The reported procedure leaves that implementation detail open, with no basis for claiming from the scores that copies crossed a partition.
The token-level evaluation leaves a gap between the scores and some of the paper’s motivating examples. A token can receive the right category even when another token in the same mention receives the wrong one. For an application that needs complete names, an exact match on the full span and its category would answer a more direct question. The paper reports aggregate class scores and analyzes token confusions. It does not give a separate result for complete span recovery or for entities of different lengths. Its examples establish that boundaries matter, while the published scores give limited detail about where boundaries were recovered correctly.
Nested mentions raise a stronger version of this issue. The paper discusses location words inside organization names and describes embeddings as a way to address the resulting ambiguity. The implemented system produces a sequence of token labels. The description gives no encoding or separate evaluation for recovering both an inner mention and an overlapping outer mention. Successfully labeling a city word as part of a larger organization is a meaningful task within a flat sequence. Establishing recovery of both entities would require annotations and scoring that preserve the overlap. The experiments give evidence about the flat tagging decisions and leave the overlapping case open.
The authors suggest that UNER’s tight scores with Floret indicate that it is the best balanced corpus. Similar performance across architectures can also arise from cleaner annotation, more consistent sentence structure or easier examples within the classes a corpus contains. Aggregate test scores do not establish how many examples each class has or how consistently each is recognized. The paper says designation was oversampled in UNER, making it especially useful to distinguish the balance of the original corpus from the balance of the material presented during training.
The experiments also leave efficiency claims unquantified. The paper describes Floret’s compact storage and the absence of a separate CRF decoding stage in BiLSTM-GRU. It reports the training hardware and tagging outcomes. A measured memory or timing comparison for the actual Urdu runs would be needed to determine the cost of exchanging the embeddings or adding each prediction layer in this setup. In the reported evaluation, the reason to prefer one configuration on a given benchmark is its measured tagging result, with storage and training cost discussed as properties of the design.
Taken together, the measures support a specific finding about prepared Urdu benchmark data. A recurrent tagger supplied with pretrained sub-word representations can achieve high macro F-scores, and the preferred representation differs across corpora. The harder claims concern unfamiliar names, new domains, and recovery of complete or overlapping mentions. The paper identifies those problems through its motivation, examples and future plans, while its experiments quantify performance on the annotated label sequences of the selected benchmarks.
What came after
No later citing study is available to trace how other researchers used the paper’s approach. The authors’ proposed cross-domain benchmark and experiments with broader training data describe directions for future research. Whether later work carried out those proposals or reused the FastText and Floret comparison remains open.
Cite
Cite as Rimsha Anam, Muhammad Waqas Anwar, Muhammad Hasan Jamal, Usama Ijaz Bajwa, Isabel de la Torre Díez, Eduardo Silva Alvarado, Emmanuel Soriano Flores and Imran Ashraf. 2024. A deep learning approach for Named Entity Recognition in Urdu language. PLoS ONE.
@inproceedings{anam2024deep,
title = {{A deep learning approach for Named Entity Recognition in Urdu language}},
author = {Rimsha Anam, Muhammad Waqas Anwar, Muhammad Hasan Jamal, Usama Ijaz Bajwa, Isabel {de la Torre Díez}, Eduardo Silva Alvarado, Emmanuel Soriano Flores and Imran Ashraf},
booktitle = {PLoS ONE},
year = {2024},
doi = {10.1371/journal.pone.0300725},
url = {https://doi.org/10.1371/journal.pone.0300725}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/anam-2024-deep-learning-approach-named-entity/