A TextSimilarityGrader object which grades text based on similarity metrics.

interface EvalTextSimilarityGrader {
    evaluation_metric:
        | "fuzzy_match"
        | "bleu"
        | "gleu"
        | "meteor"
        | "rouge_1"
        | "rouge_2"
        | "rouge_3"
        | "rouge_4"
        | "rouge_5"
        | "rouge_l"
        | "cosine";
    input: string;
    name?: string;
    pass_threshold: number;
    reference: string;
    type: "text_similarity";
}

Properties

evaluation_metric:
    | "fuzzy_match"
    | "bleu"
    | "gleu"
    | "meteor"
    | "rouge_1"
    | "rouge_2"
    | "rouge_3"
    | "rouge_4"
    | "rouge_5"
    | "rouge_l"
    | "cosine"

The evaluation metric to use. One of cosine, fuzzy_match, bleu, gleu, meteor, rouge_1, rouge_2, rouge_3, rouge_4, rouge_5, or rouge_l.

input: string

The text being graded.

name?: string

The name of the grader.

pass_threshold: number

A float score where a value greater than or equal indicates a passing grade.

reference: string

The text being graded against.

type: "text_similarity"

The type of grader.