Construction method of text semantic matching model adaptive to vertical field

By constructing effective keyword groups and calculating hit vectors in vertical domains, and combining them with artificial intelligence model training, the problems of word expression differences and length differences in text semantic matching models are solved, achieving efficient text semantic matching and ranking.

CN121859908APending Publication Date: 2026-04-14JIANGSU SUPERVISION BUREAU OF THE STATE FINANCIAL SUPERVISION & ADMINISTRATION BUREAU +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-26
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing text semantic matching models cannot effectively identify words with the same meaning but different expressions, and cannot solve the asymmetric matching problem when there are large differences in text length.

Method used

We construct effective keyword groups for vertical fields, obtain high-frequency word groups through natural language segmentation and multi-expert screening, and optimize keyword groups to improve model accuracy by combining hit vector calculation and artificial intelligence model training.

Benefits of technology

It enables the recognition of words with different expressions but the same meaning, and can effectively handle asymmetric matching with large differences in text length, thus improving the efficiency and accuracy of automated recognition and sorting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121859908A_ABST
    Figure CN121859908A_ABST
Patent Text Reader

Abstract

The invention discloses a method for constructing a text semantic matching model adaptive to a vertical field, and relates to the technical field of semantic analysis. The method comprises the following steps: constructing an effective keyword group corresponding to a certain vertical field; according to the effective keyword groups, effective keywords of AB text data in the field are extracted, the number of times that each text hits each effective keyword is determined, and hit vectors of each text are formed; the hit vector of each text A and the hit vector of each text B are calculated, and semantic matching results between the texts A and B are marked; and constructing a training sample by using a logarithm point multiplication calculation vector of a hit vector of the AB text and a text matching marking result, inputting the training sample into an artificial intelligence model for fitting training, and taking the artificial intelligence model obtained by training as a text semantic matching model adaptive to the vertical field. According to the semantic matching model constructed by the method, asymmetric matching of the vertical field text is realized, and compared with a manual checking method, the method is higher in automation degree, growth performance and efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of semantic analysis technology, and in particular to a method for constructing a text semantic matching model adapted to vertical domains. Background Technology

[0002] Currently, text semantic matching models mainly use algorithms such as text matching techniques and deep semantic matching models. Traditional text matching techniques include algorithms like BoW, VSM, TF-IDF, BM25, Jaccord, and SimHash, which primarily address word-level matching problems, or word-level similarity problems. However, they cannot handle the recognition of words with the same meaning but different expressions, such as "dishi" (taxi) and "jiche" (taxi), which have the same meaning but are completely different expressions. Deep semantic matching models mainly construct commonality matching models based on the word vector relationships appearing in large segments of text. They do not require annotation but cannot solve the semantic representation problems of phrases and sentences, and they cannot effectively achieve asymmetric matching when the lengths of the two texts to be matched differ significantly. Summary of the Invention

[0003] To address the aforementioned problems and technical requirements, the inventors have proposed a method for constructing a text semantic matching model adapted to vertical domains. This method enables asymmetric matching of professional domain vocabulary and corresponding paragraphs within sentences, where numerous different expressions exist but share the same meaning. The technical solution of this invention is as follows: A method for constructing a text semantic matching model adapted to a vertical domain includes the following steps: Construct effective keyword groups corresponding to a specific vertical field; Obtain multiple A / B text data within this vertical domain; By comparing the effective keyword groups, the effective keywords of the A and B text data are extracted and the number of times each effective keyword is hit in each A and B text is determined, forming the hit vector of each text; The hit vector of each text A is calculated together with the hit vector of each text B, and the semantic matching results between texts A and B are marked based on the calculation results. The vector is calculated by taking the logarithmic dot product of the hit vector of each text A and the hit vector of each text B. The semantic matching results between the labeled texts A and B are used to construct training samples, which are then input into the artificial intelligence model for fitting training. The trained artificial intelligence model is used as the text semantic matching model adapted to this vertical domain.

