File: transforms.rst

package info (click to toggle)
pytorch-text 0.14.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 11,560 kB
  • sloc: python: 14,197; cpp: 2,404; sh: 214; makefile: 20
file content (101 lines) | stat: -rw-r--r-- 1,483 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
.. role:: hidden
    :class: hidden-section

torchtext.transforms
===========================

.. automodule:: torchtext.transforms
.. currentmodule:: torchtext.transforms

Transforms are common text transforms. They can be chained together using :class:`torch.nn.Sequential` or using :class:`torchtext.transforms.Sequential` to support torch-scriptability.

SentencePieceTokenizer
----------------------

.. autoclass:: SentencePieceTokenizer

   .. automethod:: forward

GPT2BPETokenizer
----------------

.. autoclass:: GPT2BPETokenizer

   .. automethod:: forward

CLIPTokenizer
-------------

.. autoclass:: CLIPTokenizer

   .. automethod:: forward

RegexTokenizer
--------------

.. autoclass:: RegexTokenizer

   .. automethod:: forward

BERTTokenizer
-------------

.. autoclass:: BERTTokenizer

   .. automethod:: forward

VocabTransform
--------------

.. autoclass:: VocabTransform

   .. automethod:: forward

ToTensor
--------

.. autoclass:: ToTensor

   .. automethod:: forward

LabelToIndex
------------

.. autoclass:: LabelToIndex

   .. automethod:: forward

Truncate
--------

.. autoclass:: Truncate

   .. automethod:: forward

AddToken
--------

.. autoclass:: AddToken

   .. automethod:: forward

Sequential
----------

.. autoclass:: Sequential

   .. automethod:: forward

PadTransform
------------

.. autoclass:: PadTransform

   .. automethod:: forward

StrToIntTransform
-----------------

.. autoclass:: StrToIntTransform

   .. automethod:: forward