__init__.py — langchain Source File
Architecture documentation for __init__.py, a python file in the langchain codebase. 1 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 873caf76_d8c2_f87d_a99f_9618daa8481f["__init__.py"] b24c58a9_b7e7_0d40_177d_3e6558f24262["langchain_classic.evaluation.scoring.eval_chain"] 873caf76_d8c2_f87d_a99f_9618daa8481f --> b24c58a9_b7e7_0d40_177d_3e6558f24262 style 873caf76_d8c2_f87d_a99f_9618daa8481f fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
"""Scoring evaluators.
This module contains evaluators for scoring on a 1-10 the output of models,
be they LLMs, Chains, or otherwise. This can be based on a variety of
criteria and or a reference answer.
Example:
>>> from langchain_openai import ChatOpenAI
>>> from langchain_classic.evaluation.scoring import ScoreStringEvalChain
>>> model = ChatOpenAI(temperature=0, model_name="gpt-4")
>>> chain = ScoreStringEvalChain.from_llm(llm=model)
>>> result = chain.evaluate_strings(
... input="What is the chemical formula for water?",
... prediction="H2O",
... reference="The chemical formula for water is H2O.",
... )
>>> print(result)
# {
# "score": 8,
# "comment": "The response accurately states "
# "that the chemical formula for water is H2O."
# "However, it does not provide an explanation of what the formula means."
# }
"""
from langchain_classic.evaluation.scoring.eval_chain import (
LabeledScoreStringEvalChain,
ScoreStringEvalChain,
)
__all__ = ["LabeledScoreStringEvalChain", "ScoreStringEvalChain"]
Dependencies
- langchain_classic.evaluation.scoring.eval_chain
Source
Frequently Asked Questions
What does __init__.py do?
__init__.py is a source file in the langchain codebase, written in python.
What does __init__.py depend on?
__init__.py imports 1 module(s): langchain_classic.evaluation.scoring.eval_chain.
Where is __init__.py in the architecture?
__init__.py is located at libs/langchain/langchain_classic/evaluation/scoring/__init__.py (directory: libs/langchain/langchain_classic/evaluation/scoring).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free