Text information extraction model generation method, text information extraction method and device

By performing word segmentation and rematch processing on the judge documents, the text information extraction model is trained, and the problems of low efficiency and insufficient accuracy of information extraction in the judge documents in the existing technology are solved, and the accurate identification of complex statements and effective bank risks are achieved. Control.

CN114580398BActive Publication Date: 2024-11-12INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202210251357.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-15
Publication Date
2024-11-12
Estimated Expiration
2042-03-15

AI Technical Summary

Technical Problem

The methods for extracting key information in existing judicial documents are inefficient and inaccurate, and traditional technologies are difficult to identify subjects and objects in complex statements, and the granularization of NLP text word segmentation leads to insufficient bank risk control.

Method used

By performing word segmentation processing on the judgment text, identifying the word segmentation to be processed, and obtaining its corresponding target text for rematching, combining word frequency, word length and syntactic structure for processing, the text information extraction model is trained to improve the extraction accuracy.

Benefits of technology

It significantly improves the identification accuracy of the incoming parties and outgoing parties in the judicial documents, enhances the bank's risk control capabilities, and improves the accuracy and efficiency of the text extraction model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114580398B_ABST
    Figure CN114580398B_ABST
Patent Text Reader

Abstract

The present application relates to a text information extraction model generation method, a text information extraction method, an apparatus, a computer device, a storage medium and a computer program product. The text information extraction model generation method comprises: obtaining a sample text; performing segmentation processing on the sample text to obtain an initial segmentation; identifying the initial segmentation to determine the segmentation to be processed, and obtaining a target text corresponding to the segmentation to be processed; rematching the initial segmentation in the target text to obtain a target segmentation; training the initial model according to the target segmentation to obtain a text information extraction model. The text information extraction method comprises: obtaining a text information extraction model; obtaining a text to be processed; inputting the text to be processed into the text information extraction model to obtain entities and relationships corresponding to the text to be processed. The use of this method can improve text recognition accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a text information extraction model generation method, a text information extraction method, an apparatus, a computer device, a storage medium and a computer program product. Background Art

[0002] Judgment documents are professional descriptions of the case trial process, relevant evidence, applicable laws and regulations, and the results of the judgment. Since judgment documents are written conclusions that are legally binding on the case, the recorded content contains a large amount of valuable information, especially in the field of financial risks. It has extremely high practical value. Therefore, it is particularly important to extract key information from judgment documents. However, since judgment documents mainly exist in the form of long texts, it will take a lot of time and effort to manually screen them. This method has serious deficiencies in cost and efficiency. At the same time, since judgment documents contain a large number of special expressions such as professional terms, the general NER entity extraction model is not applicable in this field.

[0003] In traditional technology, there have been many studies on entity extraction and entity relations of judicial documents. One way is to use the beautifulsoup module to parse HTML to obtain txt text, obtain corresponding data samples through manual annotation, and use Google's open source BERT model as the event type extraction model for training and prediction, and finally obtain the corresponding entity results. However, it can only predict specific structures such as: defendant, victim and other precise keywords for recognition, and it cannot recognize sentences without such keywords, such as: someone compensates someone for losses, and it is impossible to determine the subject and object, and the corresponding manual standard cost is high and the efficiency is low. Another way is to adopt a multi-classification precision data analysis method based on NLP learning, establish a corresponding classification vocabulary, and users can obtain corresponding field extraction by keyword search. This method does not identify the corresponding subject object and needs to be extracted manually. The corresponding classification database cannot accurately identify fields such as: return, repayment, and compensation; at the same time, due to NLP text segmentation, some texts will be segmented too granularly, such as: Industrial and Commercial Bank of China Hubei Branch XX Branch, will be segmented into: China, Industrial and Commercial, Bank, Hubei Branch, XX, Branch. This segmentation is unwanted and has obvious deficiencies in bank risk management.

[0004] Therefore, the above identification and extraction methods still need to be improved. Summary of the invention

[0005] Based on this, it is necessary to provide a text information extraction model generation method, text information extraction method, device, computer equipment, storage medium and computer program product that can improve the accuracy of text recognition in response to the above technical problems.

[0006] In a first aspect, the present application provides a method for generating a text information extraction model, the method comprising:

[0007] Get sample text;

[0008] Performing word segmentation processing on the sample text to obtain initial word segmentation;

[0009] Identify the initial segmented words to determine the segmented words to be processed, and obtain the target text corresponding to the segmented words to be processed;

[0010] Re-matching the initial segmented words in the target text to obtain target segmented words;

[0011] The initial model is trained according to the target word segmentation to obtain a text information extraction model.

[0012] In one embodiment, identifying the initial segmented words to determine the segmented words to be processed includes:

[0013] The initial segmented words are fuzzily matched by a pre-configured keyword set to determine the segmented words to be processed.

[0014] In one embodiment, the method further comprises:

