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

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/dialogflow/v2/doc/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

#nameString

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

Returns:

  • (String)

    Output only. The unique identifier of this training phrase.



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/intent.rb', line 145

class TrainingPhrase
  # 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 [true, false]
  #     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; 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

#partsArray<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.


145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/intent.rb', line 145

class TrainingPhrase
  # 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 [true, false]
  #     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; 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_countInteger

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.



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/intent.rb', line 145

class TrainingPhrase
  # 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 [true, false]
  #     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; 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

#typeGoogle::Cloud::Dialogflow::V2::Intent::TrainingPhrase::Type

Returns Required. The type of the training phrase.

Returns:



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/intent.rb', line 145

class TrainingPhrase
  # 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 [true, false]
  #     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; 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