clarify number_filtering task

This commit is contained in:
Andreas Koepf 2025-02-08 19:32:45 +01:00
parent f562737eef
commit 4d9afcaba2
2 changed files with 3 additions and 4 deletions

View file

@ -4,7 +4,6 @@ from dataclasses import dataclass
from typing import Any, Dict, Optional, Tuple
import sympy as sp
from sympy import Eq, Symbol, expand, solve
from ..factory import ProceduralDataset, register_dataset
@ -23,7 +22,7 @@ class PolynomialMultiplicationConfig:
max_degree: int = 3 # Maximum polynomial degree
min_polynomials: int = 2 # Minimum number of polynomials being multiplied
max_polynomials: int = 3 # Maximum number of polynomials being multiplied
single_variable: bool = (True,)
single_variable: bool = True
operators: Tuple[str, ...] = (
"+",
"-",
@ -116,7 +115,7 @@ class PolynomialMultiplicationDataset(ProceduralDataset):
variable = self._get_variable(rng)
degree = rng.randint(self.config.min_degree, self.config.max_degree)
x = Symbol(variable)
x = sp.Symbol(variable)
# Choose the number of terms and their respective degrees
num_terms = rng.randint(self.config.min_terms, self.config.max_terms)

View file

@ -86,7 +86,7 @@ class NumberFilteringDataset(ProceduralDataset):
return {
"question": (
f"{keep_remove.capitalize()} all numbers {larger_smaller} than {filter_str} "
f"in this list: {str_numbers}"
f"in this list: {str_numbers}\nReturn the new list in the same format."
),
"answer": str(result_strs) if result_strs else "[]",
"metadata": {