Toggle Menu
Prev Up Next

# `langchain.evaluation.loading`.load_evaluator

langchain.evaluation.loading.load_evaluator(evaluator: EvaluatorType, *, llm: Optional[BaseLanguageModel] = None, **kwargs: Any) → Union[Chain, StringEvaluator]

  Load the requested evaluation chain specified by a string.

  Parameters

    - evaluator (EvaluatorType) – The type of evaluator to load.

    - llm (BaseLanguageModel, optional) – The language model to use for evaluation, by default None

    - **kwargs (Any) – Additional keyword arguments to pass to the evaluator.

  Returns

    The loaded evaluation chain.

  Return type

    Chain

  Examples

      >>> from langchain.evaluation import load_evaluator, EvaluatorType
      >>> evaluator = load_evaluator(EvaluatorType.QA)

# Examples using load_evaluator

- ANTHROPIC_API_KEY=<YOUR ANTHROPIC API KEY>

- Alternatively

- Check for the presence of a YYYY-MM-DD string.

- Correct

- Initialize the language model

- The prompt was assigned to the evaluator

- The results purely character-based, so it’s less useful when negation is concerned

- This is equivalent to loading using the enum

- You can load by enum or by raw python string

- pairwise_embedding_distance.md