[ 
https://issues.apache.org/jira/browse/OPENNLP-1978?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Richard Zowalla closed OPENNLP-1978.
------------------------------------
    Resolution: Fixed

Fixed by https://github.com/apache/opennlp/pull/1310 (6331d6e19).

> SentenceVectorsDL does not truncate input to the model's maximum sequence 
> length
> --------------------------------------------------------------------------------
>
>                 Key: OPENNLP-1978
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-1978
>             Project: OpenNLP
>          Issue Type: Bug
>            Reporter: Richard Zowalla
>            Priority: Major
>             Fix For: 3.0.0
>
>
> {{SentenceVectorsDL}} encodes the whole text and runs it through the model 
> without truncating to the model's maximum sequence length \(typically 512 
> positions for BERT\-style models\). A longer input fails inside ONNX Runtime 
> and surfaces as a generic inference failure. With batched execution one 
> over\-long input fails the whole batch.
> Suggested fix: truncate to the maximum length by default \(keeping 
> {{\[SEP\]}} at the end\), with an option to reject over\-long input with an 
> {{IllegalArgumentException}} instead, and document the behavior.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to