对于以下这个代码，将revised_data中indices_to_discard索引的数据中的[{"prompt": item["prompt"], "chosen": item["response"], "rejected": item["rejected"]加入到textual_aesthetics_rejected中，给出修改后的代码
from datasets import load_dataset, Dataset
import pandas as pd
import json
data = read_jsonl("revised_data/output_sorted_v2.jsonl")
not_revised = [item['index'] for item in data if item['revised_text'] == '']
ds = load_dataset("HuggingFaceH4/ultrafeedback_binarized", split="train_prefs")
def get_instruct_response(item):
    # item["instruction"] = item['chosen'][0]["content"]
    item["response"] = item['chosen'][1]["content"]
    return item
ds = ds.map(get_instruct_response, batch_size=1024, num_proc=8)
export_data = ds.select_columns(["prompt", "response"])

not_revised = [item['index'] for item in data if item['revised_text'] == '']
# datalen
# data
indices = set([item['index'] for item in data])
# original_indices = set(range(export_data.shape[0]))
# print(f"index complete: {original_indices - indices}")
null_response_indices = [item['index'] for item in data if item['gpt_answer'].strip() == '']
null_revised_indices = [item['index'] for item in data if item['revised_text'].strip() == '']
noneed_revised_indices = [item['index'] for item in data if item['does_it_need_modification'].strip() == 'N']
same_revised_text_indices = [item['index'] for item in data if item['response'].strip() == item['revised_text'].strip()]

# print(len(null_response))
# print(len(not_revised))
print(f"null_response_indices:{len(null_response_indices)}")
print(f"null_revised_indices:{len(null_revised_indices)}")
print(f"noneed_revised_indices:{len(noneed_revised_indices)}")
print(f"same_revised_text_indices:{len(same_revised_text_indices)}")
# 使用集合的交集操作  
indices_to_discard  = set(null_response_indices) | set(null_revised_indices) | set(noneed_revised_indices) | set(same_revised_text_indices)   
print(f"indices_to_discard: {len(indices_to_discard)}")
# filter length 
indices_to_discard = indices_to_discard | set(out_of_range_texts_indices)
indices_to_discard = list(indices_to_discard)
print(f"indices_to_discard add length: {len(indices_to_discard)}")
temp_data = data
# temp_ds = ds.select(range(10))
for i, item in enumerate(ds):
    temp_data[i]['rejected'] = item['rejected'][1]['content']
    temp_data[i]['instruct'] = item['prompt']
    temp_data[i]['chosen'] = item['chosen']
revised_data = [item for item in temp_data if item["index"] not in indices_to_discard]
print(f"length of revised data: {len(revised_data)}")
textual_aesthetics_chosen = [{"prompt": item["prompt"], "chosen": item["revised_text"], "rejected": item["response"]} for item in revised_data]
# with open("/mnt/lingjiejiang/textual_aesthetics/data/textual_aesthetics_chosen_v4_{lower}_{upper}.json", 'w') as f:
#     json.dump(textual_aesthetics_chosen, f, indent=4)
textual_aesthetics_rejected = [{"prompt": item["prompt"], "chosen": item["revised_text"], "rejected": item["rejected"]} for item in revised_data]
with open(f"/mnt/lingjiejiang/textual_aesthetics/data/textual_aesthetics_v2_rejected_v2_{lower}_{upper}.json", 'w') as f:
    json.dump(textual_aesthetics_rejected, f, indent=4)
print(f"/mnt/lingjiejiang/textual_aesthetics/data/textual_aesthetics_v2_rejected_v2_{lower}_{upper}.json")
print(f"textual_aesthetics_chosen:{len(textual_aesthetics_chosen)}  textual_aesthetics_rejected:{len(textual_aesthetics_rejected)}")