From 80adb667ba684a0c5188aee6ee2b1342b8f7d6c1 Mon Sep 17 00:00:00 2001 From: Somesh Fengade Date: Wed, 27 Mar 2024 17:45:04 +0530 Subject: [PATCH] ragas expt update --- backend/app/ragas_dataset.csv | 43 +++++++++++++++++++++++---------- backend/app/ragas_score_all.csv | 39 +++++++++++++++++++++--------- backend/app/ragas_try.py | 23 +++--------------- 3 files changed, 61 insertions(+), 44 deletions(-) diff --git a/backend/app/ragas_dataset.csv b/backend/app/ragas_dataset.csv index ec153365..ec9ae98f 100644 --- a/backend/app/ragas_dataset.csv +++ b/backend/app/ragas_dataset.csv @@ -1,52 +1,69 @@ -question,context,answer,ground_truth +question,context,answer,ground_truth Where did the study Recipient Vessels for Free Tissue Flaps in Advanced Oncologic Defects of the Midface and Scalp take place,"SELECT si.title, si.study_details->>'source' AS study_source FROM tbl_studies_info si WHERE si.title = 'Recipient Vessels for Free Tissue Flaps in Advanced Oncologic Defects of the Midface and Scalp'; SQLResult: -| title |[('Recipient Vessels for Free Tissue Flaps in Advanced Oncologic Defects of the Midface and Scalp', 'Instituto Nacional de Cancer, Brazil')]","The study Recipient Vessels for Free Tissue Flaps in Advanced Oncologic Defects of the Midface and Scalp took place at the Instituto Nacional de Cancer, Brazil. This is based on the database output which shows that the study was conducted by the Instituto Nacional de Cancer, Brazil.",University of Texas MD Anderson Cancer Center +| title |[('Recipient Vessels for Free Tissue Flaps in Advanced Oncologic Defects of the Midface and Scalp', 'Instituto Nacional de Cancer, Brazil')]","The study Recipient Vessels for Free Tissue Flaps in Advanced Oncologic Defects of the Midface and Scalp took place at the Instituto Nacional de Cancer, Brazil. This is based on the database output which shows that the study was conducted by the Instituto Nacional de Cancer, Brazil.","Instituto Nacional de Cancer, Brazil" "How many participants was enrolled in Exposure, Dose, Body Burden and Health Effects of Lead","SELECT si.study_details->>'enrollment' AS enrollment_count FROM tbl_studies_info si WHERE si.title = 'Exposure, Dose, Body Burden and Health Effects of Lead'; Reasoning: -1. First, we need to select the rows from the ""[('944',)]","The study Exposure, Dose, Body Burden and Health Effects of Lead enrolled 944 participants. This is based on the database output which shows that the study enrolled 944 participants.",944 +1. First, we need to select the rows from the ""[('944',)]","The study Exposure, Dose, Body Burden and Health Effects of Lead enrolled 944 participants. This is based on the database output which shows that the study enrolled 944 participants.",944 What is the purpose of the study Safety and Tolerability of RNS60 Given by IV to Healthy Subjects,"SELECT title, description FROM tbl_studies_info WHERE title = 'Safety and Tolerability of RNS60 Given by IV to Healthy Subjects'; Reasoning: -1. We need to extract the information from the 'tbl_studies_eligibilities' and 'tbl_studies_info[('Safety and Tolerability of RNS60 Given by IV to Healthy Subjects', 'The objective of this study is to evaluate the safety and tolerability of RNS60 administered intravenously to healthy subjects. 12 subjects will receive RNS60 or placebo at three escalating rates for 48 hours for each rate.')]",The purpose of the study Safety and Tolerability of RNS60 Given by IV to Healthy Subjects is to evaluate the safety and tolerability of RNS60 administered intravenously to healthy subjects. 12 subjects will receive RNS60 or placebo at three escalating rates for 48 hours for,"Study to investigate the effect of two types of radiotherapy on saliva: IMRT versus conventional radiotherapy. +1. We need to extract the information from the 'tbl_studies_eligibilities' and 'tbl_studies_info[('Safety and Tolerability of RNS60 Given by IV to Healthy Subjects', 'The objective of this study is to evaluate the safety and tolerability of RNS60 administered intravenously to healthy subjects. 12 subjects will receive RNS60 or placebo at three escalating rates for 48 hours for each rate.')]",The purpose of the study Safety and Tolerability of RNS60 Given by IV to Healthy Subjects is to evaluate the safety and tolerability of RNS60 administered intravenously to healthy subjects. 12 subjects will receive RNS60 or placebo at three escalating rates for 48 hours for,"evaluate the safety and tolerability of the drug RNS60 administered intravenously in healthy male subjects. The study involves testing three escalating dosage rates of RNS60 or placebo over a period of 48 hours for each rate. -In each group, one part will receive normal dental preventive treatment. The other part will use products for treatment of dry mouth (Biotene gamma). -Both anorganic and organic components of the saliva will be studied at different time points, combined with bacterial swabs. - " + + + + +" What is the purpose of the study Recreational Diving Practice for Stress Management (DIVSTRESS),"SELECT title, description FROM tbl_studies_info WHERE title = 'Recreational Diving Practice for Stress Management (DIVSTRESS)'; Reasoning: -1. First, we need to identify the study we are interested in. In this case, the study is ""Recreational Diving Practice for Stress[]",The purpose of the study Recreational Diving Practice for Stress Management (DIVSTRESS) is to investigate the effects of recreational diving on stress management. This is based on the database output which shows that the study is about recreational diving and stress management.,"Within the components of Scuba diving there are similarities with meditation and mindfulness techniques. Perceived stress is known to be diminished during meditation practice. This study evaluates the benefits of scuba diving on perceived stress and mindful functioning. -Detailed" +1. First, we need to identify the study we are interested in. In this case, the study is ""Recreational Diving Practice for Stress[]",The purpose of the study Recreational Diving Practice for Stress Management (DIVSTRESS) is to investigate the effects of recreational diving on stress management. This is based on the database output which shows that the study is about recreational diving and stress management.,"evaluate the benefits of scuba diving on perceived stress and mindful functioning. It compared the effects of a one-week recreational diving course on perceived stress, mood, well-being, and mindfulness against a control group engaged in various sports activities. The study also assessed the stability of these effects one month later. + + + + + + + +" How many participants was enrolled in Recreational Diving Practice for Stress Management (DIVSTRESS),"SELECT si.title, si.study_details->>'enrollment' AS enrollment_count FROM tbl_studies_info si WHERE si.title = 'Recreational Diving Practice for Stress Management (DIVSTRESS)'; -This SQL query uses the ->> operator to extract the value of the '[]",The study Recreational Diving Practice for Stress Management (DIVSTRESS) did not have any participants enrolled. This is based on the database output which shows that the study did not have any participants enrolled.,67 +This SQL query uses the ->> operator to extract the value of the '[]",The study Recreational Diving Practice for Stress Management (DIVSTRESS) did not have any participants enrolled. This is based on the database output which shows that the study did not have any participants enrolled.,67 "What treatment was given to the participants in Exposure, Dose, Body Burden and Health Effects of Lead","SELECT si.title, si.study_details->>'treatment' AS treatment FROM tbl_studies_info si WHERE si.title = 'Exposure, Dose, Body Burden and Health Effects of Lead'; Reasoning: -1. First, we need to identify the relevant tables and columns[('Exposure, Dose, Body Burden and Health Effects of Lead', None)]","The treatment given to the participants in Exposure, Dose, Body Burden and Health Effects of Lead is not available in the database output. This is because the column 'treatment' is not present in the table 'tbl_studies_info' for the study 'Exposure, Dose, Body Burden and Health Effects of",Not given +1. First, we need to identify the relevant tables and columns[('Exposure, Dose, Body Burden and Health Effects of Lead', None)]","The treatment given to the participants in Exposure, Dose, Body Burden and Health Effects of Lead is not available in the database output. This is because the column 'treatment' is not present in the table 'tbl_studies_info' for the study 'Exposure, Dose, Body Burden and Health Effects of",Not given What does this following study does: Safety and Tolerability of RNS60 Given by IV to Healthy Subjects,"SELECT title, description, eligibility_details ->> 'Criteria' as criteria FROM tbl_studies_eligibilities WHERE title = 'Safety and Tolerability of RNS60 Given by IV to Healthy Subjects'; -This SQL query selects the title, description, and criteria fields from the tbl_studies[('Safety and Tolerability of RNS60 Given by IV to Healthy Subjects', 'The objective of this study is to evaluate the safety and tolerability of RNS60 administered intravenously to healthy subjects. 12 subjects will receive RNS60 or placebo at three escalating rates for 48 hours for each rate.', 'Inclusion Criteria: Males between 18-55 years Minimum body weight of 60 kg BMI of 18-32 kg/m2 Able to execute informed written consent Exclusion Criteria: A chronic or acute disease that might interfere with the evaluation of the safety of RNS60 Current or prior malignancies (excluding...')]","This study does not have any specific criteria for eligibility. The criteria field in the database output is empty, which means that the study does not have any specific criteria for eligibility.",evaluate the safety and tolerability of RNS60 administered intravenously to healthy subjects. 12 subjects will receive RNS60 or placebo at three escalating rates for 48 hours for each rate. +This SQL query selects the title, description, and criteria fields from the tbl_studies[('Safety and Tolerability of RNS60 Given by IV to Healthy Subjects', 'The objective of this study is to evaluate the safety and tolerability of RNS60 administered intravenously to healthy subjects. 12 subjects will receive RNS60 or placebo at three escalating rates for 48 hours for each rate.', 'Inclusion Criteria: Males between 18-55 years Minimum body weight of 60 kg BMI of 18-32 kg/m2 Able to execute informed written consent Exclusion Criteria: A chronic or acute disease that might interfere with the evaluation of the safety of RNS60 Current or prior malignancies (excluding...')]","This study does not have any specific criteria for eligibility. The criteria field in the database output is empty, which means that the study does not have any specific criteria for eligibility.","the safety and tolerability of RNS60, administered intravenously, in healthy subjects. It was a Phase 1, double-blind, randomized, placebo-controlled trial involving 12 participants, who received RNS60 or placebo at three escalating rates for 48 hours each. The study took place between July and September 2011. + + + + + + + +" What is the type of following study: Recreational Diving Practice for Stress Management (DIVSTRESS),"SELECT si.title, si.study_details->>'study_type' AS study_type FROM tbl_studies_info si WHERE si.title = 'Recreational Diving Practice for Stress Management (DIVSTRESS)'; -This SQL query selects the title and study type of the study with the given title[]","The study Recreational Diving Practice for Stress Management (DIVSTRESS) is a randomized controlled trial. This is based on the database output which shows that the study type is ""randomized controlled trial"".",Observational +This SQL query selects the title and study type of the study with the given title[]","The study Recreational Diving Practice for Stress Management (DIVSTRESS) is a randomized controlled trial. This is based on the database output which shows that the study type is ""randomized controlled trial"".",Observational \ No newline at end of file diff --git a/backend/app/ragas_score_all.csv b/backend/app/ragas_score_all.csv index a178fbab..8e30779b 100644 --- a/backend/app/ragas_score_all.csv +++ b/backend/app/ragas_score_all.csv @@ -1,16 +1,33 @@ question,contexts,answer,ground_truth,answer_relevancy,context_precision,faithfulness,context_recall -Where did the study Recipient Vessels for Free Tissue Flaps in Advanced Oncologic Defects of the Midface and Scalp take place,"[""SELECT si.title, si.study_details->>'source' AS study_source\nFROM tbl_studies_info si\nWHERE si.title = 'Recipient Vessels for Free Tissue Flaps in Advanced Oncologic Defects of the Midface and Scalp';\n\nSQLResult:\n\n| title |[('Recipient Vessels for Free Tissue Flaps in Advanced Oncologic Defects of the Midface and Scalp', 'Instituto Nacional de Cancer, Brazil')]""]","The study Recipient Vessels for Free Tissue Flaps in Advanced Oncologic Defects of the Midface and Scalp took place at the Instituto Nacional de Cancer, Brazil. This is based on the database output which shows that the study was conducted by the Instituto Nacional de Cancer, Brazil.",University of Texas MD Anderson Cancer Center,0.9860335366698764,0.0,1.0,0.0 -"How many participants was enrolled in Exposure, Dose, Body Burden and Health Effects of Lead","['SELECT si.study_details->>\'enrollment\' AS enrollment_count\nFROM tbl_studies_info si\nWHERE si.title = \'Exposure, Dose, Body Burden and Health Effects of Lead\';\n\nReasoning:\n\n1. First, we need to select the rows from the ""[(\'944\',)]']","The study Exposure, Dose, Body Burden and Health Effects of Lead enrolled 944 participants. This is based on the database output which shows that the study enrolled 944 participants.",944,0.9757732452609623,0.0,1.0,1.0 -What is the purpose of the study Safety and Tolerability of RNS60 Given by IV to Healthy Subjects,"[""SELECT title, description FROM tbl_studies_info WHERE title = 'Safety and Tolerability of RNS60 Given by IV to Healthy Subjects';\n\nReasoning:\n\n1. We need to extract the information from the 'tbl_studies_eligibilities' and 'tbl_studies_info[('Safety and Tolerability of RNS60 Given by IV to Healthy Subjects', 'The objective of this study is to evaluate the safety and tolerability of RNS60 administered intravenously to healthy subjects. 12 subjects will receive RNS60 or placebo at three escalating rates for 48 hours for each rate.')]""]",The purpose of the study Safety and Tolerability of RNS60 Given by IV to Healthy Subjects is to evaluate the safety and tolerability of RNS60 administered intravenously to healthy subjects. 12 subjects will receive RNS60 or placebo at three escalating rates for 48 hours for,"Study to investigate the effect of two types of radiotherapy on saliva: IMRT versus conventional radiotherapy. +Where did the study Recipient Vessels for Free Tissue Flaps in Advanced Oncologic Defects of the Midface and Scalp take place,"[""SELECT si.title, si.study_details->>'source' AS study_source\nFROM tbl_studies_info si\nWHERE si.title = 'Recipient Vessels for Free Tissue Flaps in Advanced Oncologic Defects of the Midface and Scalp';\n\nSQLResult:\n\n| title |[('Recipient Vessels for Free Tissue Flaps in Advanced Oncologic Defects of the Midface and Scalp', 'Instituto Nacional de Cancer, Brazil')]""]","The study Recipient Vessels for Free Tissue Flaps in Advanced Oncologic Defects of the Midface and Scalp took place at the Instituto Nacional de Cancer, Brazil. This is based on the database output which shows that the study was conducted by the Instituto Nacional de Cancer, Brazil.","Instituto Nacional de Cancer, Brazil",0.9860335366698764,0.9999999999,1.0,1.0 +"How many participants was enrolled in Exposure, Dose, Body Burden and Health Effects of Lead","['SELECT si.study_details->>\'enrollment\' AS enrollment_count\nFROM tbl_studies_info si\nWHERE si.title = \'Exposure, Dose, Body Burden and Health Effects of Lead\';\n\nReasoning:\n\n1. First, we need to select the rows from the ""[(\'944\',)]']","The study Exposure, Dose, Body Burden and Health Effects of Lead enrolled 944 participants. This is based on the database output which shows that the study enrolled 944 participants.",944,0.9757809141538057,0.0,1.0,1.0 +What is the purpose of the study Safety and Tolerability of RNS60 Given by IV to Healthy Subjects,"[""SELECT title, description FROM tbl_studies_info WHERE title = 'Safety and Tolerability of RNS60 Given by IV to Healthy Subjects';\n\nReasoning:\n\n1. We need to extract the information from the 'tbl_studies_eligibilities' and 'tbl_studies_info[('Safety and Tolerability of RNS60 Given by IV to Healthy Subjects', 'The objective of this study is to evaluate the safety and tolerability of RNS60 administered intravenously to healthy subjects. 12 subjects will receive RNS60 or placebo at three escalating rates for 48 hours for each rate.')]""]",The purpose of the study Safety and Tolerability of RNS60 Given by IV to Healthy Subjects is to evaluate the safety and tolerability of RNS60 administered intravenously to healthy subjects. 12 subjects will receive RNS60 or placebo at three escalating rates for 48 hours for,"evaluate the safety and tolerability of the drug RNS60 administered intravenously in healthy male subjects. The study involves testing three escalating dosage rates of RNS60 or placebo over a period of 48 hours for each rate. -In each group, one part will receive normal dental preventive treatment. The other part will use products for treatment of dry mouth (Biotene gamma). -Both anorganic and organic components of the saliva will be studied at different time points, combined with bacterial swabs. - ",0.9922546655801924,0.0,1.0,1.0 -What is the purpose of the study Recreational Diving Practice for Stress Management (DIVSTRESS),"['SELECT title, description FROM tbl_studies_info WHERE title = \'Recreational Diving Practice for Stress Management (DIVSTRESS)\';\n\nReasoning:\n\n1. First, we need to identify the study we are interested in. In this case, the study is ""Recreational Diving Practice for Stress[]']",The purpose of the study Recreational Diving Practice for Stress Management (DIVSTRESS) is to investigate the effects of recreational diving on stress management. This is based on the database output which shows that the study is about recreational diving and stress management.,"Within the components of Scuba diving there are similarities with meditation and mindfulness techniques. Perceived stress is known to be diminished during meditation practice. This study evaluates the benefits of scuba diving on perceived stress and mindful functioning. -Detailed",0.9928046799152156,0.9999999999,1.0,1.0 -How many participants was enrolled in Recreational Diving Practice for Stress Management (DIVSTRESS),"[""SELECT si.title, si.study_details->>'enrollment' AS enrollment_count\nFROM tbl_studies_info si\nWHERE si.title = 'Recreational Diving Practice for Stress Management (DIVSTRESS)';\n\nThis SQL query uses the ->> operator to extract the value of the '[]""]",The study Recreational Diving Practice for Stress Management (DIVSTRESS) did not have any participants enrolled. This is based on the database output which shows that the study did not have any participants enrolled.,67,0.98306180433842,0.0,1.0,1.0 + + + + +",0.9878074720392845,0.9999999999,1.0,1.0 +What is the purpose of the study Recreational Diving Practice for Stress Management (DIVSTRESS),"['SELECT title, description FROM tbl_studies_info WHERE title = \'Recreational Diving Practice for Stress Management (DIVSTRESS)\';\n\nReasoning:\n\n1. First, we need to identify the study we are interested in. In this case, the study is ""Recreational Diving Practice for Stress[]']",The purpose of the study Recreational Diving Practice for Stress Management (DIVSTRESS) is to investigate the effects of recreational diving on stress management. This is based on the database output which shows that the study is about recreational diving and stress management.,"evaluate the benefits of scuba diving on perceived stress and mindful functioning. It compared the effects of a one-week recreational diving course on perceived stress, mood, well-being, and mindfulness against a control group engaged in various sports activities. The study also assessed the stability of these effects one month later. + + + + + + + +",0.992808957988589,0.9999999999,1.0,1.0 +How many participants was enrolled in Recreational Diving Practice for Stress Management (DIVSTRESS),"[""SELECT si.title, si.study_details->>'enrollment' AS enrollment_count\nFROM tbl_studies_info si\nWHERE si.title = 'Recreational Diving Practice for Stress Management (DIVSTRESS)';\n\nThis SQL query uses the ->> operator to extract the value of the '[]""]",The study Recreational Diving Practice for Stress Management (DIVSTRESS) did not have any participants enrolled. This is based on the database output which shows that the study did not have any participants enrolled.,67,0.983037526226498,0.0,1.0,1.0 "What treatment was given to the participants in Exposure, Dose, Body Burden and Health Effects of Lead","[""SELECT si.title, si.study_details->>'treatment' AS treatment\nFROM tbl_studies_info si\nWHERE si.title = 'Exposure, Dose, Body Burden and Health Effects of Lead';\n\nReasoning:\n\n1. First, we need to identify the relevant tables and columns[('Exposure, Dose, Body Burden and Health Effects of Lead', None)]""]","The treatment given to the participants in Exposure, Dose, Body Burden and Health Effects of Lead is not available in the database output. This is because the column 'treatment' is not present in the table 'tbl_studies_info' for the study 'Exposure, Dose, Body Burden and Health Effects of",Not given,0.0,0.0,,1.0 -What does this following study does: Safety and Tolerability of RNS60 Given by IV to Healthy Subjects,"[""SELECT title, description, eligibility_details ->> 'Criteria' as criteria FROM tbl_studies_eligibilities WHERE title = 'Safety and Tolerability of RNS60 Given by IV to Healthy Subjects';\n\nThis SQL query selects the title, description, and criteria fields from the tbl_studies[('Safety and Tolerability of RNS60 Given by IV to Healthy Subjects', 'The objective of this study is to evaluate the safety and tolerability of RNS60 administered intravenously to healthy subjects. 12 subjects will receive RNS60 or placebo at three escalating rates for 48 hours for each rate.', 'Inclusion Criteria: Males between 18-55 years Minimum body weight of 60 kg BMI of 18-32 kg/m2 Able to execute informed written consent Exclusion Criteria: A chronic or acute disease that might interfere with the evaluation of the safety of RNS60 Current or prior malignancies (excluding...')]""]","This study does not have any specific criteria for eligibility. The criteria field in the database output is empty, which means that the study does not have any specific criteria for eligibility.",evaluate the safety and tolerability of RNS60 administered intravenously to healthy subjects. 12 subjects will receive RNS60 or placebo at three escalating rates for 48 hours for each rate.,0.7806194560758991,0.9999999999,0.0,1.0 -What is the type of following study: Recreational Diving Practice for Stress Management (DIVSTRESS),"[""SELECT si.title, si.study_details->>'study_type' AS study_type\nFROM tbl_studies_info si\nWHERE si.title = 'Recreational Diving Practice for Stress Management (DIVSTRESS)';\n\nThis SQL query selects the title and study type of the study with the given title[]""]","The study Recreational Diving Practice for Stress Management (DIVSTRESS) is a randomized controlled trial. This is based on the database output which shows that the study type is ""randomized controlled trial"".",Observational,0.9776638360022827,0.0,0.0,1.0 +What does this following study does: Safety and Tolerability of RNS60 Given by IV to Healthy Subjects,"[""SELECT title, description, eligibility_details ->> 'Criteria' as criteria FROM tbl_studies_eligibilities WHERE title = 'Safety and Tolerability of RNS60 Given by IV to Healthy Subjects';\n\nThis SQL query selects the title, description, and criteria fields from the tbl_studies[('Safety and Tolerability of RNS60 Given by IV to Healthy Subjects', 'The objective of this study is to evaluate the safety and tolerability of RNS60 administered intravenously to healthy subjects. 12 subjects will receive RNS60 or placebo at three escalating rates for 48 hours for each rate.', 'Inclusion Criteria: Males between 18-55 years Minimum body weight of 60 kg BMI of 18-32 kg/m2 Able to execute informed written consent Exclusion Criteria: A chronic or acute disease that might interfere with the evaluation of the safety of RNS60 Current or prior malignancies (excluding...')]""]","This study does not have any specific criteria for eligibility. The criteria field in the database output is empty, which means that the study does not have any specific criteria for eligibility.","the safety and tolerability of RNS60, administered intravenously, in healthy subjects. It was a Phase 1, double-blind, randomized, placebo-controlled trial involving 12 participants, who received RNS60 or placebo at three escalating rates for 48 hours each. The study took place between July and September 2011. + + + + + + + +",0.7806194560758991,0.9999999999,0.0,0.3333333333333333 +What is the type of following study: Recreational Diving Practice for Stress Management (DIVSTRESS),"[""SELECT si.title, si.study_details->>'study_type' AS study_type\nFROM tbl_studies_info si\nWHERE si.title = 'Recreational Diving Practice for Stress Management (DIVSTRESS)';\n\nThis SQL query selects the title and study type of the study with the given title[]""]","The study Recreational Diving Practice for Stress Management (DIVSTRESS) is a randomized controlled trial. This is based on the database output which shows that the study type is ""randomized controlled trial"".",Observational,0.9750458356924616,0.0,0.0,1.0 diff --git a/backend/app/ragas_try.py b/backend/app/ragas_try.py index b1410d7a..16b2a7ca 100644 --- a/backend/app/ragas_try.py +++ b/backend/app/ragas_try.py @@ -1,28 +1,11 @@ -#%% -from dotenv import load_dotenv -load_dotenv() from datasets import Dataset -import os -from ragas import evaluate -from ragas.metrics import faithfulness, answer_correctness - - -score = evaluate(dataset,metrics=[faithfulness,answer_correctness]) -score.to_pandas() -# %% import pandas as pd +from ragas import evaluate df = pd.read_csv("ragas_dataset.csv") -df.rename(columns={"question":"question","answer":"answer","context":"contexts","ground_truth":"ground_truth"},inplace=True) +df.rename(columns={"context":"contexts"},inplace=True) df['contexts'] = df['contexts'].apply(lambda x: eval(f'["""{x}"""]')) - dataset = Dataset.from_pandas(df) - -score = evaluate(dataset,metrics=[faithfulness,answer_correctness]) -score.to_pandas().to_csv('ragas_score.csv', index = False ) -# %% score_all = evaluate(dataset) -# %% -score_all -# %% +print(score_all) score_all.to_pandas().to_csv('ragas_score_all.csv', index = False ) # %%