In the below image, when i use padding and apply truncate from “post” by mentioning maxlen = 5,why don’t the sequence truncate from “post”? It is still applying truncate from “pre”
Can someone please clarify me ??
In the below image, when i use padding and apply truncate from “post” by mentioning maxlen = 5,why don’t the sequence truncate from “post”? It is still applying truncate from “pre”
Can someone please clarify me ??
Please read on the truncate
parameter of pad_sequences. The place where truncating happens is specified in the parameter. For instance, if you want to start removing items from start of row, use pre
else use post
.
Keep in mind that truncation is performed before padding. The default padding is at start of the tokens (i.e. pre)
Here are some examples: