import pandas as pd

def modify_instruction(txt):
    return txt.split("Functional groups information")[0] + " What is the yield of this reaction?"

csv_files = ["train.csv", "all.csv", "test.csv"]

for csv_file in csv_files:
    df = pd.read_csv(csv_file)

    df['instruction'] = df['instruction'].apply(modify_instruction)

    df.to_csv(csv_file, index=False)
