TensorFlow 텍스트 소개
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
TensorFlow Text는 TensorFlow 2.0에서 사용할 수 있는 텍스트 관련 클래스 및 작업 모음을 제공합니다. 라이브러리는 텍스트 기반 모델에 정기적으로 필요한 전처리를 수행할 수 있으며 핵심 TensorFlow에서 제공되지 않는 시퀀스 모델링에 유용한 기타 기능을 포함합니다.
텍스트 전처리에서 이러한 작업을 사용하면 TensorFlow 그래프에서 수행된다는 이점이 있습니다. 훈련에서의 토큰화가 추론에서의 토큰화와 다르거나 전처리 스크립트를 관리하는 것에 대해 걱정할 필요가 없습니다.
TensorFlow 텍스트 설치
pip를 사용하여 설치
pip install로 TF Text를 설치할 때 해당 TF Text 버전을 지정해야 하므로 실행 중인 TensorFlow 버전을 기록해 두세요.
pip install -U tensorflow-text==<version>
소스에서 빌드
TensorFlow Text는 TensorFlow와 동일한 환경에서 구축되어야 합니다. 따라서 TF Text를 수동으로 빌드하는 경우 TensorFlow도 빌드하는 것이 좋습니다.
MacOS에서 빌드하는 경우 coreutils가 설치되어 있어야 합니다. 아마도 Homebrew를 사용하는 것이 가장 쉽습니다. 먼저 소스에서 TensorFlow를 빌드합니다.
TF Text 저장소를 복제합니다.
git clone https://github.com/tensorflow/text.git
마지막으로 빌드 스크립트를 실행하여 pip 패키지를 생성합니다.
./oss_scripts/run_build.sh
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[null,null,["최종 업데이트: 2025-07-25(UTC)"],[],[],null,["# Introduction to TensorFlow Text\n\n\u003cbr /\u003e\n\nTensorFlow Text provides a collection of text related classes and ops ready to\nuse with TensorFlow 2.0. The library can perform the preprocessing regularly\nrequired by text-based models, and includes other features useful for sequence\nmodeling not provided by core TensorFlow.\n\nThe benefit of using these ops in your text preprocessing is that they are done\nin the TensorFlow graph. You do not need to worry about tokenization in training\nbeing different than the tokenization at inference, or managing preprocessing\nscripts.\n\nInstall TensorFlow Text\n-----------------------\n\n### Install using pip\n\nWhen installing TF Text with pip install, note the version of TensorFlow you are\nrunning, as you should specify the corresponding version of TF Text. \n\n pip install -U tensorflow-text==\u003cversion\u003e\n\n### Build from source\n\nTensorFlow Text must be built in the same environment as TensorFlow. Thus, if\nyou manually build TF Text, it is highly recommended that you also build\nTensorFlow.\n\nIf building on MacOS, you must have coreutils installed. It is probably easiest\nto do with Homebrew. First, build TensorFlow\n[from source](https://www.tensorflow.org/install/source).\n\nClone the TF Text repo. \n\n git clone https://github.com/tensorflow/text.git\n\nFinally, run the build script to create a pip package. \n\n ./oss_scripts/run_build.sh"]]