[0015] The to-be-processed word segments determined by fuzzy matching and not in the keyword set are added to the keyword set.

[0016] In one embodiment, obtaining the target text corresponding to the to-be-processed segmentation includes:

[0017] The paragraph where the to-be-processed segmented word is located is obtained as the target text corresponding to the to-be-processed segmented word.

[0018] In one embodiment, re-matching the initial segmented words in the target text to obtain the target segmented words includes:

[0019] Combining the initial participles in the target text to obtain combined participles;

[0020] The combined participle is processed to obtain a target participle according to at least one of the word frequency of the combined participle in the sample text, the word length of the combined participle, and the syntactic structure of the combined participle.

[0021] In one embodiment, the training of the initial model according to the target word segmentation to obtain a text information extraction model includes:

[0022] Determine the to-be-processed participle in the target participle as a relation, and extract the target participle at the corresponding position of the to-be-processed participle as an entity;

[0023] The initial model is trained according to the entities and relationships to obtain a text information extraction model.

[0024] In a second aspect, the present application also provides a text information extraction method, the method comprising:

[0025] Obtaining a text information extraction model generated according to the text information extraction model generation method in any one of the above embodiments;

[0026] Get the text to be processed;

[0027] The text to be processed is input into the text information extraction model to obtain entities and relationships corresponding to the text to be processed.

[0028] In a third aspect, the present application also provides a text information extraction model generation device, the device comprising:

[0029] A sample text acquisition module is used to acquire sample text;

[0030] A word segmentation module, used for performing word segmentation processing on the sample text to obtain initial word segments;

[0031] A target text acquisition module is used to identify the initial segmented words to determine the segmented words to be processed, and obtain the target text corresponding to the segmented words to be processed;

[0032] A rematching module, used for rematching the initial segmented words in the target text to obtain target segmented words;

[0033] The training module is used to train the initial model according to the target word segmentation to obtain a text information extraction model.

[0034] In a fourth aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method described in any one of the above embodiments when executing the computer program.

[0035] In a fifth aspect, the present application also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method described in any one of the above embodiments are implemented.

[0036] In a sixth aspect, the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the method described in any one of the above embodiments.

[0037] The above-mentioned text information extraction model generation method, text information extraction method, device, computer equipment, storage medium and computer program product first segment the sample text to obtain initial segmentations, and then determine the segmentations to be processed in the initial segmentations, so that the corresponding target text is determined according to the segmentations to be processed, and then the initial segmentations in the target text are re-matched to obtain the target segmentations, so that the segmentation results are more accurate, and the text information extraction model obtained by training with more accurate target segmentations is also more accurate, and then the text obtained by subsequent text extraction using the text information extraction model is also more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 An application environment diagram of a method for generating a text information extraction model in an embodiment;

[0039] Figure 2 A schematic diagram of a flow chart of a method for generating a text information extraction model in one embodiment;

[0040] Figure 3 A flowchart of a text information extraction method in one embodiment;

[0041] Figure 4 A flowchart of a method for extracting and generating text information in another embodiment;

[0042] Figure 5 It is a structural block diagram of a text information extraction model generating device in one embodiment;

[0043] Figure 6 is a structural block diagram of a text information extraction device in one embodiment;

[0044] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0046] The text information extraction model generation method and text information extraction method provided in the embodiments of the present application can be applied to Figure 1 In the application environment shown, the terminal 102 communicates with the server 104 through a network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers.

[0047] Among them, the server 104 can obtain a sample text, and perform word segmentation processing on the sample text to obtain an initial word segmentation, so that the word segmentation to be processed can be determined by identifying the initial word segmentation, and then the paragraph where the word segmentation to be processed is located is obtained as the target text, and then the initial word segmentation in the target text is re-matched to obtain the target word segmentation, so that the server performs model training according to the target word segmentation to obtain a text information extraction model, for example, the initial model is trained according to the target word segmentation through transfer training to obtain a text information extraction model.

[0048] More preferably, the server 104 can subsequently receive the text to be processed sent by the terminal 102, or uploaded to the server 104 in other ways, or the text to be processed actively crawled by the server 104, and then extract information from the text to be processed through the loaded trained text information extraction model to obtain the target text.

[0049] The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.

[0050] In one embodiment, Figure 2 As shown, a method for generating a text information extraction model is provided, and the method is applied to Figure 1 The server in the example is used to illustrate the following steps:

[0051] S202: Obtain sample text.

[0052] Specifically, the sample text may refer to a judgment document, etc. In this embodiment, the main purpose is to improve the recognition accuracy of the inflow and outflow of specific funds in the judgment document. Specifically, the server can obtain multiple sample texts at a time to achieve parallel processing, such as allocating services to balance the processing volume of each server involved in the processing, thereby achieving load balancing and parallel processing. In other embodiments, the server can also perform serial processing, etc.

