Module: tfm.nlp.networks

Networks are combinations of tf.keras layers (and possibly other networks).

They are tf.keras models that would not be trained alone. It encapsulates common network structures like a transformer encoder into an easily handled object with a standardized configuration.

Classes

class AlbertEncoder: ALBERT (https://arxiv.org/abs/1810.04805) text encoder network.

class BertEncoder: Bi-directional Transformer-based encoder network.

class BertEncoderV2: Bi-directional Transformer-based encoder network.

class Classification: Classification network head for BERT modeling.

class EncoderScaffold: Bi-directional Transformer-based encoder network scaffold.

class FNet: FNet encoder network.

class FunnelTransformerEncoder: Funnel Transformer-based encoder network.

class MobileBERTEncoder: A Keras functional API implementation for MobileBERT encoder.

class PackedSequenceEmbedding: An embedding network supporting packed sequences and position ids.

class SpanLabeling: Span labeling network head for BERT modeling.

class SparseMixer: Sparse Mixer encoder network.

class XLNetBase: Base XLNet model.

class XLNetSpanLabeling: Span labeling network head for XLNet on SQuAD2.0.