Key sentence extraction method and device

By extracting keywords and semantic features in long text documents, the key sentence collection is automatically determined, which solves the problem of low efficiency in key sentence extraction in long texts in the existing technology, and achieves high accuracy and high efficiency key sentence extraction.

CN114818727BActive Publication Date: 2025-01-17BEIJING KINGSOFT DIGITAL ENTERTAINMENT CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210412327.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-19
Publication Date
2025-01-17
Estimated Expiration
2042-04-19

AI Technical Summary

Technical Problem

In the prior art, finding key sentences in long text documents is inefficient and inaccurate, and requires a lot of manpower and material resources to search manually, resulting in extremely low efficiency.

Method used

By obtaining the text content of the target document, extracting the keywords and the first key sentence collection, extracting the semantic characteristics of the keywords and the semantic characteristics of the text sentences, combining the two to determine the target key sentence collection, and achieving automated extraction of key sentences.

Benefits of technology

It improves the accuracy and efficiency of extracting key sentences, reduces costs, and avoids a large amount of manpower and material investment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114818727B_ABST
    Figure CN114818727B_ABST
Patent Text Reader

Abstract

The present application provides a key sentence extraction method and device, wherein the key sentence extraction method comprises: obtaining a target document, extracting keywords and a first key sentence set based on the text content of the target document; extracting a first semantic feature of the keyword and a second semantic feature of each text sentence in the target document, and determining a second key sentence set based on the first semantic feature and each of the second semantic features; determining a target key sentence set based on the first key sentence set and the second key sentence set. The method can effectively improve the accuracy and efficiency of extracting key sentences.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of natural language processing technology, and in particular to a key sentence extraction method. The present application also relates to a key sentence extraction device, a computing device, and a computer-readable storage medium. Background Art

[0002] With the development of artificial intelligence in the field of computer technology, the field of natural language processing has also developed rapidly. Information retrieval based on text is an important branch of natural language processing. Artificial intelligence (AI) refers to the ability of an engineered (i.e. designed and manufactured) system to perceive the environment, as well as the ability to acquire, process, apply and represent knowledge. The development status of key technologies in the field of artificial intelligence includes key technologies such as machine learning, knowledge graphs, natural language processing, computer vision, human-computer interaction, biometric recognition, virtual reality / augmented reality, etc. Natural language processing (NLP) is an important research direction in the field of computer science. It studies various theories and methods that can achieve effective communication between humans and computers using natural language. The specific manifestations of natural language processing include machine translation, text summarization, text classification, text proofreading, information extraction, speech synthesis, speech recognition, etc. With the development of natural language processing technology and the accelerated pace of life, the effective information that needs to be delivered to users is becoming shorter and shorter. At this time, the key sentence extraction technology in natural language processing can be used to extract key sentences to shorten the effective information.

[0003] For long text documents, since there are a large number of sentences, and as the document grows, the number of sentences increases, it is difficult to find key sentences, and the determined key sentences are inaccurate. In order to ensure the accuracy of key sentences, it is currently necessary to manually find key sentences in the article. However, this method requires a lot of manpower and material resources, and is extremely inefficient. Therefore, an effective solution is urgently needed to solve the above problems. Summary of the invention

[0004] In view of this, the embodiment of the present application provides a key sentence extraction method to solve the technical defects existing in the prior art. The embodiment of the present application also provides a key sentence extraction device, a computing device, and a computer-readable storage medium.

[0005] According to a first aspect of an embodiment of the present application, a key sentence extraction method is provided, comprising:

[0006] Obtain a target document, and extract keywords and a first key sentence set based on the text content of the target document;

[0007] Extracting a first semantic feature of the keyword and a second semantic feature of each text sentence in the target document, and determining a second key sentence set based on the first semantic feature and each second semantic feature;

[0008] A target key sentence set is determined according to the first key sentence set and the second key sentence set.

[0009] According to a second aspect of an embodiment of the present application, a key sentence extraction device is provided, comprising:

[0010] A first acquisition module is configured to acquire a target document and extract keywords and a first key sentence set based on text content of the target document;

[0011] A first determination module is configured to extract a first semantic feature of the keyword and a second semantic feature of each text sentence in the target document, and determine a second key sentence set based on the first semantic feature and each second semantic feature;

[0012] The second determining module is configured to determine a target key sentence set according to the first key sentence set and the second key sentence set.

[0013] According to a third aspect of an embodiment of the present application, a computing device is provided, including:

[0014] Memory and processor;

[0015] The memory is used to store computer executable instructions, and the steps of the key sentence extraction method are implemented when the processor executes the computer executable instructions.

[0016] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the key sentence extraction method are implemented.

[0017] According to a fifth aspect of an embodiment of the present application, a chip is provided, which stores a computer program, and the computer program implements the steps of the key sentence extraction method when executed by the chip.

[0018] The key sentence extraction method provided by the present application obtains the target document, extracts the keywords and the first key sentence set based on the text content of the target document; extracts the first semantic feature of the keyword and the second semantic feature of each text sentence in the target document, and determines the second key sentence set according to the first semantic feature and each second semantic feature; determines the target key sentence set according to the first key sentence set and the second key sentence set. The first key sentence set is determined by the text content of the target document, which ensures that the key sentences in the first key sentence set carry text level information; the second key sentence set is determined by the first semantic feature of the keyword and the second semantic feature of each text sentence in the target document, which can more accurately determine the key sentences from the semantic level, that is, it ensures that the key sentences in the first key sentence set carry semantic level information, and then determines the target key sentence set according to the first key sentence set and the second key sentence set, so that the key sentences in the target key sentences contain both text level information and semantic level information, that is, the accuracy of determining keywords is improved. In addition, based on the key sentence extraction method provided by the present application, the automatic extraction of key sentences is realized, while ensuring the accuracy of keywords, it avoids spending a lot of manpower and material resources to extract keywords, improves the efficiency of keyword extraction, and reduces the cost of keyword extraction. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is a structural diagram of a key sentence extraction method provided by an embodiment of the present application;

[0020] Figure 2 This is a flowchart of a key sentence extraction method provided by an embodiment of the present application;

[0021] Figure 3A It is a structural diagram of a similarity analysis model in a key sentence extraction method provided in an embodiment of the present application;

[0022] Figure 3B This is a processing flow chart for determining text similarity in a key sentence extraction method provided in an embodiment of the present application;

[0023] Figure 4 It is a processing flow chart of a key sentence extraction method applied to document recall provided in one embodiment of the present application;

[0024] Figure 5 It is a structural schematic diagram of a key sentence extraction device provided by an embodiment of the present application;

[0025] Figure 6 It is a structural block diagram of a computing device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0026] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.

[0027] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" used in one or more embodiments of the present application 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 in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.

[0028] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, such 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 the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first.

[0029] First, the terms involved in one or more embodiments of the present invention are explained.

[0030] The TextRank algorithm is a common keyword extraction algorithm in the field of natural language processing. It can be used to extract keywords, phrases, key sentences and automatically generate text summaries. It is also a graph-based sorting algorithm.

[0031] The TF-IDF (term frequency–inverse document frequency) algorithm is a commonly used weighting technique for information retrieval and data mining. TF stands for term frequency and IDF stands for inverse document frequency.

[0032] The LDA (Latent Dirichlet Allocation) algorithm is a calculation method for topic models and has no direct relationship with word vectors.

[0033] The latent semantic analysis (LSA) algorithm is mainly used for text topic extraction, mining the meaning behind the text, data dimensionality reduction, etc.

[0034] In the present application, a key sentence extraction method is provided. The present application also relates to a key sentence extraction device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.

[0035] The execution subject of the key sentence extraction method provided in the embodiment of the present application can be a server or a terminal, which is not limited in the embodiment of the present application. In addition, the terminal can be any electronic product that can interact with the user, such as a PC (Personal Computer), a mobile phone, a PPC (Pocket PC), a tablet computer, etc. The server can be a server, a server cluster composed of multiple servers, or a cloud computing service center, which is not limited in the embodiment of the present application.

[0036] See also Figure 1 The structural schematic diagram of a key sentence extraction method shown in the figure first obtains a target document; then, based on the text content of the target document, extracts the keywords and a first key sentence set of the target document; then, determines the first semantic feature of the keyword and the second semantic feature of each text sentence in the target document; further, determines the second key sentence set based on the first semantic feature and each second semantic feature; finally, determines the target key sentence set of the target document based on the first key sentence set and the second key sentence set.

[0037] The key sentence extraction method provided by the present application obtains the target document, extracts keywords and a first key sentence set based on the text content of the target document; extracts the first semantic feature of the keyword and the second semantic feature of each text sentence in the target document, and determines the second key sentence set based on the first semantic feature and each second semantic feature; determines the target key sentence set based on the first key sentence set and the second key sentence set. Determining the first key sentence set through the text content of the target document ensures that the key sentences in the first key sentence set carry text-level information; determining the second key sentence set through the first semantic feature of the keyword and the second semantic feature of each text sentence in the target document can more accurately determine the key sentences from the semantic level, that is, it ensures that the key sentences in the first key sentence set carry semantic-level information, and then determining the target key sentence set based on the first key sentence set and the second key sentence set can make the key sentences in the target key sentence set contain both text-level information and semantic-level information, that is, improve the accuracy of determining the key sentences. In addition, based on the key sentence extraction method provided in this application, automatic extraction of key sentences is achieved, which avoids spending a lot of manpower and material resources to extract key sentences while ensuring the accuracy of key sentences, improves the efficiency of key sentence extraction, and reduces the cost of key sentence extraction.

[0038] Figure 2A flowchart of a key sentence extraction method provided according to an embodiment of the present application is shown, which specifically includes the following steps:

[0039] Step 202: Obtain a target document, and extract keywords and a first key sentence set based on the text content of the target document.

[0040] The core of the embodiment of the present application is to extract key sentences (sets). For texts in different fields or categories, such as texts in the medical field, texts in the astronomy field, long texts, and short texts, the process of extracting keywords is basically the same. The key sentence extraction process is introduced in detail below.

