Class: AWSCDK::Wisdom::CfnKnowledgeBase::SemanticChunkingConfigurationProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
wisdom/cfn_knowledge_base.rb

Overview

Settings for semantic document chunking for a data source.

Semantic chunking splits a document into smaller documents based on groups of similar content derived from the text with natural language processing.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(breakpoint_percentile_threshold:, buffer_size:, max_tokens:) ⇒ SemanticChunkingConfigurationProperty

Returns a new instance of SemanticChunkingConfigurationProperty.

Parameters:

  • breakpoint_percentile_threshold (Numeric)

    The dissimilarity threshold for splitting chunks.

  • buffer_size (Numeric)

    The buffer size.

  • max_tokens (Numeric)

    The maximum number of tokens that a chunk can contain.



1166
1167
1168
1169
1170
1171
1172
1173
# File 'wisdom/cfn_knowledge_base.rb', line 1166

def initialize(breakpoint_percentile_threshold:, buffer_size:, max_tokens:)
  @breakpoint_percentile_threshold = breakpoint_percentile_threshold
  Jsii::Type.check_type(@breakpoint_percentile_threshold, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "breakpointPercentileThreshold")
  @buffer_size = buffer_size
  Jsii::Type.check_type(@buffer_size, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "bufferSize")
  @max_tokens = max_tokens
  Jsii::Type.check_type(@max_tokens, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxTokens")
end

Instance Attribute Details

#breakpoint_percentile_thresholdNumeric (readonly)

The dissimilarity threshold for splitting chunks.



1179
1180
1181
# File 'wisdom/cfn_knowledge_base.rb', line 1179

def breakpoint_percentile_threshold
  @breakpoint_percentile_threshold
end

#buffer_sizeNumeric (readonly)

The buffer size.



1184
1185
1186
# File 'wisdom/cfn_knowledge_base.rb', line 1184

def buffer_size
  @buffer_size
end

#max_tokensNumeric (readonly)

The maximum number of tokens that a chunk can contain.



1189
1190
1191
# File 'wisdom/cfn_knowledge_base.rb', line 1189

def max_tokens
  @max_tokens
end

Class Method Details

.jsii_propertiesObject



1191
1192
1193
1194
1195
1196
1197
# File 'wisdom/cfn_knowledge_base.rb', line 1191

def self.jsii_properties
  {
    :breakpoint_percentile_threshold => "breakpointPercentileThreshold",
    :buffer_size => "bufferSize",
    :max_tokens => "maxTokens",
  }
end

Instance Method Details

#to_jsiiObject



1199
1200
1201
1202
1203
1204
1205
1206
1207
# File 'wisdom/cfn_knowledge_base.rb', line 1199

def to_jsii
  result = {}
  result.merge!({
    "breakpointPercentileThreshold" => @breakpoint_percentile_threshold,
    "bufferSize" => @buffer_size,
    "maxTokens" => @max_tokens,
  })
  result.compact
end