[0053] S204: Perform word segmentation processing on the sample text to obtain initial word segmentation.

[0054] Specifically, the word segmentation process can be implemented by any word segmentation algorithm, such as HMM, i.e. Hidden Markov Model, and the server performs word segmentation on the sample text through at least one word segmentation algorithm selected by it to obtain initial word segmentation. It should be noted that the initial word segmentation here is a rough word segmentation of the sample text, which may cause errors in the word segmentation due to the inherent properties of the word segmentation algorithm. In one optional embodiment, the server can perform word segmentation on the sample text through multiple word segmentation algorithms, and synthesize the word segmentation results of multiple word segmentation algorithms to obtain the initial word segmentation. However, those skilled in the art can determine that due to the inherent errors of the word segmentation algorithm, the obtained initial word segmentation may still have errors.

[0055] In one of the preferred embodiments, the sample text is segmented by a word segmentation algorithm to obtain initial word segments and the parts of speech corresponding to the initial word segments. In this way, when extracting judicial document information, entities and relationships can be obtained based on the parts of speech and the subsequently determined part of the word to be processed. For example, the part of the word to be processed is generally a pre-set relationship, so that the target word that appears at a preset distance before and after the relationship is the entity. In this way, entities and relationships can be obtained based on the results of semantic recognition (not specifically described in this application, where semantic recognition can be any existing semantic recognition method), relationships and entities.

[0056] S206: Identify the initial segmented words to determine the segmented words to be processed, and obtain the target text corresponding to the segmented words to be processed.

[0057] Specifically, the to-be-processed segmented words are screened from the initial segmented words, that is, the set corresponding to the to-be-processed segmented words is a subset of the set corresponding to the initial segmented words.

[0058] In one of the optional embodiments, a preconfigured keyword set may be stored in the server. The server matches the initial word segmentation with the keywords in the keyword set through algorithms such as fuzzy matching to determine the word segmentation to be processed, that is, the initial word segmentation that successfully matches the keywords in the keyword set is used as the word segmentation to be processed.

[0059] In one embodiment, the target text corresponds to the to-be-processed segmentation, and a corresponding part is selected from the sample text according to the to-be-processed segmentation as the target text. For example, the target text may be the target paragraph where the to-be-processed segmentation is located. When the target paragraph is short, for example, the number of words is less than a certain value, the target text may also include a certain number of paragraphs before or after the target paragraph. In other embodiments, the target text may also be a preset number of paragraphs determined according to the to-be-processed segmentation, or a text corresponding to a preset number of lines, or even a text corresponding to a preset number of words, etc. The method of selecting the target text is not specifically limited herein. However, for the convenience of operation, in a preferred embodiment, obtaining the target text corresponding to the to-be-processed segmentation includes: obtaining the paragraph where the to-be-processed segmentation is located as the target text corresponding to the to-be-processed segmentation.

[0060] S208: Rematching the initial segmented words in the target text to obtain target segmented words.

[0061] Specifically, the target word segmentation is obtained by re-matching the initial word segmentation in the target text. It should be noted that no matter how the target text is determined, when there are multiple to-be-processed word segments in the target text, the target text determined according to the to-be-processed word segmentation needs to be de-duplicated to ensure that only one target text is re-matched.

[0062] Among them, rematching is a method of rematching the initial word segmentation in the target text. The main reason is that there are errors in the initial word segmentation. For example, "China Industrial and Commercial Bank Hubei Branch XX Branch" will be divided into: China, Industrial and Commercial, Bank, Hubei Branch, XX, Branch. This word segmentation is not what you want, so the rematching operation will be used to recombine the words and sentences. Specifically, it can recombine the initial word segmentation in the target text, and the combination method can be any adjacent word segmentation. It can be composed of two adjacent, three adjacent, etc. initial word segmentations. In a preferred embodiment, the server can pre-set the maximum number of word segments of the initial word segmentation combination, so as to avoid the word segmentation being too long and causing the processing efficiency to decrease.

[0063] Wherein after the initial participle is combined, the server judges the combined initial participle (including the initial participle itself, and the combined participle obtained by combining at least two initial groupings) to obtain the target participle, for example, judging according to any one of semantics, word frequency in the initial text and word length. In a preferred embodiment, the server can first screen the combined initial participle according to semantics to delete the combined initial participle without specific semantics, for example, the server can judge according to the part of speech to delete the sentence or the initial participle after meaningless combination. If after deletion, the initial participle (i.e., combined participle) after the combination of the same initial participle is only one participle, then it is directly output, otherwise the server screens again according to the word frequency of the combined initial participle in the initial text, if the initial participle (i.e., combined participle) after the combination of the same initial participle is only one participle, then it is directly output, otherwise the server continues to screen according to word length, for example, selecting a combined participle with the longest word length as the target participle. In this way, the sample text can be accurately processed for word segmentation.