[0004] A further technical solution is that the method also includes: Iterate through all text A, calculate the hit vector of the current text A with the hit vectors of all other text A, and group the texts in group A based on the calculation results; For text A within the same group, perform the step of calculating the hit vector of each text A and the hit vector of each text B.

[0005] Its further technical solution is to construct effective keyword groups corresponding to a specific vertical field, including: Use the keyword groups within the vertical domain provided by experts as the initial keyword groups; We acquire text materials within this vertical domain and identify high-frequency keyword groups from the text materials based on natural language segmentation methods. The initial keyword groups with differences are screened, and the selected keyword groups are classified and grouped with high-frequency keyword groups. After review by experts in the vertical field, they are combined into effective keyword groups corresponding to the vertical field. Each group of effective keywords includes proper nouns, synonyms, and abbreviations of the effective keywords.

[0006] The further technical solution is that each element in the hit vector is sorted according to the position of the phrase to which the effective keyword belongs, and the value of each element is the number of times the effective keyword corresponding to the position of the element appears in the corresponding text.

[0007] The further technical solution involves screening initial keyword groups that exhibit differences, including: The initial keyword groups with differences are filtered by using a multi-expert back-to-back ranking and voting method, and the initial keyword groups with more votes are entered into the effective keyword groups.

[0008] The further technical solution is to calculate the hit vector of each text A with the hit vector of each text B, in the same way as calculating the hit vector of the current text A with the hit vectors of all other texts A. The calculation of the hit vectors of texts A and B includes: Perform a dot product between the hit vector of each text A and the corresponding elements of the hit vector of each text B, and then sum the elements in the dot product result vector. Perform a dot product between the hit vector of each text A and the corresponding elements of the hit vector of each text B, add one to the elements of the dot product vector, take the logarithm, and then sum them. Calculate the cosine similarity between the hit vector of each text A and the hit vector of each text B.

[0009] A further technical solution is that the method also includes: During the iterative process of fitting and training the artificial intelligence model, the effective keyword phrases are continuously optimized.

[0010] The further technical solution involves optimizing effective keyword phrases, including: After marking the semantic matching results between texts A and B, the natural semantic word segmentation method is used to automatically segment all text A data and their corresponding text B data. Based on the most frequent new words in the word segmentation results, determine the number of times each new word is hit in each text A and text B, and add them one by one to the hit vector of each text; The hit vectors are recalculated and labeled, training samples are constructed, and the model is fitted and verified based on the artificial intelligence model. If the model accuracy is improved, the new words are added to the effective keyword group.

[0011] Further technical solutions include methods for optimizing effective keyword phrases, such as: After each model training is completed, the effective keywords with the lowest weights in the phrase positions of the effective keywords are selected based on the weights output by the artificial intelligence model as words to be deleted, and the words to be deleted are removed one by one from the hit vectors of each text. The hit vectors are recalculated and labeled, training samples are constructed, and the model is fitted and verified based on artificial intelligence. If the model accuracy is improved, the words to be deleted are automatically removed from the effective keyword group.

[0012] The beneficial technical effects of this invention are: This method utilizes keyword groups provided by experts in the vertical domain and high-frequency word groups from text materials within the domain to construct effective keyword groups corresponding to the vertical domain. These keywords are then used to determine the hit vectors for each text A and text B. The hit vectors of each text are then fed into a basic algorithm for calculation. Expert experience is combined to label the semantic matching results of the texts. The logarithmic dot product of the hit vectors of each text is used as the feature vector, and the expert labeling results are used as the target. This data is then input into an artificial intelligence model for fitting and training. Ultimately, the artificial intelligence model iteratively improves its accuracy and intelligently identifies and sorts subsequent texts based on their matching degree. This identification method, based on text data analysis, offers higher automation, scalability, and efficiency compared to manual screening methods. Attached Figure Description

