Skip to content

Code for evaluating uncertainty estimation methods for Transformer-based architectures in natural language understanding tasks.

License

Notifications You must be signed in to change notification settings

mourga/transformer-uncertainty

Repository files navigation

transformer-uncertainty

Code for evaluating uncertainty estimation methods for Transformer-based architectures in natural language understanding tasks.

Uncertainty Methods

Environment

Create a conda environment, download the required torch package and the rest of the requirements:

conda create -n unc_env python=3.7
conda activate unc_env
conda install pytorch=1.2.0 torchvision cudatoolkit=10.0 -c pytorch
pip install -r requirements.txt

See this pytorch page to download correctly pytorch to your machine.

Datasets

Download GLUE datasets:

bash get_data.sh

Run model

For example run:

python main_transformer --dataset_name rte 
                        --model_type bert 
                        --model_name_or_path bert-base-uncased 
                        --do_lower_case 
                        --seed 1234 
                        --unc_method bayes_adapt

See main_transformer.py for the rest of arguments.

Related Work

About

Code for evaluating uncertainty estimation methods for Transformer-based architectures in natural language understanding tasks.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published