code: def clean_line(line):
      line = line.replace("html>", "html|>")
      # news_00089.txt
      line = line.replace("<NER>", "<NE>")
      line = line.replace("</NER>", "</NE>")
      # specific error that occurs in encyclopedia_00095.txt
      line = line.replace("</AB>Penn", "</AB>|Penn>")
      # news_00058.txt
      line = line.replace(
          "<AB>จม.</AB>เปิดผนึก", "<AB>จม.</AB>|เปิดผนึก"
      )
      # news_00015.txt
      line = re.sub(
          "<NE><AB>([^|<>]+)</AB>([^|<>]+)</NE>", "\\1|\\2", line
      )
      # news_00024.txt
      line = re.sub("<NE><AB>([^|<>]+)</AB></NE>", "\\1", line)
      # news_00055.txt
      line = re.sub(
          "<NE>([^|<>]+)<AB>([^|<>]+)</AB></NE>", "\\1|\\2", line
      )
      line = re.sub(
          "<NE><AB>([^|<>]+)</AB><AB>([^|<>]+)</AB></NE>",
          "\\1|\\2",
          line,
      )
      line = re.sub(
          "<NE>([^|<>]+)<AB>([^|<>]+)</AB> <AB>([^|<>]+)</AB></NE>",
          "\\1|\\2|\\3",
          line,
      )
      # news_00008.txt and other news articles
      line = re.sub("</AB>([0-9])", "</AB>|\\1", line)
      line = line.replace("</AB> ", "</AB>|")
      line = line.replace("<EM>", "<POEM>")
      line = line.replace("</EM>", "</POEM>")
      line = line.strip()
      return line
  
file_path: stanza/stanza/utils/datasets/tokenization/convert_th_best.py
imports: import glob
  import os
  import random
  import re
  import sys
  from stanza.utils.datasets.tokenization.process_thai_tokenization import reprocess_lines, write_dataset, convert_processed_lines, write_dataset_best, write_dataset
label_desc: Use image node_id 1 for calling a global function with example usage: clean_line(line) and returns: line