mindspore.dataset.text.TruncateSequencePair =========================================== .. image:: https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/master/resource/_static/logo_source.svg :target: https://gitee.com/mindspore/mindspore/blob/master/docs/api/api_python/dataset_text/mindspore.dataset.text.TruncateSequencePair.rst :alt: 查看源文件 .. py:class:: mindspore.dataset.text.TruncateSequencePair(max_length) 对两列 1-D 字符串输入进行截断,使其总长度小于指定长度。 参数: - **max_length** (int) - 字符串最大输出总长。当其大于或等于两列输入字符串总长时,不进行截断; 否则,优先截取两列输入中的较长者,直至其总长等于该值。 异常: - **TypeError** - 当 `max_length` 不为int类型。 教程样例: - `文本变换样例库 `_