kpi6research / Bert-as-a-Library

Bert as a Library is a Tensorflow library for quick and easy training and finetuning of models based on Bert
MIT License
12 stars 2 forks source link

Multi-label classification #1

Open woiza opened 4 years ago

woiza commented 4 years ago

Hi,

can your library be used for multi-label classification?

PinkDraconian commented 3 years ago

This is entirely possible. Example:

ft_model = BertFTModel( model_dir='uncased_L-12_H-768_A-12',
                         ckpt_name="bert_model.ckpt",
                         labels=['0','1', '2', '3', '4'],
                         lr=1e-05,
                         num_train_steps=30000,
                         num_warmup_steps=1000,
                         ckpt_output_dir='output',
                         save_check_steps=1000,
                         do_lower_case=False,
                         max_seq_len=50,
                         batch_size=32,
                         )