[0041] Specifically, text refers to the expression form of written language, usually a sentence or a combination of multiple sentences with complete and systematic meanings. A text can be a sentence, a paragraph or a chapter, all of which belong to text; a document refers to a file containing text; a target document refers to a document from which keywords are to be extracted; text content is also text content; keywords refer to words used to express the subject content of a document; key sentences refer to sentences used to express the subject content of a document; a key sentence set refers to the general term or collection of one or more key sentences; and a first key sentence set refers to a key sentence set obtained from the text or text level.

[0042] In actual applications, there are many ways to obtain the target document. For example, the operator may send a key sentence extraction instruction to the execution subject, or send an instruction to obtain the target document. Accordingly, after receiving the instruction, the execution subject starts to obtain the target document. Alternatively, the server may automatically obtain the target document at preset time intervals. For example, after a preset time, a server with a key sentence extraction function automatically obtains the target document. Or after a preset time, a terminal with a key sentence extraction function automatically obtains the target document. This specification does not limit the method of obtaining the target document.

[0043] In addition, the target document can be a document in any format, such as a document in DOC (Document) format, a document in txt format, a document in image format, or a document in PDF (Portable Document Format) format, and this manual does not limit this.

[0044] After obtaining the target document, the text content of the target document can be extracted: select the corresponding text box extraction tool according to the format of the target document, and then use the text box extraction tool to extract the text box from the target document. The text box contains the characters that constitute the text content, or the text that constitutes the text content. In this way, selecting the text box extraction tool corresponding to the format of the target document to extract the text box can improve the accuracy and speed of extracting the text content.

[0045] For example, if the target document is in PDF format, the PDFominer tool corresponding to the PDF format is selected to perform an extraction operation on the target document, thereby extracting at least one text box containing text content in the target document and obtaining the text content of the target document. For another example, if the target document is in image format, the optical character recognition tool (OCR, Optical Character Recognition) corresponding to the image format is selected to perform an extraction operation on the target document, thereby extracting at least one text box containing text content in the target document and obtaining the text content of the target document.

[0046] In one or more optional embodiments of the present specification, after acquiring the text content of the target document, a preset keyword and sentence extraction tool can be used to directly extract keywords and at least one key sentence from the text content, and the obtained keywords can be determined as keywords of the target document, and the obtained at least one key sentence can be determined as a first key sentence set of the target document. In this way, the efficiency of determining the extracted keywords and the first key sentence set can be improved.

[0047] Step 204: extracting the first semantic feature of the keyword and the second semantic feature of each text sentence in the target document, and determining a second key sentence set according to the first semantic feature and each second semantic feature.

[0048] On the basis of obtaining the keywords and the first key sentence set based on the text content of the target document, further, according to the first semantic features of the keywords and the second semantic features of each text sentence, the second key sentence set of the target document is determined.

[0049] Specifically, semantic features refer to features corresponding to the language meanings of multiple text units; the first semantic feature refers to the semantic feature of keywords; the second semantic feature refers to the semantic feature of text sentences; the second key sentence set refers to the key sentence set obtained from the semantic level.

[0050] In one or more optional embodiments of the present specification, after acquiring the keywords, a preset semantic feature extraction tool can be used to first extract the first semantic features of the keywords, and then the second semantic features of each text sentence in the target document can be extracted respectively. In this way, the accuracy of determining the extraction of the first semantic features and the second semantic features can be improved.

[0051] Furthermore, the first semantic feature of the keyword is compared with the second semantic feature of each text sentence, and a second key sentence set of the target document is determined from each text sentence.

[0052] Step 206: Determine a target key sentence set according to the first key sentence set and the second key sentence set.

[0053] On the basis of determining the first key sentence set and the second key sentence set, further, a target key sentence set of the target document is determined according to the first key sentence set and the second key sentence set.

[0054] Specifically, the target key sentence set refers to the key sentence set of the target document that is finally determined, that is, the key sentence set that includes the target key sentence.

[0055] In a possible implementation of the embodiments of the present specification, after obtaining the first key sentence set and the second key sentence set, the first key sentence set and the second key sentence set can be combined to obtain the key sentence set of the target document, that is, the key sentences included in the first key sentence set and the second key sentence set are merged into one set to obtain the target key sentence set of the target document. In this way, the integrity of the target key sentence set can be guaranteed, that is, the integrity and accuracy of the extracted key sentences can be improved.

[0056] For example, the first key sentence set includes key sentence 1, key sentence 2, key sentence 3 and key sentence 4, and the second key sentence set includes key sentence 2, key sentence 4, key sentence 5 and key sentence 6, then the target key sentence set includes key sentence 1, key sentence 2, key sentence 3, key sentence 4, key sentence 5 and key sentence 6.

[0057] In another possible implementation of the embodiment of the present specification, after obtaining the first key sentence set and the second key sentence set, the intersection of the first key sentence set and the second key sentence set can be calculated to obtain the key sentence set of the target document, that is, the key sentences included in both the first key sentence set and the second key sentence set form the target key sentence set of the target document. In this way, the accuracy of the target key sentence set can be guaranteed, that is, the extracted key sentences can have key information at the text content level and the semantic level.

[0058] Continuing with the above example, the first key sentence set includes key sentence 1, key sentence 2, key sentence 3 and key sentence 4, and the second key sentence set includes key sentence 2, key sentence 4, key sentence 5 and key sentence 6, then the target key sentence set includes key sentence 2 and key sentence 4.

[0059] The key sentence extraction method provided by the present application obtains the target document, extracts the keywords and the first key sentence set based on the text content of the target document; extracts the first semantic feature of the keyword and the second semantic feature of each text sentence in the target document, and determines the second key sentence set according to the first semantic feature and each second semantic feature; determines the target key sentence set according to the first key sentence set and the second key sentence set. The first key sentence set is determined by the text content of the target document, which ensures that the key sentences in the first key sentence set carry text level information; the second key sentence set is determined by the first semantic feature of the keyword and the second semantic feature of each text sentence in the target document, which can more accurately determine the key sentences from the semantic level, that is, it ensures that the key sentences in the first key sentence set carry semantic level information, and then determines the target key sentence set according to the first key sentence set and the second key sentence set, so that the key sentences in the target key sentences contain both text level information and semantic level information, that is, the accuracy of determining keywords is improved. In addition, based on the key sentence extraction method provided by the present application, the automatic extraction of key sentences is realized, while ensuring the accuracy of keywords, it avoids spending a lot of manpower and material resources to extract keywords, improves the efficiency of keyword extraction, and reduces the cost of keyword extraction.

[0060] In one or more optional embodiments of the present specification, the keywords and the first key sentence set of the target document can be directly extracted through a preset keyword and sentence extraction tool; the keywords and the third key sentence set of the target document can also be directly extracted through a preset keyword and sentence extraction tool, and then the fourth key sentence set of the target document is determined based on the keywords and the target document, wherein the third key sentence set and the fourth key sentence set are collectively referred to as the first key sentence set. That is, when the first key sentence set includes the third key sentence set and the fourth key sentence set, the keywords and the first key sentence set are extracted based on the text content of the target document, and the specific implementation process can be as follows:

[0061] According to the text content of the target document, the keywords and the third key sentence set of the target document are extracted by using the text content-based extraction algorithm;

[0062] According to the keywords, target text sentences containing the keywords in the target document are identified, and a fourth key sentence set of the target document is constructed based on the target text sentences.

[0063] Specifically, the third key sentence set refers to a key sentence set directly obtained from text content by an extraction algorithm based on text content; the fourth key sentence set refers to a key sentence set consisting of key sentences containing keywords.

[0064] In practical applications, after obtaining the text content of the target document, the keywords and at least one key sentence can be directly extracted from the text content through a preset keyword and sentence extraction tool, and the obtained keywords are determined as the keywords of the target document, and the obtained at least one key sentence is determined as the third key sentence set of the target document. Then, for any text sentence in the target document, check whether the text sentence contains keywords. If so, the text sentence is determined as the target text sentence, and if not, the text sentence is determined as a non-target text sentence. Traverse each text sentence in the target document, and all the obtained target text sentences constitute the fourth key sentence set. In this way, the integrity of the first key sentence set can be improved, and the efficiency of determining the target key sentence set can be further improved.

[0065] In one or more optional embodiments of the present specification, the keywords of the target document may be extracted by a term frequency-inverse document frequency (TF-IDF) extraction algorithm. The keywords of the target document may also be extracted by a graph-based sorting algorithm, that is, according to the text content of the target document, the keywords of the target document may be extracted by using a text content-based extraction algorithm. The specific implementation process may be as follows:

[0066] Segment the text content of the target document and remove stop words to obtain multiple candidate words;

[0067] According to the preset sliding window, a word graph is constructed with each candidate word as a node and the co-occurrence relationship between the candidate words as an edge;

[0068] According to the word graph, iteratively calculate the first initial weight corresponding to each candidate word until a first preset convergence condition is reached, and obtain the first target weight corresponding to each candidate word;

[0069] Based on the first target weight, keywords of the target document are determined from the candidate words.

[0070] Specifically, word segmentation refers to the word segmentation process of matching character strings in text content, which can be forward maximum matching method, reverse maximum matching method, shortest path word segmentation method or bidirectional maximum matching method. This application does not limit this; stop word removal refers to deleting or filtering words and stop words in words; candidate words refer to all words obtained after word segmentation and stop word removal of text content; co-occurrence relationship refers to the relationship of co-occurrence; word graph refers to a graph with words, i.e. candidate words, as nodes; the first initial weight refers to the weight of the candidate word determined based on the word graph; the first target weight refers to the first initial weight that tends to be stable or convergent.

[0071] In practical applications, the text content of the target document can be directly segmented to obtain multiple words; or the text content can be first divided into whole sentences to obtain multiple sentences, and then each sentence can be segmented to obtain multiple words.

[0072] Furthermore, the obtained multiple words are processed to remove stop words, that is, stop words in the multiple words are eliminated to obtain multiple candidate words, such as part-of-speech tagging of each word to determine the part of speech of each word, and then according to the part of speech of each word, the function words in the multiple words, that is, stop words, are deleted to obtain multiple candidate words.

