code: def json2txt(fp_json, fp_txt):
      """
      Standard NER.
      .json -> .txt
      """
      with open(fp_json, encoding="utf-8") as f1:
          lines = json.load(f1)
          symbol = []
          for line in lines:
              sentence = line.get("sentence")
              labels = ["O"] * len(sentence)
              entities = line.get("entities")
              for entity in entities:
                  word = entity.get("word")
                  label = entity.get("label")
                  for idx in range(len(sentence) - len(word)):
                      if sentence[idx : idx + len(word)] == word:
                          labels[idx] = "B-" + label
                          for i in range(idx + 1, idx + len(word)):
                              labels[i] = "I-" + label
              symbol.append(labels)
  
          with open(fp_txt, "w", encoding="utf-8") as f2:
              for idx in range(len(lines)):
                  for i in range(len(lines[idx].get("sentence"))):
                      f2.write(
                          lines[idx].get("sentence")[i]
                          + " "
                          + symbol[idx][i]
                          + "\n"
                      )
                  if idx != len(lines) - 1:
                      f2.write("\n")
  
file_path: DeepKE/src/deepke/transform_data.py
imports: import csv
  import json
  import xlrd2
  import docx
label_desc: Use image node_id 3 for calling a global function with example usage: json2txt(fp_json, fp_txt) without return types