[0064] S210: The initial model is trained according to the target word segmentation to obtain a text information extraction model.

[0065] Specifically, the initial model can be any model, which can be only the architecture of the model, or a model that has been trained for text recognition, such as the BERT model, so that the text information extraction model can be obtained by training according to the target word segmentation through transfer learning.

[0066] In this way, the inflow and outflow of specific amounts of funds in judicial documents can be identified through the text information extraction model. By creating a judicial document keyword database, a text information extraction model, and a fuzzy matching algorithm, a good entity relationship extraction effect can be achieved in the fund flow scenario of judicial documents.

[0067] The above-mentioned text information extraction model generation method first segments the sample text to obtain initial segmentations, and then determines the segmentations to be processed in the initial segmentations, so that the corresponding target text is determined according to the segmentations to be processed, and then the initial segmentations in the target text are re-matched to obtain the target segmentations, so that the segmentation results are more accurate, and the text information extraction model obtained by training with more accurate target segmentations is also more accurate, and then the text obtained by subsequent text extraction using the text information extraction model is also more accurate.

[0068] In one embodiment, identifying the initial segmented words to determine the segmented words to be processed includes: performing fuzzy matching on the initial segmented words through a pre-configured keyword set to determine the segmented words to be processed.

[0069] Specifically, the pre-configured keyword set is pre-set by the user, and is mainly used to describe the words that appear in the judgment documents. In other embodiments, it can also include words used to describe entities, which are not specifically limited here. For example, "acceptance fee", "preservation fee", "announcement fee", "appraisal fee", "winning party", "losing party", "compensation amount", "judgment statement number", etc. Since this type of keyword matching has many synonyms: for example: "return", "repay", "compensation", etc., in a preferred embodiment, the server uses similar methods including edit distance method and semantic method for the keyword dictionary, sets a specific threshold to distinguish synonyms, and adds them to the corresponding keyword dictionary to improve the accuracy of model matching to prevent missing important sentences.

[0070] The server screens the initial segmented words by fuzzy matching to obtain the segmented words to be processed, so as to avoid omissions in matching due to a small number of words listed in the keyword dictionary.

[0071] In one of the embodiments, the method further comprises: adding the to-be-processed segmented words determined by fuzzy matching and not in the keyword set to the keyword set.

[0072] Specifically, in this embodiment, in order to ensure the accuracy of the keyword set, after fuzzy matching, if the pending word segmentation is matched successfully but not stored in the keyword set, the server adds the pending word segmentation to the keyword set, laying the foundation for the efficiency and accuracy of subsequent matching.

[0073] In one of the embodiments, re-matching the initial participles in the target text to obtain the target participles includes: combining the initial participles in the target text to obtain the combined participles; and processing the combined participles to obtain the target participles based on at least one of the word frequency of the combined participles in the sample text, the word length of the combined participles, and the syntactic structure of the combined participles.

[0074] Specifically, it can recombine the initial word segmentations in the target text, wherein the combination method can be to combine any adjacent word segmentations, which can be a combination of two adjacent, three adjacent, etc. initial word segmentations. In a preferred embodiment, the server can pre-set the maximum number of word segmentations for the initial word segmentation combination to avoid reducing processing efficiency due to excessively long word segmentations.

[0075] Wherein after the initial participle is combined, the server judges the combined initial participle (including the initial participle itself, and the combined participle obtained by combining at least two initial groupings) to obtain the target participle, for example, judging according to any one of semantics, word frequency in the initial text and word length. In a preferred embodiment, the server can first screen the combined initial participle according to semantics to delete the combined initial participle without specific semantics, for example, the server can judge according to the part of speech to delete the sentence or the initial participle after meaningless combination. If after deletion, the initial participle (i.e., combined participle) after the combination of the same initial participle is only one participle, then it is directly output, otherwise the server screens again according to the word frequency of the combined initial participle in the initial text, if the initial participle (i.e., combined participle) after the combination of the same initial participle is only one participle, then it is directly output, otherwise the server continues to screen according to word length, for example, selecting a combined participle with the longest word length as the target participle. In this way, the sample text can be accurately processed for word segmentation.

[0076] In order to facilitate the understanding of those skilled in the art, the following is explained in conjunction with a specific embodiment: Since there are many company names, personal names, etc. involved in judicial documents, the traditional HMM model will divide the company name into multiple words. For example, "China Bank Co., Ltd." is divided into five words: "China", "Industrial and Commercial", "Bank", "Limited", and "Company", and so on. Therefore, it is necessary to re-match the segmented phrase set M. This embodiment uses the keyword set S1 to combine the phrases near the keywords using the fuzzy matching method to obtain a set S2, and performs a word frequency search on the set S2 in the judicial document T1, and compares the results in the set S2. The new target is determined by comparing the word length and word frequency. The specific algorithm steps are as follows:

