简体   繁体   English

未知目标文本大小的文本摘要

[英]Text summarization for unknown target text size

I'm using Tensorflow keras library in python3 for text summarization of unknown text size.我在 python3 中使用 Tensorflow keras 库进行未知文本大小的文本摘要。

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] index[0,0] = 30 不在 [0, 13) [[node model_2/embedding_1/embedding_lookup(定义在 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)连接到节点model_2/embedding_1/embedding_lookup的输入源操作:model_2/embedding_1/embedding_lookup/19252(定义在D:\\obj\\windows-release\\37amd64_Release\\msi_python\\zip_amd64\\contextlib.py:112)

Function call stack: predict_function函数调用栈: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 .所以你必须设置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.据我所知Bahdanau et al., 2015 ),Attention 层的输入长度没有限制。 The rest ist just collecting LSTM intermediate state, which should not depend on input length either.剩下的只是收集 LSTM 中间状态,这也不应该依赖于输入长度。

Have you tried setting a different max_len_text during inference than during model building?您是否尝试在推理期间设置与模型构建期间不同的max_len_text (set it dynamically for every inference, ie for every input text you are summarizing) (为每个推理动态设置它,即为您总结的每个输入文本)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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