79638255

Date: 2025-05-26 03:16:50
Score: 3
Natty:
Report link

Hi Swati,

According to your first question, you can set maxlen argument to pad_sequence(), and than the Embedding input length set the same value.
( ref: https://www.tensorflow.org/api_docs/python/tf/keras/utils/pad_sequences#args )

About the question-2, you need to statistic your all sentences length distributed, and choose the mode value of all sentences length distributed.
( ref: https://www.carted.com/blog/variable-length-sequences-in-tensorflow-part-1/ )

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Jung-Yi Tsai