Class: ModerationAPI::Models::ContentSubmitResponse::Casebook

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/moderation_api/models/content_submit_response.rb,
sig/moderation_api/models/content_submit_response.rbs

Overview

See Also:

  • ModerationAPI::Models::ContentSubmitResponse#casebook

Defined Under Namespace

Modules: Verdict Classes: Topic

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, 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, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, 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(id:, label:) ⇒ Object

The topic the closest matching case is filed under, or null when it has not been grouped into one yet.

Parameters:

  • id (String)
  • label (String)


# File 'lib/moderation_api/models/content_submit_response.rb', line 240

Instance Attribute Details

#agreementFloat

How unanimous the matching cases are, from 0 to 1: the share of them that decided this way, ignoring how many there are. Always at least 0.8 when a ruling is returned — below that the casebook reports a disagreement instead of picking a side — so it tells you how clean the consensus was, and is not a threshold to re-apply yourself.

Parameters:

  • value (Float)

Returns:

  • (Float)


203
# File 'lib/moderation_api/models/content_submit_response.rb', line 203

required :agreement, Float

#case_countFloat

How many of your past cases backed this ruling.

Parameters:

  • value (Float)

Returns:

  • (Float)


209
# File 'lib/moderation_api/models/content_submit_response.rb', line 209

required :case_count, Float

#confidenceFloat

How strongly the casebook holds this ruling, from 0 to 1: the agreement scaled by how much evidence backs it, so a handful of close, recent cases outweighs one distant one. Older cases count for less, halving in weight roughly every 180 days. This is the number to use in rules when you want a strength condition.

Parameters:

  • value (Float)

Returns:

  • (Float)


218
# File 'lib/moderation_api/models/content_submit_response.rb', line 218

required :confidence, Float

#similarityFloat

How close the nearest matching case is, from 0 to 1. 1 means the content is identical to something you have already decided.

Parameters:

  • value (Float)

Returns:

  • (Float)


225
# File 'lib/moderation_api/models/content_submit_response.rb', line 225

required :similarity, Float

#topicModerationAPI::Models::ContentSubmitResponse::Casebook::Topic?

The topic the closest matching case is filed under, or null when it has not been grouped into one yet.



232
# File 'lib/moderation_api/models/content_submit_response.rb', line 232

required :topic, -> { ModerationAPI::Models::ContentSubmitResponse::Casebook::Topic }, nil?: true

#verdictSymbol, ModerationAPI::Models::ContentSubmitResponse::Casebook::Verdict

The ruling your past decisions point to for this content.

Parameters:

  • value (ModerationAPI::Models::ContentSubmitResponse::Casebook::verdict)

Returns:



238
# File 'lib/moderation_api/models/content_submit_response.rb', line 238

required :verdict, enum: -> { ModerationAPI::Models::ContentSubmitResponse::Casebook::Verdict }

Instance Method Details

#to_hash{

Returns:

  • ({)


168
# File 'sig/moderation_api/models/content_submit_response.rbs', line 168

def to_hash: -> {