简体   繁体   中英

Text summarization for unknown target text size

I'm using Tensorflow keras library in python3 for text summarization of unknown text size.

I'm using the code explain in this link 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??

the error text was too long so I was not successfull in finding something relevant to my case.

so the error is :

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]

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)

Function call stack: predict_function

I was trying also by

max_text_len=800
max_summary_len=500

but adding up this size, the analysis time increases but there was also

encoder_inputs = Input(shape=(max_len_text,)) 

So you must set max_len_text .

As far as I can see from ( Bahdanau et al., 2015 ), 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.

Have you tried setting a different max_len_text during inference than during model building? (set it dynamically for every inference, ie for every input text you are summarizing)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM