Skip to content

euroeval.prompt_templates.linguistic_acceptability

[docs] module euroeval.prompt_templates.linguistic_acceptability

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
"""Templates for the Linguistic Acceptability task."""

from ..data_models import PromptConfig
from ..languages import DA, DE, EN, ES, FI, FO, FR, IS, IT, NB, NL, NN, NO, PT, SV

LA_TEMPLATES = {
    DA: PromptConfig(
        default_prompt_label_mapping=dict(correct="ja", incorrect="nej"),
        default_prompt_prefix="Følgende er sætninger og om de er grammatisk korrekte.",
        default_prompt_template="Sætning: {text}\nGrammatisk korrekt: {label}",
        default_instruction_prompt="Sætning: {text}\n\nBestem om sætningen er "
        "grammatisk korrekt eller ej. Svar kun med {labels_str}, og intet andet.",
    ),
    DE: PromptConfig(
        default_prompt_label_mapping=dict(correct="ja", incorrect="nein"),
        default_prompt_prefix="Die folgenden Sätze und ob sie grammatikalisch korrekt "
        "sind.",
        default_prompt_template="Satz: {text}\nGrammatikalisch richtig: {label}",
        default_instruction_prompt="Satz: {text}\n\nBestimmen Sie, ob der Satz "
        "grammatikalisch korrekt ist oder nicht. Antworten Sie mit {labels_str}, und "
        "nichts anderes.",
    ),
    EN: PromptConfig(
        default_prompt_label_mapping=dict(correct="yes", incorrect="no"),
        default_prompt_prefix="The following are sentences and whether they are "
        "grammatically correct.",
        default_prompt_template="Sentence: {text}\nGrammatically correct: {label}",
        default_instruction_prompt="Sentence: {text}\n\nDetermine whether the sentence "
        "is grammatically correct or not. Answer with {labels_str}, and nothing else.",
    ),
    ES: PromptConfig(
        default_prompt_label_mapping=dict(correct="sí", incorrect="no"),
        default_prompt_prefix="Lo siguiente son textos y si son gramaticalmente "
        "correctos.",
        default_prompt_template="Texto: {text}\nGramaticalmente correcto: {label}",
        default_instruction_prompt="Texto: {text}\n\nDetermina si el texto es "
        "gramaticalmente correcto o no. Responde con {labels_str}, y nada más.",
    ),
    PT: PromptConfig(
        default_prompt_label_mapping=dict(correct="sim", incorrect="não"),
        default_prompt_prefix="Seguem-se abaixo textos e se são "
        "gramaticalmente correctos",
        default_prompt_template="Texto: {text}\nGramaticalmente correcto: {label}",
        default_instruction_prompt="Texto: {text}\n\nDetermina se o texto é "
        "gramaticalmente correcto ou não. Responde com {labels_str}, e nada mais.",
    ),
    FI: PromptConfig(
        default_prompt_label_mapping=dict(correct="kyllä", incorrect="ei"),
        default_prompt_prefix="Seuraavat ovat lauseita ja ovatko ne "
        "kieliopillisesti oikein.",
        default_prompt_template="Lause: {text}\nKieliopillisesti oikein: {label}",
        default_instruction_prompt="Lause: {text}\n\nMääritä onko lause "
        "oikein vai ei. Vastaa {labels_str}, ja ei mitään muuta.",
    ),
    FO: PromptConfig(
        default_prompt_label_mapping=dict(correct="ja", incorrect="nei"),
        default_prompt_prefix="Hetta eru nakrir setningar og um teir eru mállæruliga "
        "rættir.",
        default_prompt_template="Setningur: {text}\nMállæruliga rættur: {label}",
        default_instruction_prompt="Setningur: {text}\n\nGreinið hvort setningurin er "
        "mállæruliga rættur ella ikki. Svara við {labels_str}, og einki annað.",
    ),
    FR: PromptConfig(
        default_prompt_label_mapping=dict(correct="oui", incorrect="non"),
        default_prompt_prefix="Les phrases suivantes indiquent si elles sont "
        "grammaticalement correctes.",
        default_prompt_template="Phrase : {text}\nCorrect du point de vue grammatical: "
        "{label}",
        default_instruction_prompt="Phrase: {text}\n\nDéterminez si la phrase est "
        "grammaticalement correcte ou non. Répondez par {labels_str}, et rien d'autre.",
    ),
    IS: PromptConfig(
        default_prompt_label_mapping=dict(correct="já", incorrect="nei"),
        default_prompt_prefix="Eftirfarandi eru setningar og hvort þær eru "
        "málfræðilega réttar.",
        default_prompt_template="Setning: {text}\nMálfræðilega rétt: {label}",
        default_instruction_prompt="Setning: {text}\n\nGreinið hvort setningin er "
        "málfræðilega rétt eða ekki. Svaraðu með {labels_str}, og ekkert annað.",
    ),
    IT: PromptConfig(
        default_prompt_label_mapping=dict(correct="si", incorrect="no"),
        default_prompt_prefix="Di seguito sono riportate le frasi e la loro "
        "correttezza grammaticale.",
        default_prompt_template="Frase : {text}\nGrammaticalmente corretto : {label}",
        default_instruction_prompt="Frase: {text}\n\nStabilite se la frase è "
        "grammaticalmente corretta o meno. Rispondere con {labels_str}, e nient'altro.",
    ),
    NB: PromptConfig(
        default_prompt_label_mapping=dict(correct="ja", incorrect="nei"),
        default_prompt_prefix="Følgende er setninger og hvorvidt de er grammatisk "
        "korrekte.",
        default_prompt_template="Setning: {text}\nGrammatisk korrekt: {label}",
        default_instruction_prompt="Setning: {text}\n\nBestem om setningen er "
        "grammatisk korrekt eller ikke. Svar med {labels_str}, og ikke noe annet.",
    ),
    NL: PromptConfig(
        default_prompt_label_mapping=dict(correct="ja", incorrect="nee"),
        default_prompt_prefix="Hieronder staan zinnen en of ze grammaticaal correct "
        "zijn.",
        default_prompt_template="Zin: {text}\nGrammaticaal correct: {label}",
        default_instruction_prompt="Zin: {text}\n\nBepaal of de zin grammaticaal "
        "correct is of niet. Antwoord met {labels_str}, en verder niets.",
    ),
    NN: PromptConfig(
        default_prompt_label_mapping=dict(correct="ja", incorrect="nei"),
        default_prompt_prefix="Følgende er setninger og hvorvidt de er grammatisk "
        "korrekte.",
        default_prompt_template="Setning: {text}\nGrammatisk korrekt: {label}",
        default_instruction_prompt="Setning: {text}\n\nBestem om setningen er "
        "grammatisk korrekt eller ikke. Svar med {labels_str}, og ikke noe annet.",
    ),
    NO: PromptConfig(
        default_prompt_label_mapping=dict(correct="ja", incorrect="nei"),
        default_prompt_prefix="Følgende er setninger og hvorvidt de er grammatisk "
        "korrekte.",
        default_prompt_template="Setning: {text}\nGrammatisk korrekt: {label}",
        default_instruction_prompt="Setning: {text}\n\nBestem om setningen er "
        "grammatisk korrekt eller ikke. Svar med {labels_str}, og ikke noe annet.",
    ),
    SV: PromptConfig(
        default_prompt_label_mapping=dict(correct="ja", incorrect="nej"),
        default_prompt_prefix="Följande är meningar och huruvida de är grammatiskt "
        "korrekta.",
        default_prompt_template="Mening: {text}\nGrammatisk korrekt: {label}",
        default_instruction_prompt="Mening: {text}\n\nBestäm om meningen är "
        "grammatiskt korrekt eller inte. Svara med {labels_str}, och inget annat.",
    ),
}