code: def read_ner_from_tsv(filename: str) -> List[SpacyNerExample]:
      """
      Reads BIO formatted NER data from a TSV file, such as the
      NER data found here:
      https://github.com/cambridgeltl/MTL-Bioinformatics-2016
  
      Data is expected to be 2 tab seperated tokens per line, with
      sentences denoted by empty lines. Sentences read by this
      function will be already tokenized, but returned as a string,
      as this is the format required by SpaCy. Consider using the
      WhitespaceTokenizer(scispacy/util.py) to split this data
      with a SpaCy model.
  
      Parameters
      ----------
      filename : str
          The path to the tsv data.
  
      Returns
      -------
      spacy_format_data : List[SpacyNerExample]
          The BIO tagged NER examples.
      """
      spacy_format_data = []
      examples: List[Tuple[str, str]] = []
      for line in open(cached_path(filename)):
          line = line.strip()
          if line.startswith("-DOCSTART-"):
              continue
          # We have reached the end of a sentence.
          if not line:
              if not examples:
                  continue
              spacy_format_data.append(_handle_sentence(examples))
              examples = []
          else:
              word, entity = line.split("\t")
              examples.append((word, entity))
      if examples:
          spacy_format_data.append(_handle_sentence(examples))
  
      return spacy_format_data
  
file_path: scispacy/scispacy/data_util.py
imports: from typing import Optional, NamedTuple, List, Iterator, Dict, Tuple
  import tarfile
  import atexit
  import os
  import shutil
  import tempfile
  from scispacy.file_cache import cached_path
label_desc: Use image node_id 7 for calling a global function with example usage: read_ner_from_tsv(filename) and returns: spacy_format_data