def export_train_text(self):
    train_text = pd.read_csv(((self.label_path + 'result/') + 'final.csv'))
    train_text = train_text[['type', 'content']]
    train_text.columns = ['Y', 'content']
    train_text.fillna('空', inplace=True)
    train_text.Y = train_text.Y.apply((lambda x: self.label_dict[str(int(x))]))
    train_text.content = train_text.content.apply((lambda x: str(x).replace('\n', '')))
    train_text.content = train_text.content.apply((lambda x: str(x).replace(' ', '')))
    train_text.content = train_text.content.apply((lambda x: remove_waste_emoji(x)))
    train_text.fillna('空', inplace=True)
    train_dataset = train_text.sample(frac=0.8)
    val_dataset = train_text.sample(frac=0.3)
    test_dataset = train_text.sample(frac=0.3)
    self.print_label_dict(train_text)
    self.print_label_dict(train_dataset)
    self.print_label_dict(val_dataset)
    self.print_label_dict(test_dataset)
    train_dataset.to_csv((self.TEXT_CLASSIFICATION_DATA_SET + 'text_train.csv'), sep='\t', index=None, header=None)
    val_dataset.to_csv((self.TEXT_CLASSIFICATION_DATA_SET + 'text_val.csv'), sep='\t', index=None, header=None)
    test_dataset.to_csv((self.TEXT_CLASSIFICATION_DATA_SET + 'text_test.csv'), sep='\t', index=None, header=None)
    self.calculate_avg_length(train_text)
def export_train_text(self):
    train_text = pd.read_csv(((self.label_path + 'result/') + 'final.csv'))
    train_text = train_text[['type', 'content']]
    train_text.columns = ['Y', 'content']
    train_text.fillna('空', inplace=True)
    train_text.Y = train_text.Y.apply((lambda x: self.label_dict[str(int(x))]))
    train_text.content = train_text.content.apply((lambda x: str(x).replace('\n', )))
    train_text.content = train_text.content.apply((lambda x: str(x).replace(' ', )))
    train_text.content = train_text.content.apply((lambda x: remove_waste_emoji(x)))
    train_text.fillna('空', inplace=True)
    train_dataset = train_text.sample(frac=0.8)
    val_dataset = train_text.sample(frac=0.3)
    test_dataset = train_text.sample(frac=0.3)
    self.print_label_dict(train_text)
    self.print_label_dict(train_dataset)
    self.print_label_dict(val_dataset)
    self.print_label_dict(test_dataset)
    train_dataset.to_csv((self.TEXT_CLASSIFICATION_DATA_SET + 'text_train.csv'), sep='\t', index=None, header=None)
    val_dataset.to_csv((self.TEXT_CLASSIFICATION_DATA_SET + 'text_val.csv'), sep='\t', index=None, header=None)
    test_dataset.to_csv((self.TEXT_CLASSIFICATION_DATA_SET + 'text_test.csv'), sep='\t', index=None, header=None)
    self.calculate_avg_length(train_text)