nemo_rl.data.processors#

Contains data processors for evaluation.

Module Contents#

Functions#

math_data_processor

Process a datum dictionary (directly loaded from dataset) into a DatumSpec for the Math Environment.

_construct_multichoice_prompt

Construct prompt from question and options.

multichoice_qa_processor

Process a datum dictionary (directly loaded from dataset) into a DatumSpec for multiple-choice problems.

Data#

API#

nemo_rl.data.processors.TokenizerType#

None

nemo_rl.data.processors.math_data_processor(
datum_dict: dict[str, Any],
task_data_spec: nemo_rl.data.interfaces.TaskDataSpec,
tokenizer: nemo_rl.data.processors.TokenizerType,
max_seq_length: int,
idx: int,
) nemo_rl.data.interfaces.DatumSpec[source]#

Process a datum dictionary (directly loaded from dataset) into a DatumSpec for the Math Environment.

nemo_rl.data.processors._construct_multichoice_prompt(
prompt: str,
question: str,
options: dict[str, str],
) str[source]#

Construct prompt from question and options.

nemo_rl.data.processors.multichoice_qa_processor(
datum_dict: dict[str, Any],
task_data_spec: nemo_rl.data.interfaces.TaskDataSpec,
tokenizer: nemo_rl.data.processors.TokenizerType,
max_seq_length: int,
idx: int,
) nemo_rl.data.interfaces.DatumSpec[source]#

Process a datum dictionary (directly loaded from dataset) into a DatumSpec for multiple-choice problems.