Find answers from the community

Updated 2 months ago

I have a excel file that contains the

I have a excel file that contains the following columns: query|context|generated response|expected response

I want to batchevaluate the excel file. This is the code I have used


Read the Excel file

df = pd.read_excel(r"C:\Users\xxx\Desktop\TEST BATCH EVAL.xlsx")

Extract the queries and expected responses

queries = df['Query'].tolist()
reference = df['Correct Response'].tolist()
response = df['Response'].tolist()
context = df['Kontext'].tolist()

configure batcheval

runner = BatchEvalRunner(
{
"faithfulness": faithfulnessEvaluator,
"correctness": correctnessEvaluator,
"relevancy": relevancyEvaluator
},
workers=8,
)

run batcheval

eval_results = await runner.aevaluate_response_strs(
queries=queries,
response_strs=response,
contexts_list=context,
reference=reference
)

For some reason the context is not set properly in the prompt template, after every character there is a new line. The context in the prompt is set in the log like the attached txt file.

Why is it putting everytime a new line?
Add a reply
Sign up and join the conversation on Discord