CN113434642B - Text abstract generation method and device and electronic equipment - Google Patents

Text abstract generation method and device and electronic equipment Download PDF

Info

Publication number
CN113434642B
CN113434642B CN202110991727.0A CN202110991727A CN113434642B CN 113434642 B CN113434642 B CN 113434642B CN 202110991727 A CN202110991727 A CN 202110991727A CN 113434642 B CN113434642 B CN 113434642B
Authority
CN
China
Prior art keywords
text
abstract
sentence
preset
target
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202110991727.0A
Other languages
Chinese (zh)
Other versions
CN113434642A (en
Inventor
黄诗雅
罗睦军
邓从健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Yunqu Information Technology Co ltd
Original Assignee
Guangzhou Yunqu Information Technology Co ltd
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 Guangzhou Yunqu Information Technology Co ltd filed Critical Guangzhou Yunqu Information Technology Co ltd
Priority to CN202110991727.0A priority Critical patent/CN113434642B/en
Publication of CN113434642A publication Critical patent/CN113434642A/en
Application granted granted Critical
Publication of CN113434642B publication Critical patent/CN113434642B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/34Browsing; Visualisation therefor
    • G06F16/345Summarisation for human users
    • 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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

Abstract

The embodiment of the application provides a text abstract generating method, a text abstract generating device and electronic equipment, wherein the text abstract generating method comprises the following steps: acquiring a first text to be processed; obtaining sentences meeting preset conditions from the first text to construct an initial abstract, and removing the initial abstract from the first text to obtain a second text; performing preset replacement processing on the sentence in the second text to obtain a third text; and obtaining a target abstract according to the third text and the initial abstract.

Description

Text abstract generation method and device and electronic equipment
Technical Field
The embodiment of the disclosure relates to the technical field of natural language processing, and more particularly, to a text abstract generating method and device and an electronic device.
Background
With the continuous development of computer technology, people pay more and more attention to how to automatically, quickly and accurately extract a text abstract of a text by electronic equipment.
The methods currently used to extract text summaries can be generally divided into a summary extraction method and a summary generation method. The abstract extraction method generally extracts a plurality of core sentences from a text as an abstract; the abstract generation method is generally based on Natural Language Processing (NLP) technology, and generates a smooth abstract in a self-contained manner after the electronic device reads and understands a text.
The abstract extraction method is to simply combine the extracted sentences to serve as the abstract of the text, so that the generated abstract can have the problems of spoken expression, unsmooth sentence and incapability of accurately acquiring the text core. The abstract generation method usually depends on a large amount of sample data for training, and when the text to be processed is a text in a field in which the sample data is difficult to obtain, for example, problems of serious spoken language expression, wrong voice transcribed words and the like often exist in the text obtained by converting the call data, so that the sample data in the field is usually difficult to obtain, and the problem of inaccurate result often exists when the text abstract is extracted based on the method. Therefore, there is a need to provide a text abstract generating method to extract a text abstract quickly and accurately.
Disclosure of Invention
An object of the present disclosure is to provide a new technical solution for generating a text summary.
According to a first aspect of the present disclosure, an embodiment of a text summary generation method is provided, including:
acquiring a first text to be processed;
obtaining sentences meeting preset conditions from the first text to construct an initial abstract, and removing the initial abstract from the first text to obtain a second text;
performing preset replacement processing on the sentence in the second text to obtain a third text;
and obtaining a target abstract according to the third text and the initial abstract.
Optionally, the obtaining of the sentence construction initial abstract meeting the preset condition from the first text includes:
ranking the importance of the sentences in the first text;
and selecting at least one sentence meeting preset ranking conditions from the first text according to the importance ranking to construct the initial abstract.
Optionally, the obtaining a second text by removing the initial abstract from the first text includes:
and replacing the sentences meeting the preset ranking condition in the first text with a first preset mark to obtain the second text.
Optionally, the performing preset replacement processing on the sentence in the second text to obtain a third text includes:
acquiring a marked word in a first sentence, wherein the first sentence is any one sentence in the second text, and the marked word is a word selected from the first sentence by using a preset strategy;
replacing the tagged word with a second preset tag;
and obtaining the third text according to the replaced first sentence.
Optionally, the obtaining a target abstract according to the third text and the initial abstract includes:
inputting the third text into an encoder submodel of a target abstract generating model, and inputting the initial abstract into a decoder submodel of the target abstract generating model to obtain the target abstract;
the target abstract generation model is used for predicting the target abstract according to the key vector and the value vector output by the i-th layer of the encoder submodel and the query vector output by the i-1-th layer of the decoder submodel, wherein i is an integer not less than 1.
Optionally, the encoder submodel comprises a preset number of first network layers, the first network layers comprising a first multi-headed self-attention mechanism sub-network layer and a first fully-connected feed-forward sub-network layer; the decoder submodel includes the preset number of second network layers including a second multi-headed self-attention mechanism sub-network layer, a second attention sub-network layer, and a second fully-connected feedforward sub-network layer.
Optionally, the obtaining of the first text to be processed includes:
acquiring an original dialog text;
performing word segmentation processing on the sentences in the original dialog text; and the number of the first and second groups,
and performing data cleaning processing on the original dialog text subjected to the word segmentation processing to obtain the first text.
Optionally, the first text is a text obtained according to original call data; after obtaining the target summary, the method further comprises:
generating target work order data according to the first text and the target abstract;
and pushing the target work order data to target terminal equipment, wherein the target terminal equipment is used by a service user for processing a preset task.
According to a second aspect of the present disclosure, there is provided an embodiment of a text summary generation apparatus, including:
the first text acquisition module is used for acquiring a first text to be processed;
a second text obtaining module, configured to obtain a sentence meeting a preset condition from the first text as an initial abstract, and obtain a second text by removing the initial abstract from the first text;
a third text obtaining module, configured to perform preset replacement processing on the sentence in the second text to obtain a third text;
and the target abstract obtaining module is used for obtaining a target abstract according to the third text and the initial abstract.
According to a third aspect of the present disclosure, there is provided an embodiment of an electronic device, comprising the apparatus as described in the second aspect of the present description; alternatively, the first and second electrodes may be,
the electronic device includes:
a memory for storing executable instructions;
a processor configured to operate the electronic device to perform the method according to the first aspect of the specification.
The method has the advantages that after the electronic equipment acquires the first text to be processed, the electronic equipment acquires sentences meeting preset conditions from the first text to construct an initial abstract, removes the initial abstract from the first text to obtain a second text and performs preset replacement processing on the sentences in the second text to obtain a third text; and then, generating a target abstract according to the third text and the initial abstract. According to the method provided by the embodiment of the disclosure, the initial abstract is extracted from the first text, the third text is obtained by performing preset replacement processing on the sentences in the second text after the initial abstract is removed, and the abstract of the first text can be predicted based on the third text to calibrate the initial abstract, so that the target abstract with higher accuracy is obtained.
Other features of the present description and advantages thereof will become apparent from the following detailed description of exemplary embodiments thereof, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the specification and together with the description, serve to explain the principles of the specification.
Fig. 1 is a schematic block diagram showing a hardware configuration of an electronic device that can be used to implement the text digest generation method of an embodiment.
Fig. 2 is a flowchart illustrating a text summary generating method according to an embodiment of the present disclosure.
Fig. 3 is a schematic block diagram of a text summary generating apparatus according to an embodiment of the present disclosure.
Fig. 4 is a schematic diagram of a hardware structure of an electronic device provided in an embodiment of the present disclosure.
Detailed Description
Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
< hardware configuration >
Fig. 1 is a schematic block diagram showing a hardware configuration of an electronic device that can be used to implement the text digest generation method of an embodiment.
The electronic device 1000 may be a smart phone, a portable computer, a desktop computer, a tablet computer, a server, etc., and is not limited herein.
The electronic device 1000 may include, but is not limited to, a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker 1700, a microphone 1800, and the like. The processor 1100 may be a central processing unit CPU, a graphics processing unit GPU, a microprocessor MCU, or the like, and is configured to execute a computer program, and the computer program may be written by using an instruction set of architectures such as x86, Arm, RISC, MIPS, and SSE. The memory 1200 includes, for example, a ROM (read only memory), a RAM (random access memory), a nonvolatile memory such as a hard disk, and the like. The interface device 1300 includes, for example, a USB interface, a serial interface, a parallel interface, and the like. The communication device 1400 is capable of wired communication using an optical fiber or a cable, or wireless communication, and specifically may include WiFi communication, bluetooth communication, 2G/3G/4G/5G communication, and the like. The display device 1500 is, for example, a liquid crystal display panel, a touch panel, or the like. The input device 1600 may include, for example, a touch screen, a keyboard, a somatosensory input, and the like. The speaker 1700 is used to output an audio signal. The microphone 1800 is used to collect audio signals.
As applied to the disclosed embodiments, the memory 1200 of the electronic device 1000 is used to store a computer program for controlling the processor 1100 to operate so as to implement the method according to the disclosed embodiments. The skilled person can design the computer program according to the solution disclosed in the present disclosure. How the computer program controls the processor to operate is well known in the art and will not be described in detail here. The electronic device 1000 may be installed with an intelligent operating system (e.g., Windows, Linux, android, IOS, etc. systems) and application software.
It should be understood by those skilled in the art that although a plurality of devices of the electronic apparatus 1000 are illustrated in fig. 1, the electronic apparatus 1000 of the embodiments of the present disclosure may refer to only some of the devices therein, for example, only the processor 1100 and the memory 1200, etc.
Various embodiments and examples according to the present disclosure are described below with reference to the drawings.
< method examples >
Fig. 2 is a flowchart illustrating a text summary generating method according to an embodiment of the present disclosure, which may be implemented by an electronic device, for example, the electronic device 1000 shown in fig. 1.
As shown in FIG. 2, the method of the present embodiment may include steps S2100-S2400, which are described in detail below.
In step S2100, a first text to be processed is acquired.
The first text is a text of the target abstract to be obtained, and the text comprises at least one sentence.
In this embodiment, the first text may be directly the original text without any processing. For example, the text may be directly in news and articles. Alternatively, the first text may also be a text obtained by performing preset processing on the original text. For example, the text may be obtained by performing text conversion and data cleansing processing on the user call data.
Specifically, the acquiring a first text to be processed includes: acquiring an original dialog text; performing word segmentation processing on the sentences in the original dialog text; and performing data cleaning processing on the original dialog text subjected to the word segmentation processing to obtain the first text.
The original dialog text may be a text obtained by text conversion of the original call data.
For example, when a user consults a product problem with an enterprise customer service in a voice conversation manner, the electronic device implementing the method of the embodiment may acquire the voice conversation data after the conversation is completed, and perform text conversion on the voice conversation data based on a natural language processing technology to obtain an original conversation text under the condition of obtaining user authorization.
In practice, because the original dialog text may have problems of severe spoken language expression, erroneous text conversion, and the like, in this embodiment, after the original dialog text is obtained, word segmentation processing may be performed on the original dialog text first to obtain words contained in the original dialog text and parts of speech of corresponding words; after that, the first text may be obtained by removing content in which it is apparently incorrect or meaningless.
Taking the original dialog text as an example of a text obtained after converting voice call data, in this embodiment, a jieba (jieba) word segmentation method may be used to perform word segmentation processing on the original dialog text; thereafter, the repeated text, repeated words, etc. therein may be removed to obtain the first text.
It should be noted that, in the specific implementation, the first text may also be first sorted by the user online and then uploaded to the electronic device to obtain the target abstract, which is not limited herein.
Step S2200 is that sentences meeting preset conditions are obtained from the first text to construct an initial abstract, and a second text is obtained by removing the initial abstract from the first text.
Specifically, after the first text is obtained, in order to improve the accuracy of the target abstract, sentences meeting preset conditions may be extracted from the first text to construct an initial abstract of the first text.
The initial abstract may not necessarily be the final abstract, but may be text that reflects to some extent the meaning expressed by the first text. For example, the initial abstract may be an abstract constructed by extracting core sentences in the first text based on a conventional abstract extraction method.
In one embodiment, the obtaining of the sentence construction initial summary satisfying the preset condition from the first text includes: ranking the importance of the sentences in the first text; and selecting at least one sentence meeting preset ranking conditions from the first text according to the importance ranking to construct the initial abstract.
In this embodiment, the preset condition may be: the importance corresponding to the sentence in the first text is ranked within top-m of the first text sentence, wherein m is not less than 1.
Specifically, the initial summary may be a text composed of sentences in the first text whose corresponding importance ranks within the top m names.
For example, the first text may be represented as
Figure 383297DEST_PATH_IMAGE001
Wherein D represents a first text,
Figure 34858DEST_PATH_IMAGE002
representing the ith sentence in the first text, wherein n is the total number of sentences in the first text, and i is not more than n; then it can be based on equation 1:
Figure 752279DEST_PATH_IMAGE003
sequentially obtaining the importance score of each sentence in the first text, wherein greedy maximization sentence selection can be used when calculating the score of each sentence
Figure 865597DEST_PATH_IMAGE004
And other sentences in the first text
Figure 414390DEST_PATH_IMAGE005
Root 1-F1; after the importance scores of all the sentences in the first text are obtained in sequence, the sentences with the importance ranking within the top m names can be constructed into the initial abstract.
Since how to calculate the importance score of a sentence is described in detail in the prior art, it is only briefly described here, and the detailed processing procedure is not described here again.
In this embodiment, after the initial abstract is extracted from the first text according to the above process, the second text may be obtained by removing the initial abstract from the first text.
The manner of removing the initial abstract from the first text may be: and deleting or shielding the sentences forming the initial abstract in the first text.
In this embodiment, the obtaining the second text by removing the initial abstract from the first text includes: and replacing the sentences meeting the preset ranking condition in the first text with a first preset mark to obtain the second text.
The first preset mark may be "MASK 1", for example, and the first text is used to form a sentence
Figure 971273DEST_PATH_IMAGE006
The initial abstract is composed of sentences
Figure 972727DEST_PATH_IMAGE007
The second text may be composed as an example
Figure 906048DEST_PATH_IMAGE008
In the form of (1).
Step S2300, performing preset replacement processing on the sentence in the second text to obtain a third text.
The preset replacement processing is to perform a certain degree of destruction processing on the words in the sentence included in the second text.
Specifically, after the initial abstract of the first text is obtained through the above processing, and the second text is obtained by removing the sentences in the initial abstract from the first text, in order to obtain the target abstract with higher accuracy, in this embodiment, a preset replacement process may be performed to perform a certain degree of "destruction" processing on the sentences in the second text, and based on the context semantics of the third text obtained after the "destruction" processing, the missing words and sentences in the third text are predicted, so that the initial abstract obtained by extracting the sentences in the first text is calibrated, so that the target abstract can more accurately reflect the core semantics of the first text.
In one embodiment, the performing preset replacement processing on the sentence in the second text to obtain a third text includes: acquiring a marked word in a first sentence, wherein the first sentence is any one sentence in the second text, and the marked word is a word selected from the first sentence by using a preset strategy; replacing the tagged word with a second preset tag; and obtaining the third text according to the replaced first sentence.
The marked words may be words marked from a second sentence of the second text using a preset policy, where the preset policy may be, for example: randomly selecting 15% of words in the sentence.
The second preset flag may be a word different from the first preset flag, and may be "MASK 2", for example.
In a specific implementation, the replacing of the tag word by the second preset tag may be any one of the following: replacing the marked words with the second preset marks directly; uniformly replacing the marked words and the words adjacent to the marked words by using preset marks; the markup terms are deleted from the first sentence.
For example, for the sentence "i want to buy train tickets", taking the labeled word of the sentence as "buy", the labeled word can be directly replaced with "MASK 2" to obtain "i want [ MASK2] train tickets"; alternatively, the unified replacement of the tagged word and its neighbors with "MASK 2" may be used to yield "[ MASK2] train tickets"; or, the marking words can be directly deleted to obtain the 'I want the train ticket'.
After the initial abstract is obtained according to the first text and the third text obtained by randomly replacing words in the sentence through the steps S2100-S2300, the target abstract of the first text can be obtained according to the initial abstract and the third text. In addition, in specific implementation, other methods may be used to perform preset replacement processing on the sentence in the second text to obtain the third text, for example, a direct Mask Language Model (MLM) may also perform preset replacement processing on the sentence in the second text to obtain the third text.
After step S2300, step S2400 is executed to obtain a target abstract according to the third text and the initial abstract.
In this embodiment, after the initial abstract and the third text are obtained, a first word vector corresponding to the initial abstract and a second word vector corresponding to the third text may be obtained, and core semantics that the text actually needs to express is predicted according to context semantics represented by the second word vector and semantics represented by the initial abstract, so that a target abstract with higher accuracy is predicted.
In one embodiment, the obtaining a target abstract according to the third text and the initial abstract includes: inputting the third text into an encoder submodel of a target abstract generating model, and inputting the initial abstract into a decoder submodel of the target abstract generating model to obtain the target abstract; the target abstract generation model is used for predicting the target abstract according to the key vector and the value vector output by the i-th layer of the encoder submodel and the query vector output by the i-1-th layer of the decoder submodel, wherein i is an integer not less than 1.
Specifically, in this embodiment, a target abstract generation model including an encoder sub-model and a decoder sub-model may be trained in advance to generate a target abstract of the first text according to the target abstract generation model, the third text and the initial abstract, and how to train to obtain the target abstract generation model will be described in detail first.
In this embodiment, the target abstract generation model may be an auto-regression model based on an attention mechanism, and specifically may include an encoder sub-model and a decoder sub-model, where the encoder sub-model includes a preset number of first network layers, and the first network layers include two sub-network layers (sub-layers): a first multi-head self-attention mechanism sub-network layer (muti-head self-attention mechanism network) and a first fully connected feed-forward sub-network layer (full connected feed-forward network); the decoder submodel includes the preset number of second network layers including three sub-network layers: a second multi-headed self-attention mechanism sub-network layer, a second attention-sub-network layer (cross-attention), and a second fully-connected feedforward sub-network layer.
In particular implementations, the third text may be input into an encoder sub-model and the initial digest into a decoder sub-model to output the target digest through interaction of the two sub-models.
In the encoder submodel, a word embedding process may be first used to obtain a second word vector corresponding to a third text, that is, a word vector matrix corresponding to the third text; and each network layer in the encoder submodel sequentially processes the second word vector through a sub-network layer contained in the encoder submodel, takes the output of the previous layer as the input of the next layer, and inputs the predicted key vector and value vector to the corresponding previous network layer of the decoder submodel so as to predict words and sentences reflecting the real semantics of the text by the second network layer in the decoder submodel based on an attention mechanism.
In one embodiment, the first network layer included in the encoder sub-model may further include a residual connection (residual connection) sub-network layer and a normalization (normalization) sub-network layer, and an output of the sub-network layer in the encoder sub-model may be represented as: sub _ layer _ output = layernom (x + (sublayer (x))), where x denotes an input vector of the corresponding sub-network layer.
In the first multi-head self-Attention mechanism sub-network layer, the Attention mechanism, i.e., Attention, can be expressed as: attention _ output = Attention (Q, K, V), where a Query vector (Q, Query) corresponds to a sequence that needs to be expressed, a Key vector (K, Key) and a Value vector (V, Value) respectively correspond to a sequence used to express Q, Q and K are in the same high-dimensional space, and V may not be in the same high-dimensional space as Q and K. In the first multi-head self-attention mechanism sub-network layer, the first multi-head self-attention mechanism sub-network layer may be specifically configured to project Q, K, V through h different linear transformations, and then finally splice different attentions, which may specifically be expressed as:
Figure 309348DEST_PATH_IMAGE009
in this embodiment, the attention can be obtained by calculating a dot product attention, and can be specifically expressed as:
Figure 614296DEST_PATH_IMAGE010
the decoder submodel comprises a preset number of second sub-network layers, in the decoder submodel, when calculating the attention, the second multi-headed self-attention mechanism sub-network layer of the i-th layer uses the key (K) and the value (V) as the key and the value output by the first multi-headed self-attention mechanism sub-network layer of the i-th layer of the encoder submodel, and queries (Q) the second multi-headed self-attention mechanism sub-network layer from the i-1 th layer; in the specific decoding process, which performs prediction based on the real character mark, probability calculation may be performed on each predicted character probability using a softmax function, and a prediction result of the maximum probability may be output.
It should be noted that the above is only a simple illustration of the structure of the target abstract generation model used in the present application, and the detailed descriptions of the multi-headed self-attention mechanism sub-network layer, the fully-connected feedforward sub-network layer and the attention sub-network layer are omitted here because they are detailed in the prior art.
In one embodiment, the target abstract generation model can be obtained by training the following steps: acquiring training sample data and an initial abstract generating model, and training the initial abstract generating model by using the training sample data to obtain the target abstract generating model meeting a preset convergence condition.
When the model is used for generating the target abstract of the first text, and training sample data is acquired, the training sample data can be constructed according to the historical conversation text acquired after the conversion of the historical conversation data and the corresponding abstract manually input by the user as the label of the conversation text.
In addition, when the abstract of the dialog text is manually input, contents such as repeated contents or digital labels may be usually included, so that when training sample data is constructed according to the historical dialog text and the abstract corresponding to the historical dialog text, in order to improve the model training speed and the model accuracy, data normalization processing can be further performed on each abstract, for example, contents which do not relate to specific services, such as digital labels in the abstract, can be removed through the regular expression "(+) | \ d +", so as to reduce the data processing amount and avoid possible influence of non-relevant characters on model training; and deleting the abstract text with the text length lower than the preset threshold value and the corresponding historical dialogue text.
After the target abstract generation model is obtained through the above processing training, for the first text, after the corresponding initial abstract and the third text are obtained through the above steps S2200 and S2300, the third text and the initial abstract can be input into the target abstract generation model, so as to quickly and accurately obtain the target abstract of the first text.
In addition, after obtaining the target abstract of the first text, in the case that the first text is a text obtained according to the original call data, the method further includes: generating target work order data according to the first text and the target abstract; and pushing the target work order data to target terminal equipment, wherein the target terminal equipment is used by a service user for processing a preset task.
Specifically, in this embodiment, in order to reduce the workload of the enterprise customer service, after the enterprise customer service performs voice call data with the user, the electronic device may obtain the call data by itself and perform text conversion, so as to finally obtain a first text to be processed; then, a target abstract which can accurately reflect the core semantics of the first text can be automatically obtained through the processing, so that work order data can be automatically generated according to the target abstract and the first text; after the work order data is obtained, the electronic device can also automatically push the work order data to a terminal device used by a service user for processing the work order data according to the service type corresponding to the work order data, so that the service user can process the work order data in time.
To sum up, according to the method provided by the embodiment of the present disclosure, after the electronic device obtains the first text to be processed, the electronic device obtains the sentences meeting the preset conditions from the first text to construct the initial abstract, and removes the initial abstract from the first text to obtain the second text and performs the preset replacement processing on the sentences in the second text to obtain the third text; and then, generating a target abstract according to the third text and the initial abstract. According to the method provided by the embodiment of the disclosure, the initial abstract is extracted from the first text, the third text is obtained by performing preset replacement processing on the sentences in the second text after the initial abstract is removed, and the abstract of the first text can be predicted based on the third text to calibrate the initial abstract, so that the target abstract with higher accuracy is obtained.
< apparatus embodiment >
Fig. 3 is a schematic block diagram of a text summary generating apparatus according to an embodiment of the present disclosure. As shown in fig. 3, the text summary generating means may include: a first text obtaining module 3100, a second text obtaining module 3200, a third text obtaining module 3300, and a target abstract obtaining module 3400.
The first text acquiring module 3100 is configured to acquire a first text to be processed.
In one embodiment, the first text acquisition module 3100, when acquiring the first text to be processed, may be configured to: acquiring an original dialog text; performing word segmentation processing on the sentences in the original dialog text; and performing data cleaning processing on the original dialog text subjected to the word segmentation processing to obtain the first text.
The second text obtaining module 3200 is configured to obtain, from the first text, a sentence that meets a preset condition as an initial abstract, and obtain a second text by removing the initial abstract from the first text.
In an embodiment, the second text obtaining module 3200, when obtaining the sentence construction initial summary satisfying the preset condition from the first text, may be configured to: ranking the importance of the sentences in the first text; and selecting at least one sentence meeting preset ranking conditions from the first text according to the importance ranking to construct the initial abstract.
In one embodiment, the second text obtaining module 3200, when obtaining the second text by removing the initial abstract from the first text, may be configured to: and replacing the sentences meeting the preset ranking condition in the first text with a first preset mark to obtain the second text.
The third text obtaining module 3300 is configured to perform preset replacement processing on the sentence in the second text to obtain a third text.
In an embodiment, when the third text obtaining module 3300 performs preset replacement processing on the sentence in the second text to obtain a third text, it may be configured to: acquiring a marked word in a first sentence, wherein the first sentence is any one sentence in the second text, and the marked word is a word selected from the first sentence by using a preset strategy; replacing the tagged word with a second preset tag; and obtaining the third text according to the replaced first sentence.
The target abstract obtaining module 3400 is configured to obtain a target abstract according to the third text and the initial abstract.
In one embodiment, the target abstract obtaining module 3400, when obtaining the target abstract according to the third text and the initial abstract, may be configured to: inputting the third text into an encoder submodel of a target abstract generating model, and inputting the initial abstract into a decoder submodel of the target abstract generating model to obtain the target abstract; the target abstract generation model is used for predicting the target abstract according to the key vector and the value vector output by the i-th layer of the encoder submodel and the query vector output by the i-1-th layer of the decoder submodel, wherein i is an integer not less than 1.
In one embodiment, the first text is a text obtained from original call data; the device also comprises a work order data generation module which is used for generating target work order data according to the first text and the target abstract after the target abstract is obtained; and pushing the target work order data to target terminal equipment, wherein the target terminal equipment is used by a service user for processing a preset task.
< apparatus embodiment >
Fig. 4 is a hardware configuration diagram of an electronic device according to an embodiment of the present disclosure.
As shown in fig. 4, the electronic device 400 comprises a processor 410 and a memory 420, the memory 420 being adapted to store an executable computer program, the processor 410 being adapted to perform a method according to any of the above method embodiments, under control of the computer program.
The modules of the text digest generation apparatus 3000 may be realized by the processor 410 executing the computer program stored in the memory 420 in the present embodiment, or may be realized by other circuit configurations, which is not limited herein.
One or more embodiments of the present description may be a system, method, and/or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the specification.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations for embodiments of the present description may be assembly instructions, Instruction Set Architecture (ISA) instructions, machine related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, an electronic circuit, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA), can execute computer-readable program instructions to implement various aspects of the present description by utilizing state information of the computer-readable program instructions to personalize the electronic circuit.
Aspects of the present description are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the description. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present description. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are equivalent.
The foregoing description of the embodiments of the present specification has been presented for purposes of illustration and description, but is not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the application is defined by the appended claims.

