Add an Encoding.sequences to allow masking

This commit is contained in:
Anthony MOI
2020-11-05 13:12:15 -05:00
committed by Anthony MOI
parent 385d25720a
commit 57d162b269
8 changed files with 74 additions and 1 deletions

View File

@@ -327,6 +327,17 @@ class Encoding:
"""
pass
@property
def sequences(self) -> List[Optional[int]]:
"""The generated sequence indices.
They represent the index of the input sequence associated to each token.
The sequence id can be None if the token is not related to any input sequence,
like for example with special tokens.
Returns:
A :obj:`List` of :obj:`Optional[int]`: A list of optional sequence index.
"""
@property
def type_ids(self) -> List[int]:
"""The generated type IDs