Class: Google::Cloud::Dialogflow::V2::Intent::TrainingPhrase

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/cloud/dialogflow/v2/intent.rb

Overview

Represents an example that the agent is trained on.

Defined Under Namespace

Modules: Type Classes: Part

Instance Attribute Summary collapse

Instance Attribute Details

#name::String

Returns Output only. The unique identifier of this training phrase.

Returns:

  • (::String)

    Output only. The unique identifier of this training phrase.



181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# File 'proto_docs/google/cloud/dialogflow/v2/intent.rb', line 181

class TrainingPhrase
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Represents a part of a training phrase.
  # @!attribute [rw] text
  #   @return [::String]
  #     Required. The text for this part.
  # @!attribute [rw] entity_type
  #   @return [::String]
  #     Optional. The entity type name prefixed with `@`.
  #     This field is required for annotated parts of the training phrase.
  # @!attribute [rw] alias
  #   @return [::String]
  #     Optional. The parameter name for the value extracted from the
  #     annotated part of the example.
  #     This field is required for annotated parts of the training phrase.
  # @!attribute [rw] user_defined
  #   @return [::Boolean]
  #     Optional. Indicates whether the text was manually annotated.
  #     This field is set to true when the Dialogflow Console is used to
  #     manually annotate the part. When creating an annotated part with the
  #     API, you must set this to true.
  class Part
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Represents different types of training phrases.
  module Type
    # Not specified. This value should never be used.
    TYPE_UNSPECIFIED = 0

    # Examples do not contain @-prefixed entity type names, but example parts
    # can be annotated with entity types.
    EXAMPLE = 1

    # Templates are not annotated with entity types, but they can contain
    # @-prefixed entity type names as substrings.
    # Template mode has been deprecated. Example mode is the only supported
    # way to create new training phrases. If you have existing training
    # phrases that you've created in template mode, those will continue to
    # work.
    TEMPLATE = 2
  end
end

#parts::Array<::Google::Cloud::Dialogflow::V2::Intent::TrainingPhrase::Part>

Returns Required. The ordered list of training phrase parts. The parts are concatenated in order to form the training phrase.

Note: The API does not automatically annotate training phrases like the Dialogflow Console does.

Note: Do not forget to include whitespace at part boundaries, so the training phrase is well formatted when the parts are concatenated.

If the training phrase does not need to be annotated with parameters, you just need a single part with only the Part.text field set.

If you want to annotate the training phrase, you must create multiple parts, where the fields of each part are populated in one of two ways:

  • Part.text is set to a part of the phrase that has no parameters.
  • Part.text is set to a part of the phrase that you want to annotate, and the entity_type, alias, and user_defined fields are all set.

Returns:

  • (::Array<::Google::Cloud::Dialogflow::V2::Intent::TrainingPhrase::Part>)

    Required. The ordered list of training phrase parts. The parts are concatenated in order to form the training phrase.

    Note: The API does not automatically annotate training phrases like the Dialogflow Console does.

    Note: Do not forget to include whitespace at part boundaries, so the training phrase is well formatted when the parts are concatenated.

    If the training phrase does not need to be annotated with parameters, you just need a single part with only the Part.text field set.

    If you want to annotate the training phrase, you must create multiple parts, where the fields of each part are populated in one of two ways:

    • Part.text is set to a part of the phrase that has no parameters.
    • Part.text is set to a part of the phrase that you want to annotate, and the entity_type, alias, and user_defined fields are all set.


181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# File 'proto_docs/google/cloud/dialogflow/v2/intent.rb', line 181

