code: def test_t5_s2s_ner(self):
      with open(
          os.path.join("Data", "Sequence", "reuters.json"), "rt"
      ) as fp:
          texts, labels = json.load(fp)
      raw_docs = ["".join(text) for text in texts]
      texts, annotations = finetune_to_indico_sequence(
          raw_docs, texts, labels, none_value="<PAD>"
      )
      labels = [" | ".join(x["text"] for x in a) for a in annotations]
      (
          train_texts,
          test_texts,
          train_annotations,
          test_annotations,
      ) = train_test_split(
          texts, labels, test_size=0.1, random_state=42
      )
      finetune_model = HFS2S(
          base_model=HFT5,
      )
      finetune_model.fit(train_texts, train_annotations)
      seps_included = False
      pred_correct = False
      for t, p, l in zip(
          test_texts,
          finetune_model.predict(test_texts),
          test_annotations,
      ):
          seps_included = (
              seps_included or " | " in p
          )  # check it predicts separators
          pred_correct = pred_correct or any(
              li in p for li in l.split(" | ")
          )  # at least one extraction is predicted correctly.
  
      self.assertTrue(seps_included)
      self.assertTrue(pred_correct)
  
imports: import os
  import json
  import unittest
  import numpy
  import pytest
  import tensorflow
  import joblib
  from transformers import AutoTokenizer, TFAutoModel, BertTokenizer
  from finetune import SequenceLabeler, DocumentLabeler
  from finetune.base_models import LayoutLM
  from finetune.base_models.huggingface.models import HFBert, HFElectraGen, HFElectraDiscrim, HFXLMRoberta, HFT5, HFAlbert, HFDebertaV3Base
  from finetune.target_models.seq2seq import HFS2S
  from sklearn.model_selection import train_test_split
  from finetune.encoding.sequence_encoder import finetune_to_indico_sequence
label_desc: Use image node_id 7 for calling the TestHuggingFace obj's underlying member method code with example usage: obj.test_t5_s2s_ner() without return types