[0073] Afterwards, a word graph is constructed based on each candidate word: each candidate word is taken as a node, and the co-occurrence relationship is used to construct an edge between any two nodes, that is, the co-occurrence relationship between each candidate word is taken as an edge, and an edge exists between two nodes only when their corresponding candidate words co-occur in a preset sliding window of length K, where K represents the size of the preset sliding window, that is, at most K candidate words co-occur, where K is a positive integer, such as K=2, to construct a word graph.

[0074] Then, according to the connection relationship between the nodes in the word graph, the first initial weight corresponding to each candidate word is iteratively calculated according to the preset weight calculation formula, as shown in Formula 1. The first initial weight corresponding to a candidate word reaches a first preset convergence condition, such as the first initial weight tends to be stable, and the stabilized first initial weight is determined as the first target weight corresponding to the candidate word.

[0075]

[0076] In formula 1, V i represents the i-th candidate word; V j represents the jth candidate word; S(V i ) represents the first initial weight of the i-th candidate word; S(V j ) represents the first initial weight of the jth candidate word; d represents the damping coefficient, such as 0.85; In(V i ) refers to the set of candidate words pointing to the i-th candidate word; Out(V j ) refers to the set of candidate words pointed to by the jth candidate word; |Out(V j )| refers to Out(V j )

[0077] On the basis of determining each first target weight, the candidate words whose first target weight is greater than the first weight threshold can be determined as the keywords of the target document; the candidate words can also be arranged in descending order according to the first target weight, and the top N candidate words can be determined as the keywords of the target document, where N is a preset positive integer. In this way, the efficiency and accuracy of extracting keywords can be improved.

[0078] For example, the TextRank algorithm can be used to first divide the text content into whole sentences to obtain multiple sentences, and then segment each sentence to obtain multiple words; then each word is tagged with a part of speech to determine the part of speech of each word, and then the stop words are deleted according to the part of speech of each word to obtain multiple candidate words. After that, each candidate word is used as a node, and the co-occurrence relationship between the candidate words is used as an edge, and a word graph is constructed based on a preset sliding window size of 2. Then, the first initial weight of each candidate word is calculated by formula 1 until the first preset convergence condition is reached, and the first target weight corresponding to each candidate word is obtained. Finally, the five candidate words with the largest first target weight are determined as the keywords of the target document.

[0079] In one or more optional embodiments of the present specification, the key sentences of the target document can be obtained according to the semantic relevance between the sentence and the title of the target document; the key sentences of the target document can also be extracted by a graph-based sorting algorithm to obtain a third key sentence set, that is, according to the text content of the target document, the third key sentence set is extracted by using a text content-based extraction algorithm. The specific implementation process can be as follows:

[0080] Process the text content of the target document into sentences to obtain multiple candidate sentences;

[0081] A sentence graph is constructed with each candidate sentence as a node and the sentence similarities between candidate sentences as edges;

[0082] Iteratively calculate the second initial weight corresponding to each candidate sentence according to the sentence graph until a second preset convergence condition is reached, thereby obtaining a second target weight corresponding to each candidate word;

[0083] Based on the second target weight, a third key sentence set of the target document is determined from the candidate sentences.

[0084] Specifically, sentence segmentation refers to the process of dividing sentences in text content; candidate sentences refer to all sentences obtained after sentence segmentation of text content; sentence similarity refers to the degree of similarity in sentence semantics; sentence graph refers to a graph with sentences, i.e., candidate sentences, as nodes; the second initial weight refers to the weight of the candidate sentence determined based on the sentence graph; the second target weight refers to the second initial weight that tends to be stable or convergent.

[0085] In practical applications, the text content is first segmented according to the whole sentence, that is, the sentence processing is performed to obtain multiple candidate sentences. Then, a sentence graph is constructed according to each candidate sentence: each candidate sentence is used as a node, and the edges between the nodes are constructed according to the sentence similarity between the candidate sentences to obtain a sentence graph. Then, according to the connection relationship between the nodes in the sentence graph, according to the preset weight calculation formula, as shown in Formula 2, the second initial weight corresponding to each candidate sentence is iteratively calculated. The second initial weight corresponding to a candidate sentence is determined until the second preset convergence condition is reached, such as the second initial weight tends to be stable, and the second initial weight after stabilization is determined as the second target weight corresponding to the candidate sentence. Furthermore, the candidate sentence whose second target weight is greater than the second weight threshold can be determined as the key sentence of the target document; the candidate sentences can also be arranged in order from large to small according to the first target weight, and the top M candidate sentences are determined as the keywords of the target document, where M is a preset positive integer. All the key sentences obtained constitute the third key sentence set of the target document.

[0086] In this way, the efficiency and accuracy of extracting the third key sentence set can be improved.

[0087]

[0088] In formula 2, V i represents the i-th candidate sentence; V j represents the jth candidate sentence; WS(V i ) represents the second initial weight of the i-th candidate sentence; WS(V j ) represents the second initial weight of the jth candidate sentence from the last iteration; d represents the damping coefficient, such as 0.85; In(V i ) refers to the set of candidate statements pointing to the i-th candidate statement; Out(V j ) refers to the set of candidate sentences pointed to by the jth candidate sentence; W ji represents the sentence similarity between the i-th candidate sentence and the j-th candidate sentence; W jk Indicates the sentence similarity between the kth candidate sentence and the jth candidate sentence.

[0089] For example, the TextRank algorithm can be used to first segment the text content into whole sentences to obtain multiple candidate sentences. Then, a sentence graph is constructed with each candidate sentence as a node and the sentence similarity between the candidate sentences as an edge. Then, the second initial weight of each candidate sentence is calculated by formula 2 until the second preset convergence condition is reached, and the second target weight corresponding to each candidate sentence is obtained. Finally, the three candidate words with the largest second target weight constitute the third key sentence set of the target document.

[0090] In one or more optional embodiments of the present specification, the first key sentence set includes the third key sentence set and the fourth key sentence set. When determining the target key sentence set based on the first key sentence set and the second key sentence set: the second key sentence set, the third key sentence set and the fourth key sentence set can be combined to obtain the target key sentence, that is, all key sentences included in the second key sentence set, the third key sentence set and the fourth key sentence set are combined into one set to obtain the target key sentence set of the target document. The second key sentence set, the third key sentence set and the fourth key sentence set can also be combined to obtain the target key sentence set.

[0091] It should be noted that when the intersection of the second key sentence set, the third key sentence set and the fourth key sentence set is obtained to obtain the target key sentence set, the key sentences contained in the second key sentence set, the third key sentence set and the fourth key sentence set can be used to form the target key sentence set of the target document; the target confidence of each initial key sentence can also be obtained according to the initial confidence of each initial key sentence relative to the second key sentence set, the third key sentence set and the fourth key sentence set, and then the target key sentence set is determined according to the target confidence, that is, the intersection of the second key sentence set, the third key sentence set and the fourth key sentence set is obtained to obtain the target key sentence set. The specific implementation process can be as follows:

[0092] Determining a first initial confidence of the initial key sentence relative to the second key sentence set, a second initial confidence relative to the third key sentence set, and a third initial confidence relative to the fourth key sentence set, wherein the initial key sentence refers to any key sentence in the second key sentence set, the third key sentence set, and the fourth key sentence;

[0093] Determining a target confidence of the initial key sentence according to the first initial confidence, the second initial confidence, and the third initial confidence;

[0094] Determining a target key sentence from the second key sentence set, the third key sentence set, and the fourth key sentence set based on the target confidence;

[0095] Construct a target key sentence set based on the target key sentence.

[0096] Specifically, confidence is also called reliability, or confidence level, confidence coefficient; the first initial confidence refers to the confidence of an initial key sentence relative to the second key sentence set; the second initial confidence refers to the confidence of an initial key sentence relative to the third key sentence set; the third initial confidence refers to the confidence of an initial key sentence relative to the fourth key sentence set; the target confidence refers to the comprehensive confidence obtained after processing the initial confidences; the target key sentence refers to the smallest text unit that constitutes the target key sentence set; the initial key sentence refers to the smallest text unit that constitutes the second key sentence set, the third key sentence set and the fourth key sentence set.

[0097] In actual applications, each initial key sentence has a corresponding initial confidence for the second key sentence set, the third key sentence set and the fourth key sentence set. When a certain key sentence set in the second key sentence set, the third key sentence set and the fourth key sentence set does not contain a certain initial key sentence, the initial confidence of the initial key sentence relative to the key sentence set is a first preset value. For example, if the second key sentence set does not contain initial key sentence A, the first initial confidence of initial key sentence A is 0; when a certain key sentence set in the second key sentence set, the third key sentence set and the fourth key sentence set contains a certain initial key sentence, the initial confidence of the initial key sentence relative to the key sentence set is a second preset value. For example, if the third key sentence set contains initial key sentence A, the first initial confidence of initial key sentence A is 1.

[0098] The initial key sentence is respectively compared with the first initial confidence, the second initial confidence and the third initial confidence of the second key sentence set, the third key sentence set and the fourth key sentence set. Then the first initial confidence, the second initial confidence and the third initial confidence are input into the preset calculation formula (as shown in Formula 3) to calculate and obtain the target confidence of the initial key sentence. Then the key sentences whose target confidence is greater than the confidence threshold in the second key sentence set, the third key sentence set and the fourth key sentence are determined as the target key sentences of the target document; the key sentences in the second key sentence set, the third key sentence set and the fourth key sentence can also be arranged in order from large to small according to the target confidence, and the top L key sentences are determined as the target keywords of the target document, where L is a preset positive integer. All the target key sentences obtained constitute the target key sentence set of the target document. In this way, the accuracy and efficiency of the target key sentences can be improved.

[0099] y=a1*x1+a2*x2+a3*x3(Formula 3)

[0100] In Formula 3, y is the target confidence, x1, x2 and x3 are the first initial confidence, the second initial confidence and the third initial confidence, respectively, and a1, a2 and a3 are the weights corresponding to the first initial confidence, the second initial confidence and the third initial confidence, respectively.

