A method, system and storage medium for tuning a text relevance identification model

By combining data preprocessing of the TD-LSTM model with the GBDT machine learning model, the accuracy problem in text relevance judgment is solved, achieving higher model judgment ability and accuracy.

CN115374785BActive Publication Date: 2025-12-19BEIJING ZHIHUI XINGGUANG INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211016261.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-24
Publication Date
2025-12-19
Estimated Expiration
2042-08-24

AI Technical Summary

Technical Problem

Existing TD-LSTM models have low accuracy in text relevance assessment, and suffer from problems such as weak text encoding capabilities, large differences in sentence length after segmentation, and noise affecting the model's judgment ability.

Method used

The input text is segmented using data preprocessing rules, and the segmented text is then fed into the TD-LSTM model. Combined with the GBDT machine learning model, the relevance scores of entity words are obtained, and the final entity relevance is calculated using literal matching information and distribution rule information.

Benefits of technology

The accuracy of the text relevance model was improved by enhancing its judgment ability through improved rules and information fusion methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115374785B_ABST
    Figure CN115374785B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of network model, and particularly relates to a kind of text correlation identification model optimization method, system and storage medium.The present application first according to data preprocessing rule is split to input text, and the text after splitting is input to TD-LSTM model, obtains the correlation score A of entity word in input text, simultaneously, literal matching information and the distribution rule information of entity in text are input into machine learning model GBDT, and the correlation score B of entity word in input text is obtained, finally, according to correlation score A, correlation score B and preset processing rule, the final result of entity correlation degree is calculated, the present application changes the rule input to TD-LSTM model, when entity word appears more than or equal to once, the entity word position in the middle is selected as far as possible, and literal matching information and the distribution rule information of entity in text are provided, the accuracy of judging text correlation model method is improved by analysis.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of network model, and particularly relates to a text relevance identification model optimization method and system and a storage medium. BACKGROUND

[0002] The text relevance task is a task for judging the relevance degree of an entity mentioned in a text and the text itself, that is, inputting a text, for example: "XX family new high-protein skimmed milk powder, not sweet but very good to drink healthy food to drink out of health", the input entity word is "XX", and the task judgment result is that the entity word "XX" is a strong related entity of the input text "XX family new high-protein skimmed milk powder, not sweet but very good to drink healthy food to drink out of health".

[0003] The mainstream model for encoding a text sequence and performing binary classification in the prior art is an LSTM neural network model. However, when the LSTM neural network model is used to model the classification of a text sequence, there is a problem of weak text encoding capability. Therefore, a TD-LSTM model is used as an upgraded version of the LSTM to model the text relevance task, capture the context features of the target entity word, and perform classification. Please refer to Figure 1 , Figure 1 is a model structure diagram of the LSTM and TD-LSTM.

[0004] The input text is "This has to think about why there has been no breakthrough in packaging technology for so many years", in order to adapt the text to the input form of the model, the text needs to be processed, and the processed text is represented in the TD-LSTM model structure diagram as: "XX" as target word (when the entity word appears multiple times in the text, the first occurrence of the entity word is used as target word), "This has to think about XX" is input into LSTM-L, and "XX for so many years why there has been no breakthrough in packaging technology" is input into LSTM-R. Finally, the outputs of LSTM-L and LSTM-R are vector spliced as the input of softmax for relevance prediction.

[0005] The use of the TD-LSTM model for text relevance prediction has the following disadvantages:

[0006] 1. The input text is divided using the position of the entity word, and when the target entity word targetword appears multiple times in the text, if the first occurrence of the entity word is used as target word, the length difference of the two small sentences after division will be too large, and the sequence encoding advantage of the TD-LSTM model cannot be fully played.

[0007] 2. When using the target word to segment the input text into sentences, the segmentation is performed directly on the basis of the whole text. The sentences after segmentation are used as input to the model. At this time, the left and right sentences will contain a lot of noise information, which will reduce the model's judgment ability. Summary of the Invention

[0008] In view of this, the purpose of this invention is to provide a method, system and storage medium for optimizing a text relevance recognition model, so as to solve the problem that the accuracy of judging text relevance using the TD-LSTM model in the prior art is not high.

[0009] According to a first aspect of the present invention, a method for optimizing a text relevance recognition model is provided, comprising:

