A text information mining method, device, electronic device and storage medium
By applying semantic feature filtering processing technology based on business needs in contract risk audits, and using trigger word clusters and text classifiers to identify target information, the problems of low information extraction efficiency and high operation and maintenance costs in the existing technology are solved, and high accuracy and low cost information recognition are achieved.
Patent Information
- Application Number
- CN202011192918.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-30
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2040-10-30
AI Technical Summary
In the prior art, in contract risk audit, it is difficult to efficiently and automatically extract target entity information, and the rules maintenance cost is high, and it is difficult to adapt to historical data after the data volume increases.
Through semantic feature filtering processing based on business needs, the pending text is obtained and the target information is identified, and the trigger word cluster and text classifier are used to filter irrelevant data, which improves the accuracy of information recognition and reduces operation and maintenance costs.
It improves the accuracy of identification of target information, reduces the need for manual setting and maintenance rules, reduces operation and maintenance costs, and adapts to the increase in data volume.
Smart Images

Figure CN114443803B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of natural language processing, and in particular to a text information mining method, device, electronic equipment and computer storage medium. Background Art
[0002] As a general commercial information carrier, contracts contain all kinds of key information. Conducting risk audits on contracts is one of the effective ways for enterprises to avoid various risks in advance. Faced with a large amount of unstructured contract data, using text understanding technology in the field of natural language processing to achieve automatic extraction of target entities, such as Party A information, effective time, end time, etc., can greatly improve the efficiency of contract risk audits compared to purely manual information review and comparison.
[0003] The extraction of key information from carriers such as contracts can be classified as a text understanding task at the chapter level. In the related technology, the key information extraction technology at the chapter level goes through the following stages: In the early stage, the target information is obtained by traversing the chapter in a matching manner using preset rules. Since the setting and maintenance of rules need to be performed by professionals in the field, the operation and maintenance costs are relatively high; in addition, although rules can be automatically generated with the help of tools such as the open source business rule engine Drools, the addition and modification of rules will become difficult as the amount of data increases, which is reflected in: the rules modified to adapt to the current business data will cause the historical business data to no longer adapt. With the introduction of statistical models, simple shallow semantic knowledge can be applied to the extraction of key information. Statistical models have alleviated the degree of dependence on rules to a certain extent, but simple shallow semantic knowledge alone may not be able to effectively filter paragraphs that are not related to the target field information, thereby reducing the accuracy of key information extraction. Summary of the invention
[0004] The present invention provides a text information mining method, device, electronic device and computer storage medium. The method filters text based on business needs, and can filter data irrelevant to target information, thereby improving the recognition accuracy of target information; and there is no need to manually set preset rules and maintain them, which effectively reduces operation and maintenance costs.
[0005] To achieve the above object, the technical solution of the present invention is achieved as follows:
[0006] The present invention provides a text information mining method, the method comprising:
[0007] Get the text to be processed;
[0008] Based on the business needs of mining target information, the text to be processed is subjected to semantic feature filtering to obtain filtering results;
[0009] Based on the filtering result, target information of the text to be processed is identified.
[0010] Optionally, based on the business requirement of mining target information, the text to be processed is subjected to semantic feature filtering to obtain a filtering result, including:
[0011] Acquire at least one trigger word configured according to the business requirement;
[0012] Performing filtering semantic feature processing on the text to be processed based on the at least one trigger word to obtain an intermediate filtering result;
[0013] The filtering result is obtained according to the intermediate filtering result.
[0014] Optionally, the performing semantic feature filtering processing on the text to be processed based on the at least one trigger word includes:
[0015] Determine the semantic similarity between each trigger word and other words;
[0016] When the semantic similarity reaches a set threshold, determining the other words as similar words to each trigger word;
[0017] Based on the trigger word cluster set, the text to be processed is subjected to semantic feature filtering processing; the trigger word cluster set includes each of the trigger words and similar words to each of the trigger words.
[0018] Optionally, obtaining a filtering result according to the intermediate filtering result includes:
[0019] Using a text classifier to classify the intermediate filtering result to obtain a classification result; the classification result includes at least one type of text information;
[0020] In the classification results, text information that does not meet the business requirements is filtered to obtain the filtering processing results.
[0021] Optionally, the method further includes:
[0022] Inputting the sample data of the text into N pre-set feature extractors respectively to obtain N features; the N features represent N label prediction results of the sample data, where N is an integer greater than 1;
[0023] Processing the N label prediction results based on a voting mechanism to obtain a label for the sample data;
[0024] The text classifier is trained based on the label and the sample data.
[0025] Optionally, the identifying target information of the text to be processed based on the filtering processing result includes:
[0026] Using labels to mark the target information;
[0027] In the case where it is determined that the target information has an ambiguous item, a label is re-determined to mark the ambiguous item, so as to obtain a marking result of the ambiguous item;
[0028] Based on the marking results of the ambiguous terms, target information of the text to be processed is identified.
[0029] The present invention provides a text information mining device, the device comprising:
[0030] An acquisition module is used to obtain the text to be processed;
[0031] A filtering module is used to perform semantic feature filtering on the text to be processed based on the business needs of mining target information to obtain a filtering result;
[0032] The identification module is used to identify the target information of the text to be processed based on the filtering processing result.
[0033] Optionally, the filtering module is used to perform semantic feature filtering processing on the text to be processed based on the business needs of mining target information to obtain filtering processing results, including:
[0034] Acquire at least one trigger word configured according to the business requirement;
[0035] Performing semantic feature filtering processing on the text to be processed based on the at least one trigger word to obtain an intermediate filtering result;
[0036] The filtering result is obtained according to the intermediate filtering result.
[0037] Optionally, the filtering module is used to perform semantic feature filtering processing on the text to be processed based on the at least one trigger word, including:
[0038] Determine the semantic similarity between each trigger word and other words;
[0039] When the semantic similarity reaches a set threshold, determining the other words as similar words to each trigger word;
[0040] Based on the trigger word cluster set, the text to be processed is subjected to semantic feature filtering processing; the trigger word cluster set includes each of the trigger words and similar words to each of the trigger words.
[0041] Optionally, the filtering module is used to obtain a filtering processing result according to the intermediate filtering result, including:
[0042] Using a text classifier to classify the intermediate filtering result to obtain a classification result; the classification result includes at least one type of text information;
[0043] In the classification results, text information that does not meet the business requirements is filtered to obtain the filtering processing results.
[0044] Optionally, the device further comprises a training module, wherein the training module is used to:
[0045] Inputting the sample data of the text into N pre-set feature extractors respectively to obtain N features; the N features represent N label prediction results of the sample data, where N is an integer greater than 1;
[0046] Processing the N label prediction results based on a voting mechanism to obtain a label for the sample data;
[0047] The text classifier is trained based on the label and the sample data.
[0048] Optionally, the identification module is used to identify the target information of the text to be processed based on the filtering processing result, including:
[0049] Using labels to mark the target information;
[0050] In the case where it is determined that the target information has an ambiguous item, a label is re-determined to mark the ambiguous item, so as to obtain a marking result of the ambiguous item;
[0051] Based on the marking results of the ambiguous terms, target information of the text to be processed is identified.
[0052] The present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, a text information mining method provided by one or more of the above-mentioned technical solutions is implemented.
[0053] The present invention provides a computer storage medium, wherein the computer storage medium stores a computer program; after the computer program is executed, the text information mining method provided by one or more of the above-mentioned technical solutions can be implemented.
[0054] The present invention provides a text information mining method, device, electronic device and computer storage medium, the method comprising: obtaining a text to be processed; based on the business needs of mining target information, performing semantic feature filtering processing on the text to be processed to obtain a filtering processing result; based on the filtering processing result, identifying the target information of the text to be processed. In this way, by filtering the text based on business needs, data irrelevant to the target information can be filtered, thereby improving the recognition accuracy of the target information; and there is no need to manually set and maintain preset rules, which effectively reduces the operation and maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 is a flow chart of the text information mining method of the present invention;
[0056] Figure 2 Schematic diagram of the network structure of the text classifier textCNN in the present invention;
[0057] Figure 3 A schematic diagram for generating a training data set for reducing manual annotation in the present invention;
[0058] Figure 4 A flowchart of another method for mining contract text information of the present invention;
[0059] Figure 5 It is a schematic diagram of the structure of the text information mining device of the present invention;
[0060] Figure 6 This is a schematic structural diagram of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0061] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0062] In the related art, the text information mining method at the chapter level such as contracts has the following disadvantages:
[0063] 1) Use a rule-based approach to perform preliminary screening of chapter-level information. The maintenance of rules is quite difficult. Although tools such as Drools can be used to automatically generate rules, the addition and modification of rules will become difficult as the amount of data increases. This is reflected in the fact that rules modified to adapt to current business data will cause historical business data to no longer adapt.
[0064] 2) For deep learning-based network model training, data quality determines model quality. Data quality includes two aspects: quantity and annotation quality. High-quality training data requires a lot of manpower, especially for chapter-level text data such as contracts. In addition, the diversity of contract categories has caused a surge in the amount of data with text paragraphs as the basic identification unit. Therefore, the use of manual annotation will make the development cycle of the adaptation model longer when new categories of text data appear.
[0065] 3) When labeling data for named entity recognition tasks, more attention is always paid to the target entity, while the ambiguous items corresponding to the target entity in the sequence are labeled with the same label as the target entity. As a result, the model outputs the ambiguous items as target entities when predicting sequence labels, affecting the recognition accuracy of the target entity.
[0066] Based on the above technical problems, the present invention provides a text information mining method. The technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the present invention.
[0067] In some embodiments of the present invention, the text information mining method can be implemented using a processor in a text information mining device, and the processor can be at least one of an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, and a microprocessor.
[0068] Figure 1 is a flowchart of the text information mining method in the present invention, such as Figure 1 As shown, the method includes:
[0069] S101: Obtain the text to be processed;
[0070] Here, the text to be processed may represent various types of texts, such as contract texts, etc., wherein the types of contract texts may be sales contracts, technical contracts, commission contracts, etc., and the embodiments of the present invention do not limit this.
[0071] Exemplarily, the format of the text to be processed may include: text in Word format, text in Portable Document Format (PDF), etc., which is not limited in the embodiment of the present invention.
[0072] In one implementation, the content in the text may be composed of Chinese characters, English characters, or mixed characters of other different languages.
[0073] It should be noted that the embodiments of the present invention have no restrictions on the format of the text. When it is determined that the format of the input text is not Hypertext Markup Language (HTML), the text format can be converted to HTML through a parsing tool, and operations such as tag cleaning and text paragraph splicing can be performed.
[0074] Here, tag cleaning is a process of preliminary processing of data, the purpose of which is to clean a large range of useless HTML tags; illustratively, regular expressions can be used for tag cleaning, or functions such as remove() or remove_tags() can be used for tag cleaning. The implementation method of tag cleaning is not limited in the embodiment of the present invention.
[0075] In one implementation, after the HTML-formatted text is cleaned of tags, various text paragraphs of the text are obtained, and the various text paragraphs can be spliced together through a text paragraph splicing operation to form a complete text without HTML tags.
[0076] Since the text obtained by the parsing tool may contain redundant HTML tags, the consistency of the text can be ensured through operations such as tag cleaning and text paragraph splicing.
[0077] S102: Based on the business needs of mining target information, the text to be processed is subjected to semantic feature filtering processing to obtain a filtering processing result;
[0078] In the embodiment of the present invention, the business demand may represent target information that the user wants to mine from the text, that is, the target information may represent key information in the text, or text information that the user is interested in.
[0079] In one embodiment, taking the contract text as an example, the target information may be a target entity with specific meaning in the contract text, such as a person's name, an organization name, a place name, time, etc.; here, the target information may be set according to the actual application scenario, and the embodiment of the present invention is not limited thereto.
[0080] In one implementation, the business requirements may come from different users. For the same text, the business requirements of different users may be the same or different, which is not limited in the embodiment of the present invention.
[0081] For example, for the same contract text A, the business need of user 1 may be to mine Party A's information in contract text A; the business need of user 2 may be to mine Party A's information in contract text A, or to mine Party B's information in contract text A, or to mine Party A's information and Party B's information in contract text A at the same time.
[0082] In one embodiment, based on the business needs of mining target information, semantic feature filtering is performed on the text to be processed to obtain a filtering result, which may include: obtaining at least one trigger word configured according to the business needs; based on the at least one trigger word, semantic feature filtering is performed on the text to be processed to obtain an intermediate filtering result; based on the intermediate filtering result, a filtering result is obtained.
[0083] It should be noted that, before the text to be processed is subjected to semantic feature filtering processing, the embodiment of the present invention also needs to perform word segmentation on the text to be processed; word segmentation can reassemble a continuous character sequence into a word sequence according to certain specifications.
[0084] Here, the process of word segmentation of the text to be processed can be implemented by a corresponding word segmentation algorithm. The specific word segmentation algorithm used can be set according to the actual application scenario, and the embodiment of the present invention does not limit it.
[0085] In the embodiment of the present invention, after the text to be processed is segmented, different text paragraphs can be obtained, and the segmented text paragraphs are filtered based on at least one trigger word to obtain intermediate filtering results.
[0086] In an embodiment of the present invention, trigger words can clearly represent features related to target information. Users can configure trigger words according to business requirements for mining target information. By using at least one trigger word to perform semantic feature filtering on the text to be processed, text paragraphs that are obviously unrelated to the target information can be filtered out, and text paragraphs related to the target information can be retained.
[0087] In one embodiment, trigger words can be divided according to scenario categories corresponding to business needs, and the divided trigger words can be stored in different databases to form different trigger word libraries; wherein the trigger word library is visible to users, and users can add and modify trigger words in the trigger word library according to business needs.
[0088] For example, when the scenarios corresponding to the business needs are the name of Party A's organization, the name of Party B's organization, and the service location, different trigger words can form three corresponding trigger word libraries according to these three scenarios.
[0089] For example, when the scenario corresponding to the business demand is the warranty period, the user can continue to configure a trigger word library based on the three trigger word libraries configured above to store trigger words related to the warranty period. The trigger word library can be used to mine the target information of the text.
[0090] Furthermore, the segmented text paragraphs may be filtered simultaneously using multiple configured trigger word libraries to obtain an intermediate filtering result, which may be at least one text paragraph.
[0091] In one embodiment, performing semantic feature filtering processing on the text to be processed based on at least one trigger word can include: determining the semantic similarity between each trigger word and other words; when the semantic similarity is greater than or equal to a set threshold, determining other words as similar words of each trigger word; performing semantic feature filtering processing on the text to be processed based on trigger word clusters; the trigger word clusters include each trigger word and each similar word of each trigger word.
[0092] In an embodiment of the present invention, after the trigger word library is determined, the semantic similarity between each trigger word and other words in the trigger word library is determined to determine whether the semantic similarity between each trigger word and other words reaches a set threshold; if the judgment result is yes, the other words are used as similar words of each trigger word; if the judgment result is no, the other words are discarded; after the above judgment, similar words of each trigger word can be obtained.
[0093] For example, when the set threshold of the semantic similarity between the trigger word and other words is 0.8, if it is determined that the semantic similarities between trigger word A and other words B, other words C, other words D, other words E, and other words F are 0.90, 0.86, 0.65, 0.79, and 0.96, respectively, then other words B, other words C, and other words F are regarded as similar words of trigger word A, and other words C and other words D are discarded.
[0094] Exemplarily, the Word2vec tool can be used to determine the semantic similarity between each trigger word and other words, obtain the top K similar words in the trigger word library that are semantically similar to each trigger word, and form a corresponding trigger word cluster, where K is an integer greater than 0.
[0095] In one implementation, if it is determined by setting a threshold that the number of similar words to each trigger word exceeds K, the K similar words with the highest semantic similarity may form a corresponding trigger word cluster with each trigger word.
[0096] For example, when the trigger word is "payment", the three similar words with similar semantics are "expenditure", "payment" and "payment"; when the trigger word is "location", the three similar words with similar semantics are "position", "place" and "address"; when the trigger word is "time", the three similar words with similar semantics are "year", "month" and "day".
[0097] Exemplarily, when the value of K is 2, two similar words with the highest semantic similarity can be selected from the three similar words of trigger word "payment", trigger word "location" and trigger word "time"; the two selected similar words are respectively formed into three trigger word clusters with the three trigger words.
[0098] In one implementation, the number of similar words of each trigger word may be the same or different; after obtaining the similar words of each trigger word, each trigger word and the similar words in the trigger word library form a trigger word cluster.
[0099] In one implementation, filtering the segmented text paragraphs based on the trigger word clusters may include: taking the text paragraphs hit by the trigger word clusters as output, and directly filtering the text paragraphs not hit by the trigger word clusters.
[0100] In one embodiment, whether to filter a text paragraph can be determined based on whether the text paragraph is hit by a trigger word cluster. Since the words in the trigger word cluster are all related to the target information, the above filtering process can filter out text paragraphs that are obviously unrelated to the target information, so that subsequent filtering processes can focus more on the target information based on the output text paragraphs, thereby improving the recognition accuracy of the target information.
[0101] In an embodiment of the present invention, similar words to each trigger word are determined, and each trigger word and similar words to each trigger word form a trigger word cluster; based on the trigger word cluster, the text paragraphs after word segmentation are filtered, which can avoid filtering paragraphs related to target information and improve generalization ability.
[0102] In one embodiment, obtaining a filtering processing result based on the intermediate filtering result may include: using a text classifier to classify the intermediate filtering result to obtain a classification result; the classification result includes at least one type of text information; in the classification result, filtering the text information that does not meet the business requirements to obtain a filtering processing result.
[0103] In an embodiment of the present invention, the intermediate filtering result may be at least one text paragraph, and the at least one text paragraph includes text paragraphs related to the target information and may also include paragraphs unrelated to the target information. A text classifier is required to further filter the intermediate filtering result to obtain a filtering processing result.
[0104] In one embodiment, a text classifier is trained by using a labeled training data set, and the text classifier can represent the relationship between text paragraph features and text paragraph categories. Then, the text classifier is used to perform category judgment on a newly input text paragraph to obtain a category judgment result, and a candidate text paragraph set is output according to the category judgment result. Here, the candidate text paragraph set can represent text paragraphs corresponding to text paragraph categories that meet business requirements.
[0105] Exemplarily, the category of text paragraphs that meet business requirements is marked as "1", and the category of text paragraphs that do not meet business requirements is marked as "0". When 10 text paragraphs are input, the text classifier makes category judgments on these 10 text paragraphs, and 3 of the classification results are marked as "1" and the other 7 are marked as "0". The 3 text paragraphs marked as "1" are output as the candidate text paragraph set, and the other 7 text paragraphs marked as "0" are filtered.
[0106] In an embodiment of the present invention, after filtering the text paragraphs after word segmentation through trigger word clustering, an intermediate filtering result is obtained, and then the intermediate filtering result is further filtered through a text classifier to obtain candidate text paragraphs, and target information is extracted from the obtained candidate text paragraphs; it can be seen that by performing two semantic feature filtering processes on the text to be processed, text paragraphs that are not related to the target information can be filtered out, and more reliable candidate text paragraphs for target information extraction can be obtained.
[0107] For example, when 20 text paragraphs are input, 10 text paragraphs are obtained after filtering through the trigger word cluster set, and these 10 text paragraphs are further filtered through the text classifier to obtain 5 text paragraphs. These 5 text paragraphs are output as a candidate text paragraph set, and target information is extracted from the obtained candidate text paragraphs.
[0108] In one embodiment, sample data of the text are respectively input into N pre-set feature extractors to obtain N features; the N features represent N label prediction results of the sample data, where N is an integer greater than 1; the N label prediction results are processed based on a voting mechanism to obtain labels of the sample data; and a text classifier is trained based on the labels and the sample data.
[0109] In the embodiment of the present invention, the sample data of the text represents data that has not been labeled; the sample data can be set according to the business needs of the user, or the text paragraph input this time can be used as the sample data. Here, the feature extractor for label prediction of the text paragraph input this time can be trained based on the labeled text paragraph input last time as training data; the embodiment of the present invention does not limit the sample data.
[0110] In an embodiment of the present invention, N different feature extractors can be trained through a labeled training data set to obtain N trained feature extractors. Here, the value of N can be set according to the actual application scenario, and the embodiment of the present invention is not limited.
[0111] In one embodiment, unlabeled sample data is input into at least one feature extractor that has been trained. The at least one feature extractor can predict the label of the sample data to obtain at least one label prediction result of the sample data. The at least one label prediction result is processed based on a voting mechanism to obtain a label of the sample data.
[0112] Exemplarily, when three feature extractors are pre-set, three label prediction results can be obtained by inputting one sample data; based on the voting mechanism, it is determined whether the three label prediction results are consistent. If the three label prediction results are consistent, the label is used as the label of the sample data. It can be seen that the label of the sample data is automatically generated by the three feature extractors.
[0113] In one implementation, if the label prediction results of each feature extractor are consistent, the sample data is classified into a category-determined text set, and the text labels are corrected by manual sampling, which can further improve the accuracy of the labels corresponding to the sample data; if the label prediction results are inconsistent, the sample data is added to the category fuzzy text set, and then the sample data is manually labeled. It can be seen that the feature extractor can automatically generate labels for the sample data, greatly reducing the amount of manually labeled data.
[0114] In one implementation, if the label prediction results of each feature extractor are inconsistent and there is a difference in quantity, the majority of category labels are used as the label prediction result of this text paragraph.
[0115] For example, in the case of three feature extractors, for the same sample data, the label prediction result output by feature extractor 1 is 1, the label prediction result output by feature extractor 2 is also 1, and the label prediction result output by feature extractor 3 is 0. Since 1 is the majority in the label prediction results, label 1 is used as the label prediction result of the sample data.
[0116] Exemplarily, in the process of judging the label prediction results based on the voting mechanism, it is also possible to judge according to the corresponding category label probability given by each feature extractor. If the probability of the same label given by the feature extractor is greater than or equal to the set threshold, the sample data is classified into the category-determined text set; if the probability of the same label given by the feature extractor is less than the set threshold, the sample data is added to the category-fuzzy text set.
[0117] Exemplarily, in the case of three feature extractors and a threshold value set to 0.9, for the same sample data, the binary method is used for label prediction, and the probability of feature extractor 1 outputting label 0 is 0.95, and the probability of label 1 is 0.05; the probability of feature extractor 2 outputting label 0 is 0.92, and the probability of label 1 is 0.08; the probability of feature extractor 3 outputting label 0 is 0.90, and the probability of label 1 is 0.10; since the probabilities of feature extractors 1, 2, and 3 outputting label 0 are all greater than or equal to the set threshold value 0.9, it can be determined that the label of the above sample data is 0, and the above sample data is classified into a category-determined text set; if one of the three feature extractors gives a probability of the same label 0 that is less than 0.9, for example, feature extractor 3 outputs a probability of label 0 of 0.50, and a probability of label 1 of 0.50, the sample data is added to the category fuzzy text set.
[0118] In one implementation, the quality of training data directly affects the classification effect of the text classifier. However, high-quality training data requires a lot of manpower, especially for chapter-level data such as contract texts. The diversity of contract text categories has caused a surge in the amount of data with text paragraphs as the basic identification unit. The embodiment of the present invention introduces a voting mechanism to automatically generate training data labels, greatly shortening the update cycle of the text classifier.
[0119] S103: Based on the filtering result, identifying target information of the text to be processed.
[0120] In the embodiment of the present invention, the text classifier can further filter the text paragraphs obtained by filtering based on the trigger word clusters to obtain the text paragraphs containing the target information, and identify the target information of the text to be processed based on the text paragraphs containing the target information.
[0121] In one embodiment, the target information in the text paragraph, such as the name of Party A's organization, the name of Party B's organization, the service location, etc., can be automatically identified through named entity recognition technology, such as Conditional Random Field (CRF)++, Bi-directional Long Short-Term Memory (biLSTM)+CRF, etc. The target information can correspond to at least one target entity, and each target entity corresponds to an entity recognition model.
[0122] In one embodiment, based on the filtering processing results, identifying the target information of the text to be processed can include: marking the target information with a label; when it is determined that there are ambiguous items in the target information, re-determining the label to mark the ambiguous items to obtain the marking results of the ambiguous items; based on the marking results of the ambiguous items, identifying the target information of the text to be processed.
[0123] For example, the target information of the text paragraph can be annotated using the BIOES (B-begin, I-inside, O-outside, E-end, S-single) annotation method, which can clearly mark the left and right boundary positions of the target information. If there are ambiguous items in the target information of the text paragraph, the embodiment of the present invention can define another set of labels to distinguish them. For example, the shelf life is used as the target information, and BW / IW / EW is used to annotate the complete target information, and B-NW / I-NW / E-NW is auxiliary defined to annotate the ambiguous items, as shown in the following example:
[0124] The text paragraph is: 5% quality guarantee, after the project is completed and accepted, there is no quality problem and a quality guarantee letter is issued, all construction costs will be paid (the contract will end after the warranty period of two years). If the following conditions are met, Party A will pay the balance in one lump sum within 10 working days based on the audited value.
[0125] The text paragraph after the marking is: 5% quality guarantee deposit, after the project is completed and accepted, there are no quality issues and a quality guarantee letter is issued to pay all construction costs (the quality guarantee period is two years, and the contract is performed and ended after that). / OIf the following conditions are met, Party A will pay the remaining balance in one lump sum within 10-NW working days according to the audited and determined plan. / O
[0126] Here, / O is used to mark the text information other than the target information in the text paragraph, / BW / EW is used to mark the target information in the text paragraph, and / B-NW / I-NW / E-NW is used to mark the ambiguous items corresponding to the target information in the text paragraph.
[0127] It can be seen that the target information in the text paragraph is "two years", and the ambiguous item corresponding to the target information is "10 working days". By defining different labels BW / IW / EW and B-NW / I-NW / E-NW to distinguish the target information of "shelf life", the impact of ambiguous items on the target information recognition effect can be reduced, and the accuracy of target information recognition can be improved.
[0128] In one implementation, after the target information of the text to be processed is identified, the identified target information and the text paragraph corresponding to the target information are output.
[0129] In the embodiment of the present invention, the target information extraction result based on the business demand of mining the target information can be displayed to the user, and the original contract paragraph information corresponding to the extraction result can be displayed to the user, providing the user with reference information for determining whether the target information extraction result is correct. At the same time, the user can also correct the recognition error field for the background module to conduct feedback learning, so as to further improve the extraction accuracy of the target information.
[0130] The present invention provides a text information mining method, which includes: obtaining a text to be processed; based on the business needs of mining target information, performing semantic feature filtering processing on the text to be processed to obtain a filtering processing result; based on the filtering processing result, identifying the target information of the text to be processed. In this way, the present invention does not need to manually set preset rules and perform maintenance, which effectively reduces operation and maintenance costs; and by filtering the text based on business needs, text paragraphs that are not related to the target information can be filtered, thereby improving the recognition accuracy of the target information.
[0131] Figure 2 Schematic diagram of the network structure of the text classifier textCNN in the present invention, Figure 2 As shown in the figure, the network structure includes an input layer, a convolutional layer, a pooling layer, and an output layer.
[0132] The input layer is used to receive the input text paragraph and construct a word vector for each word in the text paragraph. The purpose is to digitize natural language such as text paragraphs to facilitate subsequent processing.
[0133] For example, the text paragraph "The contract is fulfilled after two years" can be segmented into "two years later / contract / fulfillment / end", and each word can be mapped into a 3-dimensional (the dimension can be specified) word vector through embedding methods such as word2vec or GLOV, for example, "two years later" -> [0 0 0], "contract" -> [0 0 1], "fulfillment" -> [0 1 0], "end" -> [0 00], etc.
[0134] The convolution layer is used to obtain the word vector of each word output by the input layer, and perform a convolution operation on the obtained word vector to obtain a feature map.
[0135] Exemplarily, a 4*3 matrix corresponding to “two years later / contract / fulfillment / end” can be convolved with a convolution kernel of a certain window size, and the output of the convolution operation is called a feature map.
[0136] The pooling layer is used to perform pooling operations on the feature maps output by the convolutional layer to obtain the pooling operation results.
[0137] For example, while maintaining the main features, the pooling layer can greatly reduce the number of parameters, from Figure 2 It can be seen that the feature map changes from 7 dimensions to 1 dimension; the pooling layer can reduce the risk of overfitting. In addition, the pooling layer reduces the parameters and can further speed up the calculation.
[0138] The output layer is used to concatenate the pooling operation results output by the pooling layer, and obtain the probability distribution of each category through the softmax layer processing. The probabilities of different categories are predicted and output based on the probability distribution.
[0139] Exemplarily, the output layer may output the obtained probabilities of each category; for example, the probability of category 1 and the probability of category 0, where the probability of category 1 and the probability of category 0 are both predicted probabilities.
[0140] Since the network structure of textCNN uses only one convolutional layer, the number of network parameters is reduced. Therefore, the feature extractor based on textCNN can quickly complete the training and prediction of the model with high classification accuracy. For chapter-level input data such as text, it improves recognition accuracy while also improving recognition rate.
[0141] In order to better understand the present invention, the process of generating a training data set in an embodiment of the present invention is described below by taking a contract text as an example. Figure 3 A schematic diagram is generated for reducing the manual annotation of the training data set in the present invention, such as Figure 3 As shown in the figure, the sample data to be labeled, such as warranty payment, no quality problems, payment after 2 years, quality deposit, etc., are respectively input into feature extractor 1, feature extractor 2 and feature extractor 3. The three feature extractors predict the labels of the sample data and obtain the label prediction results; the three label prediction results are judged based on the voting mechanism. If two of the three feature extractors give the same label, it means that the category of the sample data is decisionable, and the sample data is classified into a category-determined text set, and the label of the sample data is corrected by auxiliary manual sampling; otherwise, it means that the category of the sample data is undecided, and the sample data is classified into a category-fuzzy text set, and the category of the sample data is manually labeled; the training data set is jointly determined according to the category-determined text set and the category-fuzzy text set. It can be seen that the use of the automatic generation mechanism of text labels can greatly reduce the amount of manually labeled data, and can quickly respond to the iterative update of the model when the sample data of different categories increases, that is, when the contract data of new categories appears, the development cycle of the adaptation model can be shortened.
[0142] Exemplarily, when 10,000 sample data are input to three feature extractors, the label prediction results of the 10,000 sample data are judged based on the voting mechanism. If the categories of 5,000 sample data are decideable, they are classified into a category-determined text set; the categories of the other 5,000 sample data are undecided, they are classified into a category-fuzzy text set, and the categories of these 5,000 sample data are manually labeled. It can be seen that the voting mechanism can reduce the amount of manually labeled data by 50%.
[0143] In order to better understand the present invention, a flowchart of another method for mining contract text information of the present invention is given here. Figure 4 As shown in the figure, the flowchart consists of five parts: input part, shallow semantic parsing part, deep semantic parsing part, entity recognition part, and output part. Figure 4 The functions realized by the various parts shown are used to illustrate the technical solution of the present invention in detail.
[0144] Input part: supports inputting various contract texts stored in Word and PDF formats. If the input contract text format is not HTML, it is stored as HTML format contract text through parsing tools, and performs tag cleaning, text paragraph splicing and other operations.
[0145] Shallow semantic parsing part: takes the output of the input part as input, and inputs it into trigger word library 1, trigger word library 2, ... trigger word library N. The trigger word library of the shallow semantic parsing part is visible to the user, and the user can configure N trigger word libraries according to business needs. This part can also use high-dimensional semantic features to obtain the top K words with similar semantics to each trigger word in the trigger word library to form a corresponding trigger word cluster. For example, the Word2vec tool can be used to determine the top K words with similar semantics to each trigger word. After the input text paragraphs are segmented, the text paragraphs hit by the trigger word cluster are used as output, and the text paragraphs that are not hit are directly filtered. The shallow semantic parsing part can filter out text paragraphs that are obviously irrelevant to the target information, so that the subsequent deep semantic parsing part can focus more on the target information features.
[0146] Deep semantic analysis part: The output after filtering the shallow semantic analysis part is used as input to text classifier 1, text classifier 2, ... text classifier N. The N text classifiers in this part mainly use feature extractors formed by complex neural networks to quickly complete model training and filter out text paragraphs that are irrelevant to the target information. Take the warranty period as an example: the warranty period is defined as the payment time of the last payment, that is, the text paragraph content with this field information must contain payment features and time payment features. For the following two candidate text paragraphs, candidate 1 is not related to the warranty period information, while candidate 2 is related and needs to be retained.
[0147] Option 1: During the warranty period, Party B shall send a person to perform warranty service within 5 days after receiving the warranty notice. If Party B fails to send a person to perform warranty service within the agreed period, Party A shall not return the warranty deposit.
[0148] Option 2: 5% quality guarantee, after the project is completed and accepted, if there are no quality problems and a quality guarantee letter is issued, all construction costs will be paid (the contract will end after the warranty period of two years). If the following conditions are met, Party A will pay the balance in one lump sum within 10 working days based on the audited value.
[0149] Entity recognition part: The output after filtering by the deep semantic analysis part is used as input to entity recognizer 1, entity recognizer 2, ... entity recognizer N. The text paragraph containing the target information obtained after two semantic screenings by the shallow semantic analysis part and the deep semantic analysis part is automatically identified through the named entity recognition technology of N entity recognizers (such as CRF++, biLSTM+CRF, etc.), such as the name of Party A's organization, the name of Party B's organization, the service location and other target information. Each target information corresponds to an entity recognition model. The data annotation can adopt the BIOES annotation method to clearly mark the left and right boundary positions of the target information. For the target information in the text paragraph with ambiguous items, the embodiment of the present invention can define another set of labels for distinction.
[0150] Output part: This part can be used to display the target information identified by N entity recognizers in the entity recognition part to the user. Here, the target information corresponding to the output of entity recognizer 1 is the name of Party A's organization, such as *** Company, etc., the target information corresponding to the output of entity recognizer 2 is the name of Party B's organization, such as *** Design Institute, etc., ... The target information corresponding to the output of entity recognizer N is the service location, such as Suzhou High-tech Zone, etc.; it can be seen that the embodiment of the present invention can use natural language text understanding technology to realize the automatic extraction of target information and display the extraction results. At the same time, the original paragraph information of the contract corresponding to the extraction result can be displayed to the user, providing the user with reference information for determining whether the extraction result of the target information is correct. At the same time, the user can also correct the recognition error field for feedback learning by the background part.
[0151] It should be noted that the contract text is input into the trigger word library i, filtered by the trigger word library i, and an intermediate filtering result is obtained. The intermediate filtering result is input into the text classifier i for further filtering to obtain a filtering result, and the filtering result is input into the entity recognizer i. The entity recognizer i recognizes the target information in the filtering result, and inputs the recognized target information into the output part. Finally, the target information is output through the output part. Wherein, i is an integer greater than or equal to 1 or less than or equal to N.
[0152] Based on the text information mining method proposed in the above-mentioned embodiment, an embodiment of the present invention proposes a text information mining method device.
[0153] Figure 5 FIG. 1 is a schematic diagram of the structure of the text information mining device of the present invention. Figure 5 As shown, the device includes: an acquisition module 500, a filtering module 501 and an identification module 502, wherein:
[0154] An acquisition module 500 is used to acquire the text to be processed;
[0155] The filtering module 501 is used to perform semantic feature filtering processing on the text to be processed based on the business needs of mining target information to obtain filtering processing results;
[0156] The identification module 502 is used to identify the target information of the text to be processed based on the filtering processing result.
[0157] Optionally, the filtering module 501 is used to perform semantic feature filtering processing on the text to be processed based on the business needs of mining target information to obtain filtering processing results, including:
[0158] Acquire at least one trigger word configured according to the business requirement;
[0159] Performing semantic feature filtering processing on the text to be processed based on the at least one trigger word to obtain an intermediate filtering result;
[0160] The filtering result is obtained according to the intermediate filtering result.
[0161] In one implementation, the filtering module 501 is used to perform semantic feature filtering on the text to be processed based on the at least one trigger word, including:
[0162] Determine the semantic similarity between each trigger word and other words;
[0163] When the semantic similarity reaches a set threshold, determining the other words as similar words to each trigger word;
[0164] Based on the trigger word cluster set, the text to be processed is subjected to semantic feature filtering processing; the trigger word cluster set includes each of the trigger words and similar words to each of the trigger words.
[0165] In one implementation, the filtering module 501 is used to obtain a filtering result according to the intermediate filtering result, including:
[0166] Using a text classifier to classify the intermediate filtering result to obtain a classification result; the classification result includes at least one type of text information;
[0167] In the classification results, text information that does not meet the business requirements is filtered to obtain the filtering processing results.
[0168] In one embodiment, the apparatus further includes a training module 503, wherein the training module 503 is configured to:
[0169] Inputting the sample data of the text into N pre-set feature extractors respectively to obtain N features; the N features represent N label prediction results of the sample data, where N is an integer greater than 1;
[0170] Processing the N label prediction results based on a voting mechanism to obtain a label for the sample data;
[0171] The text classifier is trained based on the label and the sample data.
[0172] In one implementation, the identification module 502, used to identify the target information of the text to be processed based on the filtering processing result, includes:
[0173] Using labels to mark the target information;
[0174] In the case where it is determined that the target information has an ambiguous item, a label is re-determined to mark the ambiguous item, so as to obtain a marking result of the ambiguous item;
[0175] Based on the marking results of the ambiguous terms, target information of the text to be processed is identified.
[0176] In practical applications, the acquisition module 500, filtering module 501, identification module 502, and training module 503 can all be implemented by a processor located in an electronic device, and the processor can be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor.
[0177] In addition, each functional module in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or software functional modules.
[0178] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or the part that contributes to the relevant technology or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method of this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc. Various media that can store program codes.
[0179] Specifically, the computer program instructions corresponding to a text information mining method in this embodiment can be stored on a storage medium such as a CD, a hard disk, or a USB flash drive. When the computer program instructions corresponding to a text information mining method in the storage medium are read or executed by an electronic device, any text information mining method in the aforementioned embodiments is implemented.
[0180] Based on the same technical concept as the above embodiments, see Figure 6 , which shows an electronic device 600 provided by the present invention, which may include: a memory 601 and a processor 602; wherein,
[0181] Memory 601, used for storing computer programs and data;
[0182] The processor 602 is configured to execute a computer program stored in the memory to implement any one of the text information mining methods in the foregoing embodiments.
[0183] In practical applications, the memory 601 may be a volatile memory, such as RAM; or a non-volatile memory, such as ROM, flash memory, hard disk drive (HDD) or solid-state drive (SSD); or a combination of the above types of memory, and provide instructions and data to the processor 602.
[0184] The processor 602 may be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor. It is understandable that for different augmented reality cloud platforms, the electronic device used to implement the processor function may also be other, which is not specifically limited in the embodiment of the present invention.
[0185] In some embodiments, the functions or modules included in the apparatus provided in the embodiments of the present invention can be used to execute the method described in the above method embodiment. The specific implementation can refer to the description of the above method embodiment. For the sake of brevity, it will not be repeated here.
[0186] The above description of the various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other. For the sake of brevity, this article will not repeat them.
[0187] The methods disclosed in the various method embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method embodiments.
[0188] The features disclosed in the various product embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new product embodiments.
[0189] The features disclosed in the various method or device embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0190] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0191] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0192] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0193] The above are only preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention.
Claims
1. A text information mining method, characterized in that: The method comprises: Get the text to be processed; Based on the business needs of mining target information, the text to be processed is subjected to semantic feature filtering to obtain filtering results; Based on the filtering result, identifying target information of the text to be processed; The process of performing semantic feature filtering on the text to be processed based on the business needs of mining target information to obtain filtering results includes: Acquire at least one trigger word configured according to the business requirement; Based on the semantic similarity between each trigger word in the at least one trigger word and other words, performing semantic feature filtering processing on the text to be processed to obtain an intermediate filtering result; The filtering result is obtained according to the intermediate filtering result.
2. The method according to claim 1, characterized in that The performing semantic feature filtering processing on the text to be processed based on the semantic similarity between each trigger word in the at least one trigger word and other words includes: When the semantic similarity reaches a set threshold, determining the other words as similar words to each trigger word; Based on the trigger word cluster set, the text to be processed is subjected to semantic feature filtering processing; the trigger word cluster set includes each of the trigger words and similar words to each of the trigger words.
3. The method according to claim 1, characterized in that The step of obtaining a filtering result according to the intermediate filtering result includes: Using a text classifier to classify the intermediate filtering result to obtain a classification result; the classification result includes at least one type of text information; In the classification results, text information that does not meet the business requirements is filtered to obtain the filtering processing results.
4. The method according to claim 3, characterized in that The method further comprises: Inputting the sample data of the text into N pre-set feature extractors respectively to obtain N features; the N features represent N label prediction results of the sample data, where N is an integer greater than 1; Processing the N label prediction results based on a voting mechanism to obtain a label for the sample data; The text classifier is trained based on the label and the sample data.
5. The method according to claim 1, characterized in that The step of identifying target information of the text to be processed based on the filtering result includes: Using labels to mark the target information; In the case where it is determined that the target information has an ambiguous item, a label is re-determined to mark the ambiguous item, so as to obtain a marking result of the ambiguous item; Based on the marking results of the ambiguous terms, target information of the text to be processed is identified.
6. A text information mining device, characterized in that: The device comprises: An acquisition module is used to obtain the text to be processed; A filtering module is used to perform semantic feature filtering processing on the text to be processed based on the business needs of mining target information to obtain a filtering processing result; the semantic feature filtering processing on the text to be processed based on the business needs of mining target information to obtain a filtering processing result includes: obtaining at least one trigger word configured according to the business needs; performing semantic feature filtering processing on the text to be processed based on the semantic similarity between each trigger word in the at least one trigger word and other words to obtain an intermediate filtering result; obtaining the filtering processing result based on the intermediate filtering result; The identification module is used to identify the target information of the text to be processed based on the filtering processing result.
7. An electronic device, characterized in that: The device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the method according to any one of claims 1 to 5 is implemented when the processor executes the program.
8. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Informative text filter method and system
CN104216876A
Data mining method
EP3082051A1