[0101] In addition, when each of the second, third and fourth key sentence sets contains an initial key sentence, the initial confidence of the initial key sentence relative to the key sentence set can also be the weight corresponding to the initial key sentence when determining the key sentence set: for example, when the third key sentence set is obtained using the TextRank algorithm, the weight of each key sentence in the third key sentence set will be obtained, and the weight will be used as the first confidence of the key sentence; for example, when the keywords are obtained using the TextRank algorithm, the weight of the keywords will be obtained, and then the fourth key sentence set is constructed based on the target text sentences containing the keywords. At this time, the weight of each target text sentence in the fourth key sentence set, that is, the key sentence, is the sum of the weights of the keywords contained in the key sentence; for example, in the second key sentence set determined according to the semantic relevance of the first semantic feature and each second semantic feature, the weight of the key sentence is the semantic relevance corresponding to the key sentence.

[0102] In one or more optional embodiments of the present specification, the key sentence extraction method can be used for document recall, that is, the target document can be a query document, a candidate document, or a query document and a candidate document. In the case where the target document includes a query document and multiple candidate documents, after determining the target key sentence set according to the first key sentence set and the second key sentence set, it also includes:

[0103] According to the target key sentence set of the query document and the target key sentence sets of multiple candidate documents, the text similarity between the query document and each candidate document is determined.

[0104] Specifically, the query document refers to the document input by the user for retrieval; the candidate document refers to the document stored in the database; and the text similarity refers to the similarity between the text content of the query document and the candidate document.

[0105] In practical applications, based on the key sentence extraction method, the target key sentence set of the query document and the target key sentence set of each candidate document are obtained, and the text similarity between the target key sentence set of the query document and the target key sentence set of each candidate document is calculated, that is, the text similarity between the query document and each candidate document is determined. In this way, the text similarity between documents is calculated based on the target key sentence set, which can improve the accuracy and reliability of the obtained text similarity.

[0106] According to a preset vector conversion algorithm, the target key sentence sets of the query document and multiple candidate documents can be converted into feature vectors, and then according to a preset similarity algorithm, such as the Euclidian Distance algorithm, the Manhattan Distance algorithm, and the Minkowski distance algorithm, the similarity between the feature vector corresponding to the query document and the feature vector corresponding to each candidate document is calculated, that is, the text similarity between the query document and each candidate document.

[0107] In one or more optional embodiments of the present specification, after determining the text similarity between the query document and each candidate document respectively based on the target key sentence set of the query document and the target key sentence sets of multiple candidate documents, similar documents of the query document can also be recalled from the multiple candidate documents based on the text similarities. For example, candidate documents whose text similarity is greater than a text similarity threshold can be determined as similar documents of the query document, and each similar document can also be arranged in order of text similarity from large to small, and the top Q candidate words can be determined as similar documents of the query document, where Q is a preset positive integer. Similar documents are then fed back. In this way, determining and recalling similar documents based on text similarity can improve the efficiency and accuracy of recalling similar documents.

[0108] It should be noted that document recall is based on the user's query document, thus returning similar documents with high similarity to the query document. The length of the document is relatively long, so the research on long text similarity calculation is of great significance. The current methods for calculating the similarity of long texts mainly include: a method for determining similarity based on characters, that is, using edit distance, Hamming distance, Jaccard distance, etc. to directly calculate the similarity of text characters. This method is rough and simple, and only calculates similarity at the character level, ignoring the semantic level; a method for determining similarity based on traditional machine learning: manually constructing text feature vectors through methods such as TF-IDF algorithm, LSA algorithm, LDA algorithm, and then obtaining text similarity by calculating cosine similarity, Euclidean distance, etc. This method requires manual feature construction and cannot fully utilize the text context semantic information; a text similarity method based on text interception deep learning: due to the long text of the document, the front part or the middle part of the document is usually intercepted as the text, and the text similarity is calculated through the long short-term memory network (LSTM) model, convolutional neural network (CNN), BERT (Bidirectional Encoder Representations from Transformer) model, etc. Due to the long text, this method cannot be fully input into the neural network model, and intercepting part of the text in the document may cause key information to be missing, affecting the accuracy of similar document recall.

[0109] Compared with the similarity determination method based on character text, the method provided in the specification determines the second key sentence set through the first semantic feature of the keyword and the second semantic feature of each text sentence in the target document, effectively utilizes the semantic information, and greatly improves the accuracy of determining text similarity; compared with the similarity determination method based on traditional machine learning, there is no need to manually construct features, and at the same time, the second key sentence set is determined through the first semantic feature of the keyword and the second semantic feature of each text sentence in the target document, making full use of the text context semantic information; compared with the text similarity method based on text truncation deep learning, because the key sentence of the document is not extracted to achieve truncation, the lack of key information in the text is not reduced, thereby improving the accuracy of recalling similar documents. It can avoid complex feature extraction, such as calculating TF-IDF, LDA, LSA and other vector features, which is convenient and fast, and effectively improves the accuracy of recalling similar documents.

[0110] In one or more optional embodiments of the present specification, the target key sentence set of the query document and the target key sentence sets of the multiple candidate documents may also be input into a pre-trained similarity analysis model to obtain the text similarities between the query document and each candidate document. That is, before determining the text similarities between the query document and each candidate document according to the target key sentence set of the query document and the target key sentence sets of the multiple candidate documents, the method further includes:

[0111] Obtain a pre-trained similarity analysis model, wherein the similarity analysis model is trained based on a set of sample sentences carrying similarity labels;

[0112] According to the target key sentence set of the query document and the target key sentence sets of multiple candidate documents, the text similarity between the query document and each candidate document is determined, including:

[0113] The target key sentence set of the query document and the target key sentence sets of multiple candidate documents are input into the similarity analysis model to obtain the text similarity between the query document and each candidate document.

[0114] Specifically, a similarity analysis model refers to a pre-trained neural network model, such as a neural network model, a probabilistic neural network model, such as a BERT model, a Transformer model, a sentence-bert model, etc.; a sample sentence refers to a sentence used to train a similarity analysis model; a sample sentence pair refers to a set of two sample sentences; a sample sentence set refers to a set of multiple sample sentence pairs; a similarity label refers to the actual text similarity between two sample sentences in a sample sentence pair.

[0115] In practical applications, a similarity analysis model trained on a set of sample sentences carrying similarity labels can be first obtained. Then, on the basis of obtaining the target key sentence set of the query document and the target key sentence set of multiple candidate documents, the target key sentence set of the query document and the target key sentence set of multiple candidate documents are further input into the similarity analysis model, and the similarity analysis model calculates the similarity between the target key sentence set of the query document and the target key sentence set of multiple candidate documents, and outputs the text similarity between the query document and each candidate document. By using a pre-trained similarity analysis model, the text similarity between the query document and each candidate document is calculated based on the target key sentence set of the query document and the target key sentence set of multiple candidate documents, which can improve the speed and accuracy of determining text similarity.

[0116] In one or more optional embodiments of the present specification, the similarity analysis model includes a feature extraction layer and a pooling layer; at this time, the target key sentence set of the query document and the target key sentence sets of multiple candidate documents are input into the similarity analysis model to obtain the text similarity between the query document and each candidate document. The specific implementation process can be as follows:

[0117] For any candidate document, the target key sentence set of the query document and the target key sentence set of the candidate document are respectively input into the feature extraction layer for feature extraction processing to obtain a query feature vector and a candidate feature vector;

[0118] Input the query feature vector and the candidate feature vector into the pooling layer for pooling processing to obtain the query embedding vector and the candidate embedding vector;

[0119] Based on the query embedding vector and the candidate embedding vector, the text similarity between the query document and the candidate document is determined.

[0120] Specifically, the feature extraction layer can be a neural network model, such as the BERT (Bidirectional Encoder Representations from Transformer) model; the pooling layer is also called the downsampling layer, that is, the Pooling layer, which can compress the input entity feature vector and text feature vector, on the one hand reducing the features and parameters, which can simplify the complexity of subsequent similarity calculations, and on the other hand maintaining a certain invariance of the entity feature vector and the text feature vector; the query feature vector refers to the hidden layer representation obtained after the target key sentence set of the query document is input into the feature extraction layer for processing; the candidate feature vector refers to the hidden layer representation obtained after the target key sentence set of the candidate document is input into the feature extraction layer for processing; the hidden layer representation is to abstract the features of the input real target key sentence set into another dimensional space to show the more abstract features of the target key sentence set, and the hidden layer representation can better perform linear division; the pooling process is to remove the redundant information and retain the key information; the query embedding vector refers to the vector representation obtained after the query feature vector is pooled; the candidate embedding vector refers to the vector representation obtained after the candidate feature vector is pooled.

[0121] In practical applications, see Figure 3A , Figure 3AThe structural schematic diagram of the similarity analysis model in a key sentence extraction method provided by an embodiment of the present application is shown, and the similarity analysis model includes a feature extraction layer and a pooling layer. On the basis of obtaining the target key sentence set of the query document and the target key sentence set of multiple candidate documents, the target key sentence set of the query document and the target key sentence set of any candidate document can be respectively input into the feature extraction layer, and the feature extraction layer performs feature extraction processing on the target key sentence set of the query document and the target key sentence set of the candidate document respectively, and then outputs a query feature vector and a candidate feature vector. Then, in order to reduce the amount of data processing, the query feature vector and the candidate feature vector are respectively input into the pooling layer for pooling processing. After the pooling is completed, the pooling layer outputs a query embedding vector and a candidate embedding vector. Further, the query embedding vector and the candidate embedding vector are compared, and the similarity between the two is calculated, that is, the text similarity between the query document and the candidate document. In this way, the efficiency and accuracy of determining text similarity can be improved.

