@@ -40,7 +40,7 @@ class Vocab(object):
4040 between tokens and indices to be used. If provided, adjust the tokens
4141 and indices mapping according to it. If None, counter must be provided.
4242 Default: None.
43- unk_token (str, optional): Special token for unknow token. If no need,
43+ unk_token (str, optional): Special token for unknown token. If no need,
4444 it also could be None. Default: None.
4545 pad_token (str, optional): Special token for padding token. If no need,
4646 it also could be None. Default: None.
@@ -214,7 +214,7 @@ def to_tokens(self, indices):
214214 for idx in indices :
215215 if not isinstance (idx , (int , np .integer )):
216216 warnings .warn (
217- "The type of `to_tokens()`'s input `indices` is not `int` which will be forcibly transfered to `int`. "
217+ "The type of `to_tokens()`'s input `indices` is not `int` which will be forcibly transferred to `int`. "
218218 )
219219 idx = int (idx )
220220
@@ -382,7 +382,7 @@ def from_dict(cls, token_to_idx, unk_token=None, pad_token=None, bos_token=None,
382382 Args:
383383 token_to_idx (dict): A dict describes the mapping relationship between
384384 tokens and indices.
385- unk_token (str, optional): The special token for unknow token. If
385+ unk_token (str, optional): The special token for unknown token. If
386386 no need, it also could be None. Default: None.
387387 pad_token (str, optional): The special token for padding token. If
388388 no need, it also could be None. Default: None.
@@ -440,7 +440,7 @@ def build_vocab(
440440 ** kwargs
441441 ):
442442 """
443- Builds the :class:`Vocab` accoring to given iterator and other
443+ Builds the :class:`Vocab` according to given iterator and other
444444 information. Firstly, iterate over the `iterator` to construct a
445445 :class:`collections.Counter` and used to init the as :class:`Vocab`.
446446
@@ -455,7 +455,7 @@ def build_vocab(
455455 relationship between tokens and indices to be used. If provided,
456456 adjust the tokens and indices mapping according to it. If None,
457457 counter must be provided. Default: None.
458- unk_token (str, optional): The special token for unknow token
458+ unk_token (str, optional): The special token for unknown token
459459 '<unk>'. If no need, it also could be None. Default: None.
460460 pad_token (str, optional): The special token for padding token
461461 '<pad>'. If no need, it also could be None. Default: None.
0 commit comments