Class: OpenAI::Models::EvalCreateParams::TestingCriterion::TextSimilarity

Inherits:
Graders::TextSimilarityGrader show all
Defined in:
lib/openai/models/eval_create_params.rb,
sig/openai/models/eval_create_params.rbs

Instance Attribute Summary collapse

Attributes inherited from Graders::TextSimilarityGrader

#evaluation_metric, #input, #name, #reference, #type

Attributes inherited from Internal::Type::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, fields, hash, #hash, inherited, #inspect, inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, coerce_cached, coerce_with_error, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, resolve_type, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize ⇒ TextSimilarity

Returns a new instance of TextSimilarity.

Parameters:

  • evaluation_metric —

    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 —

    The text being graded.

  • name —

    The name of the grader.

  • reference —

    The text being graded against.

  • pass_threshold —

    The threshold for the score.

  • type —

    The type of grader.

  • evaluation_metric: (OpenAI::Models::Graders::TextSimilarityGrader::evaluation_metric)
  • input: (String)
  • name: (String)
  • reference: (String)
  • pass_threshold: (Float)
  • type: (:text_similarity)


489
490
491
492
493
494
495
496
# File 'sig/openai/models/eval_create_params.rbs', line 489

def initialize: (
  evaluation_metric: OpenAI::Models::Graders::TextSimilarityGrader::evaluation_metric,
  input: String,
  name: String,
  reference: String,
  pass_threshold: Float,
  ?type: :text_similarity
) -> void

Instance Attribute Details

#pass_threshold ⇒ Float

The threshold for the score.

Returns:

  • (Float)


481
# File 'lib/openai/models/eval_create_params.rb', line 481

required :pass_threshold, Float

Instance Method Details

#to_hash ⇒ { evaluation_metric: OpenAI::Models::Graders::TextSimilarityGrader::evaluation_metric, input: String, name: String, reference: String, pass_threshold: Float, ?type: :text_similarity }

Returns:

  • ({ evaluation_metric: OpenAI::Models::Graders::TextSimilarityGrader::evaluation_metric, input: String, name: String, reference: String, pass_threshold: Float, ?type: :text_similarity })


498
499
500
501
502
503
504
505
# File 'sig/openai/models/eval_create_params.rbs', line 498

def to_hash: -> {
  evaluation_metric: OpenAI::Models::Graders::TextSimilarityGrader::evaluation_metric,
  input: String,
  name: String,
  reference: String,
  pass_threshold: Float,
  ?type: :text_similarity
}