[0010] The input text is segmented and filtered according to the data preprocessing rules, and the filtered text is input into the TD-LSTM model to obtain the relevance score A of the entity words in the input text.

[0011] The literal matching information of the text and the distribution rules of entities in the text are input into the machine learning model GBDT to obtain the relevance score B of the entity words in the input text.

[0012] Based on the relevance score A, the relevance score B, and the preset processing rules, the final result of the entity relevance degree is calculated.

[0013] Preferably, the step of segmenting and filtering the input text according to data preprocessing rules includes:

[0014] The input text is segmented based on delimiters, and the five sentences containing the longest entity words are selected.

[0015] Alternatively, the three sentences containing the longest entity words;

[0016] Alternatively, the first and last sentences of a sentence and the sentence containing the longest entity word;

[0017] Alternatively, the first and last sentences containing entity words, and the longest sentence containing entity words excluding the first and last sentences.

[0018] Preferably, the method further includes:

[0019] When the number of entries containing entity clauses is less than the number of entries in the data preprocessing rules, the largest clause that meets the conditions is selected.

[0020] Preferably, when an entity appears at least once in the input text, the middle entity word position is selected to segment the input text.

[0021] Preferably, the literal matching information of the text includes:

[0022] 5.1 Entity word frequency;

[0023] 5.2 Total word count;

[0024] 5.3 Entity word frequency / total word count;

[0025] 5.4 Whether the entity word is in the title.

[0026] Preferably, the distribution rule information of the entity in the text includes:

[0027] 6.1 Offset of the first occurrence of the entity word relative to the first word in the input text;

[0028] 6.2 Offset of the first occurrence of the entity word relative to the last word in the input text;

[0029] 6.3 Offset of the last occurrence of the entity word relative to the first word in the input text;

[0030] 6.4 Offset of the last occurrence of the entity word relative to the last word in the input text;

[0031] 6.5 Interval between the last occurrence and the first occurrence of the entity word;

[0032] 6.6 Average interval when the entity word occurs multiple times;

[0033] 6.7 Average value of the offset of the actual position of the entity word from the average interval.

[0034] Preferably, the method includes:

[0035] The final result of the entity relevance degree is obtained according to the correlation score A, the correlation score B, and a preset processing rule, and includes:

[0036] The correlation score A and the correlation score B are added and then divided by 2 to obtain the entity relevance degree C.

[0037] Preferably, if the entity relevance degree C is greater than 0.5, the entity word is a strong relevant entity for the input text.

[0038] If the entity relevance degree C is less than or equal to 0.5, the entity word is a weak relevant entity for the input text.

[0039] According to a second aspect of an embodiment of the present application, a tuning system of a text relevance identification model is provided, and includes:

[0040] The segmentation module is configured to segment the input text according to a data preprocessing rule, and input the segmented text into a TD-LSTM model to obtain a relevance score A of the entity word in the input text.

[0041] The input module is configured to input the literal matching information of the text and the distribution rule information of the entity in the text into a machine learning model GBDT to obtain a relevance score B of the entity word in the input text.

[0042] The calculation module is configured to calculate a final result of the entity relevance degree according to the relevance score A, the relevance score B and a preset processing rule.

[0043] According to a third aspect of the embodiments of the present application, a computer readable storage medium is provided, which stores an erasable computer program.

[0044] When the computer program runs on the computer device, the computer device is caused to execute the method described above.

[0045] The technical solution provided by the embodiments of the present application can have the following beneficial effects:

[0046] The present application firstly segments the input text according to a data preprocessing rule, and inputs the segmented text into a TD-LSTM model to obtain a relevance score A of the entity word in the input text, simultaneously, inputs the literal matching information of the text and the distribution rule information of the entity in the text into a machine learning model GBDT to obtain a relevance score B of the entity word in the input text, and finally, calculates a final result of the entity relevance degree according to the relevance score A, the relevance score B and a preset processing rule. The present application changes the rule input into the TD-LSTM model, selects the entity word position as much as possible in the middle when the entity word appears more than or equal to once, and provides the literal matching information of the text and the distribution rule information of the entity in the text, thereby improving the accuracy of the text relevance model method through analysis.

[0047] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS

[0048] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present application and, together with the specification, serve to explain the principles of the present application.

[0049] Figure 1 is a model structure diagram of LSTM and TD-LSTM;

[0050] Figure 2is a flow chart of a tuning method of a text relevance identification model according to an example embodiment;