[0077] First, the word group near the keyword set S1 is extracted from the word segmentation set M, and a plurality of combinations S2 are obtained using a fuzzy matching algorithm.

[0078] Then, the judgment document T1 is used to count the word frequency of the phrases in combination S2.

[0079] Thirdly, the semantics, word length and word frequency of the phrases in the set S2 are compared to determine a new phrase word.

[0080] Finally, according to the determined phrases, the set M is reorganized to obtain a new set M1.

[0081] In one of the embodiments, the initial model is trained according to the target participle to obtain a text information extraction model, including: determining the participle to be processed as a relationship in the target participle, and extracting the target participle at the corresponding position of the participle to be processed as an entity; and the initial model is trained according to the entity and the relationship to obtain the text information extraction model.

[0082] Specifically, in this embodiment, what is stored in the keyword set is a relationship, so the to-be-processed segmented word is taken as a relationship, and then the target segmented word at the corresponding position of the to-be-processed segmented word is taken as an entity, and training is performed based on the relationship and the entity to obtain a text information extraction model.

[0083] Specifically, after obtaining the new set M1, it is split into training set M2, test set M3 and prediction set M4. The training of the text information extraction model for entity relationship extraction of the BERT algorithm is mainly based on training set 2 and test set M3. After the training is completed: set M4 is used as the input of the BERT model tokenizer; the Chinese language and training model of BERT are loaded; the text of the judicial documents is pre-trained to obtain the trained BERT model; entity extraction and relationship extraction are performed on the prediction set M4; and data is stored.

[0084] In the above embodiment, the flow of funds and the two parties in the judgment documents can be effectively identified, which greatly improves the accuracy compared with other extraction methods. The identification accuracy of the specific inflow and outflow of funds in the judgment is greatly improved, which greatly improves the risk management ability of our bank.

[0085] In one embodiment, Figure 3 As shown, a method for generating a text information extraction model is provided, and the method is applied to Figure 1 The server in the example is used to illustrate the following steps:

[0086] S302: Acquire a text information extraction model generated according to the text information extraction model generation method in any one of the above embodiments.

[0087] Specifically, the training method of the text information extraction model can be found in the above description and will not be repeated here.

[0088] S304: Obtain the text to be processed.

[0089] Specifically, the text to be processed is preferably a referee text.

[0090] S306: Input the text to be processed into a text information extraction model to obtain entities and relationships corresponding to the text to be processed.

[0091] The server inputs the judgment text into the text information extraction model to extract entities and relationships.

[0092] The above-mentioned text information extraction method first segments the sample text to obtain initial segmentations, and then determines the segmentations to be processed in the initial segmentations, so that the corresponding target text is determined according to the segmentations to be processed, and then the initial segmentations in the target text are re-matched to obtain the target segmentations, so that the segmentation results are more accurate, and the text information extraction model obtained by training with more accurate target segmentations is also more accurate, and then the text obtained by subsequent text extraction using the text information extraction model is also more accurate.

[0093] In order to enable those skilled in the art to fully understand the present application, Figure 4 As shown, Figure 4 It is a flow chart of a judicial document extraction method in an embodiment, which mainly includes a data text preparation module, a keyword library module, a key sentence extraction module, a key sentence re-matching module 504 and a result storage module.

[0094] Among them, the main processing flow includes rough word segmentation based on the word segmentation model HMM and keyword rules, re-matching based on fuzzy matching algorithm and syntactic structure to determine the target word segmentation, and entity relationship extraction training and actual processing process of BERT algorithm.

[0095] The pre-configured keyword set is pre-set by the user, and is mainly used to describe the words that appear in the judgment documents. In other embodiments, it can also include words used to describe entities, which are not specifically limited here. For example, "acceptance fee", "preservation fee", "announcement fee", "appraisal fee", "winning party", "losing party", "compensation amount", "judgment statement number", etc. Since this type of keyword matching has many synonyms: for example: "return", "repay", "compensation", etc., in a preferred embodiment, the server uses similar methods including edit distance method and semantic method for the keyword dictionary, sets a specific threshold to distinguish synonyms, and adds them to the corresponding keyword dictionary to improve the accuracy of model matching to prevent missing important sentences.

[0096] The server uses the commonly used word segmentation model HMM to perform sentence segmentation and part-of-speech tagging, processes the word segmentation results through the established keyword dictionary set to obtain the pending word segmentation, and records it as M. Based on M, the corresponding paragraphs in the judicial document are extracted as the target text.

[0097] Specifically, Figure 4 The data text preparation module is used to prepare sample text. The keyword word library module is used to obtain a keyword set. The key sentence extraction module uses the HMM word segmentation module 502 and the keyword rule model to segment the text and mark the part of speech, and processes the word segmentation results to obtain the word segmentation to be processed, and records it as M. According to M, the corresponding paragraphs in the judgment document are extracted as the target text.

