WO2020107878A1 - 文本摘要生成方法、装置、计算机设备及存储介质 - Google Patents

文本摘要生成方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2020107878A1
WO2020107878A1 PCT/CN2019/092616 CN2019092616W WO2020107878A1 WO 2020107878 A1 WO2020107878 A1 WO 2020107878A1 CN 2019092616 W CN2019092616 W CN 2019092616W WO 2020107878 A1 WO2020107878 A1 WO 2020107878A1
Authority
WO
WIPO (PCT)
Prior art keywords
text
word vector
text summary
extracted
model
Prior art date
Application number
PCT/CN2019/092616
Other languages
English (en)
French (fr)
Inventor
金戈
徐亮
肖京
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020107878A1 publication Critical patent/WO2020107878A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • This application relates to the field of artificial intelligence technology, and in particular, to a method, device, computer equipment, and storage medium for generating a text summary.
  • the existing text summary generation method is mainly extractive, which extracts sentences from the target text to generate a text summary, but this method takes a long time to generate a text summary, and the accuracy of the text summary is not high, and the user's reading experience is poor.
  • Embodiments of the present application provide a method, an apparatus, a computer device, and a storage medium for generating a text summary, and are intended to solve the problems of time-consuming text generation, low accuracy, and poor user reading experience.
  • an embodiment of the present application provides a method for generating a text summary, which includes: preprocessing the target text and converting the preprocessed target text with a word vector tool to obtain a word vector; A framed text summary model, using the word vector as input to the text summary model and training the text summary model in a loop iteration to output the sentence to be extracted; preprocessing the text to be processed and converting it into a word vector , Inputting the word vector of the text to be processed into the trained text summary model and outputting a plurality of sentences to be extracted; scoring the plurality of sentences to be extracted according to a preset scoring function model, and according to the The scores of the extracted sentences generate text summaries.
  • an embodiment of the present application further provides a text summary generating device, which includes: a conversion unit for preprocessing the target text and converting the preprocessed target text with a word vector tool to obtain a word vector ; Construction unit for constructing a text summary model with encoding and decoding as a frame, using the word vector as the input of the text summary model and training the text summary model in a cyclic iteration to output the sentence to be extracted; Summary unit, used to preprocess the text to be processed and converted into word vectors, input the word vector of the text to be processed into the text summary model after training, and output multiple sentences to be extracted; A scoring function model is set to score the multiple sentences to be extracted, and a text summary is generated according to the scores of the sentences to be extracted.
  • an embodiment of the present application further provides a computer device, which includes a memory and a processor, a computer program is stored on the memory, and the processor implements the computer program to implement the method according to the first aspect described above .
  • an embodiment of the present application further provides a computer-readable storage medium that stores a computer program, and when the computer program is executed by a processor, the method according to the first aspect described above can be implemented.
  • FIG. 1 is a schematic diagram of an application scenario of a method for generating a text summary provided by an embodiment of this application;
  • FIG. 2 is a schematic flowchart of a method for generating a text summary provided by an embodiment of this application;
  • FIG. 3 is a schematic diagram of a sub-process of a method for generating a text summary provided by an embodiment of the present application
  • FIG. 4 is a schematic diagram of a sub-process of a method for generating a text summary provided by an embodiment of the present application
  • FIG. 5 is a schematic diagram of a sub-process of a method for generating a text summary provided by an embodiment of the present application
  • FIG. 6 is a schematic diagram of a sub-process of a method for generating a text summary provided by an embodiment of the present application
  • FIG. 7 is a schematic block diagram of an apparatus for generating a text summary provided by an embodiment of this application.
  • FIG. 8 is a schematic block diagram of a specific unit of a device for generating a text summary provided by an embodiment of this application;
  • FIG. 9 is a schematic block diagram of a training unit of a text summary generating apparatus provided by an embodiment of this application.
  • FIG. 10 is a schematic block diagram of a computer device provided by an embodiment of the present application.
  • FIG. 1 is a schematic diagram of an application scenario of a method for generating a text summary provided by an embodiment of the present application.
  • FIG. 2 is a schematic flowchart of a method for generating a text summary provided by an embodiment of the present application.
  • the text summary generation method is specifically applied in the terminal 10, and is realized through interaction between the terminal 10 and the server 20.
  • FIG. 2 is a schematic flowchart of a method for generating a text summary provided by an embodiment of the present application. As shown, the method includes the following steps S110-S140.
  • the word vector tool is a natural language processing tool, and its function is to convert words in natural language into word vectors that can be understood by a computer.
  • Traditional word vectors are susceptible to dimensional disasters, and any two words are isolated and cannot reflect the relationship between words. Therefore, in this embodiment, the word vector tool word2vec is used to obtain the word vector. It can reflect the similarity between words by calculating the distance between vectors.
  • Word2Vec mainly uses Skip-Gram and CBOW two models to realize the conversion of word vectors. In this embodiment, Skip-Gram is used to realize the conversion of word vectors.
  • the Skip-Gram model mainly uses the center word to predict the context of the word, for example, " The sentence "Today's weather is good” predicts its "today” above and “beautiful” below by entering the central word "weather”.
  • the step S110 may include steps S111-S112.
  • the target text is the text used for training, and is obtained according to the needs of the user.
  • the target text can be obtained from the server through a web crawler or the user from the database.
  • the preprocessing includes: first removing the punctuation marks in the target text, calculating the word frequency to remove the low frequency words, then segmenting the target text, and constructing the vocabulary based on the word segmentation of the target text Table, and finally encode according to the word segmentation to get the initial word vector.
  • the initial word vector refers to expressing words in the form of one-hot coding, for example, after the participle "Today's weather is really good” gets today/weather/really good, and then performs one-hot coding according to the participle to get the initial word vector, "Today “Corresponds to [100], "weather” corresponds to [010] and "really good” corresponds to [001].
  • the Skip-Gram model has been pre-trained.
  • the Skip-Gram model includes an input layer, a hidden layer, and an output layer.
  • the activation function is not used for the mapping from the input layer to the hidden layer, and the hidden layer to the output layer uses Huo. Fuman tree optimization.
  • the Huffman tree is a binary tree, the nodes of the leaves represent the words in the vocabulary, and the weights of the leaf nodes represent the word frequency. The greater the weight of the leaf node, the closer to the root node, the path from the root node of the Huffman tree to the leaf node That is, the probability of words. After optimization of the Huffman tree, it can greatly reduce the amount of calculation and speed up the generation of text summaries.
  • the sentence "Today's weather is really good” input the initial word vector [010] of the word "weather” to the Skip-Gram model, and finally get the "true” word vector ⁇ 0.259, 0.789, -0.048 ⁇ .
  • the encoding and decoding framework is an end-to-end neural network framework, used to solve the problem of converting one sequence into another sequence, which is composed of an encoder and a decoder, and the input sequence is performed by the encoder
  • the intermediate code vector is obtained by encoding, and then the output sequence is decoded by the decoder. Since the problem of processing text summaries is close to the end-to-end sequence problem, the code summarization framework is used to construct the text summarization model.
  • the step S120 may include steps S121-S122.
  • a two-way gated loop unit neural network is used as the encoder and decoder. Because the traditional encoding and decoding model connects the encoder and decoder through a fixed intermediate encoding vector, the input sequence passes After the encoder encodes, the information of the entire sequence is compressed into an intermediate encoding vector of a specific length, resulting in the incomplete representation of the entire input sequence. The first input will be overwritten by the second input, and many details will be lost, especially In a long sequence. Therefore, in order to solve this problem, an attention mechanism is introduced in the decoding stage of the decoder, and the traditional encoder-decoder structure is broken through the attention mechanism to rely on an internal fixed-length vector during encoding and decoding.
  • the attention mechanism is used to weight change the target data, retain the intermediate output of the input sequence by the encoder, and then selectively learn the intermediate output through a matching model, and when the decoder outputs the output sequence and Correlation, where the matching model refers to a model that calculates similarity.
  • the generation probability of each item in the output sequence depends on which items are selected in the input sequence.
  • the resulting word vector is input into the text summary model for training.
  • the word vector is first input into the encoder, and the bidirectional gated loop unit according to the encoder
  • the neural network obtains the coding vector of the sentence, and then calculates the semantic similarity between the coding vector of the sentence and the previous output, and uses the coding vector of the sentence with the highest semantic similarity as the input of the decoder, according to the gated loop unit of the decoder.
  • the network decodes the encoding vector of the sentence, which is equivalent to the inverse process of encoding, and finally gets the output. After the output is obtained, it is used as the calculation parameter of the next loop iteration to continue training the model.
  • the step S122 may include steps S1221-S1223.
  • S1221 Input the word vector into a bidirectional gated loop unit neural network encoder for encoding to obtain a coding vector for a sentence.
  • GRU Gated Recurrent Unit
  • LSTM Long Short-Term Memory
  • GRU merges the input gate and forget gate in LSTM into an update gate, so it only contains Two door structure, namely reset door and update door.
  • the update gate is used to control the degree to which the state information at the previous moment is substituted into the current state; the reset gate is used to control the degree to which the state information at the previous moment is ignored.
  • the GRU model has the advantages of fewer parameters, fewer sample requirements, and faster training speed. Its specific formula is as follows:
  • x is the input word vector
  • h is the output of the GRU model
  • is the sigmoid function
  • r is the reset gate
  • z is the update gate
  • W z is the weight of the update gate
  • W r is the weight of the reset gate
  • pass update control gate and a reset gate common hidden previous time point h t-1 is calculated hidden states at the current time h t.
  • a bidirectional gated recurrent unit neural network hereinafter referred to as BIGRU
  • BIGRU a bidirectional gated recurrent unit neural network
  • bidirectional refers to a forward-propagating GRU and a backward-propagating GRU, which can be input and output Make full use of the past and future information between the mappings, realize the exchange of information before and after the text, and greatly improve the accuracy of context prediction.
  • the hidden layer state h that is, the coding vector of the sentence, is obtained.
  • S1222 Input the coding vector of the sentence to a bidirectional gated loop unit neural network decoder for decoding to obtain the sentence to be extracted.
  • the decoder also uses a bidirectional gated recurrent unit neural network.
  • the decoding of the decoder is equivalent to the inverse process of the encoder encoding.
  • the sentence encoding vector output by the encoder is used as an input to decode and output the sentence encoding vector.
  • the sentence to be extracted is used as an input to decode and output the sentence encoding vector.
  • the sentence to be extracted is matched with the current sentence coding vector according to the attention mechanism, the similarity between the two is calculated, and the weight is selected.
  • the last output is the sentence coding vector that matches the sentence to be extracted as the input of the decoder to decode the current sentence to be extracted, and then the obtained sentence to be extracted is matched with the next sentence coding vector, so iterative iteration Train the text summary model.
  • the text to be processed refers to the text that the user wants to generate a summary.
  • the user can select the text to be processed according to the needs, and pre-process the text to be converted into a word vector by a word vector tool
  • the word vector of the text to be processed is input into the text summary model, and the text summary model is processed to output the sentence to be extracted.
  • S140 Score the plurality of sentences to be extracted according to a preset scoring function model, and generate a text summary according to the scores of the sentences to be extracted.
  • a multi-layer perceptron is used as the preset scoring function model.
  • the multi-layer perceptron is a fully connected feed-forward artificial neural network model, which includes an input layer, a hidden layer, and an output layer, of which the hidden layer
  • the number of layers can be multiple layers, which can map one set of input vectors to another set of output vectors, that is, it can represent the mapping relationship between two different spaces.
  • the step S140 may include steps S141-S142.
  • the specific formula of the preset scoring function model is as follows:
  • W is the weight
  • tanh is the hyperbolic tangent function
  • h is the state of the hidden layer
  • s is the sentence to be extracted.
  • the preset scoring function model has been pre-trained, and its weights are determined to be W 1 , W 2, and W 3 after training.
  • the sentences to be extracted according to the text summary model are used as the input of the preset scoring function model.
  • the calculation of the model outputs the score value corresponding to each sentence to be extracted.
  • the score value of each sentence to be extracted is output through a preset scoring model, all the sentences to be extracted are sorted according to the score value from high to low, and a preset number of sentences with the highest score value are selected to generate a summary,
  • the preset number can be adjusted according to the user's reading habits or reading time. For example, the preset number is 2, "The weather is really good today", “Do you want to go shopping", "You are getting fat recently”, the scores of these three sentences are 0.5, 0.4 and 0.1, so select "Today the weather is really good” Okay, do you want to go shopping? Generate a text summary.
  • the embodiment of the present application shows a method for generating a text summary. Preprocessing the target text and converting the preprocessed target text with a word vector tool to obtain a word vector; constructing a text summary model with encoding and decoding as a framework, Use the word vector as the input of the text summary model and train the text summary model in a loop iteration to output the sentence to be extracted; the text to be processed is preprocessed and converted into a word vector, and the to-be-processed
  • the word vector of the text is input into the trained text summary model to output multiple sentences to be extracted; the multiple sentences to be extracted are scored according to a preset scoring function model, and generated according to the scores of the sentences to be extracted Text summaries can quickly generate text summaries, effectively improve the accuracy of text summaries, and improve the user's reading experience.
  • FIG. 7 is a schematic block diagram of a device 200 for generating a text summary provided by an embodiment of the present application.
  • the present application also provides a text summary generation device 200.
  • the text summary generating device 200 includes a unit for executing the above text summary generating method, and the device may be configured in a terminal such as a desktop computer, tablet computer, laptop computer, or the like.
  • the text summary generating apparatus 200 includes a conversion unit 210, a construction unit 220, a summary unit 230 and a scoring unit 240.
  • the conversion unit 210 is configured to pre-process the target text and convert the pre-processed target text with a word vector tool to obtain a word vector.
  • the conversion unit 210 includes subunits: an acquisition unit 211 and a conversion subunit 212.
  • the obtaining unit 211 is configured to obtain the target text for word segmentation and encode according to the word segmentation to obtain an initial word vector.
  • the conversion subunit 212 is configured to convert the initial word vector to obtain a word vector by using a word vector tool.
  • the construction unit 220 is configured to construct a text summary model with a codec as a frame, use the word vector as an input of the text summary model, and train the text summary model in a loop iteration to output the sentence to be extracted.
  • the construction unit 220 includes subunits: a construction subunit 221 and a training unit 222.
  • a construction subunit 221 is used to construct a text summary model by using a bidirectional gated looping unit neural network as an encoder and a decoder and introducing an attention mechanism in the decoding stage of the decoder.
  • the training unit 222 is configured to use the word vector as an input of the text summary model and train the text summary model according to a loop iteration method.
  • the training unit 222 includes subunits: an encoding unit 2221, a decoding unit 2222, and a feedback unit 2223.
  • the encoding unit 2221 is configured to input the word vector to the bidirectional gated loop unit neural network encoder for encoding to obtain the encoding vector of the sentence.
  • the decoding unit 2222 is configured to input the coding vector of the sentence to a bidirectional gated loop unit neural network decoder for decoding to obtain the sentence to be extracted.
  • the feedback unit 2223 is configured to feed back the sentence to be extracted to the decoder as an input for next decoding through an attention mechanism and perform training in a loop iteration manner.
  • the summary unit 230 is used to preprocess the text to be processed and convert it into word vectors, input the word vectors of the text to be processed into the trained text summary model, and output multiple sentences to be extracted.
  • the scoring unit 240 is configured to score the plurality of sentences to be extracted according to a preset scoring function model, and generate a text summary according to the scores of the sentences to be extracted.
  • the scoring unit 240 includes subunits: a scoring subunit 241 and an extraction unit 242.
  • the scoring subunit 241 is configured to score the sentence to be extracted according to a preset scoring function model to obtain a score value.
  • the extracting unit 242 is configured to sort in descending order according to the score value, and extract a preset number of sentences according to the sorting to generate a text summary.
  • the above-mentioned text summary generating apparatus may be implemented in the form of a computer program, and the computer program may run on the computer device shown in FIG. 10.
  • the computer device 500 may be a terminal, where the terminal may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, a wearable device, and other electronic devices with communication functions.
  • the computer device 500 includes a processor 502, a memory, and a network interface 505 connected through a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
  • the non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032.
  • the computer program 5032 includes program instructions.
  • the processor 502 may execute a text summary generating method.
  • the processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500.
  • the internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503.
  • the processor 502 can cause the processor 502 to execute a text summary generation method.
  • the network interface 505 is used for network communication with other devices.
  • the structure shown in FIG. 10 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied.
  • the specific computer device 500 may include more or less components than shown in the figure, or combine certain components, or have a different arrangement of components.
  • the processor 502 is used to run the computer program 5032 stored in the memory, so as to implement the text summary generating method of the embodiment of the present application.
  • the processor 502 may be a central processing unit (Central Processing Unit, CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), Application specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may be any conventional processor.
  • the computer program includes program instructions.
  • the computer program may be stored in a storage medium, which is a computer-readable storage medium.
  • the program instructions are executed by at least one processor in the computer system to implement the process steps of the above method embodiments.
  • the present application also provides a storage medium.
  • the storage medium may be a computer-readable storage medium.
  • the storage medium stores a computer program which, when executed by the processor, causes the processor to execute the steps of the text summary generating method described in the above embodiments.
  • the storage medium may be various computer-readable storage media that can store computer programs, such as a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a magnetic disk, or an optical disk.
  • the disclosed device and method may be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of each unit is only a logical function division, and there may be other division methods in actual implementation.
  • multiple units or components can be combined or integrated into another system, or some features can be ignored or not implemented.
  • the steps in the method of the embodiment of the present application may be adjusted, merged, and deleted sequentially according to actual needs.
  • the units in the device of the embodiment of the present application may be combined, divided, and deleted according to actual needs.
  • the functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium.
  • the technical solution of the present application essentially or part of the contribution to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, the computer software product is stored in a storage medium
  • several instructions are included to enable a computer device (which may be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • General Engineering & Computer Science (AREA)
  • Biomedical Technology (AREA)
  • Evolutionary Computation (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Biophysics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Machine Translation (AREA)

Abstract

一种文本摘要生成方法、装置、计算机设备及存储介质,应用于预测模型中的神经网络领域。该方法包括:对目标文本进行预处理并通过词向量工具对预处理后的目标文本进行转换以得到词向量(S110);构建以编码解码为框架的文本摘要模型,将词向量作为文本摘要模型的输入并以循环迭代的方式对文本摘要模型进行训练输出待抽取的句子(S120);对待处理文本进行预处理并转换为词向量,将待处理文本的词向量输入到训练后的文本摘要模型中输出多个待抽取的句子(S130);根据预设评分函数模型对多个待抽取的句子进行评分,并根据待抽取的句子的评分生成文本摘要(S140)。

Description

文本摘要生成方法、装置、计算机设备及存储介质
本申请要求于2018年11月30日提交中国专利局、申请号为CN201811455100.8、申请名称为“文本摘要生成方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人工智能技术领域,尤其涉及一种文本摘要生成方法、装置、计算机设备及存储介质。
背景技术
随着科技的进步与发展,人工智能时代已悄然而至,人们的日常生活中已开始逐渐涉及人工智能。在如今信息爆炸的时代,无时无刻都在产生巨量的信息,如网页新闻、微博、微信文章以及邮件等等。为了实现用户能够快速高效地获取到所需要的信息,需要对文本信息进行收集整理成文本摘要以供用户快速浏览。现有的文本摘要生成方法主要是抽取式,通过从目标文本中提取句子来生成文本摘要,但是该方法生成文本摘要的耗时较长,且文本摘要的精度不高,用户的阅读体验差。
发明内容
本申请实施例提供了一种文本摘要生成方法、装置、计算机设备及存储介质,旨在解决文本摘要生成耗时长、精度低以及用户阅读体验差的问题。
第一方面,本申请实施例提供了一种文本摘要生成方法,其包括:对目标文本进行预处理并通过词向量工具对预处理后的目标文本进行转换以得到词向量;构建以编码解码为框架的文本摘要模型,将所述词向量作为所述文本摘要模型的输入并以循环迭代的方式对所述文本摘要模型进行训练输出待抽取的句子;对待处理文本进行预处理并转换为词向量,将所述待处理文本的词向量输入到训练后的文本摘要模型中输出多个待抽取的句子;根据预设评分函数模型对所述多个待抽取的句子进行评分,并根据所述待抽取的句子的评分生成文本摘要。
第二方面,本申请实施例还提供了一种文本摘要生成装置,其包括:转换单元,用于对目标文本进行预处理并通过词向量工具对预处理后的目标文本进行转换以得到词向量;构建单元,用于构建以编码解码为框架的文本摘要模型,将所述词向量作为所述文本摘要模型的输入并以循环迭代的方式对所述文本摘要模型进行训练输出待抽取的句子;摘要单元,用于对待处理文本进行预处理并转换为词向量,将所述待处理文本的词向量输入到训练后的文本摘要模型中输出多个待抽取的句子;评分单元,用于根据预设评分函数模型对所述多个待抽取的句子进行评分,并根据所述待抽取的句子的评分生成文本摘要。
第三方面,本申请实施例还提供了一种计算机设备,其包括存储器及处理器,所述存储器上存储有计算机程序,所述处理器执行所述计算机程序时实现上述第一方面所述方法。
第四方面,本申请实施例还提供了一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序当被处理器执行时可实现上述第一方面所述方法。
附图说明
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的文本摘要生成方法的应用场景示意图;
图2为本申请实施例提供的文本摘要生成方法的流程示意图;
图3为本申请实施例提供的文本摘要生成方法的子流程示意图;
图4为本申请实施例提供的文本摘要生成方法的子流程示意图;
图5为本申请实施例提供的文本摘要生成方法的子流程示意图;
图6为本申请实施例提供的文本摘要生成方法的子流程示意图;
图7为本申请实施例提供的文本摘要生成装置的示意性框图;
图8为本申请实施例提供的文本摘要生成装置的具体单元的示意性框图;
图9为本申请实施例提供的文本摘要生成装置的训练单元的示意性框图;以及
图10为本申请实施例提供的计算机设备的示意性框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”和“包含”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
还应当理解,在此本申请说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本申请。如在本申请说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。
还应当进一步理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
请参阅图1和图2,图1为本申请实施例提供的文本摘要生成方法的应用场景示意图。图2为本申请实施例提供的文本摘要生成方法的示意性流程图。该文本摘要生成方法具体应用在终端10中,通过终端10与服务器20之间的交互实现。
图2是本申请实施例提供的文本摘要生成方法的流程示意图。如图所示,该方法包括以下步骤S110-S140。
S110、对目标文本进行预处理并通过词向量工具对预处理后的目标文本进行转换以得到词向量。
在一实施例中,词向量工具是一种自然语言处理工具,其作用就是将自然语言中的字词转为计算机可以理解的词向量。传统的词向量容易受维数灾难的困扰,且任意两个词之间都是孤立的,不能体现词和词之间的关系,因此本实施例采用word2vec这一词向量工具来得到词向量,其可通过计算向量之间的距离来体现词与词之间的相似性。Word2Vec主要采用Skip-Gram和CBOW两种模 型来实现词向量的转换,本实施例采用Skip-Gram来实现词向量的转换,Skip-Gram模型主要是通过中心词来预测上下文的词,例如,“今天天气真好”这个句子,通过输入中心词“天气”来预测其上文“今天”和下文“真好”。
在一实施例中,如图3所示,所述步骤S110可包括步骤S111-S112。
S111、获取目标文本进行分词并根据所述分词进行编码得到初始词向量。
在一实施例中,目标文本即用于训练的文本,根据用户的需求获取,例如,目标文本可通过网络爬虫的方式从服务器中获取,也可由用户从数据库中获取。在得到目标文本后,需要先对目标文本进行预处理,预处理包括:首先将目标文本中的标点符号去除,计算词频将低频词去除,然后对目标文本进行分词,基于目标文本的分词构建词汇表,最后再根据分词进行编码得到初始词向量。其中,初始词向量指的是以独热编码的形式来表示词,例如,“今天天气真好”分词后得到今天/天气/真好,再根据分词进行独热编码得到初始词向量,“今天”对应[100],“天气”对应[010]以及“真好”对应[001]。
S112、通过词向量工具将所述初始词向量进行转换得到词向量。
在一实施例中,Skip-Gram模型已预先训练好,Skip-Gram模型包括输入层、隐藏层以及输出层,从输入层到隐藏层的映射没有采用激活函数,而隐藏层到输出层采用霍夫曼树进行优化。霍夫曼树是一个二叉树,叶子的节点代表词汇表中的词,叶子节点的权重代表词频,叶子节点的权重越大,距离根节点越近,霍夫曼树的根节点到叶子节点的路径即为词的概率,经过霍夫曼树的优化可以大大减少计算量,加快文本摘要的生成速度。具体地,例如,句子“今天天气真好”,输入词“天气”的初始词向量[010]至Skip-Gram模型,最终得到“真好”的词向量{0.259,0.789,-0.048}。
S120、构建以编码解码为框架的文本摘要模型,将所述词向量作为所述文本摘要模型的输入并以循环迭代的方式对所述文本摘要模型进行训练输出待抽取的句子。
在一实施例中,编码解码框架是一种端到端的神经网络框架,用于解决一种序列转换为另一种序列的问题,其由编码器和解码器组成,通过编码器对输入序列进行编码得到中间编码向量,再由解码器解码得到输出序列。由于处理文本摘要的问题贴近于端到端的序列问题,因此采用编码解码框架构建文本摘要模型。
在一实施例中,如图4所示,所述步骤S120可包括步骤S121-S122。
S121、将双向门控循环单元神经网络作为编码器以及解码器并在所述解码器的解码阶段引入注意力机制构建文本摘要模型。
在一实施例中,采用双向门控循环单元神经网络作为编码器以及解码器,由于传统的编码解码模型通过一个固定的中间编码向量来连接编码器和解码器存在一定的局限性,输入序列经过编码器编码后整个序列的信息压缩进一个特定长度的中间编码向量中,导致不能完整的表示整个输入序列的信息,先输入的内容会被后输入的内容覆盖掉,丢失许多细节信息,尤其是在长序列中。因此,为了解决这个问题在解码器解码阶段引入注意力机制,通过注意力机制打破传统编码器-解码器结构在编解码时都依赖于内部一个固定长度向量的限制。注意力机制用于对目标数据进行加权变化,通过保留编码器对输入序列的中间输出结果,然后通过一个匹配模型来对中间输出结果进行选择性的学习,并且在解码器输出时将输出序列与之进行关联,其中匹配模型指的是计算相似度的模型,总的来说,输出序列中的每一项的生成概率取决于在输入序列中选择了哪些项。
S122、将所述词向量作为所述文本摘要模型的输入并根据循环迭代的方式对所述文本摘要模型进行训练。
在一实施例中,构建好文本摘要模型后,将所得到的词向量输入到文本摘要模型中进行训练,具体地,首先将词向量输入至编码器中,根据编码器的双向门控循环单元神经网络得到句子的编码向量,然后计算句子的编码向量与上一输出之间的语义相似度,将语义相似度最高的句子的编码向量作为解码器的输入,根据解码器的门控循环单元神经网络对句子的编码向量进行解码,相当于编码的逆过程,最终得到输出,得到输出后用作下一次循环迭代的计算参数继续训练模型。
在一实施例中,如图5所示,所述步骤S122可包括步骤S1221-S1223。
S1221、将所述词向量输入至双向门控循环单元神经网络编码器进行编码得到句子的编码向量。
在一实施例中,门控循环单元(Gated Recurrent Unit)以下简称GRU,是LSTM(Long Short-Term Memory)的变形,GRU将LSTM中的输入门和遗忘门合并成为更新门,因此其仅包含两个门结构,即重置门以及更新门。其中,更 新门用于控制前一时刻的状态信息被代入到当前状态中的程度;重置门用于控制忽略前一时刻的状态信息的程度。GRU模型具有参数少、样本需求少,训练速度快的优点,其具体公式如下:
z t=σ(W z[h t-1,x t])
r t=σ(W r[h t-1,x t])
Figure PCTCN2019092616-appb-000001
Figure PCTCN2019092616-appb-000002
其中,x是输入的词向量,h为GRU模型的输出,σ是sigmoid函数,r是重置门,z是更新门,W z是更新门的权重,W r是重置门的权重,通过更新门以及重置门共同控制从前一时刻的隐藏状态h t-1计算得到当前时刻的隐藏状态h t。在本实施例中,双向门控循环单元神经网络,以下简称BIGRU,是由两个GRU组成,其中双向指的是一个向前传播的GRU以及一个向后传播的GRU,其可在输入与输出的映射之间充分利用过去和未来的信息,实现文本前后的信息交流,极大地提高了上下文预测的精度。通过将所得到的词向量输入至BIGRU中输出得到隐含层状态h即句子的编码向量。
S1222、将所述句子的编码向量输入至双向门控循环单元神经网络解码器进行解码得到待抽取的句子。
在一实施例中,解码器同样采用双向门控循环单元神经网络,解码器的解码相当于编码器编码的逆过程,将编码器输出的句子编码向量作为输入,对句子的编码向量进行解码输出待抽取的句子。
S1223、通过注意力机制将所述待抽取的句子反馈至所述解码器作为下一次解码的输入并以循环迭代的方式进行训练。
在一实施例中,在得到上一个输出即待抽取的句子后,根据注意力机制将该待抽取的句子与当前的句子编码向量进行匹配,计算两者之间的相似度分配权重,选择与上一输出即待抽取的句子最为匹配的句子编码向量作为解码器的输入进行解码得到当前待抽取的句子,将所得到的当前待抽取的句子又与下一个句子编码向量进行匹配,如此循环迭代对文本摘要模型进行训练。
S130、对待处理文本进行预处理并转换为词向量,将所述待处理文本的词向量输入到训练后的文本摘要模型中输出多个待抽取的句子。
在一实施例中,待处理文本指的是用户想要生成摘要的文本,模型训练好 后,用户可根据需求选择待处理文本,将待处理文本进行预处理通过词向量工具转换为词向量,将待处理文本的词向量输入至文本摘要模型中,由文本摘要模型进行处理输出待抽取的句子。
S140、根据预设评分函数模型对所述多个待抽取的句子进行评分,并根据所述待抽取的句子的评分生成文本摘要。
在一实施例中,采用多层感知机作为预设评分函数模型,多层感知机是一种全连接的前馈人工神经网络模型,其包括输入层、隐藏层以及输出层,其中隐藏层的层数可以有多层,可将一组输入向量映射到另一组输出向量,即可以表示两个不同空间的映射关系。
在一实施例中,如图6所示,所述步骤S140可包括步骤S141-S142。
S141、根据预设评分函数模型对所述待抽取句子进行评分得到评分值。
在一实施例中,预设评分函数模型的具体公式如下:
Score=W 1*tanh(W 2*h t+W 3*s i)
其中,W是权重,tanh是双曲正切函数,h是隐藏层状态,s是待抽取的句子。预设评分函数模型已预先训练好,其权重经训练后确定为W 1、W 2以及W 3,根据文本摘要模型输出的待抽取的句子作为预设评分函数模型的输入,通过预设评分函数模型的计算输出各待抽取句子对应的评分值。
S142、根据所述评分值按照由高到低的顺序进行排序,并根据排序抽取预设数量的句子生成文本摘要。
在一实施例中,通过预设评分模型输出每个待抽取句子的评分值,对所有的待抽取句子按照评分值从高到低进行排序,选取预设数量的评分值最高的句子生成摘要,预设数量可根据用户的阅读习惯或者阅读时间进行调整。例如,预设数量为2,“今天天气真好”,“要不要去逛街”,“你最近又胖了”,这三个句子的评分分别为0.5、0.4以及0.1,因此选择“今天天气真好,要不要去逛街”生成文本摘要。
本申请实施例展示了一种文本摘要生成方法,通过对目标文本进行预处理并通过词向量工具对预处理后的目标文本进行转换以得到词向量;构建以编码解码为框架的文本摘要模型,将所述词向量作为所述文本摘要模型的输入并以循环迭代的方式对所述文本摘要模型进行训练输出待抽取的句子;对待处理文本进行预处理并转换为词向量,将所述待处理文本的词向量输入到训练后的文 本摘要模型中输出多个待抽取的句子;根据预设评分函数模型对所述多个待抽取的句子进行评分,并根据所述待抽取的句子的评分生成文本摘要,可以快速生成文本摘要,有效地提高文本摘要的精度,提高用户的阅读体验。
图7是本申请实施例提供的一种文本摘要生成装置200的示意性框图。如图7所示,对应于以上文本摘要生成方法,本申请还提供一种文本摘要生成装置200。该文本摘要生成装置200包括用于执行上述文本摘要生成方法的单元,该装置可以被配置于台式电脑、平板电脑、手提电脑、等终端中。具体地,请参阅图7,该文本摘要生成装置200包括转换单元210、构建单元220、摘要单元230以及评分单元240。
转换单元210,用于对目标文本进行预处理并通过词向量工具对预处理后的目标文本进行转换以得到词向量。
在一实施例中,如图8所示,所述转换单元210包括子单元:获取单元211以及转换子单元212。
获取单元211,用于获取目标文本进行分词并根据所述分词进行编码得到初始词向量。
转换子单元212,用于通过词向量工具将所述初始词向量进行转换得到词向量。
构建单元220,用于构建以编码解码为框架的文本摘要模型,将所述词向量作为所述文本摘要模型的输入并以循环迭代的方式对所述文本摘要模型进行训练输出待抽取的句子。
在一实施例中,如图8所示,所述构建单元220包括子单元:构建子单元221以及训练单元222。
构建子单元221,用于将双向门控循环单元神经网络作为编码器以及解码器并在所述解码器的解码阶段引入注意力机制构建文本摘要模型。
训练单元222,用于将所述词向量作为所述文本摘要模型的输入并根据循环迭代的方式对所述文本摘要模型进行训练。
在一实施例中,如图9所示,所述训练单元222包括子单元:编码单元2221、解码单元2222以及反馈单元2223。
编码单元2221,用于将所述词向量输入至双向门控循环单元神经网络编码器进行编码得到句子的编码向量。
解码单元2222,用于将所述句子的编码向量输入至双向门控循环单元神经网络解码器进行解码得到待抽取的句子。
反馈单元2223,用于通过注意力机制将所述待抽取的句子反馈至所述解码器作为下一次解码的输入并以循环迭代的方式进行训练。
摘要单元230,用于对待处理文本进行预处理并转换为词向量,将所述待处理文本的词向量输入到训练后的文本摘要模型中输出多个待抽取的句子。
评分单元240,用于根据预设评分函数模型对所述多个待抽取的句子进行评分,并根据所述待抽取的句子的评分生成文本摘要。
在一实施例中,如图8所示,所述评分单元240包括子单元:评分子单元241以及抽取单元242。
评分子单元241,用于根据预设评分函数模型对所述待抽取句子进行评分得到评分值。
抽取单元242,用于根据所述评分值按照由高到低的顺序进行排序,并根据排序抽取预设数量的句子生成文本摘要。
需要说明的是,所属领域的技术人员可以清楚地了解到,上述文本摘要生成装置200和各单元的具体实现过程,可以参考前述方法实施例中的相应描述,为了描述的方便和简洁,在此不再赘述。
上述文本摘要生成装置可以实现为一种计算机程序的形式,该计算机程序可以在如图10所示的计算机设备上运行。
请参阅图10,图10是本申请实施例提供的一种计算机设备的示意性框图。该计算机设备500可以是终端,其中,终端可以是智能手机、平板电脑、笔记本电脑、台式电脑、个人数字助理和穿戴式设备等具有通信功能的电子设备。
参阅图10,该计算机设备500包括通过系统总线501连接的处理器502、存储器和网络接口505,其中,存储器可以包括非易失性存储介质503和内存储器504。
该非易失性存储介质503可存储操作系统5031和计算机程序5032。该计算机程序5032包括程序指令,该程序指令被执行时,可使得处理器502执行一种文本摘要生成方法。
该处理器502用于提供计算和控制能力,以支撑整个计算机设备500的运行。
该内存储器504为非易失性存储介质503中的计算机程序5032的运行提供环境,该计算机程序5032被处理器502执行时,可使得处理器502执行一种文本摘要生成方法。
该网络接口505用于与其它设备进行网络通信。本领域技术人员可以理解,图10中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备500的限定,具体的计算机设备500可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
其中,所述处理器502用于运行存储在存储器中的计算机程序5032,以实现本申请实施例的文本摘要生成方法。
应当理解,在本申请实施例中,处理器502可以是中央处理单元(Central Processing Unit,CPU),该处理器502还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
本领域普通技术人员可以理解的是实现上述实施例的方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成。该计算机程序包括程序指令,计算机程序可存储于一存储介质中,该存储介质为计算机可读存储介质。该程序指令被该计算机系统中的至少一个处理器执行,以实现上述方法的实施例的流程步骤。
因此,本申请还提供一种存储介质。该存储介质可以为计算机可读存储介质。该存储介质存储有计算机程序,该计算机程序被处理器执行时使处理器执行以上各实施例中所描述的文本摘要生成方法的步骤。
所述存储介质可以是U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、磁碟或者光盘等各种可以存储计算机程序的计算机可读存储介质。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决 于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的。例如,各个单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。
本申请实施例方法中的步骤可以根据实际需要进行顺序调整、合并和删减。本申请实施例装置中的单元可以根据实际需要进行合并、划分和删减。另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以是两个或两个以上单元集成在一个单元中。
该集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分,或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,终端,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (20)

  1. 一种文本摘要生成方法,包括:
    对目标文本进行预处理并通过词向量工具对预处理后的目标文本进行转换以得到词向量;
    构建以编码解码为框架的文本摘要模型,将所述词向量作为所述文本摘要模型的输入并以循环迭代的方式对所述文本摘要模型进行训练输出待抽取的句子;
    对待处理文本进行预处理并转换为词向量,将所述待处理文本的词向量输入到训练后的文本摘要模型中输出多个待抽取的句子;
    根据预设评分函数模型对所述多个待抽取的句子进行评分,并根据所述待抽取的句子的评分生成文本摘要。
  2. 根据权利要求1所述的文本摘要生成方法,其中,所述对目标文本进行预处理并通过词向量工具对预处理后的目标文本进行转换以得到词向量,包括:
    获取目标文本进行分词并根据所述分词进行编码得到初始词向量;
    通过词向量工具将所述初始词向量进行转换得到词向量。
  3. 根据权利要求1所述的文本摘要生成方法,其中,所述构建以编码解码为框架的文本摘要模型,将所述词向量作为所述文本摘要模型的输入并以循环迭代的方式对所述文本摘要模型进行训练输出待抽取的句子,包括:
    将双向门控循环单元神经网络作为编码器以及解码器并在所述解码器的解码阶段引入注意力机制构建文本摘要模型;
    将所述词向量作为所述文本摘要模型的输入并根据循环迭代的方式对所述文本摘要模型进行训练。
  4. 根据权利要求3所述的文本摘要生成方法,其中,所述将所述词向量作为所述文本摘要模型的输入并根据循环迭代的方式对所述文本摘要模型进行训练,包括:
    将所述词向量输入至双向门控循环单元神经网络编码器进行编码得到句子的编码向量;
    将所述句子的编码向量输入至双向门控循环单元神经网络解码器进行解码得到待抽取的句子;
    通过注意力机制将所述待抽取的句子反馈至所述解码器作为下一次解码的输入并以循环迭代的方式进行训练。
  5. 根据权利要求1所述的文本摘要生成方法,其中,所述根据预设评分函数模型对所述多个待抽取的句子进行评分,并根据所述待抽取的句子的评分生成文本摘要,包括:
    根据预设评分函数模型对所述待抽取句子进行评分得到评分值;
    根据所述评分值按照由高到低的顺序进行排序,并根据排序抽取预设数量的句子生成文本摘要。
  6. 根据权利要求4所述的文本摘要生成方法,其中,所述双向门控循环单元神经网络编码器中的门控循环单元的公式为:
    z t=σ(W z[h t-1,x t])
    r t=σ(W r[h t-1,x t])
    Figure PCTCN2019092616-appb-100001
    Figure PCTCN2019092616-appb-100002
    其中,x为输入的词向量,h为门控循环单元的输出,σ为sigmoid函数,r为重置门,z为更新门,W z为更新门的权重,W r为重置门的权重,通过更新门以及重置门共同控制从前一时刻的隐藏状态h t-1计算得到当前时刻的隐藏状态h t
  7. 根据权利要求5所述的文本摘要生成方法,其中,所述预设评分函数模型的公式为:
    Score=W 1*tanh(W 2*h t+W 3*s i)
    其中,W为权重,tanh为双曲正切函数,h为隐藏层状态,s为待抽取的句子。
  8. 一种文本摘要生成装置,包括:
    转换单元,用于对目标文本进行预处理并通过词向量工具对预处理后的目标文本进行转换以得到词向量;
    构建单元,用于构建以编码解码为框架的文本摘要模型,将所述词向量作为所述文本摘要模型的输入并以循环迭代的方式对所述文本摘要模型进行训练输出待抽取的句子;
    摘要单元,用于对待处理文本进行预处理并转换为词向量,将所述待处理 文本的词向量输入到训练后的文本摘要模型中输出多个待抽取的句子;
    评分单元,用于根据预设评分函数模型对所述多个待抽取的句子进行评分,并根据所述待抽取的句子的评分生成文本摘要。
  9. 根据权利要求8所述的文本摘要生成装置,其中,所述构建单元包括:
    构建子单元,用于将双向门控循环单元神经网络作为编码器以及解码器并在所述解码器的解码阶段引入注意力机制构建文本摘要模型;
    训练单元,用于将所述词向量作为所述文本摘要模型的输入并根据循环迭代的方式对所述文本摘要模型进行训练。
  10. 根据权利要求9所述的文本摘要生成装置,其中,所述训练单元包括:
    编码单元,用于将所述词向量输入至双向门控循环单元神经网络编码器进行编码得到句子的编码向量;
    解码单元,用于将所述句子的编码向量输入至双向门控循环单元神经网络解码器进行解码得到待抽取的句子;
    反馈单元,用于通过注意力机制将所述待抽取的句子反馈至所述解码器作为下一次解码的输入并以循环迭代的方式进行训练。
  11. 一种计算机设备,包括存储器以及与所述存储器相连的处理器;所述存储器用于存储计算机程序;所述处理器用于运行所述存储器中存储的计算机程序,以执行如下步骤:
    对目标文本进行预处理并通过词向量工具对预处理后的目标文本进行转换以得到词向量;
    构建以编码解码为框架的文本摘要模型,将所述词向量作为所述文本摘要模型的输入并以循环迭代的方式对所述文本摘要模型进行训练输出待抽取的句子;
    对待处理文本进行预处理并转换为词向量,将所述待处理文本的词向量输入到训练后的文本摘要模型中输出多个待抽取的句子;
    根据预设评分函数模型对所述多个待抽取的句子进行评分,并根据所述待抽取的句子的评分生成文本摘要。
  12. 根据权利要求11所述的计算机设备,其中,所述对目标文本进行预处理并通过词向量工具对预处理后的目标文本进行转换以得到词向量的步骤包括:
    获取目标文本进行分词并根据所述分词进行编码得到初始词向量;
    通过词向量工具将所述初始词向量进行转换得到词向量。
  13. 根据权利要求11所述的计算机设备,其中,所述构建以编码解码为框架的文本摘要模型,将所述词向量作为所述文本摘要模型的输入并以循环迭代的方式对所述文本摘要模型进行训练输出待抽取的句子的步骤包括:
    将双向门控循环单元神经网络作为编码器以及解码器并在所述解码器的解码阶段引入注意力机制构建文本摘要模型;
    将所述词向量作为所述文本摘要模型的输入并根据循环迭代的方式对所述文本摘要模型进行训练。
  14. 根据权利要求13所述的计算机设备,其中,所述将所述词向量作为所述文本摘要模型的输入并根据循环迭代的方式对所述文本摘要模型进行训练的步骤包括:
    将所述词向量输入至双向门控循环单元神经网络编码器进行编码得到句子的编码向量;
    将所述句子的编码向量输入至双向门控循环单元神经网络解码器进行解码得到待抽取的句子;
    通过注意力机制将所述待抽取的句子反馈至所述解码器作为下一次解码的输入并以循环迭代的方式进行训练。
  15. 根据权利要求11所述的计算机设备,其中,所述根据预设评分函数模型对所述多个待抽取的句子进行评分,并根据所述待抽取的句子的评分生成文本摘要的步骤包括:
    根据预设评分函数模型对所述待抽取句子进行评分得到评分值;
    根据所述评分值按照由高到低的顺序进行排序,并根据排序抽取预设数量的句子生成文本摘要。
  16. 根据权利要求14所述的计算机设备,其中,所述双向门控循环单元神经网络编码器中的门控循环单元的公式为:
    z t=σ(W z[h t-1,x t])
    r t=σ(W r[h t-1,x t])
    Figure PCTCN2019092616-appb-100003
    Figure PCTCN2019092616-appb-100004
    其中,x为输入的词向量,h为门控循环单元的输出,σ为sigmoid函数, r为重置门,z为更新门,W z为更新门的杈重,W r为重置门的权重,通过更新门以及重置门共同控制从前一时刻的隐藏状态h t-1计算得到当前时刻的隐藏状态h t
  17. 根据权利要求15所述的计算机设备,其中,所述预设评分函数模型的公式为:
    Score=W 1*tanh(W 2*h t+W 3*s i)
    其中,W为权重,tanh为双曲正切函数,h为隐藏层状态,s为待抽取的句子。
  18. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器执行以下步骤:
    对目标文本进行预处理并通过词向量工具对预处理后的目标文本进行转换以得到词向量;
    构建以编码解码为框架的文本摘要模型,将所述词向量作为所述文本摘要模型的输入并以循环迭代的方式对所述文本摘要模型进行训练输出待抽取的句子;
    对待处理文本进行预处理并转换为词向量,将所述待处理文本的词向量输入到训练后的文本摘要模型中输出多个待抽取的句子;
    根据预设评分函数模型对所述多个待抽取的句子进行评分,并根据所述待抽取的句子的评分生成文本摘要。
  19. 根据权利要求18所述的计算机可读存储介质,其中,所述构建以编码解码为框架的文本摘要模型,将所述词向量作为所述文本摘要模型的输入并以循环迭代的方式对所述文本摘要模型进行训练输出待抽取的句子的步骤包括:
    将双向门控循环单元神经网络作为编码器以及解码器并在所述解码器的解码阶段引入注意力机制构建文本摘要模型;
    将所述词向量作为所述文本摘要模型的输入并根据循环迭代的方式对所述文本摘要模型进行训练。
  20. 根据权利要求19所述的计算机可读存储介质,其中,所述将所述词向量作为所述文本摘要模型的输入并根据循环迭代的方式对所述文本摘要模型进行训练的步骤包括:
    将所述词向量输入至双向门控循环单元神经网络编码器进行编码得到句子 的编码向量;
    将所述句子的编码向量输入至双向门控循环单元神经网络解码器进行解码得到待抽取的句子;
    通过注意力机制将所述待抽取的句子反馈至所述解码器作为下一次解码的输入并以循环迭代的方式进行训练。
PCT/CN2019/092616 2018-11-30 2019-06-25 文本摘要生成方法、装置、计算机设备及存储介质 WO2020107878A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811455100.8 2018-11-30
CN201811455100.8A CN109657051A (zh) 2018-11-30 2018-11-30 文本摘要生成方法、装置、计算机设备及存储介质

Publications (1)

Publication Number Publication Date
WO2020107878A1 true WO2020107878A1 (zh) 2020-06-04

Family

ID=66112132

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/092616 WO2020107878A1 (zh) 2018-11-30 2019-06-25 文本摘要生成方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN109657051A (zh)
WO (1) WO2020107878A1 (zh)

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112000777A (zh) * 2020-09-03 2020-11-27 上海然慧信息科技有限公司 一种文本生成方法、装置、计算机设备和存储介质
CN112015890A (zh) * 2020-09-07 2020-12-01 广东工业大学 电影剧本摘要的生成方法和装置
CN112052329A (zh) * 2020-09-02 2020-12-08 平安科技(深圳)有限公司 文本摘要生成方法、装置、计算机设备及可读存储介质
CN112148871A (zh) * 2020-09-21 2020-12-29 北京百度网讯科技有限公司 摘要生成方法、装置、电子设备及存储介质
CN112183057A (zh) * 2020-09-16 2021-01-05 北京思源智通科技有限责任公司 文章生成方法、装置、智能设备和存储介质
CN112347756A (zh) * 2020-09-29 2021-02-09 中国科学院信息工程研究所 一种基于序列化证据抽取的推理阅读理解方法及系统
CN112507711A (zh) * 2020-12-04 2021-03-16 南京擎盾信息科技有限公司 文本摘要抽取方法及系统
CN112507111A (zh) * 2020-10-20 2021-03-16 北京中科凡语科技有限公司 用于生成式自动摘要生成的模型建立方法及摘要生成方法
CN112733498A (zh) * 2020-11-06 2021-04-30 北京工业大学 一种改进中文自动文本摘要自注意力计算的方法
CN112800043A (zh) * 2021-02-05 2021-05-14 凯通科技股份有限公司 一种物联网终端信息提取方法、装置、设备和存储介质
CN112819622A (zh) * 2021-01-26 2021-05-18 深圳价值在线信息科技股份有限公司 一种信息的实体关系联合抽取方法、装置及终端设备
CN112836520A (zh) * 2021-02-19 2021-05-25 支付宝(杭州)信息技术有限公司 基于用户特征生成用户描述文本的方法和装置
CN112862727A (zh) * 2021-03-16 2021-05-28 上海壁仞智能科技有限公司 一种跨模态图像转换方法及装置
CN113408636A (zh) * 2021-06-30 2021-09-17 北京百度网讯科技有限公司 预训练模型获取方法、装置、电子设备及存储介质
CN113408272A (zh) * 2021-06-30 2021-09-17 北京百度网讯科技有限公司 摘要生成模型的训练方法、装置、设备和存储介质
CN113420143A (zh) * 2021-06-02 2021-09-21 平安国际智慧城市科技股份有限公司 文书摘要生成方法、装置、设备及存储介质
CN113657454A (zh) * 2021-07-23 2021-11-16 杭州安脉盛智能技术有限公司 基于自回归BiGRU的核电旋转机械状态监测方法
CN113806514A (zh) * 2021-09-18 2021-12-17 上海交通大学 基于Transformer模型的实体关系抽取方法和系统
CN114218932A (zh) * 2021-11-26 2022-03-22 中国航空综合技术研究所 基于故障因果图谱的航空故障文本摘要生成方法及其装置

Families Citing this family (30)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109657051A (zh) * 2018-11-30 2019-04-19 平安科技(深圳)有限公司 文本摘要生成方法、装置、计算机设备及存储介质
CN110399882A (zh) * 2019-05-29 2019-11-01 广东工业大学 一种基于可变形卷积神经网络的文字检测方法
CN112133279A (zh) * 2019-06-06 2020-12-25 Tcl集团股份有限公司 车载信息播报方法、装置及终端设备
CN110377808A (zh) * 2019-06-14 2019-10-25 北京达佳互联信息技术有限公司 文档处理方法、装置、电子设备及存储介质
CN110209803B (zh) * 2019-06-18 2023-11-14 腾讯科技(深圳)有限公司 故事生成方法、装置、计算机设备及存储介质
CN112685555B (zh) * 2019-10-17 2023-04-18 中国移动通信集团浙江有限公司 投诉工单质量检测方法及装置
CN111026861B (zh) * 2019-12-10 2023-07-04 腾讯科技(深圳)有限公司 文本摘要的生成方法、训练方法、装置、设备及介质
CN111180086B (zh) * 2019-12-12 2023-04-25 平安医疗健康管理股份有限公司 数据匹配方法、装置、计算机设备和存储介质
CN111199151A (zh) * 2019-12-31 2020-05-26 联想(北京)有限公司 数据处理方法、及数据处理装置
CN111241267B (zh) * 2020-01-10 2022-12-06 科大讯飞股份有限公司 摘要提取和摘要抽取模型训练方法及相关装置、存储介质
CN111291534A (zh) * 2020-02-03 2020-06-16 苏州科技大学 面向中文长文本自动摘要的全局编码方法
CN113407707A (zh) * 2020-03-16 2021-09-17 北京沃东天骏信息技术有限公司 生成文本摘要的方法和装置
CN111460135B (zh) * 2020-03-31 2023-11-07 北京百度网讯科技有限公司 用于生成文本摘要的方法和装置
CN111597224B (zh) * 2020-04-17 2023-09-15 北京百度网讯科技有限公司 结构化信息的生成方法、装置、电子设备和存储介质
CN111581374A (zh) * 2020-05-09 2020-08-25 联想(北京)有限公司 文本的摘要获取方法、装置及电子设备
CN111767395B (zh) * 2020-06-30 2023-12-26 平安国际智慧城市科技股份有限公司 基于图片的摘要生成方法与系统
CN111966820B (zh) * 2020-07-21 2023-03-24 西北工业大学 一种生成式摘要模型构建、提取生成式摘要方法及系统
CN111862977B (zh) * 2020-07-27 2021-08-10 北京嘀嘀无限科技发展有限公司 一种语音对话处理方法和系统
CN112257456A (zh) * 2020-10-22 2021-01-22 平安科技(深圳)有限公司 基于文本编辑技术的文本生成模型的训练方法及装置
CN112464657B (zh) * 2020-12-07 2022-07-08 上海交通大学 混合式文本摘要生成方法、系统、终端及存储介质
CN112883711A (zh) * 2021-01-25 2021-06-01 北京金山云网络技术有限公司 摘要生成的方法、装置及电子设备
CN112989784A (zh) * 2021-03-04 2021-06-18 广州汇才创智科技有限公司 基于孪生神经网络的文本自动评分方法、装置及电子设备
CN113033778B (zh) * 2021-03-17 2023-09-29 平安科技(深圳)有限公司 佛乐生成方法、装置、设备及存储介质
CN113127632B (zh) * 2021-05-17 2022-07-26 同济大学 基于异质图的文本摘要方法及装置、存储介质和终端
CN113204956B (zh) * 2021-07-06 2021-10-08 深圳市北科瑞声科技股份有限公司 多模型训练方法、摘要分段方法、文本分段方法及装置
CN113626584A (zh) * 2021-08-12 2021-11-09 中电积至(海南)信息技术有限公司 一种自动文本摘要生成方法、系统、计算机设备和存储介质
CN114547287B (zh) * 2021-11-18 2023-04-07 电子科技大学 一种生成式文本摘要方法
CN114386390B (zh) * 2021-11-25 2022-12-06 马上消费金融股份有限公司 一种数据处理方法、装置、计算机设备及存储介质
CN114722836B (zh) * 2022-05-12 2022-09-02 北京中科闻歌科技股份有限公司 摘要生成方法、装置、设备及介质
CN115099359A (zh) * 2022-07-12 2022-09-23 平安科技(深圳)有限公司 基于人工智能的地址识别方法、装置、设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120253792A1 (en) * 2011-03-30 2012-10-04 Nec Laboratories America, Inc. Sentiment Classification Based on Supervised Latent N-Gram Analysis
CN104834735A (zh) * 2015-05-18 2015-08-12 大连理工大学 一种基于词向量的文档摘要自动提取方法
CN106980683A (zh) * 2017-03-30 2017-07-25 中国科学技术大学苏州研究院 基于深度学习的博客文本摘要生成方法
CN108287922A (zh) * 2018-02-28 2018-07-17 福州大学 一种融合话题属性和情感信息的文本数据观点摘要挖掘方法
CN109657051A (zh) * 2018-11-30 2019-04-19 平安科技(深圳)有限公司 文本摘要生成方法、装置、计算机设备及存储介质

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105930314B (zh) * 2016-04-14 2019-02-05 清华大学 基于编码-解码深度神经网络的文本摘要生成系统及方法
US10474709B2 (en) * 2017-04-14 2019-11-12 Salesforce.Com, Inc. Deep reinforced model for abstractive summarization

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120253792A1 (en) * 2011-03-30 2012-10-04 Nec Laboratories America, Inc. Sentiment Classification Based on Supervised Latent N-Gram Analysis
CN104834735A (zh) * 2015-05-18 2015-08-12 大连理工大学 一种基于词向量的文档摘要自动提取方法
CN106980683A (zh) * 2017-03-30 2017-07-25 中国科学技术大学苏州研究院 基于深度学习的博客文本摘要生成方法
CN108287922A (zh) * 2018-02-28 2018-07-17 福州大学 一种融合话题属性和情感信息的文本数据观点摘要挖掘方法
CN109657051A (zh) * 2018-11-30 2019-04-19 平安科技(深圳)有限公司 文本摘要生成方法、装置、计算机设备及存储介质

Cited By (34)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112052329A (zh) * 2020-09-02 2020-12-08 平安科技(深圳)有限公司 文本摘要生成方法、装置、计算机设备及可读存储介质
CN112000777A (zh) * 2020-09-03 2020-11-27 上海然慧信息科技有限公司 一种文本生成方法、装置、计算机设备和存储介质
CN112015890A (zh) * 2020-09-07 2020-12-01 广东工业大学 电影剧本摘要的生成方法和装置
CN112015890B (zh) * 2020-09-07 2024-01-23 广东工业大学 电影剧本摘要的生成方法和装置
CN112183057A (zh) * 2020-09-16 2021-01-05 北京思源智通科技有限责任公司 文章生成方法、装置、智能设备和存储介质
CN112148871A (zh) * 2020-09-21 2020-12-29 北京百度网讯科技有限公司 摘要生成方法、装置、电子设备及存储介质
CN112148871B (zh) * 2020-09-21 2024-04-12 北京百度网讯科技有限公司 摘要生成方法、装置、电子设备及存储介质
CN112347756B (zh) * 2020-09-29 2023-12-22 中国科学院信息工程研究所 一种基于序列化证据抽取的推理阅读理解方法及系统
CN112347756A (zh) * 2020-09-29 2021-02-09 中国科学院信息工程研究所 一种基于序列化证据抽取的推理阅读理解方法及系统
CN112507111A (zh) * 2020-10-20 2021-03-16 北京中科凡语科技有限公司 用于生成式自动摘要生成的模型建立方法及摘要生成方法
CN112507111B (zh) * 2020-10-20 2024-02-06 北京中科凡语科技有限公司 用于生成式自动摘要生成的模型建立方法及摘要生成方法
CN112733498A (zh) * 2020-11-06 2021-04-30 北京工业大学 一种改进中文自动文本摘要自注意力计算的方法
CN112733498B (zh) * 2020-11-06 2024-04-16 北京工业大学 一种改进中文自动文本摘要自注意力计算的方法
CN112507711A (zh) * 2020-12-04 2021-03-16 南京擎盾信息科技有限公司 文本摘要抽取方法及系统
CN112507711B (zh) * 2020-12-04 2023-08-08 南京擎盾信息科技有限公司 文本摘要抽取方法及系统
CN112819622B (zh) * 2021-01-26 2023-10-17 深圳价值在线信息科技股份有限公司 一种信息的实体关系联合抽取方法、装置及终端设备
CN112819622A (zh) * 2021-01-26 2021-05-18 深圳价值在线信息科技股份有限公司 一种信息的实体关系联合抽取方法、装置及终端设备
CN112800043A (zh) * 2021-02-05 2021-05-14 凯通科技股份有限公司 一种物联网终端信息提取方法、装置、设备和存储介质
CN112836520A (zh) * 2021-02-19 2021-05-25 支付宝(杭州)信息技术有限公司 基于用户特征生成用户描述文本的方法和装置
CN112862727B (zh) * 2021-03-16 2023-06-23 上海壁仞智能科技有限公司 一种跨模态图像转换方法及装置
CN112862727A (zh) * 2021-03-16 2021-05-28 上海壁仞智能科技有限公司 一种跨模态图像转换方法及装置
CN113420143A (zh) * 2021-06-02 2021-09-21 平安国际智慧城市科技股份有限公司 文书摘要生成方法、装置、设备及存储介质
CN113420143B (zh) * 2021-06-02 2023-12-22 平安国际智慧城市科技股份有限公司 文书摘要生成方法、装置、设备及存储介质
CN113408272B (zh) * 2021-06-30 2023-08-18 北京百度网讯科技有限公司 摘要生成模型的训练方法、装置、设备和存储介质
CN113408636B (zh) * 2021-06-30 2023-06-06 北京百度网讯科技有限公司 预训练模型获取方法、装置、电子设备及存储介质
CN113408272A (zh) * 2021-06-30 2021-09-17 北京百度网讯科技有限公司 摘要生成模型的训练方法、装置、设备和存储介质
CN113408636A (zh) * 2021-06-30 2021-09-17 北京百度网讯科技有限公司 预训练模型获取方法、装置、电子设备及存储介质
US11989516B2 (en) 2021-06-30 2024-05-21 Beijing Baidu Netcom Science Technology Co., Ltd. Method and apparatus for acquiring pre-trained model, electronic device and storage medium
CN113657454A (zh) * 2021-07-23 2021-11-16 杭州安脉盛智能技术有限公司 基于自回归BiGRU的核电旋转机械状态监测方法
CN113657454B (zh) * 2021-07-23 2024-02-23 杭州安脉盛智能技术有限公司 基于自回归BiGRU的核电旋转机械状态监测方法
CN113806514A (zh) * 2021-09-18 2021-12-17 上海交通大学 基于Transformer模型的实体关系抽取方法和系统
CN113806514B (zh) * 2021-09-18 2024-03-01 上海交通大学 基于Transformer模型的实体关系抽取方法和系统
CN114218932A (zh) * 2021-11-26 2022-03-22 中国航空综合技术研究所 基于故障因果图谱的航空故障文本摘要生成方法及其装置
CN114218932B (zh) * 2021-11-26 2024-02-20 中国航空综合技术研究所 基于故障因果图谱的航空故障文本摘要生成方法及其装置

Also Published As

Publication number Publication date
CN109657051A (zh) 2019-04-19

Similar Documents

Publication Publication Date Title
WO2020107878A1 (zh) 文本摘要生成方法、装置、计算机设备及存储介质
CN110119765B (zh) 一种基于Seq2seq框架的关键词提取方法
CN109840287B (zh) 一种基于神经网络的跨模态信息检索方法和装置
US11423233B2 (en) On-device projection neural networks for natural language understanding
CN108829757B (zh) 一种聊天机器人的智能服务方法、服务器及存储介质
CN109241524B (zh) 语义解析方法及装置、计算机可读存储介质、电子设备
CN109190120B (zh) 神经网络训练方法和装置及命名实体识别方法和装置
WO2023065544A1 (zh) 意图分类方法、装置、电子设备及计算机可读存储介质
CN111914067B (zh) 中文文本匹配方法及系统
CN108419094A (zh) 视频处理方法、视频检索方法、装置、介质及服务器
WO2021139107A1 (zh) 情感智能识别方法、装置、电子设备及存储介质
CN113591483A (zh) 一种基于序列标注的文档级事件论元抽取方法
CN107895024B (zh) 用于网页新闻分类推荐的用户模型构建方法及推荐方法
CN114676234A (zh) 一种模型训练方法及相关设备
WO2023134083A1 (zh) 基于文本的情感分类方法和装置、计算机设备、存储介质
CN111178053B (zh) 一种结合语义和文本结构进行生成式摘要抽取的文本生成方法
WO2021135457A1 (zh) 基于循环神经网络的情绪识别方法、装置及存储介质
CN110569505A (zh) 一种文本输入方法及装置
WO2022228127A1 (zh) 要素文本处理方法、装置、电子设备和存储介质
CN111767697A (zh) 文本处理方法、装置、计算机设备以及存储介质
CN111680529A (zh) 一种基于层聚合的机器翻译算法及装置
CN111046233A (zh) 一种基于视频评论文本的视频标签确定方法
WO2020155769A1 (zh) 关键词生成模型的建模方法和装置
CN113434698B (zh) 基于全层级注意力的关系抽取模型建立方法及其应用
WO2018171499A1 (zh) 一种信息检测方法、设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19890231

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19890231

Country of ref document: EP

Kind code of ref document: A1