[0013] Figure 1 This is a flowchart illustrating the construction method of the adapted vertical domain text semantic matching model provided in this application.

[0014] Figure 2 This is an application flowchart of the vertical domain text semantic matching model provided in this application. Detailed Implementation

[0015] The specific embodiments of the present invention will be further described below with reference to the accompanying drawings.

[0016] Please refer to Figure 1As shown, this application provides a method for constructing a text semantic matching model adapted to a vertical domain. In this embodiment, the vertical domain is taken as the financial auditing domain as an example to illustrate the method, which specifically includes the following steps: Step 2: Construct effective keyword phrases for a specific vertical market. This step specifically includes: Step 2.1: Use the keyword groups provided by experts in the field of financial auditing as initial keyword groups. For example, based on expert experience, the keyword groups can be summarized into one group: [X Commercial Bank, X Bank, X Bank] can be grouped together, and [Micro-loans, Micro-enterprise loans, Private enterprise loans, Inclusive loans, Inclusive loans] can be grouped together.

[0017] Step 2.2: Collect text materials within the financial auditing field and identify high-frequency keyword groups after segmentation using natural language processing (NLP). Specifically, keywords extracted based on expert experience are used as stop words in the NLP method. NLP is used to identify high-frequency keyword groups from all text materials. These are then screened by financial auditing experts before being used for actual matching. For example, based on the segmentation results, words like "bank," "business," "inclusive finance," "loan," "materials," "operation," "problem," and "prudential" are identified as high-frequency words. In practical applications, this identification model can be a relevant vertical domain segmentation model built based on NLP. This model uses domain-specific nouns as learning words and invalid words within the domain as stop words during training. Training with a deep learning framework based on NLP can improve the usability of the vertical domain segmentation model.

[0018] Step 2.3: Screen the initial keyword groups that have differences, categorize and group the selected keyword groups with high-frequency keyword groups, and after review by financial audit experts, form effective keyword groups corresponding to the financial audit field. Each effective keyword group contains proper nouns, synonyms, and abbreviations of the effective keywords.

[0019] When multiple expert groups exist, the initial keyword groups determined by different groups may differ. To address consistency issues, a back-to-back ranking and voting method among multiple experts is prioritized to filter out differing initial keyword groups. Specifically, initial keyword groups with differing expert opinions are extracted and pushed to an odd number of expert groups (even numbers may result in ties, so this is not considered) for voting. The initial keyword group with the most votes is then added to the effective keyword group, and the other group is deleted. To address difficulties in expert group collaboration, differing initial keyword groups can be merged into relevant keyword group positions based on each expert's experience, thereby expanding the effective keyword group. For example, if Expert 1 suggests that micro-loans belong to the keyword group

micro-loans, micro-enterprise loans, inclusive loans, inclusive loans

loans

micro-loans, micro-enterprise loans, inclusive loans, inclusive loans, micro-loans

loans, micro-loans

[0020] This embodiment provides a set of effective keyword phrases: [X Commercial Bank, X Bank, X Branch] is in position 1 [Micro and Small Enterprises] in location 2 [Micro and Small Enterprise Loans, Inclusive Loans, and Financial Loans] are located in position 3. Loan in position 4 Business in position 5 The material is in position 6 Operating in location 7 Prudence in position 8 It should be noted that the order of the phrases containing the effective keywords is meaningless and will not affect subsequent calculations. Furthermore, this method does not have strict requirements regarding textual overlap between keywords; for example, "micro-enterprises," "micro-enterprise loans," and "loans" can exist in three different keyword groups.

[0021] Step 4: Obtain multiple A texts and their corresponding B texts within the financial auditing field. In this embodiment, A texts and their corresponding B texts are primarily obtained from documents published on public platforms by institutions related to the financial auditing field. Typically, A and B texts are a set of asymmetric text data, and one A text may correspond to multiple B texts. An example is given below and will be used in subsequent steps to illustrate the specific implementation of each step, such as: Text A1: X Commercial Bank has engaged in imprudent operations in its inclusive lending business.

