πŸ“„ FlanΒΆ

templates.regression.two_texts.similarity.flan

OutputQuantizingTemplate(
    instruction="Evaluate the similarity between them and classify them into classes from 0-5 as follows:
0 : The two sentences are completely dissimilar.
1 : The two sentences are not equivalent, but are on the same topic.
2 : The two sentences are not equivalent, but share some details.
3 : The two sentences are roughly equivalent, but some important information differs/missing.
4 : The two sentences are mostly equivalent, but some unimportant details differ.
5 : The two sentences are completely equivalent, as they mean the same thing.",
    input_format="Sentence 1: {text1} Sentence 2: {text2}",
    output_format="{attribute_value}",
    quantum=1,
    postprocessors=[
        "processors.take_first_non_empty_line",
        "processors.cast_to_float_return_zero_if_failed",
    ],
)
[source]

References: processors.cast_to_float_return_zero_if_failed, processors.take_first_non_empty_line

Read more about catalog usage here.