Skip to content

Commit 94eed1f

Browse files
authored
Special Tokens (#2)
* add special tokens * special tokens * pylint * flake8
1 parent f0718f0 commit 94eed1f

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Some shared utilities across multiple ASYML projects.
55

66
## List of Modules
77
* `asyml_utilities.hyperparams.HParams`
8+
* `asyml_utilities.special_tokens.SpecialTokens`
89

910
## License
1011
[Apache License 2.0](./LICENSE)

asyml_utilities/special_tokens.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
__all__ = [
2+
'SpecialTokens',
3+
]
4+
5+
6+
class SpecialTokens:
7+
r"""Special tokens, including :attr:`PAD`, :attr:`BOS`, :attr:`EOS`,
8+
:attr:`UNK`. These tokens will by default have token ids 0, 1, 2, 3,
9+
respectively.
10+
"""
11+
PAD = "<PAD>"
12+
BOS = "<BOS>"
13+
EOS = "<EOS>"
14+
UNK = "<UNK>"

0 commit comments

Comments
 (0)