Claims (8)

1. A text summary generation method is characterized by comprising the following steps:
acquiring a first text to be processed;
obtaining sentences meeting preset conditions from the first text to construct an initial abstract, and removing the initial abstract from the first text to obtain a second text;
performing preset replacement processing on the sentence in the second text to obtain a third text;
obtaining a target abstract according to the third text and the initial abstract;
performing preset replacement processing on the sentence in the second text to obtain a third text, where the step of performing preset replacement processing on the sentence in the second text includes: acquiring a marked word in a first sentence, wherein the first sentence is any one sentence in the second text, and the marked word is a word selected from the first sentence by using a preset strategy; replacing the tagged word with a second preset tag; obtaining the third text according to the replaced first sentence;
the obtaining of the target abstract according to the third text and the initial abstract comprises: inputting the third text into an encoder submodel of a target abstract generating model, and inputting the initial abstract into a decoder submodel of the target abstract generating model to obtain the target abstract;
the encoder submodel includes a preset number of first network layers; the decoder submodel includes the preset number of second network layers; the target abstract generation model predicts the target abstract by the following steps:
the preset number of first network layers in the encoder submodel sequentially process second word vectors, the output of the last first network layer is used as the input of the next first network layer, each first network layer inputs the predicted value vector and the predicted key vector to the corresponding second network layer of the decoder submodel, and the second word vectors are word vectors obtained after word embedding processing is carried out on the third text;
and predicting the target abstract by a second network layer in the decoder submodel according to the key vector and the value vector output by the corresponding first network layer of the encoder submodel and the query vector output by the last second network layer in the decoder submodel, wherein the initial value of the query vector is obtained according to the initial abstract.
2. The method of claim 1, wherein the obtaining of the sentence construction initial abstract meeting the preset condition from the first text comprises:
ranking the importance of the sentences in the first text;
and selecting at least one sentence meeting preset ranking conditions from the first text according to the importance ranking to construct the initial abstract.
3. The method of claim 2, wherein obtaining a second text by removing the initial abstract from the first text comprises:
and replacing the sentences meeting the preset ranking condition in the first text with a first preset mark to obtain the second text.
4. The method of claim 1, wherein the first network layer comprises a first multi-headed self-attention mechanism sub-network layer and a first fully-connected feedforward sub-network layer; the second network layer includes a second multi-headed self-attention mechanism sub-network layer, a second attention sub-network layer, and a second fully-connected feedforward sub-network layer.
5. The method of claim 1, wherein obtaining the first text to be processed comprises:
acquiring an original dialog text;
performing word segmentation processing on the sentences in the original dialog text; and the number of the first and second groups,
and performing data cleaning processing on the original dialog text subjected to the word segmentation processing to obtain the first text.
6. The method of claim 1, wherein the first text is a text obtained from original call data; after obtaining the target summary, the method further comprises:
generating target work order data according to the first text and the target abstract;
and pushing the target work order data to target terminal equipment, wherein the target terminal equipment is used by a service user for processing a preset task.
7. A text summary generation apparatus, comprising:
the first text acquisition module is used for acquiring a first text to be processed;
a second text obtaining module, configured to obtain a sentence meeting a preset condition from the first text as an initial abstract, and obtain a second text by removing the initial abstract from the first text;
a third text obtaining module, configured to perform preset replacement processing on the sentence in the second text to obtain a third text;
the target abstract obtaining module is used for obtaining a target abstract according to the third text and the initial abstract;
performing preset replacement processing on the sentence in the second text to obtain a third text, where the step of performing preset replacement processing on the sentence in the second text includes: acquiring a marked word in a first sentence, wherein the first sentence is any one sentence in the second text, and the marked word is a word selected from the first sentence by using a preset strategy; replacing the tagged word with a second preset tag; obtaining the third text according to the replaced first sentence;
the obtaining of the target abstract according to the third text and the initial abstract comprises: inputting the third text into an encoder submodel of a target abstract generating model, and inputting the initial abstract into a decoder submodel of the target abstract generating model to obtain the target abstract;
the encoder submodel includes a preset number of first network layers; the decoder submodel includes the preset number of second network layers; the target abstract generation model predicts the target abstract by the following steps:
the preset number of first network layers in the encoder submodel sequentially process second word vectors, the output of the last first network layer is used as the input of the next first network layer, each first network layer inputs the predicted value vector and the predicted key vector to the corresponding second network layer of the decoder submodel, and the second word vectors are word vectors obtained after word embedding processing is carried out on the third text;
and predicting the target abstract by a second network layer in the decoder submodel according to the key vector and the value vector output by the corresponding first network layer of the encoder submodel and the query vector output by the last second network layer in the decoder submodel, wherein the initial value of the query vector is obtained according to the initial abstract.
8. An electronic device comprising the apparatus of claim 7; alternatively, the first and second electrodes may be,
the electronic device includes:
a memory for storing executable instructions;
a processor configured to execute the electronic device to perform the method according to any one of claims 1 to 6 under the control of the instructions.
CN202110991727.0A 2021-08-27 2021-08-27 Text abstract generation method and device and electronic equipment Active CN113434642B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110991727.0A CN113434642B (en) 2021-08-27 2021-08-27 Text abstract generation method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110991727.0A CN113434642B (en) 2021-08-27 2021-08-27 Text abstract generation method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN113434642A CN113434642A (en) 2021-09-24
CN113434642B true CN113434642B (en) 2022-01-11

