(label, texts_after, new_path, no_label)
Save a text nlu joint data to a file.
Save a text nlu joint data to a file.
Save a text nlu joint data to a file .
def save_a_text_nlu_joint_file(label, texts_after, new_path, no_label):
  """Save a text nlu joint data to a file."""
  intent_label, slots_label = label
  logging.info("Saving processed file to: {}".format(new_path))
  with open(new_path, "w", encoding="utf-8") as out_f:
    for i, one_line in enumerate(texts_after):
      if no_label:
        out_f.write(one_line + "\n")
      else:
        out_f.write(intent_label[i] + "\t" + slots_label[i] + "\t" + one_line +
                    "\n")
def save_a_text_nlu_joint_file ( label , texts_after , new_path , no_label ) : intent_label , slots_label = label logging . info ( "Saving processed file to: {}" . format ( new_path ) ) with open ( new_path , "w" , encoding = "utf-8" ) as out_f : for i , one_line in enumerate ( texts_after ) : if no_label : out_f . write ( one_line + "\n" ) else : out_f . write ( intent_label [ i ] + "\t" + slots_label [ i ] + "\t" + one_line + "\n" )