View Source GoogleApi.ContentWarehouse.V1.Model.NlpSemanticParsingAnnotationEvalData (google_api_content_warehouse v0.4.0)

Annotators whose semantics are represented via a protocol message should add to that message a field or extension of this type and set it using Annotator::PopulateAnnotationEvalData to enable span-based evaluation metrics in training. Evaluation is done based on token spans. The byte span aligns with the token span and is used when saving examples. Background: In some settings, the examples used to induce/train a grammar do not specify complete semantics of an annotation. For example, some examples that come from Ewok specify only the span associated with each annotation. This message allows evaluation metrics to test the span by embedding it in the semantics. LINT.IfChange

Attributes

  • additionalSpans (type: list(GoogleApi.ContentWarehouse.V1.Model.NlpSemanticParsingAnnotationEvalData.t), default: nil) - Additional spans after the first. Empty in all additional_spans.
  • numBytes (type: integer(), default: nil) -
  • numTokens (type: integer(), default: nil) -
  • startByte (type: integer(), default: nil) - Byte position within the utterance. Safe to use across different components of the NLU stack as long as said components have access to the same query.
  • startToken (type: integer(), default: nil) - Token position. This is cleared when normalizing examples for storage because tokenization changes over time. DO NOT use these two fields across components that use different tokenizations.

Summary

Functions

Unwrap a decoded JSON object into its complex fields.

Types

@type t() ::
  %GoogleApi.ContentWarehouse.V1.Model.NlpSemanticParsingAnnotationEvalData{
    additionalSpans: [t()] | nil,
    numBytes: integer() | nil,
    numTokens: integer() | nil,
    startByte: integer() | nil,
    startToken: integer() | nil
  }

Functions

@spec decode(struct(), keyword()) :: struct()

Unwrap a decoded JSON object into its complex fields.