--- 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`](https://huggingface.co/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 `` and `` in the context of the sentence - Send it through the model with the prompt: `classify token in: ` 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`](https://huggingface.co/pepegiallo/flan-t5-base_ner)