컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
텐서플로우:: 작전:: 문자열 Ngram
#include <string_ops.h>
비정형 문자열 데이터에서 ngram을 생성합니다.
요약
이 작업은 문자열만 포함하는 1개의 비정형 차원이 있는 비정형 텐서를 허용하고 가장 안쪽 축을 따라 결합된 해당 문자열의 ngram을 포함하는 1개의 비정형 차원을 포함하는 비정형 텐서를 출력합니다.
인수:
- 범위: 범위 개체
- data: ngram을 만들 비정형 문자열 텐서의 값 텐서입니다. 1D 문자열 텐서여야 합니다.
- data_splits: ngram을 만들기 위한 비정형 문자열 텐서의 분할 텐서입니다.
- 구분 기호: 토큰 요소 사이에 추가할 문자열입니다. 구분 기호가 없으면 ""를 사용하세요.
- ngram_widths: 생성할 ngram의 크기입니다.
- left_pad: ngram 시퀀스의 왼쪽을 채우는 데 사용할 문자열입니다. pad_width != 0인 경우에만 사용됩니다.
- right_pad: ngram 시퀀스의 오른쪽을 채우는 데 사용할 문자열입니다. pad_width != 0인 경우에만 사용됩니다.
- pad_width: 각 시퀀스의 각 측면에 추가할 패딩 요소 수입니다. 패딩은 이 값에 관계없이 'ngram_widths'-1보다 클 수 없습니다.
pad_width=-1
인 경우 max(ngram_widths)-1
요소를 추가합니다.
보고:
-
Output
ngrams: 출력 ngram 비정형 텐서의 값 텐서입니다. -
Output
ngrams_splits: 출력 ngrams 비정형 텐서의 분할 텐서입니다.
공개 속성
공공 기능
문자열 Ngram
StringNGrams(
const ::tensorflow::Scope & scope,
::tensorflow::Input data,
::tensorflow::Input data_splits,
StringPiece separator,
const gtl::ArraySlice< int > & ngram_widths,
StringPiece left_pad,
StringPiece right_pad,
int64 pad_width,
bool preserve_short_sequences
)
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[null,null,["최종 업데이트: 2025-07-25(UTC)"],[],[],null,["# tensorflow::ops::StringNGrams Class Reference\n\ntensorflow::ops::StringNGrams\n=============================\n\n`#include \u003cstring_ops.h\u003e`\n\nCreates ngrams from ragged string data.\n\nSummary\n-------\n\nThis op accepts a ragged tensor with 1 ragged dimension containing only strings and outputs a ragged tensor with 1 ragged dimension containing ngrams of that string, joined along the innermost axis.\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- data: The values tensor of the ragged string tensor to make ngrams out of. Must be a 1D string tensor.\n- data_splits: The splits tensor of the ragged string tensor to make ngrams out of.\n- separator: The string to append between elements of the token. Use \"\" for no separator.\n- ngram_widths: The sizes of the ngrams to create.\n- left_pad: The string to use to pad the left side of the ngram sequence. Only used if pad_width != 0.\n- right_pad: The string to use to pad the right side of the ngram sequence. Only used if pad_width != 0.\n- pad_width: The number of padding elements to add to each side of each sequence. Note that padding will never be greater than 'ngram_widths'-1 regardless of this value. If `pad_width=-1`, then add `max(ngram_widths)-1` elements.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) ngrams: The values tensor of the output ngrams ragged tensor.\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) ngrams_splits: The splits tensor of the output ngrams ragged tensor.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [StringNGrams](#classtensorflow_1_1ops_1_1_string_n_grams_1a52a1f08705af6ba58d3607b809b3f835)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` data, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` data_splits, StringPiece separator, const gtl::ArraySlice\u003c int \u003e & ngram_widths, StringPiece left_pad, StringPiece right_pad, int64 pad_width, bool preserve_short_sequences)` ||\n\n| ### Public attributes ||\n|------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [ngrams](#classtensorflow_1_1ops_1_1_string_n_grams_1a447bd501492adc42e453473dd818baf0) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [ngrams_splits](#classtensorflow_1_1ops_1_1_string_n_grams_1af326c6b4d4d0f53e7b7360546c807526) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [operation](#classtensorflow_1_1ops_1_1_string_n_grams_1a96bbeebe04843441f8b36c587ed4f1c9) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n\nPublic attributes\n-----------------\n\n### ngrams\n\n```text\n::tensorflow::Output ngrams\n``` \n\n### ngrams_splits\n\n```scdoc\n::tensorflow::Output ngrams_splits\n``` \n\n### operation\n\n```text\nOperation operation\n``` \n\nPublic functions\n----------------\n\n### StringNGrams\n\n```gdscript\n StringNGrams(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input data,\n ::tensorflow::Input data_splits,\n StringPiece separator,\n const gtl::ArraySlice\u003c int \u003e & ngram_widths,\n StringPiece left_pad,\n StringPiece right_pad,\n int64 pad_width,\n bool preserve_short_sequences\n)\n```"]]