class TrainingPhrase
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Represents a part of a training phrase.
  # @!attribute [rw] text
  #   @return [::String]
  #     Required. The text for this part.
  # @!attribute [rw] entity_type
  #   @return [::String]
  #     Optional. The entity type name prefixed with `@`.
  #     This field is required for annotated parts of the training phrase.
  # @!attribute [rw] alias
  #   @return [::String]
  #     Optional. The parameter name for the value extracted from the
  #     annotated part of the example.
  #     This field is required for annotated parts of the training phrase.
  # @!attribute [rw] user_defined
  #   @return [::Boolean]
  #     Optional. Indicates whether the text was manually annotated.
  #     This field is set to true when the Dialogflow Console is used to
  #     manually annotate the part. When creating an annotated part with the
  #     API, you must set this to true.
  class Part
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Represents different types of training phrases.
  module Type
    # Not specified. This value should never be used.
    TYPE_UNSPECIFIED = 0

    # Examples do not contain @-prefixed entity type names, but example parts
    # can be annotated with entity types.
    EXAMPLE = 1

    # Templates are not annotated with entity types, but they can contain
    # @-prefixed entity type names as substrings.
    # Template mode has been deprecated. Example mode is the only supported
    # way to create new training phrases. If you have existing training
    # phrases that you've created in template mode, those will continue to
    # work.
    TEMPLATE = 2
  end
end

#times_added_count::Integer

Returns Optional. Indicates how many times this example was added to the intent. Each time a developer adds an existing sample by editing an intent or training, this counter is increased.

Returns:

  • (::Integer)

    Optional. Indicates how many times this example was added to the intent. Each time a developer adds an existing sample by editing an intent or training, this counter is increased.



181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# File 'proto_docs/google/cloud/dialogflow/v2/intent.rb', line 181

class TrainingPhrase
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Represents a part of a training phrase.
  # @!attribute [rw] text
  #   @return [::String]
  #     Required. The text for this part.
  # @!attribute [rw] entity_type
  #   @return [::String]
  #     Optional. The entity type name prefixed with `@`.
  #     This field is required for annotated parts of the training phrase.
  # @!attribute [rw] alias
  #   @return [::String]
  #     Optional. The parameter name for the value extracted from the
  #     annotated part of the example.
  #     This field is required for annotated parts of the training phrase.
  # @!attribute [rw] user_defined
  #   @return [::Boolean]
  #     Optional. Indicates whether the text was manually annotated.
  #     This field is set to true when the Dialogflow Console is used to
  #     manually annotate the part. When creating an annotated part with the
  #     API, you must set this to true.
  class Part
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Represents different types of training phrases.
  module Type
    # Not specified. This value should never be used.
    TYPE_UNSPECIFIED = 0

    # Examples do not contain @-prefixed entity type names, but example parts
    # can be annotated with entity types.
    EXAMPLE = 1

    # Templates are not annotated with entity types, but they can contain
    # @-prefixed entity type names as substrings.
    # Template mode has been deprecated. Example mode is the only supported
    # way to create new training phrases. If you have existing training
    # phrases that you've created in template mode, those will continue to
    # work.
    TEMPLATE = 2
  end
end

#type::Google::Cloud::Dialogflow::V2::Intent::TrainingPhrase::Type

Returns Required. The type of the training phrase.

Returns:



181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# File 'proto_docs/google/cloud/dialogflow/v2/intent.rb', line 181

class TrainingPhrase
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Represents a part of a training phrase.
  # @!attribute [rw] text
  #   @return [::String]
  #     Required. The text for this part.
  # @!attribute [rw] entity_type
  #   @return [::String]
  #     Optional. The entity type name prefixed with `@`.
  #     This field is required for annotated parts of the training phrase.
  # @!attribute [rw] alias
  #   @return [::String]
  #     Optional. The parameter name for the value extracted from the
  #     annotated part of the example.
  #     This field is required for annotated parts of the training phrase.
  # @!attribute [rw] user_defined
  #   @return [::Boolean]
  #     Optional. Indicates whether the text was manually annotated.
  #     This field is set to true when the Dialogflow Console is used to
  #     manually annotate the part. When creating an annotated part with the
  #     API, you must set this to true.
  class Part
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Represents different types of training phrases.
  module Type
    # Not specified. This value should never be used.
    TYPE_UNSPECIFIED = 0

    # Examples do not contain @-prefixed entity type names, but example parts
    # can be annotated with entity types.
    EXAMPLE = 1

    # Templates are not annotated with entity types, but they can contain
    # @-prefixed entity type names as substrings.
    # Template mode has been deprecated. Example mode is the only supported
    # way to create new training phrases. If you have existing training
    # phrases that you've created in template mode, those will continue to
    # work.
    TEMPLATE = 2
  end
end