API reference for text and NLP libraries.
Stay organized with collections
Save and categorize content based on your preferences.
KerasNLP
API reference
The easiest way to get started processing text in TensorFlow is to use KerasNLP,
a natural language processing library that provides modular components with
state-of-the-art preset weights and architectures. You can use KerasNLP
components out-of-the-box or customize them as needed. KerasNLP
emphasizes in-graph computation for all workflows, so you can expect easy
productionization using the TensorFlow ecosystem.
To install KerasNLP, see
Installation.
TensorFlow Text
API reference
The tensorflow_text
package provides a collection of text related classes and
ops ready to use with TensorFlow. The library can perform the preprocessing
regularly required by text-based models, and includes other features useful for
sequence modeling not provided by core TensorFlow.
For installation details, refer to the
the guide
TensorFlow Models - NLP
API reference
The
TensorFlow Models repository
provides implementations of state-of-the-art (SOTA) models. The
tensorflow-models-official
pip package includes many high-level functions and
classes for building SOTA NLP models including nlp.layers
, nlp.losses
,
nlp.models
and nlp.tasks
.
You can install the package with pip
:
$ pip install tensorflow-models-official # For the latest release
$ #or
$ pip install tf-models-nightly # For the nightly build
The NLP functionality is available in the tfm.nlp
submodule.
import tensorflow_models as tfm
tfm.nlp
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 2023-06-03 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 2023-06-03 UTC."],[],[],null,["# API reference for text and NLP libraries.\n\nKerasNLP\n--------\n\n[API reference](https://keras.io/api/keras_nlp/)\n\nThe easiest way to get started processing text in TensorFlow is to use KerasNLP,\na natural language processing library that provides modular components with\nstate-of-the-art preset weights and architectures. You can use KerasNLP\ncomponents out-of-the-box or customize them as needed. KerasNLP\nemphasizes in-graph computation for all workflows, so you can expect easy\nproductionization using the TensorFlow ecosystem.\n\nTo install KerasNLP, see\n[Installation](https://keras.io/keras_nlp/#installation).\n\nTensorFlow Text\n---------------\n\n[API reference](https://www.tensorflow.org/text/api_docs/python/text)\n\nThe `tensorflow_text` package provides a collection of text related classes and\nops ready to use with TensorFlow. The library can perform the preprocessing\nregularly required by text-based models, and includes other features useful for\nsequence modeling not provided by core TensorFlow.\n\nFor installation details, refer to the\n[the guide](https://www.tensorflow.org/text/guide/tf_text_intro)\n\nTensorFlow Models - NLP\n-----------------------\n\n[API reference](https://tensorflow.org/api_docs/python/tfm/nlp)\n\nThe\n[TensorFlow Models repository](https://github.com/tensorflow/models)\nprovides implementations of state-of-the-art (SOTA) models. The\n`tensorflow-models-official` pip package includes many high-level functions and\nclasses for building SOTA NLP models including [`nlp.layers`](https://www.tensorflow.org/api_docs/python/tfm/nlp/layers), [`nlp.losses`](https://www.tensorflow.org/api_docs/python/tfm/nlp/losses),\n[`nlp.models`](https://www.tensorflow.org/api_docs/python/tfm/nlp/models) and [`nlp.tasks`](https://www.tensorflow.org/api_docs/python/tfm/nlp/tasks).\n\nYou can install the package with `pip`: \n\n $ pip install tensorflow-models-official # For the latest release\n $ #or\n $ pip install tf-models-nightly # For the nightly build\n\nThe NLP functionality is available in the [`tfm.nlp`](https://www.tensorflow.org/api_docs/python/tfm/nlp) submodule. \n\n import tensorflow_models as tfm\n tfm.nlp"]]