flair.data.get_spans_from_bio#

flair.data.get_spans_from_bio(bioes_tags, bioes_scores=None)View on GitHub#

Decodes a sequence of BIOES/BIO tags into labeled spans with scores.

Parameters:
  • bioes_tags (list[str]) – List of predicted tags (e.g., “B-PER”, “I-PER”).

  • bioes_scores (Optional[list[float]], optional) – Confidence scores for each tag. Defaults to 1.0 if None.

Returns:

List of found spans:

(token_indices, avg_score, label_type).

Return type:

list[tuple[list[int], float, str]]