Tagging a verbal sentence
Tag «كتب الطالب الدرس في المكتبة» with the tool, and compare with the correct answer.
Hint
UPOS.
Show solution
كتب/VERB الطالب/NOUN الدرس/NOUN في/ADP المكتبة/NOUN ./PUNCT
POS Tagging Lab
Color each word by its part of speech (noun, verb, adjective, particle...) using rules and a limited dictionary, with the reason for each label and the confidence level.
Part-of-Speech Tagging gives each word its grammatical category in context. We use the Universal POS tags adopted by the Universal Dependencies project: NOUN, VERB, ADJ, ADV, PRON, DET, ADP, CCONJ, SCONJ, PART, NUM, PROPN, PUNCT. Modern systems learn tagging from hand-annotated corpora (such as PADT for Arabic) with models such as CRF, BiLSTM or transformers, and their accuracy exceeds 95% on Modern Standard Arabic. The default mode here is rule-based: a dictionary of closed-class words (particles, pronouns and demonstratives) and some common words, followed by morphological cues.
"High" confidence means the word is in the dictionary, "medium" that it was found after separating a clitic, and "low" that it is a morphological cue only. Check the table to see the reason for each decision.
We always distinguish between traditional algorithms, resource-based methods and trained models. The tools on this page are traditional or lexicon-based, while trained models are explained here and run only through an external engine enabled by the site admin.
The results are approximate: without diacritics the rules cannot tell «ذهبَ» ("went", verb) from «ذهبٌ» ("gold", noun), and they do not handle foreign names or irregular verbs well. Trained models are an additional option through an external engine.
This tool's results are educational: they show how the algorithm works step by step, and they are not presented as confirmed scientific results.
Giving each word in a sentence a tag that shows its part of speech, such as noun, verb, particle, adjective and pronoun. Tagging is a basic stage for syntactic analysis and information extraction.
The universal UPOS tags from the Universal Dependencies project, such as NOUN, VERB, ADJ, ADP, PRON, CCONJ, DET, NUM, PROPN, PUNCT, PART, ADV, AUX and X, with a name for each tag.
With three layers in order: a dictionary of tagged words in the database, then form rules (for example: starts with «ال», so a noun; starts with a present-tense prefix with a verbal pattern, so a likely verb), then simple contextual rules. For each word, the source of the decision and the confidence level are shown.
Rule-based tagging uses rules written by linguists; it is transparent but has limited coverage. Statistical tagging (HMM and CRF) learns tag probabilities from a tagged corpus. Modern neural models (BiLSTM and BERT) reach very high accuracy on MSA.
The hidden Markov model assumes that the tags are a chain of hidden states and that the words are their outputs. It learns the transition probabilities between tags and the probabilities of a word appearing with a tag, then finds the best sequence with the Viterbi algorithm.
Because the same word may be a noun or a verb depending on the diacritics and the context, such as «ذهب» (gold or "went"). Simple rules do not see distant context, which is why the lab shows the tag with its confidence.
NOUN is a common noun such as «مدينة» ("city"), and PROPN is a proper noun such as «بغداد». Arabic has no capital letters to mark proper names, so the distinction relies on lists and context.
ADP (Adposition) covers the Arabic prepositions such as في, من, إلى and على, and the adverbs that act like them in some corpora.
Yes. An administrator can add words and their tags from the "Lexicons" panel or import them with a CSV file, and they appear in the tool right after the update.
Well-known tools include CAMeL Tools, Farasa, MADAMIRA, Stanford CoreNLP and Stanza. Each has a different licence and terms; see the "Libraries guide" in the lab.
Tag «كتب الطالب الدرس في المكتبة» with the tool, and compare with the correct answer.
UPOS.
كتب/VERB الطالب/NOUN الدرس/NOUN في/ADP المكتبة/NOUN ./PUNCT
Assign UPOS tags by hand to «هو لم يذهب إلى الجامعة».
«لم» is a negation particle.
هو/PRON لم/PART يذهب/VERB إلى/ADP الجامعة/NOUN
Load the "Words with ambiguous tags" example. Did the tool distinguish the first «ذهب» from the second? What evidence did it use?
Look at the "Source" column.
The first is a verb (its position at the start of the sentence and the verb dictionary), and the second, «الذهب», is a noun because of «ال». If the tool gets it wrong, that shows the limits of rules.
What two pieces of information does an HMM learn from a tagged corpus?
Two kinds of probabilities.
The probability of moving from one tag to the next P(tᵢ∣tᵢ₋₁), and the probability of the word appearing with the tag P(wᵢ∣tᵢ). Viterbi then finds the most probable sequence.
A tagger gave 47 correct tags out of 50 words. What is its accuracy? And if 10 of those words were not in the training data and it got 3 of them wrong, what is its accuracy on unknown words?
Accuracy = correct / total.
The overall accuracy is 94%. On unknown words 7/10 = 70%, and on known words 40/40 = 100%.
Write a sentence with a word that the lab tags X (unknown). How can an administrator fix this without changing the code?
The lexicons panel.
By adding the word and its tag to the pos lexicon from the admin panel, or by importing a CSV.
Why are proper names harder to identify in Arabic than in English?
Think of the shape of the letters.
Because Arabic has no capital letters, and many proper names are also common words (كريم, أمل, سعيد).
Sections
No section has this name. Press “Search” to search all site content.
Favourites
My results & certificates
My academy progressMy quiz resultsKids’ progressAcademy certificatesQuiz certificatesStart any lesson or quiz and it will show up here so you can get back to it quickly.
Settings
I am the NLP Lab assistant. Ask me about a concept, an algorithm or a dialect word, and I will answer from the lab's knowledge base, citing the sources.
It answers from the lab's knowledge base only, without an external language model and without sending your question anywhere.
The assistant can make mistakes, so check the attached sources.