[0051] Figure 3 is a length statistical chart of screening out five longest sentences containing entities according to an example embodiment;

[0052] Figure 4 is a length statistical chart of screening out three longest sentences containing entities according to an example embodiment;

[0053] Figure 5 is a length statistical chart of screening out the longest sentence containing the subject and the ordinary first and last sentences according to an example embodiment;

[0054] Figure 6 is a length statistical chart of screening out the longest sentence containing the subject and the first and last sentences containing the subject except the first and last sentences according to an example embodiment;

[0055] Figure 7 is a 6.1-6.4 illustration schematic according to an example embodiment;

[0056] Figure 8 is a 6.5 illustration schematic according to an example embodiment;

[0057] Figure 9 is a whole work flow chart of a tuning method of a text relevance identification model according to an example embodiment;

[0058] Figure 10 is a schematic block diagram of a tuning system of a text relevance identification model according to an example embodiment. DETAILED DESCRIPTION

[0059] The example embodiments will be described in detail herein with reference to the attached drawings. When the description below refers to attaching, connecting, or coupling, it is understood that the attachment, connection, or coupling can be direct or indirect. The description below refers to the accompanying drawings, which use the same numbers to identify similar or like elements. The embodiments described in the example embodiments below do not represent all the implementations consistent with the present disclosure. Instead, they are merely examples of apparatuses and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0060] Embodiment One

[0061] Please refer to Figure 2 , Figure 2 is a flow chart of a tuning method of a text relevance identification model according to an example embodiment, as shown in Figure 1 , the method comprises:

[0062] Step S11, according to the data preprocessing rule, the input text is segmented and screened, and the screened text is input into the TD-LSTM model to obtain the relevance score A of the entity word in the input text.

[0063] Step S12, the literal matching information of the text and the distribution rule information of the entity in the text are input into the machine learning model GBDT to obtain the relevance score B of the entity word in the input text.

[0064] Step S13, according to the relevance score A, the relevance score B and the preset processing rule, the final result of the entity relevance degree is calculated.

[0065] It can be understood that the technical scheme provided by the embodiment first segments the input text according to the data preprocessing rule, and inputs the segmented text into the TD-LSTM model to obtain the relevance score A of the entity word in the input text. At the same time, the literal matching information of the text and the distribution rule information of the entity in the text are input into the machine learning model GBDT to obtain the relevance score B of the entity word in the input text. Finally, according to the relevance score A, the relevance score B and the preset processing rule, the final result of the entity relevance degree is calculated. The present application changes the rule input into the TD-LSTM model. When the entity word appears more than or equal to once, the entity word position in the middle is selected as much as possible, and the literal matching information of the text and the distribution rule information of the entity in the text are provided. Through analysis, the accuracy of the text relevance model method is improved.

[0066] In specific practice, the "segmenting and screening the input text according to the data preprocessing rule" in step S11 has multiple implementation ways, which can be:

[0067] According to the separator, the input text is segmented and the five sentences containing the longest entity word are screened out;

[0068] Or, the three sentences containing the longest entity word;

[0069] Or, the normal first and last sentences and the sentence containing the longest entity word;

[0070] Or, the first and last sentences containing the entity word and the longest sentence containing the entity word except the first and last sentences.

[0071] Also includes:

[0072] When the number of entity-containing clauses is less than the number in the data preprocessing rule, the maximum clause that meets the condition is taken.

[0073] It should be noted that the feature distribution of the relevance of the entity word and the text in the input text is relatively sparse, and most of the entity relevance feature distribution is around the entity word, that is, the relevance feature is usually close to the entity word. Based on the above findings and assumptions, we carried out a variety of rule processing experiments on the input text, and used a variety of rule-processed texts for model training to take the better processing rule. First, the input text is divided according to the separator, which can be a comma, a period, an exclamation point, etc. After cutting, the five sentences containing the longest entity words are selected, or the three sentences containing the longest entity words are selected, or the ordinary first and last sentences and the longest sentence containing the entity word are selected, or the first and last sentences containing the entity word and the longest sentence containing the entity word except the first and last sentences are selected. Among them, after cutting the input text, if the entity word appears 20 times, the five sentences containing the longest entity word can be understood as containing the sentence of the entity word, and the sentence length is ranked in the top 5.

