from typing import override

from srs2std.evaluate.factcheck_strategies.scorers.scorer import (
    BERT,
    DEFAULT_BATCH_SIZE,
    DEFAULT_DEVICE,
)


class FactCGDeBERTa(BERT):
    model_path = "yaxili96/FactCG-DeBERTa-v3-Large"
    max_model_len = 2048
    device = DEFAULT_DEVICE
    batch_size = DEFAULT_BATCH_SIZE // 4

    # setting for the classifier
    label2id = {"unsupported": 0, "supported": 1}

    @override
    def _concat_doc_and_claim(self, doc, claim):
        return (
            "{text_a}\n"
            "\n"
            'Choose your answer: based on the paragraph above can we conclude that "{text_b}"?\n'
            "\n"
            "OPTIONS:\n"
            "- Yes\n"
            "- No\n"
            "I think the answer is "
        ).format(text_a=doc, text_b=claim)
