def METHOD_NAME(self, question, head, tail, y):
    """
    :param question: tokenized question ({"attention_mask": [0,0,...,1]})
    :param head: idx of the head entity
    :param tail: idx of the tail entity
    :param y: the score of the triple, either 0 or 1
    :return:
    """
    input_ids = torch.reshape(question['input_ids'], (-1, self.max_len))
    attention_mask = torch.reshape(question['attention_mask'], (-1, self.max_len))
    pooled_output = self.bert(input_ids=input_ids.to(self.device),
                              attention_mask=attention_mask.to(self.device),
                              return_dict=False)[1].to(self.device)
    true_rel = torch.FloatTensor(self.rel_embedding.iloc[y].values.tolist()).to(self.device)
    dropout_output = self.dropout(pooled_output).to(self.device)
    predicted_rel = self.linear(dropout_output).to(self.device)
    triple_score = self.score((head, predicted_rel, tail)).to(self.device)
    distance = (predicted_rel - true_rel).norm(p=1, dim=1)
    return distance, triple_score