Spaces:
Runtime error
Runtime error
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 `<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`](https://huggingface.co/pepegiallo/flan-t5-base_ner) | |