alistairewj / bert-deid

deidentify patient notes using pre-trained BERT
12 stars 2 forks source link

Migrate to pytorch-transformers 1.2.0 #6

Closed tompollard closed 5 years ago

tompollard commented 5 years ago

Migrate to pytorch-transformers 1.2.0, following the notes at: https://github.com/huggingface/transformers/blob/master/docs/source/migration.md

Training runs with something along the lines of:

CUDA_VISIBLE_DEVICES=0 python train_bert.py 
--data_path ./data/binary/i2b2_2014 
--model_path ./tmp  
--bert_model bert-large-cased 
--task_name i2b2 
--max_seq_length=128 
--do_train 
--train_batch_size 32 
--num_train_epochs 3 
--warmup_proportion=0.4 
--seed 7802;

Tests are passing with the new trained model.

It looks like pytorch-transformers is now transformers, so we'll probably want to make another update to the version shortly.