from arize.experiments import (
ExperimentTaskFieldNames,
EvaluationResultFieldNames,
)
# Define field mappings for the LLM task id and example output
task_fields = ExperimentTaskFieldNames(
example_id="example_id", output="result"
)
# Define field mappings for evaluator
evaluator_fields = EvaluationResultFieldNames(
label="label",
score="score",
explanation="explanation_text",
)
# This maps the dataset ID to the example_id
dataset_examples = client.datasets.list_examples(dataset_id=dataset_id, all=True)
dataset_df = dataset_examples.to_df()
experiment_run_df["example_id"] = dataset_df["id"]