flan-t5-token-ner / README.md
pepegiallo's picture
Update README.md
cc5f6e8 verified

A newer version of the Gradio SDK is available: 5.29.0

Upgrade
metadata
title: Flan T5 Token Ner
emoji: πŸ“š
colorFrom: red
colorTo: gray
sdk: gradio
sdk_version: 5.23.3
app_file: app.py
pinned: false
license: mit
short_description: Classifies each token in the input text as LOC, ORG, PER, or

Flan-T5 Token Classifier (NER Demo)

This Huggingface Space is a Gradio demo for the model pepegiallo/flan-t5-base_ner. It performs token-level Named Entity Recognition (NER) using a Flan-T5 encoder-based architecture.


πŸ” What does this demo do?

You can enter any sentence, and the app will:

  1. Split the sentence into tokens (words and punctuation)
  2. For each token:
    • Mark it with <TSTART> and <TEND> in the context of the sentence
    • Send it through the model with the prompt: classify token in: <wrapped sentence>
  3. Predict one of the following labels for each token:
    • PER β€” Person
    • ORG β€” Organization
    • LOC β€” Location
    • O β€” Not an entity

🧠 Example

Input:

Max Mustermann works at Microsoft and lives in Berlin.

Output:

Max         -> PER
Mustermann  -> PER
Microsoft   -> ORG
Berlin      -> LOC

πŸ“¦ Model Details

  • Base model: google/flan-t5-base (encoder only)
  • Fine-tuned on: WikiANN, open-pii-masking-500k, and custom samples
  • Prompt-based classification per token
  • Architecture: T5 encoder + classification head

πŸš€ Try it out!

Type any sentence in English, German, French, Italian or Spanish, and the model will tag names, organizations, and locations.

For more details, check the full model card: πŸ‘‰ pepegiallo/flan-t5-base_ner