code: def test_bmes_tags_to_spans_extracts_correct_spans_without_labels(
      self,
  ):
      # Good transitions.
      tag_sequence = ["B", "M", "E", "B", "E", "S"]
      spans = span_utils.bmes_tags_to_spans(tag_sequence)
      assert set(spans) == {("", (0, 2)), ("", (3, 4)), ("", (5, 5))}
  
      tag_sequence = ["S", "B", "E", "S"]
      spans = span_utils.bmes_tags_to_spans(tag_sequence)
      assert set(spans) == {("", (0, 0)), ("", (1, 2)), ("", (3, 3))}
  
      # Invalid transitions.
      tag_sequence = ["B", "B", "E"]
      spans = span_utils.bmes_tags_to_spans(tag_sequence)
      assert set(spans) == {("", (0, 0)), ("", (1, 2))}
  
      tag_sequence = ["B", "S"]
      spans = span_utils.bmes_tags_to_spans(tag_sequence)
      assert set(spans) == {("", (0, 0)), ("", (1, 1))}
  
      tag_sequence = ["M", "B", "E"]
      spans = span_utils.bmes_tags_to_spans(tag_sequence)
      assert set(spans) == {("", (0, 0)), ("", (1, 2))}
  
      tag_sequence = ["B", "M", "S"]
      spans = span_utils.bmes_tags_to_spans(tag_sequence)
      assert set(spans) == {("", (0, 1)), ("", (2, 2))}
  
      tag_sequence = ["B", "E", "M", "E"]
      spans = span_utils.bmes_tags_to_spans(tag_sequence)
      assert set(spans) == {("", (0, 1)), ("", (2, 3))}
  
      tag_sequence = ["B", "E", "E"]
      spans = span_utils.bmes_tags_to_spans(tag_sequence)
      assert set(spans) == {("", (0, 1)), ("", (2, 2))}
  
      tag_sequence = ["S", "M"]
      spans = span_utils.bmes_tags_to_spans(tag_sequence)
      assert set(spans) == {("", (0, 0)), ("", (1, 1))}
  
      tag_sequence = ["S", "E"]
      spans = span_utils.bmes_tags_to_spans(tag_sequence)
      assert set(spans) == {("", (0, 0)), ("", (1, 1))}
  
file_path: allennlp/tests/data/dataset_readers/dataset_utils/span_utils_test.py
imports: from typing import List
  import pytest
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.data.dataset_readers.dataset_utils import span_utils
  from allennlp.data.tokenizers import Token, SpacyTokenizer
label_desc: Use image node_id 12 for calling the SpanUtilsTest obj's underlying member method code with example usage: obj.test_bmes_tags_to_spans_extracts_correct_spans_without_labels() without return types