[0122] In one or more optional embodiments of the present specification, in order to improve the efficiency and accuracy of feature extraction performed by the feature extraction layer, two sub-feature extraction layers with the same structure, parameter type and parameter number can be set in the feature extraction layer, that is, the feature extraction layer includes a first sub-feature extraction layer and a second sub-feature extraction layer with the same structure, parameter type and parameter number, so that one of the sub-feature extraction layers can perform feature extraction on the target key sentence set of the query document, and the other sub-feature extraction layer can perform feature extraction on the target key sentence set of the candidate document. That is, when the feature extraction layer includes a first sub-feature extraction layer and a second sub-feature extraction layer with the same structure, parameter type and parameter number, the target key sentence set of the query document and the target key sentence set of the candidate document are respectively input into the feature extraction layer for feature extraction processing to obtain a query feature vector and a candidate feature vector. The specific implementation process can be as follows:

[0123] Inputting the target key sentence set of the query document into the first sub-feature extraction layer for feature extraction processing to obtain a query feature vector;

[0124] The target key sentence set of the candidate document is input into the second sub-feature extraction layer for feature extraction processing to obtain a candidate feature vector.

[0125] In practical applications, see Figure 3A , Figure 3AA schematic diagram of the structure of a similarity analysis model in a key sentence extraction method provided by an embodiment of the present application is shown, wherein the feature extraction layer includes two sub-feature extraction layers: a first sub-feature extraction layer and a second sub-feature extraction layer. When extracting features from a target key sentence set of a query document and a target key sentence set of a candidate document, the target key sentence set of the query document needs to be input into the first sub-feature extraction layer, and after the first sub-feature extraction layer extracts features from the target key sentence set of the query document, a query feature vector corresponding to the target key sentence set of the query document is output; the target key sentence set of the candidate document is input into the second sub-feature extraction layer, and after the second sub-feature extraction layer extracts features from the target key sentence set of the candidate document, a candidate feature vector corresponding to the target key sentence set of the candidate document is output.

[0126] In order to improve the efficiency and accuracy of the pooling process performed by the pooling layer, and further the efficiency of the similarity analysis model in determining the text similarity, two sub-pooling layers with the same structure, parameter type and parameter number can be set in the pooling layer, that is, the pooling layer includes a first sub-pooling layer and a second sub-pooling layer with the same structure, parameter type and parameter number, so that one of the sub-pooling layers can perform pooling on the query feature vector, and the other sub-pooling layer can perform pooling on the candidate feature vector. That is, when the pooling layer includes a first sub-pooling layer and a second sub-pooling layer with the same structure, parameter type and parameter number, the query feature vector and the candidate feature vector are respectively input into the pooling layer for pooling processing to obtain the query embedding vector and the candidate embedding vector. The specific implementation process can be as follows:

[0127] Input the query feature vector into the first sub-pooling layer for pooling processing to obtain the query embedding vector;

[0128] The candidate feature vector is input into the second sub-pooling layer for pooling processing to obtain the candidate embedding vector.

[0129] In practical applications, see Figure 3A , Figure 3A A schematic diagram of the structure of a similarity analysis model in a key sentence extraction method provided by an embodiment of the present application is shown, wherein the pooling layer includes two sub-pooling layers: a first sub-pooling layer and a second sub-pooling layer. When performing pooling processing on a query feature vector and a candidate feature vector, the query feature vector is input into the first sub-pooling layer, and after the first sub-pooling layer performs pooling processing on the query feature vector, a query embedding vector corresponding to the query feature vector is output; the candidate feature vector is input into the second sub-pooling layer, and after the second sub-pooling layer performs pooling processing on the candidate feature vector, a candidate embedding vector corresponding to the query candidate feature vector is output.

[0130] Before obtaining the pre-trained similarity analysis model, the language representation model needs to be trained to obtain the similarity analysis model. That is, before obtaining the pre-trained similarity analysis model, it also includes:

[0131] Obtaining a preset language representation model and a sample set, wherein the sample set includes a plurality of sample sentence set pairs carrying similarity labels, and the sample sentence set pairs include a first sample sentence set and a second sample sentence set;

[0132] Extract any sample sentence set pair from the sample set, input the first sample sentence set and the second sample sentence set in the sample sentence set pair into the language representation model, and obtain the predicted similarity of the first sample sentence set and the second sample sentence set;

[0133] Determine the loss value based on the predicted similarity and the similarity label carried by the sample sentence set;

[0134] According to the loss value, the model parameters of the language representation model are adjusted, and the step of extracting any sample sentence set pair from the sample set is continued. When the first preset training stop condition is reached, the trained language representation model is determined as the similarity analysis model.

[0135] Specifically, the language representation model refers to a pre-specified pre-trained neural network model, such as the RoBERTa model; the first sample sentence set and the second sample sentence set are two sample sentence sets contained in the sample sentence set pair; the predicted similarity refers to the similarity between the first sample sentence set and the second sample sentence set determined by the language representation model; the first training stop condition can be that the loss value is less than or equal to a preset threshold, or the number of iterative training reaches a preset iteration value, or the loss value converges, that is, the loss value no longer decreases as the training continues.

[0136] In practical applications, there are many ways to obtain language representation models and sample sets. For example, the operator may send a training instruction for the language representation model to the execution subject, or send an instruction to obtain the language representation model and sample set. Accordingly, after receiving the instruction, the execution subject begins to obtain the language representation model and sample set. Alternatively, the server may automatically obtain the language representation model and sample set at preset time intervals. For example, after a preset time, a server with a model training function automatically obtains the language representation model and sample set in a specified access area. Or after a preset time, a terminal with a model training function automatically obtains the language representation model and sample set stored locally. This specification does not limit the method of obtaining the language representation model and sample set.

[0137] After obtaining the language representation model and the sample set, a sample sentence set pair is extracted from the sample set, and then the first sample sentence set and the second sample sentence set contained in the sample sentence set pair are input into the language representation model, and the language representation model determines the similarity calculation for the first sample sentence set and the second sample sentence set, and outputs the predicted similarity of the first sample sentence set and the second sample sentence set. Then, according to the predicted similarity and the similarity label carried by the sample sentence set pair, the loss value is determined according to the preset first loss function. If the first preset training stop condition is not met, the model parameters of the language representation model are adjusted according to the loss value, and then a sample sentence set pair is extracted from the sample set again to perform the next round of training; if the first preset training stop condition is met, the trained language representation model is determined as the similarity analysis model. In this way, by training the language representation model through multiple sample sentence set pairs, the accuracy and speed of the similarity analysis model in determining the text similarity can be improved, and the robustness of the similarity analysis model can be improved.

[0138] In one or more optional embodiments of the present specification, after extracting the first semantic feature of the keyword and the second semantic feature of each text sentence in the target document, the second key sentence set can be determined according to the semantic association between the first semantic feature and each second semantic feature. That is, the second key sentence set is determined according to the first semantic feature and each second semantic feature, and the specific implementation process can be as follows:

[0139] Determining the semantic relevance of the first semantic feature and each second semantic feature;

[0140] According to the semantic relevance, a second key sentence set is determined from each text sentence.

[0141] Specifically, the semantic relevance refers to the similarity between the first semantic feature and the second semantic feature.

[0142] In practical applications, the similarity between the first semantic feature and each second semantic feature, that is, the semantic relevance, can be calculated according to a preset similarity algorithm, such as the Euclidian distance algorithm, the Manhattan distance algorithm, and the Minkowski distance algorithm. Then, the text sentences whose semantic relevance is greater than the semantic relevance threshold are added to the second key sentence set to obtain the second key sentence set; each text sentence can also be arranged in order from large to small according to the semantic relevance, and the top P text sentences are added to the second key sentence set to obtain the second key sentence set, where P is a preset positive integer. In this way, the integrity of the second key sentence set can be improved, and the efficiency of determining the target key sentence set can be further improved.

[0143] In one or more optional embodiments of the present specification, the keywords and each text sentence in the target document may be input into a pre-trained association analysis model to obtain the semantic association between the first semantic feature and each second semantic feature. That is, before extracting the first semantic feature of the keyword and the second semantic feature of each text sentence in the target document, the following is further included:

[0144] Obtaining a pre-trained correlation analysis model, wherein the correlation analysis model includes a feature extraction sub-model and a correlation calculation sub-model;

[0145] Extracting the first semantic features of the keywords and the second semantic features of each text sentence in the target document includes:

[0146] Input the keywords and each text sentence in the target document into the feature extraction sub-model to obtain the first semantic feature of the keywords and the second semantic feature of each text sentence;

[0147] Determining the semantic association between the first semantic feature and each second semantic feature includes:

[0148] The first semantic feature and each second semantic feature are input into the relevance calculation sub-model to obtain the semantic relevance between the first semantic feature and each second semantic feature.

[0149] Specifically, the relevance analysis model refers to a pre-trained neural network model, such as a neural network model, a probabilistic neural network model, such as the BERT model, the Transformer model, the sentence-bert model, etc.; the feature extraction sub-model refers to the part of the relevance analysis model that extracts features from keywords or text sentences; the relevance calculation sub-model refers to the part of the relevance analysis model that calculates semantic relevance.

[0150] In practical applications, a relevance analysis model including a feature extraction submodel and a relevance calculation submodel can be first obtained. Then, based on the acquisition of keywords and text sentences in the target document, the keywords and text sentences are further input into the feature extraction submodel, and the feature extraction submodel performs feature extraction on the keywords and text sentences to obtain the first semantic feature of the keywords and the second semantic feature of the text sentences; then the first semantic feature and the second semantic features are input into the relevance calculation submodel, and the relevance calculation submodel performs relevance calculation on the first semantic feature and the second semantic features, and outputs the semantic relevance of the first semantic feature and the second semantic feature, that is, the semantic relevance between the keywords and the text sentences. By using the pre-trained relevance analysis model, the semantic relevance between the keywords and the text sentences is obtained based on the keywords and the text sentences in the target document, which can improve the speed and accuracy of determining the semantic relevance.

[0151] Before obtaining the pre-trained correlation analysis model, the neural network model needs to be trained to obtain the correlation analysis model. That is, before obtaining the pre-trained correlation analysis model, the following steps are also required:

[0152] Obtaining a preset neural network model and a training set, wherein the neural network model includes a feature extraction sub-model and a relevance calculation sub-model, and the training set includes a plurality of sample pairs carrying relevance labels, and the sample pairs include sample words and sample sentences;

