> For the complete documentation index, see [llms.txt](https://remi-calizzano.gitbook.io/benchmark-for-transformers/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://remi-calizzano.gitbook.io/benchmark-for-transformers/add-custom-features.md).

# Add custom features

## Task

To add a new task, you have to create a new model class that corresponds to your task. The model has to be a sub-class of `Model` and implement at least the function `_predict`.

The `_predict`function takes `x` as input and return the prediction of the model. `x` is a list that contains the values from the `x_column_name` (see [dataset parameters](/benchmark-for-transformers/get-started.md#dataset)) of the dataset. The prediction is directly pass to the metric. The format of the prediction returned must correspond to the format that the metric needs.

Once it done, you just have to put the path of the python script containing the new model class to the `model_class` of the scenario.

## Dataset

All the datasets from the [`datasets`](https://huggingface.co/docs/datasets/) library can be used. If you want to use a local dataset, you can create you own script (see [instructions](https://huggingface.co/nlp/add_dataset.html)) as scripts in `examples/datasets/`.

## Metric

As for the datasets, all the metrics from [`datasets`](https://huggingface.co/docs/datasets/) can be used. You can add your metric by creating a script in `examples/metrics/`.
