A method and device for extracting abstract text
By splicing the full text vectors and paragraph vectors of the text file and inputting the classification model, the problems of high redundancy and poor coherence of the extracted abstract are solved, and the accuracy and coherence of the abstract text are improved.
Patent Information
- Application Number
- CN202210152342.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-18
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2042-02-18
AI Technical Summary
In the existing extraction abstract technology, the abstract text has high redundancy, poor coherence and low accuracy, making it difficult to accurately extract the central idea of text files.
By generating the full text vector and paragraph text vector of the text file for splicing, inputting the classification model for classification calculation, determining whether the text paragraph is abstract text, improving semantic similarity to improving the accuracy of extraction.
Improves the accuracy of extracting abstract text from text files, ensuring the importance and coherence of paragraphs.
Smart Images

Figure CN114510563B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of text processing, and in particular to a summary text extraction method, device, electronic device and machine-readable storage medium. Background Art
[0002] Text summarization refers to the process of extracting, summarizing or refining the text content of an original text through various technical means to obtain the key text information therein as a summary text of the original text; that is, the summary text can be used to summarize and display the main content or central idea of the original text, so that users can quickly find effective information from massive data.
[0003] In practical applications, the summary text can be divided into extractive summary and generative summary according to the generation method of the summary text. For the extractive summary, there is a strong correlation between the quality of the summary text and the quality of the original text. The summary text may have high redundancy, poor coherence and low accuracy. Summary of the invention
[0004] The present application provides a summary text extraction method, the method comprising:
[0005] Generate a full-text text vector corresponding to the entire text content of the target text file, and generate a paragraph text vector corresponding to each text paragraph in the target text file;
[0006] Respectively concatenating each paragraph text vector with the full-text text vector to obtain concatenated vectors corresponding to each text paragraph in the target text file;
[0007] Input the splicing vectors corresponding to the respective text paragraphs in the target text file into the trained classification model for classification calculation, so as to obtain classification results corresponding to the respective text paragraphs in the target text file; the classification results are used to indicate whether the text paragraph corresponding to the input splicing vector is the summary text of the target text file;
[0008] According to the classification result, it is determined whether each text paragraph in the target text file is a summary text of the target text file.
[0009] Optionally, generating a full-text text vector corresponding to the entire text content of the target text file, and generating paragraph text vectors corresponding to each text paragraph in the target text file, respectively, includes:
[0010] Extracting each text paragraph in the target text file;
[0011] All text contents in the target text file and each text paragraph are respectively input into a language processing model for text vectorization processing to obtain a full-text text vector corresponding to the entire text contents and a paragraph text vector corresponding to each text paragraph.
[0012] Optionally, extracting each text paragraph in the target text file includes:
[0013] The entire text content of the target text file is matched using a preset regular expression for extracting text paragraphs, so as to extract each text paragraph in the target text file from the entire text content of the target text file.
[0014] Optionally, at least part of the text paragraphs in the respective text paragraphs include the paragraph title of the text paragraph;
[0015] Before respectively concatenating each paragraph text vector with the full text vector, the method further includes:
[0016] Generate paragraph title vectors corresponding to the paragraph titles of at least part of the text paragraphs respectively;
[0017] The step of respectively splicing each paragraph text vector with the full text vector to obtain a splicing vector corresponding to each text paragraph in the target text file includes:
[0018] The paragraph text vectors corresponding to each text paragraph, the paragraph title vectors corresponding to the text paragraph, and the full-text text vector are spliced respectively to obtain splicing vectors corresponding to each text paragraph in the target text file.
[0019] Optionally, generating paragraph title vectors corresponding to paragraph titles of at least part of the text paragraphs respectively includes:
[0020] Extracting the paragraph title of the at least part of the text paragraph;
[0021] The paragraph titles of at least part of the text paragraphs are respectively input into the language processing model for text vectorization processing to obtain paragraph title vectors corresponding to the paragraph titles of at least part of the text paragraphs.
[0022] Optionally, extracting the paragraph title of at least part of the text paragraph includes:
[0023] The at least part of the text paragraph is matched using a preset regular expression for extracting the paragraph title, so as to extract the paragraph title of the text paragraph from the at least part of the text paragraph.
[0024] Optionally, before generating a full-text text vector corresponding to the entire text content of the target text file, the method further includes:
[0025] A text file set from which summary text is to be extracted is obtained, and a plurality of text files in the text file set are sequentially determined as the target text files.
[0026] Optionally, the target text file is unstructured data; the method further includes:
[0027] The determined summary text of the target text file is converted into structured data and stored in a database.
[0028] Optionally, the method further includes:
[0029] Extracting key text information related to preset keywords to be extracted from the summary text of the target file;
[0030] The key text information is converted into structured data and stored in a database.
[0031] Optionally, converting the key text information into structured data and storing it in a database includes:
[0032] The keywords to be extracted are used as field names, and the key text information extracted and related to the keywords to be extracted are used as corresponding field values, and stored in a relational database in the form of a data table; or,
[0033] The keyword to be extracted is used as a key, and the key text information extracted and related to the keyword to be extracted is used as a corresponding value, and stored in a non-relational database in the form of a key-value pair.
[0034] Optionally, the target text file includes a report text file.
[0035] Optionally, the language processing model includes a BERT model.
[0036] The present application also provides a summary text extraction device, the device comprising:
[0037] A generating unit, used to generate a full-text text vector corresponding to the entire text content of the target text file, and to generate a paragraph text vector corresponding to each text paragraph in the target text file;
[0038] A concatenation unit, used to concatenate each paragraph text vector with the full-text text vector to obtain concatenation vectors corresponding to each text paragraph in the target text file;
[0039] A classification unit, used for inputting the concatenation vectors corresponding to the respective text paragraphs in the target text file into the trained classification model for classification calculation, so as to obtain classification results corresponding to the respective text paragraphs in the target text file; the classification results are used to indicate whether the text paragraph corresponding to the input concatenation vector is the summary text of the target text file;
[0040] The determination unit is used to determine whether each text paragraph in the target text file is a summary text of the target text file according to the classification result.
[0041] Optionally, the generating unit is specifically used for:
[0042] Extracting each text paragraph in the target text file;
[0043] All text contents in the target text file and each text paragraph are respectively input into a language processing model for text vectorization processing to obtain a full-text text vector corresponding to the entire text contents and a paragraph text vector corresponding to each text paragraph.
[0044] Optionally, the generating unit is specifically used for:
[0045] The entire text content of the target text file is matched using a preset regular expression for extracting text paragraphs, so as to extract each text paragraph in the target text file from the entire text content of the target text file.
[0046] Optionally, at least part of the text paragraphs in the respective text paragraphs include the paragraph title of the text paragraph;
[0047] The generating unit is further configured to generate paragraph title vectors corresponding to the paragraph titles of the at least part of the text paragraphs;
[0048] The splicing unit is also used to splice the paragraph text vectors corresponding to each text paragraph, the paragraph title vector corresponding to the text paragraph, and the full-text text vector respectively, so as to obtain splicing vectors corresponding to each text paragraph in the target text file.
[0049] Optionally, the generating unit is specifically used for:
[0050] Extracting the paragraph title of the at least part of the text paragraph;
[0051] The paragraph titles of at least part of the text paragraphs are respectively input into the language processing model for text vectorization processing to obtain paragraph title vectors corresponding to the paragraph titles of at least part of the text paragraphs.
[0052] Optionally, the generating unit is specifically used for:
[0053] The at least part of the text paragraph is matched using a preset regular expression for extracting the paragraph title, so as to extract the paragraph title of the text paragraph from the at least part of the text paragraph.
[0054] Optionally, the device further comprises:
[0055] The acquisition unit is used to acquire a text file set from which summary text is to be extracted, and to sequentially determine a plurality of text files in the text file set as the target text files.
[0056] Optionally, the target text file is unstructured data; and the device further includes:
[0057] The first conversion unit is used to convert the determined summary text of the target text file into structured data and store it in a database.
[0058] Optionally, the device further comprises:
[0059] An extraction unit, used to extract key text information related to preset keywords to be extracted from the summary text of the target file;
[0060] The second conversion unit is used to convert the key text information into structured data and store it in a database.
[0061] Optionally, the second conversion unit is specifically configured to:
[0062] The keywords to be extracted are used as field names, and the key text information extracted and related to the keywords to be extracted are used as corresponding field values, and stored in a relational database in the form of a data table; or,
[0063] The keyword to be extracted is used as a key, and the key text information extracted and related to the keyword to be extracted is used as a corresponding value, and stored in a non-relational database in the form of a key-value pair.
[0064] Optionally, the target text file includes a report text file.
[0065] Optionally, the language processing model includes a BERT model.
[0066] The present application also provides an electronic device, comprising a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are interconnected via the bus;
[0067] The memory stores machine-readable instructions, and the processor executes the above method by calling the machine-readable instructions.
[0068] The present application also provides a machine-readable storage medium, which stores machine-readable instructions. When the machine-readable instructions are called and executed by a processor, the above method is implemented.
[0069] Through the above embodiments, by performing text vectorization processing on the entire text content of the target text file and each text paragraph in the target text file respectively, the paragraph text vectors corresponding to each text paragraph and the full-text text vector corresponding to the entire text content can be spliced, and then the spliced vectors corresponding to each text paragraph can be input into the classification model for classification calculation to determine whether each text paragraph is the summary text of the target text file according to the obtained classification result; since the spliced vector is used as the input vector of the classification model, it can be determined whether to extract the text paragraph as the summary text of the target text file based on the semantic similarity between each text paragraph and the entire text content, thereby improving the accuracy of extracting the summary text from the text file. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] Figure 1 is a flowchart of a summary text extraction method shown in an exemplary embodiment;
[0071] Figure 2 is a hardware structure diagram of an electronic device in which a summary text extraction device is located according to an exemplary embodiment;
[0072] Figure 3 The figure is a block diagram of a summary text extraction device shown in an exemplary embodiment. DETAILED DESCRIPTION
[0073] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0074] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0075] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of this specification, the related technologies of text summarization involved in the embodiments of this specification are briefly described below.
[0076] Text summarization refers to the process of extracting, summarizing or refining the text content of an original text through various technical means to obtain the key text information therein as a summary text of the original text; that is, the summary text can be used to summarize and display the main content or central idea of the original text, so that users can quickly find effective information from massive data.
[0077] In practical applications, according to the generation method of the summary text, it can be divided into extractive summary and generative summary. Among them, the extractive summary can extract several key sentences from the entire text content of the original text, and directly splice the extracted key sentences to obtain the summary text of the original text; the generative summary is usually an end-to-end process, that is, it can automatically generate a summary text based on the semantics expressed by the important text content in the original text to summarize the text content of the original text. It can be seen that since each sentence in the extracted summary text is a sentence in the original text, the error rate in syntax and grammar is low, so compared with the generative summary, the extractive summary is simpler and more practical.
[0078] Traditional extractive summarization can usually use graph methods, clustering and other methods to complete unsupervised text summarization. For example, the Lead-3 method refers to the extraction of the first three sentences of the original text as the summary text of the original text. Another example is the TextRank algorithm, which refers to the use of each sentence in the original text as a node, and the calculation of the similarity between each sentence to construct an undirected weighted edge, and then the weight on each edge can be used to iteratively update the score of each node, and finally the sentences corresponding to the N nodes with the highest scores can be selected as the summary text of the original text.
[0079] It can be seen that in the embodiments shown above, for extractive summarization, there is a strong correlation between the quality of the summary text and the quality of the original text, and the summary text may have problems such as high redundancy, poor coherence, and low accuracy (that is, it is impossible to find the central idea).
[0080] In view of this, the present specification aims to propose a technical solution for determining whether to extract each text paragraph in a text file as a summary text of the text file based on the semantic similarity between the text paragraphs in the text file and the entire text content of the text file.
[0081] During implementation, a full-text text vector corresponding to the entire text content of a target text file can be generated, and paragraph text vectors corresponding to each text paragraph in the target text file can be generated; further, each paragraph text vector can be spliced with the full-text text vector to obtain a splicing vector corresponding to each text paragraph in the target text file; further, the splicing vectors corresponding to each text paragraph in the target text file can be input into a trained classification model for classification calculation to obtain classification results corresponding to each text paragraph in the target text file; the classification result is used to indicate whether the text paragraph corresponding to the input splicing vector is a summary text of the target text file; further, based on the classification result, it can be determined whether each text paragraph in the target text file is a summary text of the target text file.
[0082] It can be seen that in the technical solution of the present specification, by performing text vectorization processing on the entire text content of the target text file and each text paragraph in the target text file respectively, the paragraph text vectors corresponding to each text paragraph and the full-text text vector corresponding to the entire text content can be spliced, and then the spliced vectors corresponding to each text paragraph can be input into the classification model for classification calculation to determine whether each text paragraph is the summary text of the target text file according to the obtained classification result; since the spliced vector is used as the input vector of the classification model, it can be determined whether to extract the text paragraph as the summary text of the target text file (that is, the classification result corresponding to the text paragraph) based on the semantic similarity between each text paragraph and the entire text content, thereby improving the accuracy of extracting the summary text from the text file.
[0083] The present application is described below through specific embodiments and in combination with specific application scenarios.
[0084] See also Figure 1 , Figure 1 FIG. 1 is a flowchart of a method for extracting a summary text according to an exemplary embodiment. The method may perform the following steps:
[0085] Step 102: Generate a full-text text vector corresponding to the entire text content of the target text file, and generate a paragraph text vector corresponding to each text paragraph in the target text file;
[0086] Step 104: respectively concatenate each paragraph text vector with the full text vector to obtain concatenated vectors corresponding to each text paragraph in the target text file;
[0087] Step 106: inputting the concatenation vectors corresponding to the respective text paragraphs in the target text file into the trained classification model for classification calculation, so as to obtain classification results corresponding to the respective text paragraphs in the target text file; the classification results are used to indicate whether the text paragraph corresponding to the input concatenation vector is the summary text of the target text file;
[0088] Step 108: According to the classification result, determine whether each text paragraph in the target text file is a summary text of the target text file.
[0089] In this specification, a text file is a computer file consisting of several lines of characters. The target text file is the text file from which the summary text is to be extracted.
[0090] For example, if it is necessary to extract the summary text from the text file file_1, the target text file is the text file file_1.
[0091] In an illustrated embodiment, in a scenario of extracting summary text from a text file set, the method may further include: obtaining a text file set from which summary text is to be extracted, and sequentially determining a plurality of text files included in the text file set as the target text files.
[0092] For example, in the conversion link of the ETL process, it is necessary to extract the summary text of each text file in the text file set file_set, and the text file set file_set may include at least one text file; then the text file set file_set from which the summary text is to be extracted can be first obtained, and then several text files included in the obtained text file set file_set are sequentially determined as the target text files, and the summary text of the target text file is extracted until the extraction of each text file in the text file set file_set is completed.
[0093] In this case, if the several text files included in the text file set are respectively stored in multiple file servers that support one or more protocols (such as sftp, ftp, obs and other protocols), the several text files can be first read from the multiple file servers according to the preset URL to form a text file set for extracting summary text. The text file set can also be downloaded locally and then the summary text can be extracted through script calls.
[0094] It should be noted that the file format of the target text file is not specifically limited in this specification. For example, the file format of the target text file may specifically include but is not limited to: .txt, .doc, .docx, .pdf, and the like.
[0095] In practical applications, for target text files of different file formats, the target text files can be first parsed using a text parsing tool to obtain the entire text content of the target text file. It should be noted that the text parsing tool is not specifically limited in this specification, and those skilled in the art can flexibly select it according to needs; for example, the text parsing tool can be a PDF parser or other third-party text parsing library.
[0096] In one illustrated embodiment, the target text file may include a report-type text file.
[0097] In practical applications, since the writing style of the report text file is usually relatively standardized and the full text will contain at least one summary text paragraph, the summary text paragraph can be directly extracted as the summary text of the report text file.
[0098] For example, the target text file may specifically include, but is not limited to, accident investigation reports, disaster assessment reports, and other report-type text files in the emergency management industry; wherein the report-type text file may include a text paragraph with a paragraph title of "Accident Overview", and the text paragraph may be extracted as the summary text of the report-type text file.
[0099] In the present specification, a full-text text vector corresponding to the entire text content of the target text file may be generated, and paragraph text vectors corresponding to each text paragraph in the target text file may be generated.
[0100] For example, the target text file file_1 may contain three text paragraphs seg_1, seg_2, and seg_3; then a full-text text vector f1 corresponding to the entire text content of the target text file file_1 may be generated, and paragraph text vectors s1, s2, and s3 corresponding to the text paragraphs seg_1, seg_2, and seg_3 in the target text file file_1 may be generated.
[0101] It should be noted that, in the embodiment shown above, the target text file contains three text paragraphs, which is merely an exemplary description method and does not impose any special restrictions on this specification. The target text file may contain any number of text paragraphs (segments), and each text paragraph may also contain any number of sentences (sentences).
[0102] In one embodiment shown, the generating of a full-text text vector corresponding to the entire text content of a target text file, and the generating of paragraph text vectors corresponding to each text paragraph in the target text file, may specifically include: extracting each text paragraph in the target text file; inputting the entire text content in the target text file and each text paragraph into a language processing model for text vectorization processing, so as to obtain a full-text text vector corresponding to the entire text content and paragraph text vectors corresponding to each text paragraph.
[0103] For example, a preset regular expression for extracting text paragraphs can be used to match the entire text content of the target text file file_1 to extract text paragraphs seg_1, seg_2, and seg_3 from the entire text content of the target text file file_1; further, the entire text content of the target text file file_1 and the extracted text paragraphs seg_1, seg_2, and seg_3 can be respectively input into the trained language processing model for text vectorization processing to obtain the full-text text vector f1 and the paragraph text vectors s1, s2, and s3.
[0104] The language processing model may specifically include but is not limited to the BERT model, the WoBERT model, the ERNIE model, etc. It should be noted that the language processing model can be used not only for text vectorization, but also for semantic vectorization, that is, the full-text text vector and paragraph text vector can be used to represent the semantic features of the corresponding entire text content and text paragraph.
[0105] In practical applications, in order to optimize the effect of text vectorization processing for texts with industry attributes, the language processing model can be trained using the special corpus data of the corresponding industry. For example, based on the BERT model trained using general corpus data, the special corpus data of the emergency management industry can be further used for incremental training to obtain a special BERT model for the emergency management industry.
[0106] It should be noted that, while or after generating the full-text text vector and each paragraph text vector, at least the correspondence between the full-text text vector and each paragraph text vector can be stored, so that the full-text text vector and the paragraph text vector can be spliced according to the correspondence later. Specifically, the correspondence between the full-text text vector and each paragraph text vector can be recorded in a table; please refer to Table 1, which is an exemplary implementation method.
[0107] Text files Full text vector Text paragraph Paragraph text vector file_1 f1 seg_1 s1 file_1 f1 seg_2 s2 file_1 f1 seg_3 s3
[0108] Table 1
[0109] As shown in Table 1, the full-text text vector f1 corresponds to the entire text content of the target text file file_1; the paragraph text vectors s1, s2, and s3 correspond to the text paragraphs seg_1, seg_2, and seg_3 respectively; the text paragraphs seg_1, seg_2, and seg_3 all correspond to the text file file_1, and the paragraph text vectors s1, s2, and s3 all correspond to the full-text text vector f1.
[0110] In this specification, after generating the full-text text vector and each paragraph text vector, each paragraph text vector can be spliced with the full-text text vector to obtain splicing vectors corresponding to each text paragraph in the target text file.
[0111] For example, after generating a full-text text vector f1 corresponding to the entire text content of the target text file file_1, and generating paragraph text vectors s1, s2, s3 corresponding to the text paragraphs seg_1, seg_2, seg_3 in the target text file file_1, the paragraph text vectors s1, s2, s3 can be respectively spliced with the full-text text vector f1 to obtain splicing vectors "s1+f1", "s2+f1", "s2+f1" corresponding to the text paragraphs seg_1, seg_2, seg_3 in the target text file file_1, respectively.
[0112] It should be noted that the specific implementation method of splicing each paragraph text vector with the full-text text vector is only an exemplary description shown above, and does not impose special restrictions on this specification. Those skilled in the art may also choose other splicing methods according to their needs. For example, by splicing paragraph text vectors s1, s2, and s3 with the full-text text vector f1, splicing vectors "f1+s1", "f1+s2", and "f1+s3" corresponding to the text paragraphs seg_1, seg_2, and seg_3 in the target text file file_1 can be obtained.
[0113] In practical applications, each text paragraph in the target text file may also include a corresponding paragraph title. Since the paragraph title of a text paragraph can reflect the main content of the text paragraph to a certain extent, such as "accident overview", "accident process", etc., in order to further improve the accuracy of extracting summary text from the target text file, classification calculation can also be performed in combination with the semantics of the paragraph title of each text paragraph.
[0114] In one embodiment shown, at least part of the text paragraphs may include a paragraph title of the text paragraph; before respectively concatenating each paragraph text vector with the full-text text vector, the method may further include: generating paragraph title vectors corresponding to the paragraph titles of at least part of the text paragraphs.
[0115] For example, the text paragraphs seg_1, seg_2, and seg_3 in the target text file file_1 may respectively include: the paragraph title title_1 of the text paragraph seg_1, the paragraph title title_2 of the text paragraph seg_2, and the paragraph title title_3 of the text paragraph seg_3; in addition to generating the full-text text vector and each paragraph text vector, paragraph title vectors t1, t2, and t3 corresponding to the paragraph titles title_1, title_2, and title_3 may also be generated.
[0116] In the implementation manner shown above, the generating of paragraph title vectors corresponding to the paragraph titles of the at least partial text paragraphs may specifically include: extracting the paragraph titles of the at least partial text paragraphs; inputting the paragraph titles of the at least partial text paragraphs into the language processing model for text vectorization processing, so as to obtain paragraph title vectors corresponding to the paragraph titles of the at least partial text paragraphs.
[0117] For example, a preset regular expression for extracting paragraph titles can be used to match text paragraphs seg_1, seg_2, and seg_3 in the target text file file_1, so as to extract the paragraph titles title_1, title_2, and title_3 of the text paragraphs from the above-mentioned text paragraphs, respectively; further, the extracted paragraph titles title_1, title_2, and title_3 can be respectively input into the trained language processing model for text vectorization processing, so as to obtain paragraph title vectors t1, t2, and t3.
[0118] It should be noted that, while or after generating each paragraph title vector, at least the corresponding relationship between each paragraph title vector, the full text vector, and / or each paragraph text vector can be stored, so that the full text vector can be spliced with the paragraph text vector and the paragraph title vector according to the corresponding relationship. Specifically, the corresponding relationship between the full text vector, each paragraph text vector and each paragraph title vector can be recorded in a table; please refer to Table 2, which is an exemplary implementation method.
[0119] Full text vector Paragraph text vector Paragraph title vector f1 s1 t1 f1 s2 t2 f1 s3 t3
[0120] Table 2
[0121] As shown in Table 2, the paragraph title vectors t1, t2, and t3 correspond to the paragraph text vectors s1, s2, and s3, respectively, and both correspond to the full text vector f1.
[0122] Further, in the embodiment shown above, after generating paragraph title vectors corresponding to the paragraph titles of the at least part of the text paragraphs, respectively splicing the respective paragraph text vectors with the full-text text vector to obtain splicing vectors corresponding to the respective text paragraphs in the target text file, specifically may include: respectively splicing the paragraph text vectors corresponding to the respective text paragraphs, the paragraph title vector corresponding to the text paragraph, and the full-text text vector to obtain splicing vectors corresponding to the respective text paragraphs in the target text file.
[0123] For example, after generating a full-text text vector f1 corresponding to the entire text content of the target text file file_1, generating paragraph text vectors s1, s2, s3 corresponding to the text paragraphs seg_1, seg_2, seg_3 in the target text file file_1, and generating paragraph title vectors t1, t2, t3 corresponding to the paragraph titles of the text paragraphs seg_1, seg_2, seg_3 in the target text file file_1, the paragraph text vectors s1, s2, s3 and the paragraph title vectors t1, t2, t3 can be respectively spliced with the full-text text vector f1 to obtain splicing vectors "s1+t1+f1", "s2+t2+f1", "s2+t3+f1" corresponding to the text paragraphs seg_1, seg_2, seg_3 in the target text file file_1, respectively.
[0124] It should be noted that, in the implementation shown above, when a part of the text paragraphs in the target text file contain paragraph titles, while another part of the text paragraphs do not contain paragraph titles, for the part of the text paragraphs that do not contain paragraph titles, the splicing vector corresponding to the text paragraph can be obtained by reusing the paragraph text vector corresponding to the text paragraph.
[0125] For example, in the text paragraphs seg_1, seg_2, and seg_3 in the target text file file_1, the text paragraph seg_1 does not contain a paragraph title, the text paragraph seg_2 may contain a paragraph title title_2, and the text paragraph seg_3 may contain a paragraph title title_3; in addition to generating the full-text text vector and each paragraph text vector, paragraph title vectors t2 and t3 corresponding to the paragraph titles title_2 and title_3, respectively, may also be generated; further, the reused paragraph text vector s1 may be spliced with the full-text text vector f1 to obtain a splicing vector "s1+s1+f1" corresponding to the text paragraph seg_1, and the paragraph text vectors s2, s3, the paragraph title vectors t2, t3 may be spliced with the full-text text vector f1, respectively, to obtain splicing vectors "s2+t2+f1" and "s2+t3+f1" corresponding to the text paragraphs seg_2 and seg_3, respectively.
[0126] It should be noted that the specific implementation method of obtaining the splicing vector is only an exemplary description shown above, and does not impose special restrictions on this specification. Those skilled in the art may also choose other splicing methods according to their needs. For example, by splicing the paragraph text vector s1, the paragraph title vector t1, and the full text vector f1, respectively, a splicing vector "f1+s1+t1" corresponding to the text paragraph seg_1 in the target text file file_1 can be obtained.
[0127] In the present specification, after obtaining the splicing vectors corresponding to each text paragraph in the target text file, each splicing vector can be input into the trained classification model for classification calculation to obtain the classification results corresponding to each text paragraph in the target text file, wherein the classification result can be used to indicate whether the text paragraph corresponding to the input splicing vector is the summary text of the target text file; further, based on the classification result, it can be determined whether each text paragraph in the target text file is the summary text of the target text file.
[0128] In practical applications, when training the classification model, supervised training can be performed on the classification function of the classification model. In implementation, a training sample can be obtained first, and the training sample can include the entire text content of a sample text file, any sample text paragraph in the sample text file, and the actual classification result corresponding to the sample text paragraph. Then, based on the training sample, supervised training is performed on the classification function of the classification model according to a preset optimization goal; wherein the optimization goal can include: for any training sample in the training sample, the classification result corresponding to the sample text paragraph matches the actual classification result.
[0129] In order to achieve supervised training of the classification function of the classification model according to a preset optimization goal, when the classification function of the classification model is supervisedly trained based on the training sample, it can be determined whether the classification function reaches the optimization goal by judging whether the cross entropy loss function corresponding to the classification function converges, that is, whether the classification model is trained. For example, if the cross entropy loss function converges, it can be determined that the classification model training is completed; if the cross entropy loss function does not converge, it can be determined that the classification model is not trained, so that the classification function can continue to be supervised.
[0130] It should be noted that those skilled in the art can select different classification functions for the classification model according to their needs, and this specification does not limit this. Among them, the concatenation vectors corresponding to each text paragraph can be used as the independent variable of the classification function, and the classification results corresponding to each text paragraph can be used as the dependent variable of the classification function.
[0131] For example, after obtaining the splicing vectors "f1+s1", "f1+s2", and "f1+s3" respectively corresponding to the text paragraphs seg_1, seg_2, and seg_3 in the target text file file_1, the splicing vector "f1+s1" can be first input into the classification model for classification calculation to obtain a classification result corresponding to the text paragraph seg_1 in the target text file file_1, and the classification result can be used to indicate whether the text paragraph seg_1 is the summary text of the target text file file_1; similarly, the splicing vectors "f1+s2" and "f1+s3" can also be sequentially input into the classification model for classification calculation. To obtain classification results corresponding to text paragraphs seg_2 and seg_3 in the target text file file_1 respectively; further, after obtaining the classification results output by the classification model corresponding to each text paragraph in the target text file file_1, if according to the classification results, it can be determined that text paragraphs seg_1 and seg_3 are not summary texts of the target text file file_1, and text paragraph seg_2 is the summary text of the target text file file_1, then text paragraph seg_2 can be extracted as the summary text of the target text file file_1, that is, the summary paragraph of the target text file file_1.
[0132] In one embodiment shown, the target text file may be unstructured data; after determining the summary text of the target text file, the method may further include: converting the summary text of the target text file into structured data and storing it in a database.
[0133] In practical applications, in order to further utilize the effective information in unstructured data, the obtained effective information can be converted into structured data and stored in the downstream database of the data chain, so that technical personnel in this field can use the structured data stored in the downstream database for modeling analysis, data mining and other processing. The structured data or decision recommendations obtained by modeling analysis can also be displayed to users through visualization pages, smart cockpits, etc., which will not be repeated here.
[0134] For example, after determining that the text paragraph seg_2 in the target text file file_1 is the summary text of the target text file file_1, it can be converted into structured data, and the converted structured data can be stored in a database; wherein the database may include a relational database and a non-relational database, which is not limited in this specification.
[0135] In a possible case, if the database is a relational database, "text file" and "summary text" can be used as preset field names, and the file identifier of the target text file and the summary text of the target text file can be used as corresponding field values and stored in the relational database in the form of a data table. For example, see Table 3, which is an exemplary data table.
[0136] Text files Summary text file_1 seg_2 …… ……
[0137] Table 3
[0138] As shown in Table 3, after determining that the text paragraph seg_2 in the target text file file_1 is the summary text of the target text file file_1, the file identifier file_1 of the target text file can be used as the field value corresponding to the preset field "text file", and the text paragraph seg_2 (that is, the summary text of the target text file file_1) can be used as the field value corresponding to the preset field "summary text" and stored in the relational database in the form of a data table.
[0139] In another possible case, if the database is a non-relational database, the target text file can be used as a key, and the summary text of the target text file can be used as a corresponding value to be stored in the non-relational database in the form of a key-value pair.
[0140] Among them, if the target text file file_1 is an accident investigation report of the emergency management industry, the structured data shown in Table 3 can also be stored in a database corresponding to the emergency management industry, so that subsequent modeling analysis, data mining and other processing can be performed on the structured data stored in the database corresponding to the emergency management industry.
[0141] In another illustrated embodiment, after determining the summary text of the target text file, the method may further include: extracting key text information related to preset keywords to be extracted from the summary text of the target text file; and converting the key text information into structured data and storing it in a database.
[0142] In one possible case, if the database is a relational database, the keywords to be extracted can be used as field names, and the extracted key text information related to the keywords to be extracted can be used as corresponding field values, and stored in the relational database in the form of a data table. For example, in the application scenario of the emergency management industry, the preset keywords to be extracted can specifically include but are not limited to: event reporting time, event type, event subtype, event location, event time, event process, industry attributes, etc.; after determining that the summary text of the target text file file_1 is the text paragraph seg_2, the key text information related to each of the above preset keywords to be extracted can be extracted from the text paragraph seg_2. For example, the key text information related to the keyword to be extracted "time of event" can be extracted as "xxxx year xx month xx day xx hour xx minute", and the key text information related to the keyword to be extracted "location of event" can be extracted as "xx province xx city xx district"; further, please refer to Table 4, which is another exemplary data table,
[0143] Time of the incident Location of the incident …… xxxx year xx month xx day xx hour xx minute xx District, xx City, xx Province ……
[0144] Table 4
[0145] As shown in Table 4, the keywords to be extracted "time of event occurrence" and "time of event occurrence" can be used as field names, and the key text information related to each keyword to be extracted "xxxx year xx month xx day xx hour xx minute" and "xx province xx city xx district" can be used as corresponding field values and stored in a relational database in the form of a data table.
[0146] In another possible case, if the database is a non-relational database, the keyword to be extracted can be used as the key, and the key text information extracted and related to the keyword to be extracted can be used as the corresponding value and stored in the non-relational database in the form of key-value pairs.
[0147] It should be noted that, in the above-mentioned embodiments, this specification does not impose any special restrictions on the keywords to be extracted, and those skilled in the art can flexibly set them according to needs; for example, the keywords to be extracted can also be keywords related to other industries or other scenarios. In addition, it should be noted that, regarding the specific organization form of the data table, Table 3 and Table 4 are only an exemplary description method and do not impose any special restrictions on this specification.
[0148] In the above-described implementation, the key text information related to the preset keywords to be extracted from the summary text of the target text file may be extracted by one or more of the following methods: regular expression, classification model, named entity recognition, etc. The following is an exemplary description of the specific implementation methods of extracting the key text information related to the keywords to be extracted from the text paragraphs.
[0149] (1) Regularized expression
[0150] Specifically, a preset regular expression for extracting key text information may be used to match the summary text of the target text file to extract key text information related to the preset keywords to be extracted.
[0151] For example, the preset regular expression for extracting time information can be used to match the text paragraph seg_4 to extract the key text information "xxxx year xx month xx day xx hour xx minute" related to the keyword "accident occurrence time" to be extracted from the text paragraph seg_4.
[0152] (2) Classification Model
[0153] Specifically, the paragraph text vector corresponding to the summary text of the target text file can be input into the classification model corresponding to the keyword to be extracted for classification calculation to obtain the classification result corresponding to the summary text as the key text information related to the keyword to be extracted from the summary text.
[0154] For example, the paragraph text vector s4 corresponding to the summary text seg_4 can be input into the classification model corresponding to the keyword "industry attributes" to be extracted for classification calculation to obtain the classification result corresponding to the summary text seg_4; wherein, the classification result obtained by the classification model corresponding to the keyword "industry attributes" to be extracted may specifically include but is not limited to "construction industry", "road transport industry", "coal mining industry", "chemical industry" and the like; if the classification result corresponding to the summary text seg_4 is "construction industry", it can be used as the key text information related to the keyword "industry attributes" to be extracted from the summary text seg_4; that is, if the text file file_1 is specifically a report text file of the emergency management industry, the classification model can be used to further realize the industry segmentation of the emergency management industry.
[0155] It should be noted that in the embodiment shown above, the classification model is a classification model corresponding to the keyword "industry attributes" to be extracted. It is only an exemplary description and does not impose any special restrictions on this specification. In actual applications, the classification model can also be used to perform classification calculations corresponding to other keywords to be extracted. Those skilled in the art can flexibly set it according to their needs, and will not be described in detail here.
[0156] (3) Named Entity Recognition
[0157] Specifically, several named entities corresponding to the text content contained in the summary text of the target text file can be identified, the named entities matching the keywords to be extracted can be determined among the several named entities, and the text content corresponding to the matching named entities can be extracted from the summary text as key text information related to the keywords to be extracted.
[0158] For example, for the text content contained in the summary text seg_4, it can be identified that the named entities corresponding to the key text information "xx province xx city xx district" include "place name"; further, since the named entity matching the keyword "accident location" to be extracted is "place name", the text content "xx province xx city xx district" corresponding to the named entity "place name" can be extracted from the summary text seg_4 as the key text information related to the keyword "accident location" to be extracted from the summary text seg_4. It should be noted that in the above-mentioned embodiments, the specific implementation method of named entity recognition can be referred to the relevant technology, which will not be elaborated here.
[0159] It should be noted that, in this specification, "obtaining the target text file", "extracting summary text for the target text file", and "converting the extraction results into structured data and storing them in the database" are multiple decoupled parts, and the extraction results can be stored in any relational database and / or non-relational database, thereby improving the scalability of the overall system.
[0160] It can be known from the above technical scheme that by performing text vectorization processing on the entire text content of the target text file and each text paragraph in the target text file respectively, the paragraph text vectors corresponding to each text paragraph and the full-text text vector corresponding to the entire text content can be spliced, and then the spliced vectors corresponding to each text paragraph obtained by splicing can be input into the classification model for classification calculation, so as to determine whether each text paragraph is the summary text of the target text file according to the obtained classification result; since the splicing vector is used as the input vector of the classification model, it can be determined whether to extract the text paragraph as the summary text of the target text file (that is, the classification result corresponding to the text paragraph) based on the semantic similarity between each text paragraph and the entire text content, thereby improving the accuracy of extracting the summary text from the text file.
[0161] Corresponding to the above-mentioned embodiment of the summary text extraction method, this specification also provides an embodiment of a summary text extraction device.
[0162] See also Figure 2 , Figure 2 This is a hardware structure diagram of an electronic device in which a summary text extraction device is located, which is shown as an exemplary embodiment. At the hardware level, the device includes a processor 202, an internal bus 204, a network interface 206, a memory 208, and a non-volatile memory 210, and of course may also include hardware required for other services. One or more embodiments of this specification can be implemented based on software, such as the processor 202 reading the corresponding computer program from the non-volatile memory 210 into the memory 208 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0163] See also Figure 3 , Figure 3 is a block diagram of a summary text extraction device shown in an exemplary embodiment. The summary text extraction device can be applied to Figure 2 In the electronic device shown in the figure, the technical solution of this specification is implemented. Among them, the above-mentioned summary text extraction device may include:
[0164] A generating unit 302, configured to generate a full-text text vector corresponding to the entire text content of the target text file, and to generate a paragraph text vector corresponding to each text paragraph in the target text file;
[0165] A concatenation unit 304 is used to concatenate each paragraph text vector with the full text vector to obtain concatenation vectors corresponding to each text paragraph in the target text file;
[0166] The classification unit 306 is used to input the concatenation vectors corresponding to the respective text paragraphs in the target text file into the trained classification model for classification calculation, so as to obtain the classification results corresponding to the respective text paragraphs in the target text file; the classification results are used to indicate whether the text paragraph corresponding to the input concatenation vector is the summary text of the target text file;
[0167] The determination unit 308 is used to determine whether each text paragraph in the target text file is a summary text of the target text file according to the classification result.
[0168] In this embodiment, the generating unit 302 is specifically used for:
[0169] Extracting each text paragraph in the target text file;
[0170] All text contents in the target text file and each text paragraph are respectively input into a language processing model for text vectorization processing to obtain a full-text text vector corresponding to the entire text contents and a paragraph text vector corresponding to each text paragraph.
[0171] In this embodiment, the generating unit 302 is specifically used for:
[0172] The entire text content of the target text file is matched using a preset regular expression for extracting text paragraphs, so as to extract each text paragraph in the target text file from the entire text content of the target text file.
[0173] In this embodiment, at least part of the text paragraphs in the text paragraphs include the paragraph title of the text paragraph;
[0174] The generating unit 302 is further configured to generate paragraph title vectors corresponding to the paragraph titles of the at least part of the text paragraphs;
[0175] The splicing unit 304 is further used to splice the paragraph text vectors corresponding to each text paragraph, the paragraph title vectors corresponding to the text paragraph, and the full-text text vector, respectively, to obtain splicing vectors corresponding to each text paragraph in the target text file.
[0176] In this embodiment, the generating unit 302 is specifically used for:
[0177] Extracting the paragraph title of the at least part of the text paragraph;
[0178] The paragraph titles of at least part of the text paragraphs are respectively input into the language processing model for text vectorization processing to obtain paragraph title vectors corresponding to the paragraph titles of at least part of the text paragraphs.
[0179] In this embodiment, the generating unit 302 is specifically used for:
[0180] The at least part of the text paragraph is matched using a preset regular expression for extracting the paragraph title, so as to extract the paragraph title of the text paragraph from the at least part of the text paragraph.
[0181] In this embodiment, the device further includes:
[0182] The acquisition unit is used to acquire a text file set from which summary text is to be extracted, and to sequentially determine a plurality of text files in the text file set as the target text files.
[0183] In this embodiment, the target text file is unstructured data; the device further includes:
[0184] The first conversion unit is used to convert the determined summary text of the target text file into structured data and store it in a database.
[0185] In this embodiment, the device further includes:
[0186] An extraction unit, used to extract key text information related to preset keywords to be extracted from the summary text of the target file;
[0187] The second conversion unit is used to convert the key text information into structured data and store it in a database.
[0188] In this embodiment, the second conversion unit is specifically used to:
[0189] The keywords to be extracted are used as field names, and the key text information extracted and related to the keywords to be extracted are used as corresponding field values, and stored in a relational database in the form of a data table; or,
[0190] The keyword to be extracted is used as a key, and the key text information extracted and related to the keyword to be extracted is used as a corresponding value, and stored in a non-relational database in the form of a key-value pair.
[0191] In this embodiment, the target text file includes a report text file.
[0192] In this embodiment, the language processing model includes a BERT model.
[0193] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0194] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. Ordinary technicians in this field can understand and implement it without paying creative work.
[0195] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.
[0196] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0197] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0198] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0199] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0200] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0201] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "one", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0202] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0203] The above description is merely a preferred embodiment of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of protection of one or more embodiments of the present specification.
Claims
1. A summary text extraction method, the method comprising: Generate a full-text text vector corresponding to the entire text content of the target text file, and generate a paragraph text vector corresponding to each text paragraph in the target text file; Respectively concatenating each paragraph text vector with the full-text text vector to obtain concatenated vectors corresponding to each text paragraph in the target text file; Input the splicing vectors corresponding to the respective text paragraphs in the target text file into the trained classification model for classification calculation, so as to obtain classification results corresponding to the respective text paragraphs in the target text file; the classification results are used to indicate whether the text paragraph corresponding to the input splicing vector is the summary text of the target text file; According to the classification result, it is determined whether each text paragraph in the target text file is a summary text of the target text file.
2. The method according to claim 1, wherein generating a full-text text vector corresponding to the entire text content of the target text file, and generating paragraph text vectors corresponding to each text paragraph in the target text file, respectively, comprises: Extracting each text paragraph in the target text file; All text contents in the target text file and each text paragraph are respectively input into a language processing model for text vectorization processing to obtain a full-text text vector corresponding to the all text contents and a paragraph text vector corresponding to each text paragraph.
3. The method according to claim 2, wherein extracting each text paragraph in the target text file comprises: The entire text content of the target text file is matched using a preset regular expression for extracting text paragraphs, so as to extract each text paragraph in the target text file from the entire text content of the target text file.
4. The method according to claim 1, wherein at least part of the text paragraphs in each of the text paragraphs comprises a paragraph title of the text paragraph; Before respectively concatenating each paragraph text vector with the full text vector, the method further includes: Generate paragraph title vectors corresponding to the paragraph titles of at least part of the text paragraphs respectively; The step of respectively splicing each paragraph text vector with the full text vector to obtain a splicing vector corresponding to each text paragraph in the target text file includes: The paragraph text vectors corresponding to each text paragraph, the paragraph title vectors corresponding to the text paragraph, and the full-text text vector are spliced respectively to obtain splicing vectors corresponding to each text paragraph in the target text file.
5. The method according to claim 4, wherein generating paragraph title vectors respectively corresponding to the paragraph titles of the at least part of the text paragraphs comprises: Extracting the paragraph title of the at least part of the text paragraph; The paragraph titles of at least part of the text paragraphs are respectively input into the language processing model for text vectorization processing to obtain paragraph title vectors corresponding to the paragraph titles of at least part of the text paragraphs.
6. The method according to claim 5, wherein extracting the paragraph title of the at least part of the text paragraph comprises: The at least part of the text paragraph is matched using a preset regular expression for extracting the paragraph title, so as to extract the paragraph title of the text paragraph from the at least part of the text paragraph.
7. The method according to claim 1, before generating a full-text text vector corresponding to the entire text content of the target text file, the method further comprises: A text file set from which summary text is to be extracted is obtained, and a plurality of text files in the text file set are sequentially determined as the target text files.
8. The method according to claim 1, wherein the target text file is unstructured data; the method further comprises: The determined summary text of the target text file is converted into structured data and stored in a database.
9. The method according to claim 1, further comprising: Extracting key text information related to preset keywords to be extracted from the summary text of the target text file; The key text information is converted into structured data and stored in a database.
10. The method according to claim 9, wherein the step of converting the key text information into structured data and storing it in a database comprises: The keywords to be extracted are used as field names, and the key text information related to the keywords to be extracted are used as corresponding field values, and are stored in a relational database in the form of a data table; or, The keyword to be extracted is used as a key, and the key text information extracted and related to the keyword to be extracted is used as a corresponding value, and stored in a non-relational database in the form of a key-value pair.
11. The method according to claim 1, wherein the target text file comprises a report-type text file.
12. According to the method according to claim 2 or 5, the language processing model comprises a BERT model.
13. A summary text extraction device, the device comprising: A generating unit, used to generate a full-text text vector corresponding to the entire text content of the target text file, and to generate a paragraph text vector corresponding to each text paragraph in the target text file; A concatenation unit, used to concatenate each paragraph text vector with the full-text text vector to obtain concatenation vectors corresponding to each text paragraph in the target text file; A classification unit, used for inputting the concatenation vectors corresponding to the respective text paragraphs in the target text file into the trained classification model for classification calculation, so as to obtain classification results corresponding to the respective text paragraphs in the target text file; the classification results are used to indicate whether the text paragraph corresponding to the input concatenation vector is the summary text of the target text file; The determination unit is used to determine whether each text paragraph in the target text file is a summary text of the target text file according to the classification result.
14. An electronic device, comprising a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are interconnected via the bus; The memory stores machine-readable instructions, and the processor executes the method according to any one of claims 1 to 12 by calling the machine-readable instructions.
15. A machine-readable storage medium storing machine-readable instructions, wherein the machine-readable instructions, when called and executed by a processor, implement the method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Text characteristic modeling method and device for network security reports
CN107368592A
Dispute focus discovery method and device based on dispute focus entity, and terminal
CN111814477A