Skip to main content

normalize_label

Function normalize_label 

Source
pub fn normalize_label(label: &str) -> String
Expand description

Normalize an entity type label: lowercase, spaces → underscores.

GLiNER is zero-shot and uses the label text in its attention, so the original label is passed to the model unchanged. This function is only used for tag storage to ensure consistent, searchable keys.

Examples: “Person” → “person”, “Law Firm” → “law_firm”, “ ORG “ → “org”