In this repository, we introduce TabFormerLite, a fork of IBM's TabFormer library. The original TabFormer library implements a transformer-based model for tabular time-series data, described in Padhi et al. 2021.
In TabFormerLite, we address some of the limitations encountered in the original TabFormer library. Our changes have resulted in an updated model that is lighter, more flexible, and faster to train.
The key modifications we have introduced are detailed below.
We use HuggingFace's Trainer to facilitate the training process for both pre-training and fine-tuning of the TabFormerLite model.
TabFormerLite can be used to accomplish the following tasks:
TabFormerLite requires the following packages to be installed:
(X.Y.Z) represents the versions on which we tested the code.
The required packages can be installed with pip:
$ pip install -r requirements.txt
Or with Poetry:
$ poetry install
Running the following command line will pre-process your data to be suitable for the model.
$ python3 scripts/encode_dataset.py -cfg --path-to-config-files
An example of a configuration file is available in: ./configs/example/data_encoding/ and can be used like this:
$ python3 scripts/encode_dataset.py -cfg ./configs/example/data_encoding/config_card_dataset_encoding.json
Once the data pre-processing step is complete, use the following command to pre-train the model.
$ python3 scripts/run_mlm_pretraining.py -cfg --path-to-config-files
An example of a configuration file is available in: ./configs/example/pre-training/ and can be used like this:
$ python3 scripts/run_mlm_pretraining.py -cfg ./configs/example/pretraining/config_card_dataset_size_300.json
Running the following command line extracts embeddings from a pre-trained model.
$ python3 scripts/inference_main.py -cfg --path-to-config-files
An example of a configuration file is available in the folder: ./configs/example/inference/ and can be used like this:
e.g.
$ python3 scripts/inference_main.py -cfg configs/example/inference/config_card_dataset_inference.json
Running the following command line will fine-tune the model on a downstream task.
$ python3 scripts/finetuning.py -cfg --path-to-config-files
An example of a configuration file is available in the folder: ./configs/example/finetuning/ and can be used like this:
e.g.
$ python3 scripts/finetuning.py -cfg configs/example/finetuning/config_card_finetuning.json
Python
75.4%
Jupyter Notebook
24.6%
In this repository, we introduce TabFormerLite, a fork of IBM's TabFormer library. The original TabFormer library implements a transformer-based model for tabular time-series data, described in Padhi et al. 2021.
In TabFormerLite, we address some of the limitations encountered in the original TabFormer library. Our changes have resulted in an updated model that is lighter, more flexible, and faster to train.
The key modifications we have introduced are detailed below.
We use HuggingFace's Trainer to facilitate the training process for both pre-training and fine-tuning of the TabFormerLite model.
TabFormerLite can be used to accomplish the following tasks:
TabFormerLite requires the following packages to be installed:
(X.Y.Z) represents the versions on which we tested the code.
The required packages can be installed with pip:
$ pip install -r requirements.txt
Or with Poetry:
$ poetry install
Running the following command line will pre-process your data to be suitable for the model.
$ python3 scripts/encode_dataset.py -cfg --path-to-config-files
An example of a configuration file is available in: ./configs/example/data_encoding/ and can be used like this:
$ python3 scripts/encode_dataset.py -cfg ./configs/example/data_encoding/config_card_dataset_encoding.json
Once the data pre-processing step is complete, use the following command to pre-train the model.
$ python3 scripts/run_mlm_pretraining.py -cfg --path-to-config-files
An example of a configuration file is available in: ./configs/example/pre-training/ and can be used like this:
$ python3 scripts/run_mlm_pretraining.py -cfg ./configs/example/pretraining/config_card_dataset_size_300.json
Running the following command line extracts embeddings from a pre-trained model.
$ python3 scripts/inference_main.py -cfg --path-to-config-files
An example of a configuration file is available in the folder: ./configs/example/inference/ and can be used like this:
e.g.
$ python3 scripts/inference_main.py -cfg configs/example/inference/config_card_dataset_inference.json
Running the following command line will fine-tune the model on a downstream task.
$ python3 scripts/finetuning.py -cfg --path-to-config-files
An example of a configuration file is available in the folder: ./configs/example/finetuning/ and can be used like this:
e.g.
$ python3 scripts/finetuning.py -cfg configs/example/finetuning/config_card_finetuning.json
Python
75.4%
Jupyter Notebook
24.6%