[0098] After the target text is determined, the segmented data is reorganized through the key sentence rematching module 504, and the BERT algorithm is trained to obtain a text information extraction model.

[0099] Specifically, since the judicial documents involve many company names, names of people, etc., the traditional HMM model will divide the company name into multiple words. For example, "China Bank Co., Ltd." is divided into five words: "China", "Industrial and Commercial", "Bank", "Limited", and "Company", and so on. Therefore, it is necessary to re-match the segmented phrase set M. This embodiment uses the keyword set S1 to combine the phrases near the keywords using the fuzzy matching method to obtain the set S2, and performs a word frequency search on the set S2 in the judicial document T1, and compares the results in the set S2. The new target is determined by comparing the word length and word frequency. The specific algorithm steps are as follows:

[0100] First, the word group near the keyword set S1 is extracted from the word segmentation set M, and a plurality of combinations S2 are obtained using a fuzzy matching algorithm.

[0101] Then, the judgment document T1 is used to count the word frequency of the phrases in combination S2.

[0102] Thirdly, the semantics, word length and word frequency of the phrases in the set S2 are compared to determine a new phrase word.

[0103] Finally, according to the determined phrases, the set M is reorganized to obtain a new set M1.

[0104] After obtaining the new set M1, it is split into training set M2, test set M3 and prediction set M4. The training of the text information extraction model for entity relationship extraction of the BERT algorithm is mainly based on training set 2 and test set M3. After the training is completed: set M4 is used as the input of the BERT model tokenizer; the Chinese language and training model of BERT are loaded; the text of the judicial documents is pre-trained to obtain the trained BERT model; entity extraction and relationship extraction are performed on the prediction set M4; and data is stored.

[0105] In the above embodiment, the flow of funds and the two parties in the judgment documents can be effectively identified, which greatly improves the accuracy compared with other extraction methods. The identification accuracy of the specific inflow and outflow of funds in the judgment is greatly improved, which greatly improves the risk management ability of our bank.

[0106] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0107] Based on the same inventive concept, the embodiment of the present application also provides a text information extraction model generation device for implementing the above-mentioned text information extraction model generation method, and a text information extraction device for the text information extraction method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in the one or more text information extraction model generation devices and text information extraction device embodiments provided below can refer to the limitations of the text information extraction model generation method and text information extraction method above, and will not be repeated here.

[0108] In one embodiment, Figure 5 As shown, a text information extraction model generation method device is provided, including: a sample text acquisition module 501, a word segmentation module 502, a target text acquisition module 503, a rematching module 504 and a training module 505, wherein:

[0109] A sample text acquisition module 501 is used to acquire sample text;

[0110] The word segmentation module 502 is used to perform word segmentation processing on the sample text to obtain initial word segments;

[0111] The target text acquisition module 503 is used to identify the initial segmented words to determine the segmented words to be processed, and obtain the target text corresponding to the segmented words to be processed;

[0112] A rematching module 504 is used to rematch the initial segmented words in the target text to obtain the target segmented words;

[0113] The training module 505 is used to train the initial model according to the target word segmentation to obtain a text information extraction model.

[0114] In one embodiment, the target text acquisition module 503 is further configured to perform fuzzy matching on the initial segmented words through a pre-configured keyword set to determine the segmented words to be processed.

[0115] In one embodiment, the above device further comprises:

[0116] The adding module is used to add the to-be-processed word segments determined by fuzzy matching and not in the keyword set to the keyword set.

[0117] In one embodiment, the target text acquisition module 503 is further configured to: acquire the paragraph where the to-be-processed segmented word is located as the target text corresponding to the to-be-processed segmented word.

[0118] In one embodiment, the rematching module 504 includes:

[0119] A combination unit, used to combine initial segmented words in the target text to obtain combined segmented words;

[0120] The target analysis and acquisition unit is used to process the combined participles according to at least one of the word frequency of the combined participles in the sample text, the word length of the combined participles, and the syntactic structure of the combined participles to obtain the target participles.

[0121] In one embodiment, the training module 505 includes:

[0122] A determination unit, used to determine the to-be-processed participle in the target participle as a relation, and extract the target participle at the corresponding position of the to-be-processed participle as an entity;

[0123] The training unit is used to train the initial model according to entities and relationships to obtain a text information extraction model.

[0124] In one embodiment, Figure 6 As shown, a text information extraction device is provided, comprising: a model acquisition module 601, a to-be-processed text acquisition module 602 and an extraction module 603, wherein:

[0125] A model acquisition module 601 is used to acquire a text information extraction model generated according to the text information extraction model generation method in any one of the above embodiments;

[0126] A to-be-processed text acquisition module 602 is used to acquire the to-be-processed text;

[0127] The extraction module 603 is used to input the text to be processed into the text information extraction model to obtain the entities and relationships corresponding to the text to be processed.

