def METHOD_NAME(self, query_lprobs, cand_lprobs):
    if self.args.wsc_cross_entropy:
        return F.cross_entropy(
            torch.cat([query_lprobs, cand_lprobs]).unsqueeze(0),
            query_lprobs.new([0]).long(),
        )
    else:
        return (
            - query_lprobs
            + self.args.wsc_margin_alpha * (
                cand_lprobs - query_lprobs + self.args.wsc_margin_beta
            ).clamp(min=0)
        ).sum()