英文

SlovakT5-small

这个模型是在 run_t5_mlm_flax.py 的略微改进代码上进行训练的。如果想了解训练细节或评估结果,请参考 SlovakT5_report.pdf 。对于评估,您也可以运行 SlovakT5_eval.ipynb

如何使用

SlovakT5-small 可以用于许多不同的下游任务的微调。例如,NER(命名实体识别):

from transformers import AutoTokenizer, T5ForConditionalGeneration

tokenizer = AutoTokenizer.from_pretrained("ApoTro/slovak-t5-small")
model = T5ForConditionalGeneration.from_pretrained("ApoTro/slovak-t5-small")

input_ids = tokenizer("ner veta: Do druhého kola postúpili Robert Fico a Andrej Kiska s rozdielom 4,0%.", return_tensors="pt").input_ids
labels = tokenizer("per: Robert Fico | per: Andrej Kiska", return_tensors="pt").input_ids

# the forward function automatically creates the correct decoder_input_ids
loss = model(input_ids=input_ids, labels=labels).loss
loss.item()