def format_paper_data(data): # タイトルとタグを質問に question = f"タイトル: {data['ja_title_provisional_translate']}\nタグ: {data['tags']}" # 3行まとめを回答に answer = f"{data['R3summary_1']}\n{data['R3summary_2']}\n{data['R3summary_3']}" # Gemma-3形式に変換 return f"""<start_of_turn>user {question}<end_of_turn> <start_of_turn>model {answer}<end_of_turn>"""
def format_comparison_data(data): source = data['comparison_source'] target = data['comparison_target'] category = data['label'] sentence = data['sentence'] # 共通点か違いかを判定 q_type = "共通点" if data['common_or_different'] == 1 else "違い" question = f"{source}と{target}の{q_type}(カテゴリ: {category})" return f"""<start_of_turn>user {question}<end_of_turn> <start_of_turn>model {sentence}<end_of_turn>"""