[0074] It should be noted that the input text is divided using the target word, and the cut sub-sentence is input into the TD-LSTM model, wherein the position of the target word is changed from the position of the first occurrence of the existing entity word to the position of the entity word as much as possible in the middle when the entity word appears more than or equal to the first time. Among them, the selected entity word target word = (entity word hit times + 1) ÷ 2.

[0075] It should be noted that the "selected entity target word" refers to: in the input text, from the left of the text to the right, the string matching of the target entity word is performed, the hit position sequence of the entity word is formed, and in a certain input text, the entity word "AB" appears twice, the hit position sequence is: (19, 20) and (61, 62), the integer "19" is the position of the character "A" in the input text, and the integer "20" is the position of the character "B" in the input text. The position of the first word of the text is 0, and the first four words of the text correspond to "(0, 1, 2, 3)". Therefore, the selected entity target word = (AB entity word hit times + 1) ÷ 2 = (2 + 1) ÷ 2 = 1, that is, in the hit position sequence, the first hit sequence position (19, 20) is used as the entity target word for cutting the input text.

[0076] Therefore, we carried out relevant statistics on the real business with a data size of 50,000, and obtained the following data:

[0077] Table 1 Length statistics of sub-sentence selected using "five sentences containing the longest entity word"

[0078]

[0079] Table 2 Length statistics of clauses filtered by "containing entity words longest 3 sentences"

[0080]

[0081] Table 3 Length statistics of clauses filtered by "containing entity words first and last sentences and containing entity words longest one sentence except first and last sentences"

[0082]

[0083] Table 4 Length statistics of clauses filtered by "normal first and last sentences + containing entity words longest one sentence"

[0084]

[0085] In the table, the left column represents the clause on the left side of the target word, i.e., the left clause; the right column represents the clause on the right side of the target word, i.e., the right clause. Each row in the table represents a statistical indicator. From top to bottom, the left column is an example of:

[0086] 1. The number of words in all left clauses of the input text.

[0087] 2. The average number of words in all left clauses of the input text.

[0088] 3. The standard deviation of the number of words in all left clauses of the input text.

[0089] 4. The minimum number of words in all left clauses of the input text.

[0090] 5. The 25th percentile of the number of words in all left clauses of the input text.

[0091] 6. The 50th percentile of the number of words in all left clauses of the input text.

[0092] 7. The 75th percentile of the number of words in all left clauses of the input text.

[0093] 8. The maximum number of words in all left clauses of the input text.

[0094] Based on the data pre-processing rules, we conducted model tuning experiments on the TD-LSTM model. The main parameters of the model involved include: lr-learning rate, l2reg-regular term, dropout-random inactivation rate, batch_size-batch size, hidden_dim-lstm hidden layer size, max_seq_len-lstm sequence maximum length. The results are as follows: Figures 3-6As shown in the results, after fine-tuning the parameters, the data preprocessing rule of "containing entity words longest five sentences" can obtain better model effect.

[0095] In specific practice, the "literal matching information of the text" in step S12 can have various implementation manners, and specifically is:

[0096] 5.1 Entity word frequency;

[0097] 5.2 Total number of words;

[0098] 5.3 Entity word frequency / total number of words;

[0099] 5.4 Whether the entity word is in the title.

[0100] It should be noted that 5.1 represents the number of times the entity word hits in the input text; 5.2 represents the total number of words after tokenization (currently using jieba tokenization) of the input text; 5.3 represents the result of using 5.1 divided by 6.2 as the result of 5.3; 5.4 represents whether the current entity word appears in the title of the input text, if it exists, it is 1, and if it does not exist, it is 0.

[0101] In specific practice, the "entity distribution rule information in the text" in step S12 can have various implementation manners, and specifically is:

[0102] 6.1 The offset of the first occurrence of the entity word relative to the first word in the input text;

[0103] 6.2 The offset of the first occurrence of the entity word relative to the last word in the input text;

[0104] 6.3 The offset of the last occurrence of the entity word relative to the first word in the input text;

[0105] 6.4 The offset of the last occurrence of the entity word relative to the last word in the input text;

[0106] 6.5 The interval between the last occurrence and the first occurrence of the entity word;

[0107] 6.6 The average interval when the entity word appears multiple times;

[0108] 6.7 The average value of the offset of the actual position of the entity word from the average interval.

