Last updated
Copyright © 2023 Arize AI, Inc
Last updated
We have built simple functions for using our eval prompt templates. These prompts are tested against and target precision at 70-90% and F1 at 70-85%. We use , our open-source package to run evaluations.
To use our evaluators, follow these steps below.
llm_classify
runs LLM as a Judge across your LLM outputs. You can use any of the evaluation templates below. You can see notebook tutorials on how to use these in our Phoenix repo.
All of our evaluators are easily imported with the phoenix library, which you can install using this command below.
Import the pre-tested evaluators along with the helper functions using this code snippet.
For this example, we will create the dataframe from scratch to include the required columns we need -- input
, reference
, and output
.
Then you can use the llm_classify
function to run the evals on your dataframe.
Now you have the results of your hallucination eval and QA correctness eval! See the results below when you print your results (data not included).
hallucination_eval_df
qa_correctness_eval_df
The models are instantiated and usable in the LLM Eval function. The models are also directly callable with strings.
If you are unsure where eval to choose,✨. Navigate to the main chat in the UI and ask Copilot to suggest a Phoenix eval for your application.
The LLM Classify uses a library to classify and generate Evals. Arize uses the Arize Phoenix open source library to run phoenix .
Next, you need to setup the evaluators to use a specific large language model provider. This example uses OpenAIModel
, but you can use any of our . In this example, we will use the hallucination evaluator and the QA correctness evaluator.
Our evaluation functions require dataframes to be passed with specific column names. You can construct these dataframes manually or you can manipulate the dataframes you retrieve from or .
If you'd like, you can to save the results.
We currently support a growing set of models for LLM Evals, please check out the
🎓 Learn more about the concept of .