我正在尝试在我的自定义数据集上微调“RobertaForQuestionAnswering”,但我对它需要的输入参数感到困惑。这是示例代码。
>>> from transformers import RobertaTokenizer, RobertaForQuestionAnswering
>>> import torch
>>> tokenizer = RobertaTokenizer.from_pretrained('roberta-base')
>>> model = RobertaForQuestionAnswering.from_pretrained('roberta-base')
>>> question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"
>>> inputs = tokenizer(question, text, return_tensors='pt')
>>> start_positions = torch.tensor([1])
>>> end_positions = torch.tensor([3])
>>> outputs = model(**inputs, start_positions=start_positions, end_positions=end_positions)
>>> loss = outputs.loss
>>> start_scores = outputs.start_logits
>>> end_scores = outputs.end_logits
我无法理解模型中作为输入给出的变量start_positions和end_positions以及正在生成的变量start_scores和end_scores 。