You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/inference/inference-apis.asciidoc
+61-1Lines changed: 61 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,6 @@ Elastic –, then create an {infer} endpoint by the <<put-inference-api>>.
35
35
Now use <<semantic-search-semantic-text, semantic text>> to perform
36
36
<<semantic-search, semantic search>> on your data.
37
37
38
-
39
38
[discrete]
40
39
[[default-enpoints]]
41
40
=== Default {infer} endpoints
@@ -53,6 +52,67 @@ For these models, the minimum number of allocations is `0`.
53
52
If there is no {infer} activity that uses the endpoint, the number of allocations will scale down to `0` automatically after 15 minutes.
54
53
55
54
55
+
[discrete]
56
+
[[infer-chunking-config]]
57
+
=== Configuring chunking
58
+
59
+
{infer-cap} endpoints have a limit on the amount of text they can process at once, determined by the model's input capacity.
60
+
Chunking is the process of splitting the input text into pieces that remain within these limits.
61
+
It occurs when ingesting documents into <<semantic-text,`semantic_text` fields>>.
62
+
Chunking also helps produce sections that are digestible for humans.
63
+
Returning a long document in search results is less useful than providing the most relevant chunk of text.
64
+
65
+
Each chunk will include the text subpassage and the corresponding embedding generated from it.
66
+
67
+
By default, documents are split into sentences and grouped in sections up to 250 words with 1 sentence overlap so that each chunk shares a sentence with the previous chunk.
68
+
Overlapping ensures continuity and prevents vital contextual information in the input text from being lost by a hard break.
69
+
70
+
{es} uses the https://unicode-org.github.io/icu-docs/[ICU4J] library to detect word and sentence boundaries for chunking.
71
+
https://unicode-org.github.io/icu/userguide/boundaryanalysis/#word-boundary[Word boundaries] are identified by following a series of rules, not just the presence of a whitespace character.
72
+
For written languages that do use whitespace such as Chinese or Japanese dictionary lookups are used to detect word boundaries.
73
+
74
+
75
+
[discrete]
76
+
==== Chunking strategies
77
+
78
+
Two strategies are available for chunking: `sentence` and `word`.
79
+
80
+
The `sentence` strategy splits the input text at sentence boundaries.
81
+
Each chunk contains one or more complete sentences ensuring that the integrity of sentence-level context is preserved, except when a sentence causes a chunk to exceed a word count of `max_chunk_size`, in which case it will be split across chunks.
82
+
The `sentence_overlap` option defines the number of sentences from the previous chunk to include in the current chunk which is either `0` or `1`.
83
+
84
+
The `word` strategy splits the input text on individual words up to the `max_chunk_size` limit.
85
+
The `overlap` option is the number of words from the previous chunk to include in the current chunk.
86
+
87
+
The default chunking strategy is `sentence`.
88
+
89
+
NOTE: The default chunking strategy for {infer} endpoints created before 8.16 is `word`.
90
+
91
+
92
+
[discrete]
93
+
==== Example of configuring the chunking behavior
94
+
95
+
The following example creates an {infer} endpoint with the `elasticsearch` service that deploys the ELSER model by default and configures the chunking behavior.
0 commit comments