[0128] The above-mentioned text information extraction model generation method device and each module in the text information extraction model can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0129] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store sample texts, keyword sets, and trained text information extraction models, etc. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a text information extraction model generation method and a text information extraction method are implemented.

[0130] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0131] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: obtaining a sample text; performing word segmentation processing on the sample text to obtain an initial word segmentation; identifying the initial word segmentation to determine a word segmentation to be processed, and obtaining a target text corresponding to the word segmentation to be processed; rematching the initial word segmentation in the target text to obtain a target word segmentation; and training an initial model according to the target word segmentation to obtain a text information extraction model.

[0132] In one embodiment, the identification of the initial segmented words to determine the segmented words to be processed implemented when the processor executes the computer program includes: fuzzy matching the initial segmented words through a pre-configured keyword set to determine the segmented words to be processed.

[0133] In one embodiment, when the processor executes the computer program, the following steps are further implemented: adding the to-be-processed segmented words that are determined by fuzzy matching and are not in the keyword set to the keyword set.

[0134] In one embodiment, obtaining the target text corresponding to the to-be-processed segmented word implemented when the processor executes the computer program includes: obtaining the paragraph where the to-be-processed segmented word is located as the target text corresponding to the to-be-processed segmented word.

[0135] In one embodiment, the rematching of initial participles in the target text to obtain target participles implemented when the processor executes the computer program includes: combining the initial participles in the target text to obtain combined participles; and processing the combined participles to obtain the target participles based on at least one of the word frequency of the combined participles in the sample text, the word length of the combined participles, and the syntactic structure of the combined participles.

[0136] In one embodiment, the processor executes a computer program to train an initial model according to a target participle to obtain a text information extraction model, including: determining a participle to be processed as a relationship in the target participle, and extracting the target participle at a position corresponding to the participle to be processed as an entity; and training the initial model according to the entity and the relationship to obtain a text information extraction model.

[0137] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: obtaining a text information extraction model generated according to the text information extraction model generation method in any one of the above embodiments; obtaining a text to be processed; and inputting the text to be processed into the text information extraction model to obtain entities and relationships corresponding to the text to be processed.

[0138] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: obtaining a sample text; performing word segmentation processing on the sample text to obtain an initial word segmentation; identifying the initial word segmentation to determine a word segmentation to be processed, and obtaining a target text corresponding to the word segmentation to be processed; rematching the initial word segmentation in the target text to obtain a target word segmentation; and training an initial model according to the target word segmentation to obtain a text information extraction model.

[0139] In one embodiment, the computer program, when executed by a processor, identifies the initial word segmentation to determine the word segmentation to be processed, including: performing fuzzy matching on the initial word segmentation through a pre-configured keyword set to determine the word segmentation to be processed.

[0140] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: adding the to-be-processed segmented words that are determined by fuzzy matching and are not in the keyword set to the keyword set.

[0141] In one embodiment, obtaining a target text corresponding to a to-be-processed segmented word implemented when the computer program is executed by a processor includes: obtaining a paragraph where the to-be-processed segmented word is located as the target text corresponding to the to-be-processed segmented word.

[0142] In one embodiment, the computer program implemented by the processor when executed by the processor to re-match the initial participles in the target text to obtain the target participles includes: combining the initial participles in the target text to obtain the combined participles; and processing the combined participles to obtain the target participles based on at least one of the word frequency of the combined participles in the sample text, the word length of the combined participles, and the syntactic structure of the combined participles.

[0143] In one embodiment, the computer program implemented when executed by a processor trains an initial model according to a target participle to obtain a text information extraction model, including: determining a participle to be processed as a relationship in the target participle, and extracting the target participle at a corresponding position of the participle to be processed as an entity; and training the initial model according to the entity and the relationship to obtain a text information extraction model.

[0144] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: obtaining a text information extraction model generated according to the text information extraction model generation method in any one of the above embodiments; obtaining a text to be processed; and inputting the text to be processed into the text information extraction model to obtain entities and relationships corresponding to the text to be processed.

[0145] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the following steps: obtaining a sample text; performing word segmentation processing on the sample text to obtain an initial word segmentation; identifying the initial word segmentation to determine a word segmentation to be processed, and obtaining a target text corresponding to the word segmentation to be processed; rematching the initial word segmentation in the target text to obtain a target word segmentation; and training an initial model based on the target word segmentation to obtain a text information extraction model.

[0146] In one embodiment, the computer program, when executed by a processor, identifies the initial word segmentation to determine the word segmentation to be processed, including: performing fuzzy matching on the initial word segmentation through a pre-configured keyword set to determine the word segmentation to be processed.

[0147] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: adding the to-be-processed segmented words that are determined by fuzzy matching and are not in the keyword set to the keyword set.

[0148] In one embodiment, obtaining a target text corresponding to a to-be-processed segmented word implemented when the computer program is executed by a processor includes: obtaining a paragraph where the to-be-processed segmented word is located as the target text corresponding to the to-be-processed segmented word.

