Skip to content

Commit

Permalink
Special Tokens (#2)
Browse files Browse the repository at this point in the history
* add special tokens

* special tokens

* pylint

* flake8
  • Loading branch information
hepengfe authored Apr 6, 2022
1 parent f0718f0 commit 94eed1f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Some shared utilities across multiple ASYML projects.

## List of Modules
* `asyml_utilities.hyperparams.HParams`
* `asyml_utilities.special_tokens.SpecialTokens`

## License
[Apache License 2.0](./LICENSE)
14 changes: 14 additions & 0 deletions asyml_utilities/special_tokens.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
__all__ = [
'SpecialTokens',
]


class SpecialTokens:
r"""Special tokens, including :attr:`PAD`, :attr:`BOS`, :attr:`EOS`,
:attr:`UNK`. These tokens will by default have token ids 0, 1, 2, 3,
respectively.
"""
PAD = "<PAD>"
BOS = "<BOS>"
EOS = "<EOS>"
UNK = "<UNK>"

0 comments on commit 94eed1f

Please sign in to comment.