[0109] It should be noted that for ease of understanding, please refer to Figures 7-86.1 represents the offset between the first entity word in the entity hit position sequence and the first word in all the segmented result sequences in 5.2; 6.2 represents the offset between the first entity word in the entity hit position sequence and the last word in all the segmented result sequences in 5.2; 6.3 represents the offset between the last entity word in the entity hit position sequence and the first word in all the segmented result sequences in 5.2; 6.4 represents the offset between the last entity word in the entity hit position sequence and the last word in all the segmented result sequences in 5.2; 6.5 represents the offset between the last entity word in the entity hit position sequence and the first entity word in the entity hit position sequence; 6.6 represents the result of the offset between the last entity word in the entity hit position sequence and the first entity word in the entity hit position sequence divided by the length of the entity hit position sequence minus one, for details, please refer to Figure 8 The calculation formula is: (7-2) / (3-1)=2.5, where 3 is the number of entity words, 2 and 7 are the positions of the entity words; 6.7 represents a sequence X composed of the positions of the entity words other than the last entity word, and a sequence Y composed of the results of adding 6.6 to the position of each entity word, respectively, the difference between the sequence X and the sequence Y is calculated, and the sum of all the difference values is taken as the result of 6.7, for details, please refer to Figure 8 The calculation formula is: 4-(2+2.5)=-0.5, 4 is the position of the entity word other than the last entity word, such as the position of the second entity word in the figure; 2 is the result of adding 6.6 to the position of each entity word, such as the position of the first entity word in the figure; 2.5 is the result of 6.6.

[0110] The output result of the input rule based on the text literal matching information and the distribution rule information of the entity in the text is shown in Table 5. And input this result into the machine learning model GBDT to get the relevance score B of the entity word in the input text.

[0111] Table 5 Output result

[0112]

[0113] In specific practice, the step S13 "calculating the final result of the entity relevance degree according to the relevance score A, the relevance score B and the preset processing rule" can have various implementation manners, one of which can be:

[0114] The relevance score A and the relevance score B are added and then divided by 2 to obtain the entity relevance degree C.

[0115] In a specific implementation, if the entity correlation degree C is greater than 0.5, the entity word is a strong related entity for the input text.

[0116] If the entity correlation degree C is less than or equal to 0.5, the entity word is a weak related entity for the input text.

[0117] It should be noted that the sum of the correlation score A based on the TD-LSTM model and the entity correlation score B based on the rule and machine learning model GBDT is divided by 2, and the quotient is C. We take C as the final threshold for judging the degree of entity correlation, and currently we take 0.5 as the judgment threshold. The specific judgment method is that if C is greater than 0.5, the entity is a strong related entity for the input text, and weak C is less than or equal to 0.5, the entity is a weak related entity for the input text.

[0118] It should be noted that when the input text and its contained entity word are input into this scheme system (we call this system EntityCorrelation_Ensemble, abbreviated as ECE), the system will pass through two independent entity correlation judgment models, and after the two entity correlation models output the correlation results, the two results are calculated and fused, and the threshold is used to determine the correlation result of the entity for the input text. Finally, ECE will output one of the "strong correlation" and "weak correlation" results.

[0119] Table: Based on our same self-built test set, the "precision", "recall" and "F1-score" of the entity and input text correlation judgment of each key iteration node in the optimization path of the system are tested.

[0120] Table 6 Test set

[0121]

[0122] Through testing, it can be obtained that the final version of EntityCorrelation_Ensemble in our entity correlation task has achieved the best results in all evaluation indicators.

[0123] It should be noted that please refer to Figure 9 , Figure 9It is a kind of text relevance identification model tuning method overall workflow diagram shown in an exemplary embodiment, the present application first according to data preprocessing rule is split to input text, and the text after cutting is input to TD-LSTM model, the correlation score A of entity word in input text is obtained, simultaneously, the literal matching information of text and the distribution rule information of entity in text are input into machine learning model GBDT, and the correlation score B of entity word in input text is obtained, finally, according to the correlation score A, the correlation score B and preset processing rule, the final result of entity correlation degree is calculated, the present application changes the rule input to TD-LSTM model, when entity word appears more than or equal to once, the entity word position in the middle is selected as far as possible, and the literal matching information of text and the distribution rule information of entity in text are provided, the accuracy of the judgment text relevance model method is improved by analysis.

[0124] Embodiment two