[0149] In one embodiment, the computer program implemented by the processor when executed by the processor to re-match the initial participles in the target text to obtain the target participles includes: combining the initial participles in the target text to obtain the combined participles; and processing the combined participles to obtain the target participles based on at least one of the word frequency of the combined participles in the sample text, the word length of the combined participles, and the syntactic structure of the combined participles.

[0150] In one embodiment, the computer program implemented when executed by a processor trains an initial model according to a target participle to obtain a text information extraction model, including: determining a participle to be processed as a relationship in the target participle, and extracting the target participle at a corresponding position of the participle to be processed as an entity; and training the initial model according to the entity and the relationship to obtain a text information extraction model.

[0151] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the following steps: obtaining a text information extraction model generated according to the text information extraction model generation method in any one of the above embodiments; obtaining a text to be processed; and inputting the text to be processed into the text information extraction model to obtain entities and relationships corresponding to the text to be processed.

[0152] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0153] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0154] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for generating a text information extraction model, characterized in that: The method comprises: Get sample text; Performing word segmentation processing on the sample text to obtain initial word segmentation; wherein, performing word segmentation processing on the sample text to obtain initial word segmentation includes: performing word segmentation on the sample text using multiple word segmentation algorithms, and combining the word segmentation results of the multiple word segmentation algorithms to obtain initial word segmentation; Identify the initial segmented words to be processed and obtain the target text corresponding to the segmented words to be processed; when there are multiple segmented words to be processed in the target text, perform deduplication processing on the target text determined by the segmented words to be processed; wherein the target text includes: text corresponding to a preset number of lines or words in the target paragraph where the segmented words to be processed are located; if the number of words in the target paragraph is lower than a preset value, select the target paragraph and a preset number of paragraphs before or after the target paragraph as the target text; Re-matching the initial segmented words in the target text to obtain the target segmented words; The initial model is trained according to the target word segmentation to obtain a text information extraction model.

2. The method according to claim 1, characterized in that The step of identifying the initial segmented words to determine the segmented words to be processed includes: The initial segmented words are fuzzily matched by a pre-configured keyword set to determine the segmented words to be processed.

3. The method according to claim 2, characterized in that The method further comprises: The to-be-processed segmented words that are determined by fuzzy matching and are not in the keyword set are added to the keyword set.

4. The method according to claim 1, characterized in that The re-matching of the initial segmented words in the target text to obtain the target segmented words includes: Combining the initial participles in the target text to obtain combined participles; The combined participle is processed to obtain a target participle according to at least one of the word frequency of the combined participle in the sample text, the word length of the combined participle, and the syntactic structure of the combined participle.

5. The method according to any one of claims 1 to 4, characterized in that: The training of the initial model according to the target word segmentation to obtain a text information extraction model includes: Determine the to-be-processed participle in the target participle as a relation, and extract the target participle at the corresponding position of the to-be-processed participle as an entity; The initial model is trained according to the entities and relationships to obtain a text information extraction model.

6. A method for extracting text information, characterized in that: The method comprises: Obtain a text information extraction model generated by the text information extraction model generation method according to any one of claims 1 to 5; Get the text to be processed; The text to be processed is input into the text information extraction model to obtain entities and relationships corresponding to the text to be processed.

7. A text information extraction model generation device, characterized in that: The device comprises: A sample text acquisition module is used to acquire sample text; A word segmentation module is used to perform word segmentation processing on the sample text to obtain initial word segmentation; wherein the word segmentation processing on the sample text to obtain initial word segmentation includes: performing word segmentation on the sample text through multiple word segmentation algorithms, and combining the word segmentation results of the multiple word segmentation algorithms to obtain initial word segmentation; A target text acquisition module is used to identify the initial segmentation to determine the segmentation to be processed, and obtain the target text corresponding to the segmentation to be processed; when there are multiple segmentations to be processed in the target text, the target text determined by the segmentation to be processed is deduplicated; wherein the target text includes: text corresponding to a preset number of lines or words in the target paragraph where the segmentation to be processed is located; if the number of words in the target paragraph is lower than a preset value, the target paragraph and a preset number of paragraphs before or after the target paragraph are selected as the target text; A rematching module, used for rematching the initial segmented words in the target text to obtain target segmented words; The training module is used to train the initial model according to the target word segmentation to obtain a text information extraction model.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 or 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 or 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 or 6 are implemented.

Citation Information

Patent Citations

  • Method and device for extracting target words

    CN109992766A

  • Short text data processing method and device for operation and maintenance of hospital logistics

    CN111161861A

  • Text data processing method, device and equipment and storage medium

    CN111444326A

  • Natural language processing method and device and electronic equipment

    CN112800201A

  • Data normalization processing method, device and equipment, and computer-readable storage medium

    CN113722429A