# ScoreStringEvalChain

> **Class** in `langchain_classic`

📖 [View in docs](https://reference.langchain.com/python/langchain-classic/evaluation/scoring/eval_chain/ScoreStringEvalChain)

A chain for scoring on a scale of 1-10 the output of a model.

## Signature

```python
ScoreStringEvalChain()
```

## Description

**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."
# }

## Extends

- `StringEvaluator`
- `LLMEvalChain`
- `LLMChain`

## Properties

- `output_key`
- `output_parser`
- `normalize_by`
- `criterion_name`
- `model_config`
- `requires_reference`
- `requires_input`
- `evaluation_name`

## Methods

- [`is_lc_serializable()`](https://reference.langchain.com/python/langchain-classic/evaluation/scoring/eval_chain/ScoreStringEvalChain/is_lc_serializable)
- [`from_llm()`](https://reference.langchain.com/python/langchain-classic/evaluation/scoring/eval_chain/ScoreStringEvalChain/from_llm)

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/9f232caa7a8fe1ca042a401942d5d90d54ceb1a6/libs/langchain/langchain_classic/evaluation/scoring/eval_chain.py#L150)