Family

ID=77798146

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110991727.0A Active CN113434642B (en) 2021-08-27 2021-08-27 Text abstract generation method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN113434642B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114386390B (en) * 2021-11-25 2022-12-06 马上消费金融股份有限公司 Data processing method and device, computer equipment and storage medium
CN115040092A (en) * 2022-06-13 2022-09-13 天津大学 Heart rate monitoring method and respiratory event detection method based on channel state information

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190129942A1 (en) * 2017-10-30 2019-05-02 Northern Light Group, Llc Methods and systems for automatically generating reports from search results
CN108052686B (en) * 2018-01-26 2022-02-11 腾讯科技(深圳)有限公司 Abstract extraction method and related equipment
CN109726281A (en) * 2018-12-12 2019-05-07 Tcl集团股份有限公司 A kind of text snippet generation method, intelligent terminal and storage medium
CN109918496B (en) * 2018-12-27 2022-09-16 杭州环形智能科技有限公司 Accurate document retrieval method based on multi-vocabulary abstract
US20200372113A1 (en) * 2019-05-24 2020-11-26 Sap Se Log file meaning and syntax generation system
CN111506725B (en) * 2020-04-17 2021-06-22 北京百度网讯科技有限公司 Method and device for generating abstract
CN111581374A (en) * 2020-05-09 2020-08-25 联想(北京)有限公司 Text abstract obtaining method and device and electronic equipment
CN111708878B (en) * 2020-08-20 2020-11-24 科大讯飞(苏州)科技有限公司 Method, device, storage medium and equipment for extracting sports text abstract
CN112417854A (en) * 2020-12-15 2021-02-26 北京信息科技大学 Chinese document abstraction type abstract method
CN112732901A (en) * 2021-01-15 2021-04-30 联想(北京)有限公司 Abstract generation method and device, computer readable storage medium and electronic equipment
CN112711662A (en) * 2021-03-29 2021-04-27 贝壳找房(北京)科技有限公司 Text acquisition method and device, readable storage medium and electronic equipment
CN113204637B (en) * 2021-04-13 2022-09-27 北京三快在线科技有限公司 Text processing method and device, storage medium and electronic equipment
CN113282711B (en) * 2021-06-03 2023-09-22 中国软件评测中心(工业和信息化部软件与集成电路促进中心) Internet of vehicles text matching method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113434642A (en) 2021-09-24

