Views
No views yet
tokenizer = AutoTokenizer.from_pretrained("satyaalmasian/temporal_tagger_BERT_tokenclassifier")
model = EncoderDecoderModel.from_pretrained("satyaalmasian/temporal_tagger_BERT_tokenclassifier")
model_inputs = tokenizer(input_text, truncation=True, return_tensors="pt")
out = model.generate(**model_inputs)
decoded_preds = tokenizer.batch_decode(out, skip_special_tokens=True)
Seq2SeqTrainer from hugginface. An example of a similar fine-tuning can be found here.trainer = Seq2SeqTrainer(
model=model2model,
tokenizer=tokenizer,
args=training_args,
compute_metrics=metrics.compute_metrics,
train_dataset=train_data,
eval_dataset=val_data,
)
train_result=trainer.train()training_args is an instance of Seq2SeqTrainingArguments.
#Training data
We use four data sources:
For Pretraining :1 million weakly annotated samples from heideltime. The samples are from news articles between the 1st January 2019 and the 30th July.
Fine-tunning: Tempeval-3, Wikiwars, Tweets datasets. For the correct data versions please refer to our repository.bert-base-uncased), with a batch size of 12. We use a learning rate of 5e-05 with an Adam optimizer and linear weight decay.
Additionally, we use 2000 warmup steps.
We fine-tune the 3 benchmark data for 8 epochs with 5 different random seeds, this version of the model is the only seed=4.
The batch size and the learning rate is the same as the pre-training setup, but the warm-up steps are reduced to 100.
For training, we use 2 NVIDIA A100 GPUs with 40GB of memory.
For inference in seq2seq models, we use Greedy decoding, since beam search had sub-optimal results.