POS Tagging Process Flow

flowchart TD
    Start([Input: Tokenized sentence]):::io
    Init[Initialize: Load POS tag probabilities]:::prob
    ForEach[For each word in sequence]:::prob
    Lookup[Lookup word in vocabulary]:::prob
    Known{Word known?}:::decision
    UseProb[Use trained probabilities]:::prob
    Unknown[Apply unknown word heuristics]:::unknown
    Assign[Assign most probable tag]:::prob
    More{More words?}:::decision
    Return[Return tagged sequence]:::io
    End([Tagged sentence ready for parsing]):::io

    Start --> Init --> ForEach --> Lookup --> Known
    Known -->|Yes| UseProb --> Assign
    Known -->|No| Unknown --> Assign
    Assign --> More
    More -->|Yes| ForEach
    More -->|No| Return --> End

    classDef io fill:#42a5f5,stroke:#0d47a1,stroke-width:2px,color:#fff,font-size:15px
    classDef prob fill:#66bb6a,stroke:#1b5e20,stroke-width:2px,color:#fff,font-size:15px
    classDef decision fill:#ffd54f,stroke:#f57f17,stroke-width:2px,color:#333,font-size:15px,font-weight:bold
    classDef unknown fill:#ab47bc,stroke:#4a148c,stroke-width:2px,color:#fff,font-size:15px

    linkStyle default stroke:#777,stroke-width:2px,font-size:14px
            
Step Color Key
Input / output
Probability calculations
Decision points
Unknown-word handling

Step Details

Hover a step to see how it works.
Example: for "show" the model holds P(VB|show)=0.65 and P(NN|show)=0.35. Given the modal context "Can you ___", the tagger selects VB.