[0153] Extract any sample pair from the training set, input the sample word and the sample sentence in the sample pair into the feature extraction sub-model, and obtain the first prediction feature of the sample word and the second prediction feature of the sample sentence;

[0154] Inputting the first prediction feature and the second prediction feature into the correlation calculation sub-model to obtain the prediction correlation between the first prediction feature and the second prediction feature;

[0155] Determine the difference value according to the predicted association and the association label carried by the sample pair;

[0156] According to the difference value, the model parameters of the feature extraction sub-model and the association calculation sub-model are adjusted, and the step of extracting any sample pair from the training set is continued. When the second preset training stop condition is reached, the trained neural network model is determined as the association analysis model.

[0157] Specifically, a neural network model refers to a neural network model that is a mathematical model based on neurons, such as a BERT model; a sample sentence refers to a sentence used to train an association analysis model; a sample word refers to a word used to train an association analysis model; a sample pair refers to a set containing a sample sentence and a sample word; a training set refers to a set containing multiple sample pairs; an association label refers to the actual association between a sample word and a sample sentence in a sample pair; a first prediction feature refers to the semantic feature of a sample word determined by a feature extraction submodel; a second prediction feature refers to the semantic feature of a sample sentence determined by a feature extraction submodel; a predicted association refers to the association between a first prediction feature and a second prediction feature determined by an association calculation submodel; and a second training stop condition may be that a loss value is less than or equal to a preset threshold, or that the number of iterative training reaches a preset iteration value, or that a loss value converges, that is, the loss value no longer decreases as training continues.

[0158] In practical applications, there are many ways to obtain neural network models and training sets. For example, the operator may send a training instruction for the neural network model to the execution subject, or send an instruction to obtain the neural network model and training set. Accordingly, after receiving the instruction, the execution subject begins to obtain the neural network model and training set. Alternatively, the server may automatically obtain the neural network model and training set at preset time intervals. For example, after a preset time, a server with a model training function automatically obtains the neural network model and training set in a designated access area. Or after a preset time, a terminal with a model training function automatically obtains the neural network model and training set stored locally. This specification does not limit the method of obtaining the neural network model and training set.

[0159] After obtaining the neural network model and the sample set, a sample pair is extracted from the training set, and then the sample words and sample sentences contained in the sample pair are input into the feature extraction sub-model, and the feature extraction sub-model determines the first prediction feature and the second prediction feature of the sample sentence for feature extraction of the sample words and sample sentences; then the first prediction feature and the second prediction feature are input into the relevance calculation sub-model, and the relevance calculation sub-model calculates the relevance of the first prediction feature and the second prediction feature, and outputs the predicted relevance of the first prediction feature and the second prediction feature. Then, according to the predicted relevance and the relevance label carried by the sample pair, according to the preset second loss function, the difference value is determined, and when the second preset training stop condition is not reached, the model parameters of the neural network model are adjusted according to the difference value, and then a sample pair is extracted from the training set again for the next round of training; when the second preset training stop condition is reached, the trained neural network model is determined as the relevance analysis model. In this way, by training the neural network model with multiple sample pairs, the accuracy and speed of the relevance analysis model in determining the semantic relevance can be improved, and the robustness of the relevance analysis model can be improved.

[0160] See also Figure 3B , Figure 3B A flowchart of determining text similarity in a key sentence extraction method provided in an embodiment of the present application is shown, and a query document and a candidate document are used as examples for explanation:

[0161] S1, first obtain a first key sentence set of keywords of a query document and a candidate document, wherein the first key sentence set includes a third key sentence set and a fourth key sentence set.

[0162] S1-1, obtaining the third key sentence set of the query document and the candidate document keywords: using the textrank method to extract the keywords and key sentences of the query document and the candidate document respectively, and generating the third key sentence set of the query document and the candidate document respectively;

[0163] S1-2, then obtain the fourth key sentence set of the query document and the candidate document: according to the keywords generated in step S1-1, respectively search for the target text sentences containing the keywords in the query document and the candidate document, and determine the fourth key sentence set of the query document and the fourth key sentence set of the candidate document.

[0164] S2, input the keywords of the query document and each text sentence of the query document into the association analysis model, obtain the first preset number of text sentences with the highest semantic association of the keywords of the query document as the second key sentence set of the query document; similarly, obtain the second key sentence set of the candidate document.

[0165] S3, generating a target key sentence set: respectively finding the intersection of the second key sentence set, the third key sentence set and the fourth key sentence set of the query document to obtain the target key sentence set of the query document; similarly, obtaining the target key sentence set of the candidate document.

[0166] S4, determining text similarity: inputting the target key sentence set of the query document and the target key sentence set of the candidate document into the pre-trained similarity analysis model to obtain the text similarity of the query document and the candidate document.

[0167] The key sentence extraction method provided by the present application obtains the target document, extracts keywords and a first key sentence set based on the text content of the target document; extracts the first semantic feature of the keyword and the second semantic feature of each text sentence in the target document, and determines the second key sentence set based on the first semantic feature and each second semantic feature; determines the target key sentence set based on the first key sentence set and the second key sentence set. Determining the first key sentence set through the text content of the target document ensures that the key sentences in the first key sentence set carry text-level information; determining the second key sentence set through the first semantic feature of the keyword and the second semantic feature of each text sentence in the target document can more accurately determine the key sentences from the semantic level, that is, it ensures that the key sentences in the first key sentence set carry semantic-level information, and then determining the target key sentence set based on the first key sentence set and the second key sentence set can make the key sentences in the target key sentence set contain both text-level information and semantic-level information, that is, improve the accuracy of determining the key sentences. In addition, based on the key sentence extraction method provided in this application, automatic extraction of key sentences is achieved, which avoids spending a lot of manpower and material resources to extract key sentences while ensuring the accuracy of key sentences, improves the efficiency of key sentence extraction, and reduces the cost of key sentence extraction.

[0168] The following combination Figure 4 Taking the application of the key sentence extraction method provided in this application to document recall as an example, the key sentence extraction method is further explained. Figure 4 A processing flow chart of a key sentence extraction method for document recall provided in an embodiment of the present application is shown, which specifically includes the following steps:

[0169] Step 402: Obtain a query document and multiple candidate documents.

[0170] Step 404: for the query document and any document among the multiple candidate documents, extract the keywords and the third key sentence set of the document according to the text content of the document using a text content-based extraction algorithm.

[0171] Optionally, based on the text content of the document, keywords of the document are extracted using a text content-based extraction algorithm, including:

[0172] The text content of the document is segmented and stop words are removed to obtain multiple candidate words;

[0173] According to the preset sliding window, a word graph is constructed with each candidate word as a node and the co-occurrence relationship between the candidate words as an edge;

[0174] According to the word graph, iteratively calculate the first initial weight corresponding to each candidate word until a first preset convergence condition is reached, and obtain the first target weight corresponding to each candidate word;

[0175] Based on the first target weight, keywords of the document are determined from the candidate words.

[0176] Optionally, according to the text content of the document, a third key sentence set of the document is extracted using a text content-based extraction algorithm, including:

[0177] The text content of the document is processed into sentences to obtain multiple candidate sentences;

[0178] A sentence graph is constructed with each candidate sentence as a node and the sentence similarities between candidate sentences as edges;

[0179] Iteratively calculate the second initial weight corresponding to each candidate sentence according to the sentence graph until a second preset convergence condition is reached, thereby obtaining a second target weight corresponding to each candidate word;

[0180] Based on the second target weight, a third key sentence set of the document is determined from the candidate sentences.

[0181] Step 406: According to the keywords, target text sentences in the document containing the keywords are identified, and a fourth key sentence set of the document is constructed based on the target text sentences.

[0182] Step 408: Obtain a pre-trained correlation analysis model, wherein the correlation analysis model includes a feature extraction sub-model and a correlation calculation sub-model.

[0183] Optionally, before obtaining the pre-trained association analysis model, the following steps are also included:

[0184] Obtaining a preset neural network model and a training set, wherein the neural network model includes a feature extraction sub-model and a relevance calculation sub-model, and the training set includes a plurality of sample pairs carrying relevance labels, and the sample pairs include sample words and sample sentences;

[0185] Extract any sample pair from the training set, input the sample word and the sample sentence in the sample pair into the feature extraction sub-model, and obtain the first prediction feature of the sample word and the second prediction feature of the sample sentence;

[0186] Inputting the first prediction feature and the second prediction feature into the correlation calculation sub-model to obtain the prediction correlation between the first prediction feature and the second prediction feature;

[0187] Determine the difference value according to the predicted association and the association label carried by the sample pair;

[0188] According to the difference value, the model parameters of the feature extraction sub-model and the association calculation sub-model are adjusted, and the step of extracting any sample pair from the training set is continued. When the second preset training stop condition is reached, the trained neural network model is determined as the association analysis model.

[0189] Step 410: Input the keyword and each text sentence in the document into the feature extraction sub-model to obtain the first semantic feature of the keyword and the second semantic feature of each text sentence.

[0190] Step 412: Input the first semantic feature and each second semantic feature into the relevance calculation sub-model to obtain the semantic relevance between the first semantic feature and each second semantic feature.

[0191] Step 414: Determine a second key sentence set from each text sentence according to the semantic relevance.

[0192] Step 416: finding the intersection of the second key sentence set, the third key sentence set and the fourth key sentence set to obtain the target key sentence set of the document.

[0193] Optionally, finding the intersection of the second key sentence set, the third key sentence set and the fourth key sentence set to obtain the target key sentence set of the document includes:

[0194] Determining a first initial confidence of the initial key sentence relative to the second key sentence set, a second initial confidence relative to the third key sentence set, and a third initial confidence relative to the fourth key sentence set, wherein the initial key sentence refers to any key sentence in the second key sentence set, the third key sentence set, and the fourth key sentence;

[0195] Determining a target confidence of the initial key sentence according to the first initial confidence, the second initial confidence, and the third initial confidence;

[0196] Determining a target key sentence from the second key sentence set, the third key sentence set, and the fourth key sentence set based on the target confidence;

[0197] A target key sentence set of the document is constructed based on the target key sentences.

