<pre><code>encoder_inputs = Input(shape=(max_len_text,)) 
</code></pre>
<p>So you must set <code>max_len_text</code>.</p>
<p>As far as I can see from (<a href="https://arxiv.org/pdf/1409.0473.pdf" rel="nofollow noreferrer">Bahdanau et al., 2015</a>), there is no restriction on the input length of Attention layer. The rest ist just collecting LSTM intermediate state, which should not depend on input length either.</p>
<p>Have you tried setting a different <code>max_len_text</code> during inference than during model building? (set it dynamically for every inference, i.e. for every input text you are summarizing)</p>
Text summarization for unknown target text size
<p>I'm using Tensorflow keras library in python3 for text summarization of unknown text size.</p>
<p>I'm using the code explain in <a href="https://www.analyticsvidhya.com/blog/2019/06/comprehensive-guide-text-summarization-using-deep-learning-python/" rel="nofollow noreferrer">this link</a> for text summarization. but it looks like the code has a set up value for the maximum size for the input text to be summarized because it already knows what text size it's going to summarize. But what if I don't know? I mean if I have to do the summarization for many texts that I don't know the total size of them??</p>
<p>the error text was too long so I was not successfull in finding something relevant to my case.</p>
<p>so the error is :</p>
<blockquote>
<p>indices[0,0] = 30 is not in [0, 13) [[node
model_2/embedding_1/embedding_lookup (defined at
C:\Users\f_pc\Desktop\class_python.py:314) ]]
[Op:__inference_predict_function_19765]</p>
<p>Errors may have originated from an input operation. Input Source
operations connected to node model_2/embedding_1/embedding_lookup:
model_2/embedding_1/embedding_lookup/19252 (defined at
D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\contextlib.py:112)</p>
<p>Function call stack: predict_function</p>
</blockquote>
<p>I was trying also by</p>
<pre><code>max_text_len=800
max_summary_len=500
</code></pre>
<p>but adding up this size, the analysis time increases but there was also</p>