[0022] The corresponding text B1 states: "An investigation revealed that Bank X's micro-loans and inclusive finance business had flawed credit application review process and imprudent credit approval decisions, resulting in a flawed loan application (a) with a loan amount of b million yuan."

[0023] The corresponding text B2 states: Among the institutions surveyed, Bank X, Bank Y, and Bank Z have issues with risk management of inclusive loans. The main problems include flawed approval materials, imprudent operation, and overly extensive business development.

[0024] Step 6: Compare the effective keyword groups, extract the effective keywords of text A and the corresponding text B data, and determine the number of times each text A and text B hits each effective keyword, forming the hit vector for each text.

[0025] Specifically, based on the effective keyword groups given in step 2, the hit vector for each text A and text B is determined. The elements in the hit vector are sorted according to the position of the effective keyword's phrase, and the value of each element is the number of times the effective keyword corresponding to that element's position appears in the corresponding text. The above-listed effective keyword groups are 8 groups. Assuming there are m texts A, the hit vector for each text A can be represented as follows: Therefore, the hit vector of text A1 in the example above is Suppose there are n texts B, then the hit vector of each text B can be represented as: Therefore, the hit vector of text B1 in the example above is The hit vector of text B2 is .

[0026] Step 8: Calculate the hit vector of each text A with the hit vector of each text B. The calculation mainly reflects the semantic matching degree between texts from three aspects: wording direction, key information verification, and keyword relevance. The basic algorithms designed based on comprehensive consideration of multiple aspects include the dot product summation algorithm, the logarithmic dot product summation algorithm, and the vector cosine similarity algorithm.

[0027] (1) Dot product summation algorithm: Perform a dot product between the corresponding elements of the hit vector of each text A and the hit vector of each text B, and then sum the elements in the dot product result vector. The dot product summation result of the hit vectors of text A1 and text B1 is:

[0028] The sum of the dot product of the hit vectors of text A1 and text B2 is:

[0029] (2) Logarithmic dot product summation algorithm: Perform dot product of the corresponding elements of the hit vector of each text A with the hit vector of each text B, add one to the elements of the dot product result vector, take the logarithm, and then sum them. The logarithmic dot product summation result of the hit vectors of text A1 and text B1 is then:

[0030] The sum of the dot product of the hit vectors of text A1 and text B2 is:

[0031] Compared to dot product summation, logarithmic processing can reduce the problem of excessive weighting of high word frequencies in summation in long texts.

[0032] (3) Vector cosine similarity algorithm: Calculate the cosine similarity between the hit vector of each text A and the hit vector of each text B. The expression is:

[0033] Step 10: Mark the semantic matching results between texts A and B based on the calculation results of Step 8. In this embodiment, the expert group comprehensively judges the calculation results of the above three algorithms. A multi-expert back-to-back ranking and voting method can still be used to determine whether the calculation results of each pair of texts A and B match. A match is marked as 1, and a non-match is marked as 0, thereby generating a semantic matching result matrix between texts A and B. Optionally, all elements in the semantic matching result matrix are arranged in descending order of the degree of matching of text B, facilitating expert group review.

[0034] Step 12: Calculate the semantic matching results between the target A and target B texts using the logarithmic dot product of each A text's hit vector and the target B text's hit vector. Construct training samples and input them into the AI ​​model for fitting training. The trained AI model will serve as the text semantic matching model adapted to this financial auditing domain. During training, the target A and B texts given in Step 6 can be logarithmically multiplied. The difference from the logarithmic dot product summation algorithm in Step 8 is that no summation is performed at the end. The output logarithmic dot product vectors are used as feature vectors. The semantic matching results between the A and B texts given in Step 10 are used as targets to jointly construct training samples. A certain proportion of samples are retained for validation and input into the iteratively trained neural network model. The performance of the trained model is evaluated based on recall and precision. Optionally, the AI ​​model can be built based on existing mature network architectures such as neural networks (e.g., backpropagation BP networks) and random forests.

