text.Reduction
Stay organized with collections
Save and categorize content based on your preferences.
Type of reduction to be done by the n-gram op.
The supported reductions are as follows:
Class Variables |
MEAN
|
<Reduction.MEAN: 2>
|
STRING_JOIN
|
<Reduction.STRING_JOIN: 3>
|
SUM
|
<Reduction.SUM: 1>
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-04-11 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-04-11 UTC."],[],[],null,["# text.Reduction\n\n\u003cbr /\u003e\n\n|--------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/text/blob/v2.19.0/tensorflow_text/python/ops/ngrams_op.py#L40-L52) |\n\nType of reduction to be done by the n-gram op.\n\nThe supported reductions are as follows:\n\n- [`Reduction.SUM`](../text/Reduction#SUM): Add values in the window.\n- [`Reduction.MEAN`](../text/Reduction#MEAN): Average values in the window.\n- [`Reduction.STRING_JOIN`](../text/Reduction#STRING_JOIN): Join strings in the window.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Class Variables --------------- ||\n|-------------|------------------------------|\n| MEAN | `\u003cReduction.MEAN: 2\u003e` |\n| STRING_JOIN | `\u003cReduction.STRING_JOIN: 3\u003e` |\n| SUM | `\u003cReduction.SUM: 1\u003e` |\n\n\u003cbr /\u003e"]]