> ## Documentation Index
> Fetch the complete documentation index at: https://docs.camel-ai.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Camel.datagen.evol instruct.scorer

<a id="camel.datagen.evol_instruct.scorer" />

<a id="camel.datagen.evol_instruct.scorer.BaseScorer" />

## BaseScorer

```python theme={"system"}
class BaseScorer(ABC):
```

<a id="camel.datagen.evol_instruct.scorer.BaseScorer.score" />

### score

```python theme={"system"}
def score(self, reference_prompt: str, candidate_prompt: str):
```

Compare a candidate prompt against a reference prompt and
return a tuple of scores. The higher the score, the better.
For example, (diversity, difficulty, feasibility).

<a id="camel.datagen.evol_instruct.scorer.MathScorer" />

## MathScorer

```python theme={"system"}
class MathScorer(BaseScorer):
```

<a id="camel.datagen.evol_instruct.scorer.MathScorer.__init__" />

### **init**

```python theme={"system"}
def __init__(self, agent: Optional[ChatAgent] = None):
```

<a id="camel.datagen.evol_instruct.scorer.MathScorer.score" />

### score

```python theme={"system"}
def score(self, reference_problem: str, new_problem: str):
```

Evaluates the new math problem relative to the reference math
problem.

**Parameters:**

* **reference\_problem** (str): The reference math problem.
* **new\_problem** (str): The new or evolved math problem.

**Returns:**

Dict\[str, int]: A dictionary with scores for diversity, difficulty,
validity, and solvability.

<a id="camel.datagen.evol_instruct.scorer.GeneralScorer" />

## GeneralScorer

```python theme={"system"}
class GeneralScorer(BaseScorer):
```

<a id="camel.datagen.evol_instruct.scorer.GeneralScorer.__init__" />

### **init**

```python theme={"system"}
def __init__(self, agent: Optional[ChatAgent] = None):
```

<a id="camel.datagen.evol_instruct.scorer.GeneralScorer.score" />

### score

```python theme={"system"}
def score(self, reference_problem: str, new_problem: str):
```

Evaluates the new problem against the reference problem using
structured scoring.

**Parameters:**

* **reference\_problem** (str): The original problem.
* **new\_problem** (str): The evolved or new problem.

**Returns:**

Dict\[str, int]: A dictionary with scores for diversity, complexity,
and validity.