Similar Documents

Publication Publication Date Title
CN109299458B (en) Entity identification method, device, equipment and storage medium
CN107705784B (en) Text regularization model training method and device, and text regularization method and device
CN109313719B (en) Dependency resolution for generating text segments using neural networks
CN110619867B (en) Training method and device of speech synthesis model, electronic equipment and storage medium
TWI428768B (en) Shared language model
CN111709248A (en) Training method and device of text generation model and electronic equipment
CN113434642B (en) Text abstract generation method and device and electronic equipment
CN112528655B (en) Keyword generation method, device, equipment and storage medium
CN111160004B (en) Method and device for establishing sentence-breaking model
CN110808032A (en) Voice recognition method and device, computer equipment and storage medium
CN114912450B (en) Information generation method and device, training method, electronic device and storage medium
JP2023012493A (en) Language model pre-training method, apparatus, device, and storage medium
CN113947095A (en) Multilingual text translation method and device, computer equipment and storage medium
CN112860919A (en) Data labeling method, device and equipment based on generative model and storage medium
CN115640520A (en) Method, device and storage medium for pre-training cross-language cross-modal model
US11036996B2 (en) Method and apparatus for determining (raw) video materials for news
CN116050425A (en) Method for establishing pre-training language model, text prediction method and device
CN112732896B (en) Target information display method, device, electronic equipment and medium
CN115620726A (en) Voice text generation method, and training method and device of voice text generation model
CN111667828B (en) Speech recognition method and apparatus, electronic device, and storage medium
CN115270719A (en) Text abstract generating method, training method and device based on multi-mode information
CN113657104A (en) Text extraction method and device, computer equipment and storage medium
CN113901841A (en) Translation method, translation device and storage medium
CN114898754B (en) Decoding image generation method, decoding image generation device, speech recognition method, speech recognition device, electronic device and storage medium
CN112966085B (en) Man-machine conversation intelligent control method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant