pepegiallo commited on
Commit
cc5f6e8
Β·
verified Β·
1 Parent(s): 3ada68a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +55 -1
README.md CHANGED
@@ -11,4 +11,58 @@ license: mit
11
  short_description: Classifies each token in the input text as LOC, ORG, PER, or
12
  ---
13
 
14
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  short_description: Classifies each token in the input text as LOC, ORG, PER, or
12
  ---
13
 
14
+ # Flan-T5 Token Classifier (NER Demo)
15
+
16
+ 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.
17
+
18
+ ---
19
+
20
+ ## πŸ” What does this demo do?
21
+
22
+ You can enter any sentence, and the app will:
23
+
24
+ 1. Split the sentence into tokens (words and punctuation)
25
+ 2. For each token:
26
+ - Mark it with `<TSTART>` and `<TEND>` in the context of the sentence
27
+ - Send it through the model with the prompt: `classify token in: <wrapped sentence>`
28
+ 3. Predict one of the following labels for each token:
29
+ - `PER` β€” Person
30
+ - `ORG` β€” Organization
31
+ - `LOC` β€” Location
32
+ - `O` β€” Not an entity
33
+
34
+ ---
35
+
36
+ ## 🧠 Example
37
+
38
+ Input:
39
+ ```
40
+ Max Mustermann works at Microsoft and lives in Berlin.
41
+ ```
42
+
43
+ Output:
44
+ ```
45
+ Max -> PER
46
+ Mustermann -> PER
47
+ Microsoft -> ORG
48
+ Berlin -> LOC
49
+ ```
50
+
51
+ ---
52
+
53
+ ## πŸ“¦ Model Details
54
+
55
+ - **Base model:** `google/flan-t5-base` (encoder only)
56
+ - **Fine-tuned on:** WikiANN, open-pii-masking-500k, and custom samples
57
+ - **Prompt-based classification** per token
58
+ - **Architecture:** T5 encoder + classification head
59
+
60
+ ---
61
+
62
+ ## πŸš€ Try it out!
63
+
64
+ Type any sentence in English, German, French, Italian or Spanish, and the model will tag names, organizations, and locations.
65
+
66
+ For more details, check the full model card:
67
+ πŸ‘‰ [`pepegiallo/flan-t5-base_ner`](https://huggingface.co/pepegiallo/flan-t5-base_ner)
68
+