[0035] In practical model application scenarios, the process involves acquiring each A and B text to be matched within the domain, along with pre-constructed effective keyword groups corresponding to that domain. This generates hit vectors for A and B texts. Then, the logarithmic dot product of the hit vector of A text and the hit vectors of each B text is calculated. A pre-trained AI model is then invoked to obtain the model-recommended semantic matching results for A and B texts. Domain experts or users can further consider whether to calibrate these results. If calibration is required, the AI ​​model is iteratively trained again, and the upgraded AI model is invoked to re-obtain the model-recommended semantic matching results for A and B texts. Figure 2 As shown.

[0036] Optionally, to improve the accuracy of the constructed model, this method also includes the following steps: Step 7: Traverse all text A texts, calculate the hit vector of the current text A with the hit vectors of all other text A texts, and group the texts in group A based on the calculation results. The calculation method for the hit vectors between two texts is the same as the calculation method for the hit vectors of texts A and B in Step 8, namely, using the dot product summation algorithm, the logarithmic dot product summation algorithm, and the vector cosine similarity algorithm. Then, the expert panel comprehensively judges the calculation results of the above three algorithms, sorts all text A texts in descending order of similarity quantification results, and groups them accordingly. For example, texts with high similarity are grouped together, texts with slightly lower similarity are grouped together, and texts with very low similarity are grouped together, etc.

[0037] In step 8, the hit vector of each text A within the same group is calculated together with the hit vector of each text B, and then steps 10 and 12 are executed. The text semantic matching model obtained through this iterative training can quickly provide a matching answer text B for similar question texts A.

[0038] In one embodiment, when the matched samples do not meet expert expectations, the effective keyword groups can be optimized, and training samples can be regenerated for iterative training of the artificial intelligence model. One optimization method is to add high-frequency word groups, which specifically includes: after labeling the semantic matching results between texts A and B, using NLP methods to automatically segment all text A and corresponding text B data and count word frequencies. Based on several new words with high frequency in the segmentation results (such as the top 10% of words), the number of times each text A and text B hits the new word is determined, and these new words are added to the hit vector of each text. The hit vector is recalculated and labeled, training samples are constructed, and the model is fitted and validated. If the model accuracy improves, the new words are added to the effective keyword groups.

[0039] Another optimization method is to remove misleading matching accuracy phrases. This involves: after each model training iteration, the AI ​​model outputs weights corresponding to the weights of the phrase positions of the effective keywords. The lowest-ranking effective keywords (e.g., the bottom 10%) are selected from these weights as words to be deleted, and these words are then removed one by one from the hit vectors of each text. The hit vectors are then recalculated and labeled, training samples are reconstructed, and the AI ​​model is used for fitting and validation. If the model accuracy improves, the words to be deleted are automatically removed from the effective keyword groups.

[0040] The above descriptions are merely preferred embodiments of this application, and the present invention is not limited to the above embodiments. It is understood that other improvements and variations directly derived or conceived by those skilled in the art without departing from the spirit and concept of the present invention should be considered to be included within the protection scope of the present invention.

Claims

1. A method for constructing a text semantic matching model adapted to a vertical domain, characterized in that, The method includes: Construct effective keyword groups corresponding to a specific vertical field; Obtain multiple A / B text data within this vertical domain; By comparing the effective keyword groups, the effective keywords of the A and B text data are extracted and the number of times each effective keyword is hit in each A and B text is determined, forming the hit vector of each text; The hit vector of each text A is calculated together with the hit vector of each text B, and the semantic matching results between texts A and B are marked based on the calculation results. The vector is calculated by taking the logarithmic dot product of the hit vector of each text A and the hit vector of each text B. The semantic matching results between the labeled texts A and B are used to construct training samples, which are then input into the artificial intelligence model for fitting training. The trained artificial intelligence model is used as the text semantic matching model adapted to this vertical domain.

