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

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

## BaseScorer

```python
class BaseScorer(ABC):
```

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

### score

```python
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"></a>

## MathScorer

```python
class MathScorer(BaseScorer):
```

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

### __init__

```python
def __init__(self, agent: Optional[ChatAgent] = None):
```

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

### score

```python
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"></a>

## GeneralScorer

```python
class GeneralScorer(BaseScorer):
```

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

### __init__

```python
def __init__(self, agent: Optional[ChatAgent] = None):
```

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

### score

```python
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.