[0125] Please refer to Figure 10 , Figure 10 It is a kind of text relevance identification model tuning system 900 schematic block diagram shown in an exemplary embodiment, as shown in Figure Figure 10 The text relevance identification model tuning system 900 includes:

[0126] The cutting module 901 is used for cutting and screening input text according to data preprocessing rule, and the text after screening is input to TD-LSTM model, and the correlation score A of entity word in input text is obtained;

[0127] The input module 902 is used for inputting the literal matching information of text and the distribution rule information of entity in text into machine learning model GBDT, and obtaining the correlation score B of entity word in input text;

[0128] The calculation module 903 is used for calculating the final result of entity correlation degree according to the correlation score A, the correlation score B and preset processing rule.

[0129] It should be noted that the implementation mode of each module of the present embodiment can be understood by referring to the related introduction in embodiment one, and the present embodiment will not be repeated.

[0130] It can be understood that the technical scheme provided by the embodiment, the input module 902 splits the input text according to the data preprocessing rule, and inputs the split text into the TD-LSTM model to obtain the relevance score A of the entity word in the input text, the input module 902 inputs the literal matching information of the text and the distribution rule information of the entity in the text into the machine learning model GBDT to obtain the relevance score B of the entity word in the input text, and the calculation module 903 calculates the final result of the entity relevance degree according to the relevance score A, the relevance score B and the preset processing rule. The application changes the rule input into the TD-LSTM model, selects the entity word position as much as possible in the middle when the entity word appears more than or equal to once, and provides the literal matching information of the text and the distribution rule information of the entity in the text. Through analysis, the accuracy of the text relevance judgment model method is improved.

[0131] Embodiment three

[0132] According to an exemplary embodiment, a computer readable storage medium is shown, and a computer program is stored on the computer readable storage medium.

[0133] When the computer program runs on the computer device, the computer device executes the optimization method of the text relevance identification model.

[0134] The computer readable storage medium disclosed by the embodiment includes but is not limited to: an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device or component, or any combination of the above. More specific examples (non-exhaustive list) of computer readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In the present application, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or component.

[0135] It should be noted that the implementation mode and beneficial effects of each module of the embodiment can be referred to the related introduction in embodiment one, and the embodiment will not be repeated.

[0136] It can be understood that the same or similar parts in each of the above embodiments can be mutually referred to, and the contents not described in detail in some embodiments can be referred to the same or similar contents in other embodiments.

[0137] Any procedural or methodological descriptions in flow charts or otherwise described herein can be understood to represent modules, segments, or portions of code that include executable instructions for implementing the specific logical functions or steps, and the scope of preferred embodiments of the present application includes additional implementations in which the functions are performed in a different order, including substantially simultaneously, or in reverse order, as will be understood by those skilled in the art to which embodiments of the present application pertain.

[0138] It should be understood that portions of the present application can be realized with hardware, software, firmware or a combination thereof. In the above embodiments, a number of steps or methods can be realized as software or firmware to be executed by a suitable instruction-executing system and stored in a storage medium. For example, if realized with hardware, as in another embodiment, it can be realized with any one or a combination of the following technologies known in the art: discrete logic circuit having logic gates for implementing logic functions on data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), etc.

[0139] Those skilled in the art can understand that all or part of the steps carried out by the above-mentioned embodiments can be instructed by a program to complete the relevant hardware, and the program can be stored in a computer readable storage medium. When the program is executed, it includes one of the steps of the method embodiment or a combination thereof.

[0140] In addition, each functional unit in each embodiment of the present application can be integrated into one processing module, or each unit can exist physically, or two or more units can be integrated into one module. The above-mentioned integrated module can be realized in the form of hardware or in the form of a software function module. When the integrated module is realized in the form of a software function module and sold or used as an independent product, it can also be stored in a computer readable storage medium.

[0141] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0142] In the description of the present specification, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example" or "some examples" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0143] Although the embodiments of the present application have been shown and described above, it is understood that the above-described embodiments are exemplary and are not to be construed as limiting the present application, and that variations, modifications, substitutions and changes can be made by those skilled in the art without departing from the scope of the present application.

Claims

