Python 在文章不存在标签或预期输出摘要的情况下,使用BERT进行文章摘要

Python 在文章不存在标签或预期输出摘要的情况下,使用BERT进行文章摘要,python,machine-learning,nlp,artificial-intelligence,Python,Machine Learning,Nlp,Artificial Intelligence,我正在从事一个项目,在这个项目中,我有一些限制,我不能使用提取方法来总结一篇文章,而必须使用BERT来完成这项工作。如果这是一个标签问题(总结推特、评论、问题),其中我有列车数据的相应标签,我会使用来自BERT的向量作为Keras嵌入层LSTM的输入,并构建一个带有输入和输出标签的模型。但问题是,我必须总结文本,而不是那些贴有标签的推文和评论。当我有对应于词汇表的向量时,是否有任何方法(我确信有,因为有人特别要求我)可以使用BERT?您有很多文档,希望自动汇总,但您没有任何培训数据。我想你的文件

我正在从事一个项目,在这个项目中,我有一些限制,我不能使用提取方法来总结一篇文章,而必须使用BERT来完成这项工作。如果这是一个标签问题(总结推特、评论、问题),其中我有列车数据的相应标签,我会使用来自BERT的向量作为
Keras
嵌入层
LSTM
的输入,并构建一个带有输入和输出标签的模型。但问题是,我必须总结文本,而不是那些贴有标签的推文和评论。当我有对应于词汇表的向量时,是否有任何方法(我确信有,因为有人特别要求我)可以使用BERT?

您有很多文档,希望自动汇总,但您没有任何培训数据。我想你的文件是英文的。幸运的是,BERT是一个预先训练好的模型,甚至还有专门用于总结的库,而且非常容易使用。如果其中一个符合你的目标,你试过了吗? 例如:

输出:

印度银行是一家印度国有金融服务公司,成立于1907年,总部位于印度钦奈。银行的总业务量已达到₹截至2019年3月31日,43亿欧元(600亿美元)


你能添加一个示例数据样本和预期输出吗?这将有助于理解你的问题。这就是问题所在。我没有任何预期的输出。输入是任何文件说我的问题以上。您和我可以总结一下,我想对没有任何预期输出的文档使用BERT,如果您什么都不期望,一切都可以;)哦谢谢。这是很有帮助的,我们将立即在此基础上建立一个最先进的模型!很抱歉。但它仍然可以帮助我查看示例输入和您希望从模型接收的相应输出!
from summarizer import Summarizer

body = ''' Indian Bank is an Indian state-owned financial services company established in 1907 and headquartered in Chennai, India. 
It has 20,924 employees, 2900 branches with 2861 ATMs and 1014 cash deposit machines and is one of the top performing public sector banks in India. 
Total business of the bank has touched ₹430,000 crore (US$60 billion) as on 31 March 2019. Bank's Information Systems & Security processes certified with ISO27001:2013 standard and is among very few Banks certified worldwide. 
It has overseas branches in Colombo and Singapore including a Foreign Currency Banking Unit at Colombo and Jaffna. It has 227 Overseas Correspondent banks in 75 countries.
Since 1969, the Government of India has owned the bank. As per the announcement made by the Indian Finance Minister Nirmala Sitharaman on 30 August 2019, Indian Bank will be anchor bank for the Kolkata-based Allahabad Bank, and this merger is expected to come on force from 1 April 2020, making it the seventh largest bank in the country. '''


model = Summarizer()
result = model(body, min_length=60)
full = ''.join(result)
print(full)