From 286ccefb4894e2353c36cb3c1d387232093cd9f6 Mon Sep 17 00:00:00 2001 From: Apoorv Garg <57873504+Apoorvgarg-creator@users.noreply.github.com> Date: Tue, 31 Aug 2021 15:58:37 +0530 Subject: [PATCH] doc mismatch fixed (#13345) --- docs/source/preprocessing.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/source/preprocessing.rst b/docs/source/preprocessing.rst index d0af7d2506..eb8d8702db 100644 --- a/docs/source/preprocessing.rst +++ b/docs/source/preprocessing.rst @@ -243,15 +243,16 @@ three arguments you need to know for this are :obj:`padding`, :obj:`truncation` - :obj:`truncation` controls the truncation. It can be a boolean or a string which should be: - - :obj:`True` or :obj:`'only_first'` truncate to a maximum length specified by the :obj:`max_length` argument or + - :obj:`True` or :obj:`'longest_first'` truncate to a maximum length specified by the :obj:`max_length` argument or the maximum length accepted by the model if no :obj:`max_length` is provided (``max_length=None``). This will - only truncate the first sentence of a pair if a pair of sequence (or a batch of pairs of sequences) is provided. + truncate token by token, removing a token from the longest sequence in the pair until the proper length is + reached. - :obj:`'only_second'` truncate to a maximum length specified by the :obj:`max_length` argument or the maximum length accepted by the model if no :obj:`max_length` is provided (``max_length=None``). This will only truncate the second sentence of a pair if a pair of sequence (or a batch of pairs of sequences) is provided. - - :obj:`'longest_first'` truncate to a maximum length specified by the :obj:`max_length` argument or the maximum - length accepted by the model if no :obj:`max_length` is provided (``max_length=None``). This will truncate token - by token, removing a token from the longest sequence in the pair until the proper length is reached. + - :obj:`'only_first'` truncate to a maximum length specified by the :obj:`max_length` argument or the maximum + length accepted by the model if no :obj:`max_length` is provided (``max_length=None``). This will only truncate + the first sentence of a pair if a pair of sequence (or a batch of pairs of sequences) is provided. - :obj:`False` or :obj:`'do_not_truncate'` to not truncate the sequences. As we have seen before, this is the default behavior.