2. The method for constructing an adaptive vertical domain text semantic matching model according to claim 1, characterized in that, The method further includes: Iterate through all text A, calculate the hit vector of the current text A with the hit vectors of all other text A, and group the texts in group A based on the calculation results; For text A within the same group, the step of calculating the hit vector of each text A and the hit vector of each text B is then performed.

3. The method for constructing an adapted vertical domain text semantic matching model according to claim 1, characterized in that, The construction of effective keyword groups corresponding to a specific vertical domain includes: Use the keyword groups within the vertical domain provided by experts as the initial keyword groups; Obtain text materials within this vertical domain, and identify high-frequency keyword groups from the text materials based on natural language segmentation methods; The initial keyword groups with differences are screened, and the selected keyword groups are classified and grouped with the high-frequency keyword groups. After review by experts in the vertical field, they are combined into effective keyword groups corresponding to the vertical field. Each group of effective keywords includes proper nouns, synonyms, and abbreviations of the effective keywords.

4. The method for constructing an adapted vertical domain text semantic matching model according to claim 3, characterized in that, The elements in the hit vector are sorted according to the position of the phrase to which the effective keyword belongs, and the value of each element is the number of times the effective keyword corresponding to the position of the element appears in the corresponding text.

5. The method for constructing an adapted vertical domain text semantic matching model according to claim 3, characterized in that, The process of filtering initial keyword groups that exhibit differences includes: The initial keyword groups with differences are filtered by using a multi-expert back-to-back ranking and voting method, and the initial keyword groups with more votes are entered into the effective keyword groups.

6. The method for constructing an adapted vertical domain text semantic matching model according to claim 2, characterized in that, The method of calculating the hit vector of each text A with the hit vector of each text B is the same as the method of calculating the hit vector of the current text A with the hit vectors of all other text A. The calculation of the hit vectors of texts A and B includes: Perform a dot product between the hit vector of each text A and the corresponding elements of the hit vector of each text B, and then sum the elements in the dot product result vector. Perform a dot product between the hit vector of each text A and the corresponding elements of the hit vector of each text B, add one to the elements of the dot product vector, take the logarithm, and then sum them. Calculate the cosine similarity between the hit vector of each text A and the hit vector of each text B.

7. The method for constructing an adaptive vertical domain text semantic matching model according to any one of claims 1 to 6, characterized in that, The method further includes: During the iterative process of fitting and training the artificial intelligence model, the effective keyword group is continuously optimized.

8. The method for constructing an adaptive vertical domain text semantic matching model according to claim 7, characterized in that, The methods for optimizing the effective keyword groups include: After marking the semantic matching results between texts A and B, the natural semantic word segmentation method is used to automatically segment all text A data and their corresponding text B data. Based on the high frequency of several new words in the word segmentation results, determine the number of times each new word is hit in each text A and text B, and add them one by one to the hit vector of each text; The hit vectors are recalculated and labeled, training samples are constructed, and the model is fitted and verified based on the artificial intelligence model. If the model accuracy is improved, the new words are added to the effective keyword group.

9. The method for constructing an adapted vertical domain text semantic matching model according to claim 7, characterized in that, The method for optimizing the effective keyword group also includes: After each model training is completed, the effective keywords with the lowest weights in the phrase positions of the effective keywords are selected based on the weights output by the artificial intelligence model as words to be deleted, and the words to be deleted are removed one by one from the hit vectors of each text. The hit vectors are recalculated and labeled, training samples are constructed, and the model is fitted and verified based on the artificial intelligence model. If the model accuracy is improved, the words to be deleted are automatically removed from the effective keyword group.