Hi. I have the following code to create new entries with the target
sentence being the source
sentence:
def add_source_as_target(examples):
new_targets, new_sources = [], []
for i in range(len(examples["target"])):
new_targets += [examples["target"][i], examples["source"][i]]
new_sources += [examples["source"][i], examples["source"][i]]
examples["source"] = new_sources
examples["target"] = new_targets
return examples
I was wondering if there is a better way to do this using built-in functions. Do you have any suggestion how to do it?