Part-of-speech tagging

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.

What is this module?

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.

Tool: Part-of-speech tagging

Runs in your browser (JavaScript) — your text is not sent anywhere
Settings

How does the tool work?

  • Look up the tag dictionary after normalization.
  • If the word is not found: try separating clitics, then look up the stem.
  • Morphological cues: tanween and the definite article indicate a noun; imperfect prefixes (ي، ت، ن) with a suitable length indicate a verb, as do past-tense suffixes (وا، ت، نا).
  • A word after a preposition is treated as a noun in the genitive.
  • Each tag comes with the rule that produced it and the confidence level.

How to read the results?

"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.

Algorithms and methods

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.

Limitations and accuracy limits

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.

Frequently asked questions

What is part-of-speech (POS) tagging?

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.

What tag set does the lab use?

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.

How does tagging work in the lab?

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.

What is the difference between rule-based and statistical tagging?

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.

What is the HMM model in part-of-speech tagging?

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.

Why does tagging make mistakes with undiacritized words?

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.

What is the difference between PROPN and NOUN?

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.

What does ADP mean in the tags?

ADP (Adposition) covers the Arabic prepositions such as في, من, إلى and على, and the adverbs that act like them in some corpora.

Can the tag dictionary be improved?

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.

What real tools are used to tag Arabic?

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.

Exercises and challenges

Beginner Hands-on in the lab

Tagging a verbal sentence

Tag «كتب الطالب الدرس في المكتبة» with the tool, and compare with the correct answer.

Hint

UPOS.

Show solution

كتب/VERB الطالب/NOUN الدرس/NOUN في/ADP المكتبة/NOUN ./PUNCT

Beginner Computing by hand

Manual tagging

Assign UPOS tags by hand to «هو لم يذهب إلى الجامعة».

Hint

«لم» is a negation particle.

Show solution

هو/PRON لم/PART يذهب/VERB إلى/ADP الجامعة/NOUN

Intermediate Hands-on in the lab

One word with two tags

Load the "Words with ambiguous tags" example. Did the tool distinguish the first «ذهب» from the second? What evidence did it use?

Hint

Look at the "Source" column.

Show solution

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.

Intermediate Conceptual question

HMM and Viterbi

What two pieces of information does an HMM learn from a tagged corpus?

Hint

Two kinds of probabilities.

Show solution

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.

Advanced Computing by hand

Tagging accuracy

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?

Hint

Accuracy = correct / total.

Show solution

The overall accuracy is 94%. On unknown words 7/10 = 70%, and on known words 40/40 = 100%.

Intermediate Hands-on in the lab

Extending the dictionary

Write a sentence with a word that the lab tags X (unknown). How can an administrator fix this without changing the code?

Hint

The lexicons panel.

Show solution

By adding the word and its tag to the pos lexicon from the admin panel, or by importing a CSV.

Beginner Conceptual question

PROPN in Arabic

Why are proper names harder to identify in Arabic than in English?

Hint

Think of the shape of the letters.

Show solution

Because Arabic has no capital letters, and many proper names are also common words (كريم, أمل, سعيد).

Related sections of the site