code: def replace_semicolons(sentences):
      """
      Spanish GSD and AnCora have different standards for semicolons.
  
      GSD has semicolons at the end of sentences, AnCora has them in the middle as clause separators.
      Consecutive sentences in GSD do not seem to be related, so there is no combining that can be done.
      The easiest solution is to replace sentence final semicolons with "." in GSD
      """
      new_sents = []
      count = 0
      for sentence in sentences:
          for text_idx, text_line in enumerate(sentence):
              if text_line.startswith("# text"):
                  break
          else:
              raise ValueError(
                  "Expected every sentence in GSD to have a # text field"
              )
          if not text_line.endswith(";"):
              new_sents.append(sentence)
              continue
          count = count + 1
          new_sent = list(sentence)
          new_sent[text_idx] = text_line[:-1] + "."
          new_sent[-1] = new_sent[-1].replace(";", ".")
          count = count + 1
          new_sents.append(new_sent)
      print(
          "Updated %d sentences to replace sentence-final ; with ."
          % count
      )
      return new_sents
  
imports: import argparse
  import glob
  import os
  import random
  import re
  import tempfile
  from collections import Counter
  from stanza.models.common.constant import treebank_to_short_name
  import stanza.utils.datasets.common
  from stanza.utils.datasets.common import read_sentences_from_conllu, write_sentences_to_conllu, INT_RE, MWT_RE, MWT_OR_COPY_RE
  import stanza.utils.datasets.tokenization.convert_ml_cochin
  import stanza.utils.datasets.tokenization.convert_my_alt
  import stanza.utils.datasets.tokenization.convert_vi_vlsp
  import stanza.utils.datasets.tokenization.convert_th_best
  import stanza.utils.datasets.tokenization.convert_th_lst20
  import stanza.utils.datasets.tokenization.convert_th_orchid
label_desc: Use image node_id 29 for calling a global function with example usage: replace_semicolons(sentences) and returns: new_sents