docs: def _prep_tags(t, annotations):
      """Apply IOB chemical entity tags and POS tags to text."""
      tags = [['O' for _ in sent.tokens] for sent in t.sentences]
      for start, end, text in annotations:
          done_first = False
          for i, sent in enumerate(t.sentences):
              for j, token in enumerate(sent.tokens):
                  if start <= token.start < end or start < token.end <= end:
                      # Token start or end occurs within the annotation
                      tags[i][j] = 'I-CM' if done_first else 'B-CM'
                      done_first = True
      tagged = [[(token[0], token[1], tags[i][j]) for j, token in enumerate(sentence.pos_tagged_tokens)] for i, sentence in enumerate(t.sentences)]
      return tagged