Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replacing eval with .format #38

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions config/evaluator/default_multi_qa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ output_options:
'Partially correct': 0.5
'Wrong': 0
prompt:
system: f"You are an evaluation tool. Answer with one of \n {self.rubrik_section}."
user: f"Here is a question, a golden answer and an AI-generated answer. Can you judge whether the AI-generated answer is correct according to the question and golden answer, simply answer with one of {self.rubrik_section}.\n Question:\ {question}. \nGolden answer:\ {answer} \n Generated answer:\ {prediction}"
user_without_system: f"You are an evaluation tool. Just answer as following {self.rubrik_section}. Here is a question, a golden answer and an AI-generated answer. Judge whether the AI-generated answer is correct according to the question and golden answer, answer with {self.rubrik_section}.\nQuestion:\ {question}.\nGolden answer:\ {answer}\nGenerated answer:\ {prediction}"
system: "You are an evaluation tool. Answer with one of \n {rubrik_section}."
user: "Here is a question, a golden answer and an AI-generated answer. Can you judge whether the AI-generated answer is correct according to the question and golden answer, simply answer with one of {rubrik_section}.\n Question {question}. \nGolden answer: {answer} \n Generated answer {prediction}"
user_without_system: "You are an evaluation tool. Just answer as following {rubrik_section}. Here is a question, a golden answer and an AI-generated answer. Judge whether the AI-generated answer is correct according to the question and golden answer, answer with {rubrik_section}.\nQuestion {question}.\nGolden answer {answer}\nGenerated answer {prediction}"
8 changes: 4 additions & 4 deletions config/evaluator/default_qa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ output_options:
'Yes': 1
'No': 0
prompt:
system: f"You are an evaluation tool. Answer with one of {self.rubrik_section}."
user: f"Here is a question, a golden answer and an AI-generated answer. Can you judge whether the AI-generated answer is correct according to the question and golden answer, simply answer with one of {self.rubrik_section}.\n Question:\ {question}. \nGolden answer:\ {answer} \n Generated answer:\ {prediction}"
assistant: f"Response:\ {{"
user_without_system: f"You are an evaluation tool. Just answer by {self.rubrik_section}. Here is a question, a golden answer and an AI-generated answer. Judge whether the AI-generated answer is correct according to the question and golden answer, answer with {self.rubrik_section}.\nQuestion:\ {question}.\nGolden answer:\ {answer}\nGenerated answer:\ {prediction}"
system: "You are an evaluation tool. Answer with one of {rubrik_section}."
user: "Here is a question, a golden answer and an AI-generated answer. Can you judge whether the AI-generated answer is correct according to the question and golden answer, simply answer with one of {rubrik_section}.\n Question: {question}. \nGolden answer: {answer} \n Generated answer: {prediction}"
assistant: "Response: {{"
user_without_system: "You are an evaluation tool. Just answer by {rubrik_section}. Here is a question, a golden answer and an AI-generated answer. Judge whether the AI-generated answer is correct according to the question and golden answer, answer with {rubrik_section}.\nQuestion: {question}.\nGolden answer: {answer}\nGenerated answer: {prediction}"
4 changes: 2 additions & 2 deletions config/prompt/basic.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "You are a helpful assistant. Your task is to extract relevant information from provided documents and to answer to questions as briefly as possible."
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "You are a helpful assistant. Answer the questions as briefly as possible."
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_langspec/basic_reply_in_ar.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "You are a helpful assistant. Your task is to extract relevant information from provided documents and to answer to questions as briefly as possible. Please reply in Arabic."
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "You are a helpful assistant. Answer the questions as briefly as possible. Please reply in Arabic."
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_langspec/basic_reply_in_de.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "You are a helpful assistant. Your task is to extract relevant information from provided documents and to answer to questions as briefly as possible. Please reply in German."
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "You are a helpful assistant. Answer the questions as briefly as possible. Please reply in German."
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_langspec/basic_reply_in_en.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "You are a helpful assistant. Your task is to extract relevant information from provided documents and to answer to questions as briefly as possible. Please reply in English."
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "You are a helpful assistant. Answer the questions as briefly as possible. Please reply in English."
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_langspec/basic_reply_in_es.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "You are a helpful assistant. Your task is to extract relevant information from provided documents and to answer to questions as briefly as possible. Please reply in Spanish."
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "You are a helpful assistant. Answer the questions as briefly as possible. Please reply in Spanish."
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_langspec/basic_reply_in_fi.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "You are a helpful assistant. Your task is to extract relevant information from provided documents and to answer to questions as briefly as possible. Please reply in Finnish."
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "You are a helpful assistant. Answer the questions as briefly as possible. Please reply in Finnish."
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_langspec/basic_reply_in_fr.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "You are a helpful assistant. Your task is to extract relevant information from provided documents and to answer to questions as briefly as possible. Please reply in French."
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "You are a helpful assistant. Answer the questions as briefly as possible. Please reply in French."
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_langspec/basic_reply_in_it.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "You are a helpful assistant. Your task is to extract relevant information from provided documents and to answer to questions as briefly as possible. Please reply in Italian."
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "You are a helpful assistant. Answer the questions as briefly as possible. Please reply in Italian."
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_langspec/basic_reply_in_ja.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "You are a helpful assistant. Your task is to extract relevant information from provided documents and to answer to questions as briefly as possible. Please reply in Japanese."
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "You are a helpful assistant. Answer the questions as briefly as possible. Please reply in Japanese."
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_langspec/basic_reply_in_ko.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "You are a helpful assistant. Your task is to extract relevant information from provided documents and to answer to questions as briefly as possible. Please reply in Korean."
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "You are a helpful assistant. Answer the questions as briefly as possible. Please reply in Korean."
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_langspec/basic_reply_in_pt.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "You are a helpful assistant. Your task is to extract relevant information from provided documents and to answer to questions as briefly as possible. Please reply in Brazilian Portuguese."
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "You are a helpful assistant. Answer the questions as briefly as possible. Please reply in Brazilian Portuguese."
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_langspec/basic_reply_in_ru.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "You are a helpful assistant. Your task is to extract relevant information from provided documents and to answer to questions as briefly as possible. Please reply in Russian."
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "You are a helpful assistant. Answer the questions as briefly as possible. Please reply in Russian."
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_langspec/basic_reply_in_th.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "You are a helpful assistant. Your task is to extract relevant information from provided documents and to answer to questions as briefly as possible. Please reply in Thai."
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "You are a helpful assistant. Answer the questions as briefly as possible. Please reply in Thai."
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_langspec/basic_reply_in_zh.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "You are a helpful assistant. Your task is to extract relevant information from provided documents and to answer to questions as briefly as possible. Please reply in Simplified Chinese."
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "You are a helpful assistant. Answer the questions as briefly as possible. Please reply in Simplified Chinese."
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_matchlang.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "You are a helpful assistant. Your task is to extract relevant information from provided documents and to answer to questions as briefly as possible. Please reply in the same language as the language of the question."
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "You are a helpful assistant. Answer the questions as briefly as possible. Please reply in the same language as the language of the question."
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_translated/ar.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "أنت مساعد مفيد. مهمتك هي استخراج المعلومات ذات الصلة من الوثائق المقدمة والإجابة على الأسئلة في أقصر وقت ممكن."
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "أنت مساعد مفيد. أجب عن الأسئلة باختصار قدر الإمكان."
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_translated/de.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "Du bist ein hilfreicher Assistent. Deine Aufgabe ist es, aus bereitgestellten Dokumenten relevante Informationen zu extrahieren und Fragen so kurz wie möglich zu beantworten."
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "Du bist ein hilfreicher Assistent. Beantworte die Fragen so kurz wie möglich."
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_translated/en.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "You are a helpful assistant. Your task is to extract relevant information from provided documents and to answer to questions as short as possible."
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "You are a helpful assistant. Answer the questions as short as possible."
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_translated/es.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "Eres un asistente útil. Tu tarea es extraer información relevante de los documentos proporcionados y responder a las preguntas lo más breve posible."
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "Eres un asistente útil. Responde las preguntas lo más breve posible."
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_translated/fi.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "Olet avulias avustaja. Tehtäväsi on poimia tarvittavat tiedot annetuista asiakirjoista ja vastata kysymyksiin mahdollisimman lyhyesti."
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "Olet avulias avustaja. Vastaa kysymyksiin mahdollisimman lyhyesti."
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
8 changes: 4 additions & 4 deletions config/prompt/basic_translated/fr.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "Tu es un assistant utile. Ta tâche consiste à extraire les informations pertinentes des documents fournis et à répondre aux questions aussi courts que possible."
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
system_without_docs: "Tu es un assistant utile. Réponds aux questions avec une réponse minimale."
user_without_docs: f"Question:\ {question}"
system: "Tu es un assistant utile. Ta tâche consiste à extraire les informations pertinentes des documents fournis et à répondre aux questions aussi court que possible."
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "Tu es un assistant utile. Réponds aux questions avec des réponses minimales."
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_translated/it.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "Sei un assistente affidabile. Il tuo compito è estrarre le informazioni rilevanti dai documenti forniti e rispondere alle domande nel modo più breve possibile."
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "Sei un assistente affidabile. Rispondi alle domande il più brevemente possibile."
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_translated/ja.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "あなたは役に立つアシスタントです。あなたの仕事は、提供された文書から関連情報を抽出し、質問にできるだけ短く答えることです。"
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "あなたは役に立つアシスタントです。質問にできるだけ短く答えてください。"
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_translated/ko.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "이제부터 너는 내 유능한 비서야. 네 역할은 내가 제공한 문서에서 관련 정보를 찾아내고 내 질문에 최대한 짧게 답하는 거야."
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "이제부터 너는 내 비서야. 내 질문에 최대한 짧게 답해 줘. "
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_translated/pt.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "Você é um assistente produtivo. Dada uma lista de documentos e perguntas, a sua tarefa é extrair as informações pertinentes dos documentos e responder as perguntas da forma mais resumida possível."
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "Você é um assistente produtivo. Responda as perguntas da forma mais resumida possível."
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_translated/ru.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "Ты всегда готовый помочь ассистент. Твоя задача извлекать из предоставленных документов релевантную информацию и как можно короче отвечать на вопросы."
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "Ты всегда готовый помочь ассистент. Отвечай на вопросы как можно короче."
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_translated/th.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "คุณเป็นผู้ช่วยที่เป็นประโยชน์ งานของคุณคือการดึงข้อมูลที่เกี่ยวข้องจากเอกสารที่ให้มาและตอบคำถามให้สั้นที่สุด"
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "คุณเป็นผู้ช่วยที่เป็นประโยชน์ ตอบคำถามให้สั้นที่สุด"
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
4 changes: 2 additions & 2 deletions config/prompt/basic_translated/zh.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
system: "你是一名乐于助人的助手。你的任务是从提供的文档中提取相关信息,并尽可能简短地回答问题。"
user: f"Background:\n{docs}\n\nQuestion:\ {question}"
user: "Background:\n{docs}\n\nQuestion: {question}"
system_without_docs: "你是一个乐于助人的助手。请尽可能简短地回答问题。"
user_without_docs: f"Question:\ {question}"
user_without_docs: "Question: {question}"
Loading