[0198] Step 418: Obtain a pre-trained similarity analysis model, wherein the similarity analysis model is trained based on a set of sample sentences carrying similarity labels.

[0199] Optionally, before obtaining the pre-trained similarity analysis model, the method further includes:

[0200] Obtaining a preset language representation model and a sample set, wherein the sample set includes a plurality of sample sentence set pairs carrying similarity labels, and the sample sentence set pairs include a first sample sentence set and a second sample sentence set;

[0201] Extract any sample sentence set pair from the sample set, input the first sample sentence set and the second sample sentence set in the sample sentence set pair into the language representation model, and obtain the predicted similarity of the first sample sentence set and the second sample sentence set;

[0202] Determine the loss value based on the predicted similarity and the similarity label carried by the sample sentence set;

[0203] According to the loss value, the model parameters of the language representation model are adjusted, and the step of extracting any sample sentence set pair from the sample set is continued. When the first preset training stop condition is reached, the trained language representation model is determined as the similarity analysis model.

[0204] Step 420: Input the target key sentence set of the query document and the target key sentence sets of multiple candidate documents into a similarity analysis model to obtain the text similarity between the query document and each candidate document.

[0205] Step 422: Recall similar documents to the query document from multiple candidate documents based on the similarities of each text.

[0206] The key sentence extraction method provided by the present application determines the first key sentence set through the text content of the target document, ensuring that the key sentences in the first key sentence set carry text-level information; determines the second key sentence set through the first semantic feature of the keyword and the second semantic feature of each text sentence in the target document, which can more accurately determine the key sentences from the semantic level, that is, ensure that the key sentences in the first key sentence set carry semantic-level information, and then determines the target key sentence set based on the first key sentence set and the second key sentence set, so that the key sentences in the target key sentences contain both text-level information and semantic-level information, that is, improves the accuracy of determining the key sentences. In addition, based on the key sentence extraction method provided by the present application, automatic extraction of key sentences is achieved, which avoids spending a lot of manpower and material resources to extract key sentences while ensuring the accuracy of key sentences, improves the efficiency of key sentence extraction, and reduces the cost of key sentence extraction.

[0207] In addition, compared with the similarity determination method based on character text, the key sentence extraction method provided by the present application determines the second key sentence set through the first semantic feature of the keyword and the second semantic feature of each text sentence in the target document, effectively utilizes the semantic information, and greatly improves the accuracy of determining the text similarity; compared with the similarity determination method based on traditional machine learning, there is no need to manually construct features, and at the same time, the second key sentence set is determined through the first semantic feature of the keyword and the second semantic feature of each text sentence in the target document, making full use of the text context semantic information; compared with the text similarity method based on text truncation deep learning, since the key sentences of the document are not extracted to achieve truncation, the lack of key information in the text is not reduced, thereby improving the accuracy of recalling similar documents.

[0208] Corresponding to the above method embodiment, the present application also provides a key sentence extraction device embodiment, Figure 5 FIG. 1 is a schematic diagram showing the structure of a key sentence extraction device provided by an embodiment of the present application. Figure 5 As shown, the device comprises:

[0209] A first acquisition module 502 is configured to acquire a target document and extract keywords and a first key sentence set based on text content of the target document;

[0210] A first determination module 504 is configured to extract a first semantic feature of the keyword and a second semantic feature of each text sentence in the target document, and determine a second key sentence set based on the first semantic feature and each second semantic feature;

[0211] The second determining module 506 is configured to determine a target key sentence set according to the first key sentence set and the second key sentence set.

[0212] Optionally, the first key sentence set includes a third key sentence set and a fourth key sentence set;

[0213] The first acquisition module 502 is further configured to:

[0214] According to the text content of the target document, the keywords and the third key sentence set of the target document are extracted by using the text content-based extraction algorithm;

[0215] According to the keywords, target text sentences containing the keywords in the target document are identified, and a fourth key sentence set of the target document is constructed based on the target text sentences.

[0216] Optionally, the first acquisition module 502 is further configured to:

[0217] Segment the text content of the target document and remove stop words to obtain multiple candidate words;

[0218] According to the preset sliding window, a word graph is constructed with each candidate word as a node and the co-occurrence relationship between the candidate words as an edge;

[0219] According to the word graph, iteratively calculate the first initial weight corresponding to each candidate word until a first preset convergence condition is reached, and obtain the first target weight corresponding to each candidate word;

[0220] Based on the first target weight, keywords of the target document are determined from the candidate words.

[0221] Optionally, the first acquisition module 502 is further configured to:

[0222] Process the text content of the target document into sentences to obtain multiple candidate sentences;

[0223] A sentence graph is constructed with each candidate sentence as a node and the sentence similarities between candidate sentences as edges;

[0224] Iteratively calculate the second initial weight corresponding to each candidate sentence according to the sentence graph until a second preset convergence condition is reached, thereby obtaining a second target weight corresponding to each candidate word;

[0225] Based on the second target weight, a third key sentence set of the target document is determined from the candidate sentences.

[0226] Optionally, the second determining module 506 is further configured to:

[0227] The intersection of the second key sentence set, the third key sentence set and the fourth key sentence set is obtained to obtain the target key sentence set.

[0228] Optionally, the second determining module 506 is further configured to:

[0229] Determining a first initial confidence of the initial key sentence relative to the second key sentence set, a second initial confidence relative to the third key sentence set, and a third initial confidence relative to the fourth key sentence set, wherein the initial key sentence refers to any key sentence in the second key sentence set, the third key sentence set, and the fourth key sentence;

[0230] Determining a target confidence of the initial key sentence according to the first initial confidence, the second initial confidence, and the third initial confidence;

[0231] Determining a target key sentence from the second key sentence set, the third key sentence set, and the fourth key sentence set based on the target confidence;

[0232] Construct a target key sentence set based on the target key sentence.

[0233] Optionally, the target document includes a query document and a plurality of candidate documents;

[0234] Optionally, the device further includes a third determining module, configured to:

[0235] According to the target key sentence set of the query document and the target key sentence sets of multiple candidate documents, the text similarity between the query document and each candidate document is determined.

[0236] Optionally, the device further comprises a recall module configured to:

[0237] Recall similar documents to the query document from multiple candidate documents based on the similarity of each text.

[0238] Optionally, the device further includes a second acquisition module configured to:

[0239] Obtain a pre-trained similarity analysis model, wherein the similarity analysis model is trained based on a set of sample sentences carrying similarity labels;

[0240] The third determination module is further configured to:

[0241] The target key sentence set of the query document and the target key sentence sets of multiple candidate documents are input into the similarity analysis model to obtain the text similarity between the query document and each candidate document.

[0242] Optionally, the device further includes a first training module configured to:

[0243] Obtaining a preset language representation model and a sample set, wherein the sample set includes a plurality of sample sentence set pairs carrying similarity labels, and the sample sentence set pairs include a first sample sentence set and a second sample sentence set;

[0244] Extract any sample sentence set pair from the sample set, input the first sample sentence set and the second sample sentence set in the sample sentence set pair into the language representation model, and obtain the predicted similarity of the first sample sentence set and the second sample sentence set;

[0245] Determine the loss value based on the predicted similarity and the similarity label carried by the sample sentence set;

[0246] According to the loss value, the model parameters of the language representation model are adjusted, and the step of extracting any sample sentence set pair from the sample set is continued. When the first preset training stop condition is reached, the trained language representation model is determined as the similarity analysis model.

[0247] Optionally, the first determining module 504 is further configured to:

[0248] Determining the semantic relevance of the first semantic feature and each second semantic feature;

[0249] According to the semantic relevance, a second key sentence set is determined from each text sentence.

[0250] Optionally, the device further includes a third acquisition module, configured to:

[0251] Obtaining a pre-trained correlation analysis model, wherein the correlation analysis model includes a feature extraction sub-model and a correlation calculation sub-model;

[0252] The first determining module 504 is further configured to:

[0253] Input the keywords and each text sentence in the target document into the feature extraction sub-model to obtain the first semantic feature of the keywords and the second semantic feature of each text sentence;

[0254] The first semantic feature and each second semantic feature are input into the relevance calculation sub-model to obtain the semantic relevance between the first semantic feature and each second semantic feature.

[0255] Optionally, the device further includes a second training module configured to:

[0256] Obtaining a preset neural network model and a training set, wherein the neural network model includes a feature extraction sub-model and a relevance calculation sub-model, and the training set includes a plurality of sample pairs carrying relevance labels, and the sample pairs include sample words and sample sentences;

[0257] Extract any sample pair from the training set, input the sample word and the sample sentence in the sample pair into the feature extraction sub-model, and obtain the first prediction feature of the sample word and the second prediction feature of the sample sentence;

[0258] Inputting the first prediction feature and the second prediction feature into the correlation calculation sub-model to obtain the prediction correlation between the first prediction feature and the second prediction feature;

[0259] Determine the difference value according to the predicted association and the association label carried by the sample pair;

[0260] According to the difference value, the model parameters of the feature extraction sub-model and the association calculation sub-model are adjusted, and the step of extracting any sample pair from the training set is continued. When the second preset training stop condition is reached, the trained neural network model is determined as the association analysis model.

[0261] The key sentence extraction device provided by the present application determines the first key sentence set through the text content of the target document, ensuring that the key sentences in the first key sentence set carry text-level information; determines the second key sentence set through the first semantic feature of the keyword and the second semantic feature of each text sentence in the target document, and can more accurately determine the key sentences from the semantic level, that is, ensuring that the key sentences in the first key sentence set carry semantic-level information, and then determines the target key sentence set based on the first key sentence set and the second key sentence set, so that the key sentences in the target key sentences contain both text-level information and semantic-level information, that is, improves the accuracy of determining the key sentences. In addition, based on the key sentence extraction method provided by the present application, automatic extraction of key sentences is achieved, which avoids spending a lot of manpower and material resources to extract key sentences while ensuring the accuracy of key sentences, improves the efficiency of key sentence extraction, and reduces the cost of key sentence extraction.

