code: def test_build_tag_id_dict():
      message_1 = Message.build(
          text="Germany is part of the European Union", intent="inform"
      )
      message_1.set(
          BILOU_ENTITIES,
          [
              "U-location",
              "O",
              "O",
              "O",
              "O",
              "B-organisation",
              "L-organisation",
          ],
      )
  
      message_2 = Message.build(
          text="Berlin is the capital of Germany", intent="inform"
      )
      message_2.set(
          BILOU_ENTITIES,
          ["U-location", "O", "O", "O", "O", "U-location"],
      )
  
      training_data = TrainingData([message_1, message_2])
  
      tag_id_dict = bilou_utils.build_tag_id_dict(training_data)
  
      assert tag_id_dict == {
          "O": 0,
          "B-location": 1,
          "I-location": 2,
          "L-location": 3,
          "U-location": 4,
          "B-organisation": 5,
          "I-organisation": 6,
          "L-organisation": 7,
          "U-organisation": 8,
      }
  
file_path: rasa/tests/nlu/utils/test_bilou_utils.py
imports: import logging
  from typing import Text, List, Optional
  from _pytest.logging import LogCaptureFixture
  import pytest
  from rasa.nlu.tokenizers.whitespace_tokenizer import WhitespaceTokenizer
  import rasa.nlu.utils.bilou_utils
  from rasa.nlu.constants import BILOU_ENTITIES
  from rasa.shared.nlu.constants import ENTITIES
  from rasa.shared.nlu.training_data.training_data import TrainingData
  from rasa.shared.nlu.training_data.message import Message
label_desc: Use image node_id 4 for calling a global function with example usage: test_build_tag_id_dict() without return types