Sniffer特征
Opened this issue · 0 comments
caseware66 commented
def consturct_train_features(samples_train):
convert_train = []
en_labels = {
'gpt2': 0,
'gptneo': 1,
'gptj': 2,
'llama': 3,
'gpt3re': 4,
# 'gpt3sum': 4,
'human': 5
}
for item in samples_train:
label = item['label']
label_int = en_labels[label]
end_doc = item.get('end_doc', 1)
# if label == 'human':
# label_int = 1
# else:
# label_int = 0
values = item['values']
features = values['losses'] + values['lt_zero_percents'] + values[
'std_deviations'] + values['pearson_list'] + values[
'spearmann_list']
if np.isnan(np.sum(features)):
continue
convert_train.append([features, label_int, label, end_doc])
return convert_train
您好,values['losses'] + values['lt_zero_percents'] + values[
'std_deviations'] + values['pearson_list'] + values[
'spearmann_list'] 这几个特征如何生成的?