[0262] The above is a schematic scheme of a key sentence extraction device of the present embodiment. It should be noted that the technical scheme of the key sentence extraction device and the technical scheme of the key sentence extraction method mentioned above belong to the same concept. For the details not described in detail in the technical scheme of the key sentence extraction device, please refer to the description of the technical scheme of the key sentence extraction method mentioned above. In addition, each component in the device embodiment should be understood as a functional module that must be established to implement each step of the program flow or each step of the method, and each functional module is not an actual functional division or separation definition. The device claim defined by such a group of functional modules should be understood as a functional module architecture that mainly implements the solution through the computer program recorded in the specification, and should not be understood as a physical device that mainly implements the solution through hardware.

[0263] Figure 6 The block diagram of a computing device 600 according to an embodiment of the present application is shown. The components of the computing device 600 include but are not limited to a memory 610 and a processor 620. The processor 620 is connected to the memory 610 via a bus 630, and the database 650 is used to store data.

[0264] The computing device 600 also includes an access device 640 that enables the computing device 600 to communicate via one or more networks 660. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 640 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0265] In one embodiment of the present application, the above components of the computing device 600 and Figure 6 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 5 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.

[0266] The computing device 600 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 600 may also be a mobile or stationary server.

[0267] The processor 620 is used to execute computer executable instructions of the key sentence extraction method.

[0268] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above key sentence extraction method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above key sentence extraction method.

[0269] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which are used in a key sentence extraction method when executed by a processor.

[0270] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the key sentence extraction method described above belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be found in the description of the technical scheme of the key sentence extraction method described above.

[0271] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0272] An embodiment of the present application further provides a chip storing a computer program, which implements the steps of the key sentence extraction method when executed by the chip.

[0273] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0274] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0275] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can understand and use the present application well. The present application is only limited by the claims and their full scope and equivalents.

Claims

1. A key sentence extraction method, characterized in that: include: Acquire a target document, and extract keywords and a first key sentence set based on the text content of the target document, wherein the first key sentence set refers to a key sentence set acquired from a text or text level; Extracting the first semantic feature of the keyword and the second semantic feature of each text sentence in the target document, and determining a second key sentence set according to the first semantic feature and each of the second semantic features, wherein the second key sentence set refers to a key sentence set obtained from a semantic level, and determining the second key sentence set according to the first semantic feature and each of the second semantic features includes: determining the second key sentence set according to the semantic association between the first semantic feature and each of the second semantic features; A target key sentence set is determined according to the first key sentence set and the second key sentence set, wherein the step of determining the target key sentence set according to the first key sentence set and the second key sentence set includes: finding the intersection of the first key sentence set and the second key sentence set to determine the target key sentence set.

2. The method according to claim 1, characterized in that The first key sentence set includes a third key sentence set and a fourth key sentence set; The step of extracting keywords and a first key sentence set based on the text content of the target document includes: Extracting keywords and a third key sentence set of the target document according to the text content of the target document using a text content-based extraction algorithm; According to the keyword, a target text sentence in the target document containing the keyword is identified, and a fourth key sentence set of the target document is constructed based on the target text sentence.

3. The method according to claim 2, characterized in that The step of extracting keywords of the target document based on the text content of the target document by using a text content-based extraction algorithm includes: Segmenting the text content of the target document and removing stop words to obtain multiple candidate words; According to the preset sliding window, a word graph is constructed with each candidate word as a node and the co-occurrence relationship between the candidate words as an edge; Iteratively calculating a first initial weight corresponding to each candidate word according to the word graph until a first preset convergence condition is reached, thereby obtaining a first target weight corresponding to each candidate word; Based on the first target weight, keywords of the target document are determined from the candidate words.

4. The method according to claim 2, characterized in that: The step of extracting a third key sentence set based on the text content of the target document using a text content-based extraction algorithm includes: Segmenting the text content of the target document to obtain multiple candidate sentences; A sentence graph is constructed with each candidate sentence as a node and the sentence similarities between candidate sentences as edges; Iteratively calculating the second initial weight corresponding to each candidate sentence according to the sentence graph until a second preset convergence condition is reached to obtain a second target weight corresponding to each candidate sentence; Based on the second target weight, a third key sentence set of the target document is determined from each candidate sentence.

5. The method according to claim 2, characterized in that: Determining a target key sentence set according to the first key sentence set and the second key sentence set includes: The intersection of the second key sentence set, the third key sentence set and the fourth key sentence set is obtained to obtain a target key sentence set.

6. The method according to claim 5, characterized in that The step of finding the intersection of the second key sentence set, the third key sentence set and the fourth key sentence set to obtain a target key sentence set includes: Determining a first initial confidence of an initial key sentence relative to a second key sentence set, a second initial confidence relative to a third key sentence set, and a third initial confidence relative to a fourth key sentence set, wherein the initial key sentence refers to any key sentence in the second key sentence set, the third key sentence set, and the fourth key sentence; Determining a target confidence of the initial key sentence according to the first initial confidence, the second initial confidence, and the third initial confidence; Based on the target confidence, determining a target key sentence from the second key sentence set, the third key sentence set, and the fourth key sentence set; The target key sentence set is constructed based on the target key sentence.

7. The method according to any one of claims 1 to 6, characterized in that: The target document includes a query document and a plurality of candidate documents; After determining the target key sentence set according to the first key sentence set and the second key sentence set, the method further includes: The text similarity between the query document and each candidate document is determined according to the target key sentence set of the query document and the target key sentence sets of the plurality of candidate documents.

8. The method according to claim 7, characterized in that After determining the text similarity between the query document and each candidate document according to the target key sentence set of the query document and the target key sentence sets of the plurality of candidate documents, the method further includes: According to each of the text similarities, similar documents to the query document are recalled from the multiple candidate documents.

9. The method according to claim 7, characterized in that: Before determining the text similarity between the query document and each candidate document according to the target key sentence set of the query document and the target key sentence sets of the plurality of candidate documents, the method further includes: Obtaining a pre-trained similarity analysis model, wherein the similarity analysis model is trained based on a set of sample sentences carrying similarity labels; The determining, based on the target key sentence set of the query document and the target key sentence sets of the plurality of candidate documents, the text similarity between the query document and each candidate document includes: The target key sentence set of the query document and the target key sentence sets of the multiple candidate documents are input into the similarity analysis model to obtain the text similarity between the query document and each candidate document.

10. The method according to claim 9, characterized in that Before obtaining the pre-trained similarity analysis model, the method further includes: Obtaining a preset language representation model and a sample set, wherein the sample set includes a plurality of sample sentence set pairs carrying similarity labels, and the sample sentence set pairs include a first sample sentence set and a second sample sentence set; Extract any sample sentence set pair from the sample set, input a first sample sentence set and a second sample sentence set in the sample sentence set pair into the language representation model, and obtain a predicted similarity between the first sample sentence set and the second sample sentence set; Determining a loss value according to the predicted similarity and a similarity label carried by the sample sentence set; According to the loss value, the model parameters of the language representation model are adjusted, and the step of extracting any sample sentence set pair from the sample set is continued. When a first preset training stop condition is reached, the trained language representation model is determined as a similarity analysis model.

11. The method according to claim 1, characterized in that: Before extracting the first semantic feature of the keyword and the second semantic feature of each text sentence in the target document, the method further includes: Acquire a pre-trained correlation analysis model, wherein the correlation analysis model includes a feature extraction sub-model and a correlation calculation sub-model; The extracting the first semantic feature of the keyword and the second semantic feature of each text sentence in the target document includes: Inputting the keyword and each text sentence in the target document into the feature extraction sub-model to obtain a first semantic feature of the keyword and a second semantic feature of each text sentence; The determining of the semantic association between the first semantic feature and each of the second semantic features includes: The first semantic feature and each second semantic feature are input into the association degree calculation sub-model to obtain the semantic association degree between the first semantic feature and each second semantic feature.

12. The method according to claim 11, characterized in that Before obtaining the pre-trained relevance analysis model, the method further includes: Obtaining a preset neural network model and a training set, wherein the neural network model includes a feature extraction sub-model and a relevance calculation sub-model, and the training set includes a plurality of sample pairs carrying relevance labels, wherein the sample pairs include sample words and sample sentences; Extract any sample pair from the training set, input the sample word and the sample sentence in the sample pair into the feature extraction sub-model, and obtain the first prediction feature of the sample word and the second prediction feature of the sample sentence; Inputting the first prediction feature and the second prediction feature into the correlation calculation sub-model to obtain the prediction correlation between the first prediction feature and the second prediction feature; Determining a difference value according to the predicted correlation and the correlation label carried by the sample pair; According to the difference value, the model parameters of the feature extraction sub-model and the association calculation sub-model are adjusted, and the step of extracting any sample pair from the training set is continued. When a second preset training stop condition is reached, the trained neural network model is determined as the association analysis model.

13. A key sentence extraction device, characterized in that: include: A first acquisition module is configured to acquire a target document, and extract keywords and a first key sentence set based on the text content of the target document, wherein the first key sentence set refers to a key sentence set acquired from a text or text level; The first determination module is configured to extract the first semantic feature of the keyword and the second semantic feature of each text sentence in the target document, and determine a second key sentence set according to the first semantic feature and each of the second semantic features, wherein the second key sentence set refers to a key sentence set obtained from a semantic level, and the first determination module is further configured to: determine the second key sentence set according to the semantic association between the first semantic feature and each of the second semantic features; The second determination module is configured to determine a target key sentence set according to the first key sentence set and the second key sentence set, wherein the second determination module is further configured to: find the intersection of the first key sentence set and the second key sentence set to determine the target key sentence set.

14. A computing device, characterized in that include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the steps of the key sentence extraction method according to any one of claims 1 to 12.

15. A computer-readable storage medium storing computer instructions, characterized in that: When the instruction is executed by the processor, the steps of the key sentence extraction method described in any one of claims 1 to 12 are implemented.

Citation Information

Patent Citations

  • Unsupervised keyword extraction method based on Markdown feature perception

    CN111680505A

  • Statement processing method and device, electronic equipment and storage medium

    CN112164391A

  • Text correlation model training method, device, question answering method and device

    CN113590768A