1. A method for optimizing a text relevance recognition model, characterized in that, The method comprises the following steps: According to the data preprocessing rule, the input text is segmented and filtered, and the filtered text is input into the TD-LSTM model to obtain the relevance score A of the entity word in the input text; The literal matching information of the text and the distribution rule information of the entity in the text are input into the machine learning model GBDT to obtain the relevance score B of the entity word in the input text; According to the relevance score A, the relevance score B and the preset processing rule, the final result of the entity relevance degree is calculated; According to the data preprocessing rule, the input text is segmented, including: when the entity word appears more than or equal to once in the input text, the string matching of the entity word is performed from the left to the right of the text to obtain the entity word hit position sequence; the input text is segmented by selecting the entity word hit position at the Xth position in the entity word hit position sequence; X is the result of the entity word hit frequency plus 1 and 2 divided by the integer; The literal matching information of the text includes: entity word frequency; total word number; entity word frequency / total word number; whether the entity word is in the title; The distribution rule information of the entity in the text includes: The offset of the first occurrence of the entity word relative to the first word in the input text; The offset of the first occurrence of the entity word relative to the last word in the input text; The offset of the last occurrence of the entity word relative to the first word in the input text; The offset of the last occurrence of the entity word relative to the last word in the input text; The interval between the last occurrence of the entity word and the first occurrence of the entity word; the interval is the offset of the last occurrence of the entity word relative to the first occurrence of the entity word; The average interval when the entity word appears multiple times; the average interval is (the offset of the last occurrence of the entity word relative to the first occurrence of the entity word) / (the length of the entity word hit position sequence minus one), wherein / represents division.

2. The method of claim 1, wherein, The segmentation and filtering of the input text according to the data preprocessing rule comprises: Segmenting the input text according to the delimiter and filtering out the five sentences containing the longest entity word; Or, the three sentences containing the longest entity word; Or, the ordinary first and last sentences and the sentence containing the longest entity word; Or, the first and last sentences containing the entity word and the longest sentence containing the entity word except the first and last sentences.

3. The method of claim 2, wherein, Further comprising: When the number of entity-containing clauses is less than the number in the data preprocessing rule, the maximum clause that meets the condition is taken.

4. The method of claim 1, wherein, The final result of the entity relevance degree is obtained according to the relevance score A, the relevance score B and the preset processing rule, including: Add the relevance score A and the relevance score B and divide by 2 to obtain the entity relevance degree C.

5. The method of claim 4, wherein, Including: If the entity relevance degree C is greater than 0.5, the entity word is a strongly related entity for the input text; If the entity relevance degree C is less than or equal to 0.5, the entity word is a weakly related entity for the input text. 6.A system for tuning a text relevance identification model, the system comprising: Including: The segmentation module is configured to segment and filter the input text according to a data preprocessing rule, and input the filtered text into a TD-LSTM model to obtain a relevance score A of the entity word in the input text. The segmentation of the input text according to the data preprocessing rule comprises: when the entity word appears in the input text more than or equal to once, string matching of the entity word is performed from the left to the right of the input text to obtain a sequence of hit positions of the entity word; and the input text is segmented by selecting the hit position of the entity word at the Xth position in the sequence of hit positions of the entity word; X is the result of the hit frequency of the entity word plus one divided by two. The literal matching information of the text comprises: a word frequency of the entity word; a word count of the text; the word frequency of the entity word / the word count of the text; and whether the entity word is in a title; The distribution rule information of the entity in the text comprises: an offset of the first occurrence of the entity word relative to the first word in the input text; an offset of the first occurrence of the entity word relative to the last word in the input text; an offset of the last occurrence of the entity word relative to the first word in the input text; an offset of the last occurrence of the entity word relative to the last word in the input text; an interval between the first occurrence and the last occurrence of the entity word; the interval is an offset of the last occurrence of the entity word relative to the first occurrence of the entity word; an average interval when the entity word occurs multiple times; the average interval is (an offset of the last occurrence of the entity word relative to the first occurrence of the entity word) / (a length of the sequence of hit positions of the entity word minus one), wherein / represents division; The input module is configured to input the literal matching information of the text and the distribution rule information of the entity in the text into a machine learning model GBDT to obtain a relevance score B of the entity word in the input text. The calculation module is configured to calculate a final result of the relevance degree of the entity according to the relevance score A, the relevance score B, and a preset processing rule.

7. A computer readable storage medium characterized in that, The computer program is stored on the computer device and is executable on the computer device. When the computer program runs on the computer device, the computer device is caused to perform the method of any one of claims 1-5.