Cost list matching method and device suitable for business system and storage medium
By using the ColBERT model to semantic match the user revenue and standard cost lists, the semantic matching problems in cost list matching in the prior art and the problem of rule engine failure are solved, and higher matching accuracy and efficiency are achieved.
Patent Information
- Application Number
- CN202411811934.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-03-25
AI Technical Summary
The existing business system cost list matching method relies on quota methods and literal matching of text, and cannot effectively deal with the semantic matching problem of synonyms and synonyms. When the income list description provided by the owner is not based on national or local standard quotas, the rule engine faces the problem of failure.
The text description of user income and text description in the standard cost list library were trained using the ColBERT model. By constructing positive and negative samples, the similarity probability was calculated to determine the standard cost list of user income matching.
It improves the accuracy and efficiency of cost list matching, can accurately match the revenue items provided by the owner to the standard cost list corresponding to the enterprise, and solves the semantic matching problems and the failure of the rule engine in the prior art.
Smart Images

Figure CN119691200A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of cost list matching, and in particular to a cost list matching method, device and storage medium applicable to a business system. Background Art
[0002] The cost list matching of the business system is applied in the cost management link. In the cost management link, it is necessary to calculate the cost corresponding to each income item based on the income list provided by the owner. The specific approach is to match each income item provided by the owner to the corresponding standard cost list of the enterprise, and then calculate the specific cost of each income item based on the unit price and engineering quantity of the standard list. Each owner's income item may match one or more standard cost lists.
[0003] At present, the cost list matching of business systems is mainly achieved by quotas. Specifically, a set of rule engines based on literal text matching is designed based on national or local quotas to achieve the cost list matching of business systems. The engineering quota is a certain amount of manpower, machinery, and materials that must be consumed in order to complete a certain project or a certain structural component during the construction and production process of building installation projects. This method, firstly, is overly dependent on literal matching and cannot handle the semantic matching problem of synonyms and synonyms; secondly, when the description of the income list provided by the owner is not based on national or local standard quotas, the rule engine faces the problem of failure. Summary of the invention
[0004] In view of this, it is necessary to provide a cost list matching method, device and storage medium applicable to a business system to solve the problem of how to improve the accuracy of cost list matching.
[0005] In order to solve the above problems, the present invention provides a cost list matching method applicable to a business system, comprising: Input the text description of the user's income and the text description of each standard cost list in the standard cost list library into the trained matching model to obtain the similarity probability output by the matching model; Determining a standard cost list matching the user's income based on the similarity probability; The matching model is trained in the following way: Based on the cost list matching data, construct positive and negative samples; Constructing training data based on the positive samples and the negative samples; The ColBERT model is trained based on the training data to obtain the matching model.
[0006] In a possible implementation, the cost list matching data includes a text description of each income and an ID list of a standard cost list that matches each income; the negative samples include difficult negative samples and simple negative samples; The method of constructing positive samples and negative samples based on the cost list matching data includes: Constructing the positive sample based on the elements in the ID list; Based on the text descriptions of all standard cost lists in the standard cost list library, a difficult negative sample set is constructed; Randomly select a sample from the difficult negative sample set as the difficult negative sample; Ten samples are randomly selected from the standard cost list library as the simple negative samples.
[0007] In a possible implementation, constructing a difficult negative sample set based on the text descriptions of all standard cost lists in the standard cost list library includes: Encode the text descriptions of all standard cost lists based on the BERT model to obtain the target vector; Based on the HNSW index structure of the vectorized retrieval library, a vectorized index of the target vector is established; Based on the target vector and the vectorized index, obtaining similar vectors of the elements in the ID list; The difficult negative sample set is determined based on the similarity vector and the ID list.
[0008] In a possible implementation, the expression of the training data is as follows:
[0009] in, Indicates i A text description of the income, Indicates i Article 1 of the income k Positive samples, Indicates i Article 1 of the income k hard negative examples, Indicates i Article 1 of the income k A simple negative sample.
[0010] In a possible implementation manner, the training the ColBERT model based on the training data to obtain the matching model includes: The ColBERT model is used to cross-match the token representation matrix corresponding to the text description of each income with the token representation matrix corresponding to the text description of the standard cost list to obtain a similarity matrix. Calculating a first loss function between the positive sample and the negative sample, and a second loss function between the difficult negative sample and the simple negative sample based on the similarity matrix; The first loss function and the second loss function are optimized by a weighted multi-task learning method to obtain the matching model.
[0011] In a possible implementation, the expression of the first loss function is as follows:
[0012] in, represents the first loss function, represents the user's income, represents a positive sample, Represents the first in the set of positive and negative samples i samples, and τ represents a hyperparameter.
[0013] In a possible implementation, the expression of the second loss function is as follows:
[0014] in, represents the second loss function, Represents difficult negative samples.
[0015] The present invention also provides a cost list matching device applicable to a business system, comprising: An input module, used for inputting the text description of the user's income and the text description of each standard cost list in the standard cost list library into the trained matching model to obtain the similarity probability output by the matching model; A matching module, configured to determine a standard cost list matching the user's income based on the similarity probability; The matching model is trained in the following way: Based on the cost list matching data, construct positive and negative samples; Constructing training data based on the positive samples and the negative samples; The ColBERT model is trained based on the training data to obtain the matching model.
[0016] On the other hand, the present invention also provides an electronic device, including a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the cost list matching method applicable to the business system described in any of the above implementations.
[0017] On the other hand, the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the cost list matching method applicable to a business system as described in any of the above implementations is implemented.
[0018] The beneficial effects of the present invention are as follows: the cost list matching method, device and storage medium applicable to the business system provided by the present invention construct positive samples and negative samples according to the cost list matching data, and construct training data, and train the ColBERT model according to the training data to obtain a matching model, and the trained matching model is used to determine the similarity probability between the text description of the user's income and the text description of each standard cost list in the standard cost list library, and the standard cost list with the highest similarity probability is the standard cost list that matches the user's income, so that the income items provided by the owner can be accurately matched to the standard cost list corresponding to the enterprise, and the accuracy and efficiency of matching are improved by utilizing advanced natural language processing technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 One of the method flow charts of an embodiment of the cost list matching method applicable to a business system provided by the present invention; Figure 2 A second method flow chart of an embodiment of a cost list matching method applicable to a business system provided by the present invention; Figure 3 A schematic diagram of the structure of a cost list matching system applicable to a business system provided by the present invention; Figure 4 A schematic diagram of the structure of an embodiment of a cost list matching device applicable to a business system provided by the present invention; Figure 5 A schematic structural diagram of an embodiment of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0021] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0022] In the description of the embodiments of the present invention, unless otherwise specified, "multiple" means two or more than two. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone.
[0023] The descriptions of "first", "second", etc. involved in the embodiments of the present invention are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the technical features defined as "first" or "second" may explicitly or implicitly include at least one of the features.
[0024] Figure 1 One of the method flow charts of an embodiment of the cost list matching method applicable to a business system provided by the present invention is as follows Figure 1 As shown, the cost list matching methods applicable to business systems include: S101, inputting the text description of the user's income and the text description of each standard cost list in the standard cost list library into the trained matching model to obtain the similarity probability output by the matching model; S102, determining a standard cost list matching the user's income based on the similarity probability; The matching model is trained in the following way: Based on the cost list matching data, construct positive and negative samples; Constructing training data based on the positive samples and the negative samples; The ColBERT model is trained based on the training data to obtain the matching model.
[0025] It should be noted that the ColBERT model is a BERT-based text matching model that can be used to process semantic similarity between texts. Positive and negative samples are constructed through cost list matching data. Positive samples refer to standard cost list items related to the user's income text description. During the training process, positive samples can be used to guide the model to learn how to identify and match related cost list items. Negative samples can be used to help the model distinguish irrelevant cost list items. A training data set is constructed using positive and negative samples. The training data set is used to train the ColBERT model to obtain a matching model. The matching model can learn to distinguish between positive and negative samples and can accurately calculate the similarity probability between user input and the standard cost list.
[0026] In step S101, the text description of the user's income and the text description of each standard cost list in the standard cost list library are input into a trained matching model. The matching model analyzes these text descriptions and outputs the similarity probability between the two.
[0027] In step S102, the standard cost list that best matches the user's income may be determined based on the similarity probability. The standard cost list with the highest similarity probability is the standard cost list that matches the user's income.
[0028] Compared with the prior art, the cost list matching method suitable for a business system provided by an embodiment of the present invention constructs positive samples and negative samples according to cost list matching data, constructs training data, and trains the ColBERT model according to the training data to obtain a matching model. The trained matching model is used to determine the similarity probability between the text description of the user's income and the text description of each standard cost list in the standard cost list library, and the standard cost list with the highest similarity probability is the standard cost list that matches the user's income, so that the income items provided by the owner can be accurately matched to the standard cost list corresponding to the enterprise, and the accuracy and efficiency of matching are improved by utilizing advanced natural language processing technology.
[0029] In some embodiments of the present invention, the cost list matching data includes a text description of each income and an ID list of a standard cost list that matches each income; the negative samples include difficult negative samples and simple negative samples; The method of constructing positive samples and negative samples based on the cost list matching data includes: Constructing the positive sample based on the elements in the ID list; Based on the text descriptions of all standard cost lists in the standard cost list library, a difficult negative sample set is constructed; Randomly select a sample from the difficult negative sample set as the difficult negative sample; Ten samples are randomly selected from the standard cost list library as the simple negative samples.
[0030] In some embodiments of the present invention, constructing a difficult negative sample set based on the text descriptions of all standard cost lists in the standard cost list library includes: Encode the text descriptions of all standard cost lists based on the BERT model to obtain the target vector; Based on the HNSW index structure of the vectorized retrieval library, a vectorized index of the target vector is established; Based on the target vector and the vectorized index, obtaining similar vectors of the elements in the ID list; The difficult negative sample set is determined based on the similarity vector and the ID list.
[0031] In some embodiments of the present invention, the expression of the training data is as follows:
[0032] in, Indicates i A text description of the income, Indicates i Article 1 of the income k Positive samples, Indicates i Article 1 of the income k hard negative examples, Indicates i Article 1 of the income k A simple negative sample.
[0033] Optionally, historical cost list matching data completed manually or by other means can be collected, and the data not in the existing standard list library can be filtered to obtain a data set. D .
[0034] For the dataset D The i Data , which can be expressed as , Indicates i A text description of the income, Indicates i A list of the IDs of the standard cost lists that the revenue item matches. Each revenue item can match one or more standard cost lists.
[0035] Then the dataset D Further decomposition to construct positive samples and negative samples. Negative samples include hard negative samples and simple negative samples.
[0036] Positive samples refer to standard cost list items related to the user's income text description. During the training process, positive samples can be used to guide the model to learn how to identify and match relevant cost list items.
[0037] Negative samples can be used to help the model distinguish irrelevant cost list items and can be divided into hard negative samples and easy negative samples.
[0038] Difficult negative samples refer to standard cost list items that are similar to the user's income text description to a certain extent but are actually irrelevant. They can be used to improve the robustness and generalization ability of the model, and enable the model to learn more detailed feature distinctions to avoid incorrect matching.
[0039] Simple negative samples refer to standard cost list items that are obviously irrelevant to the user's income text description, which can help the model learn to quickly exclude obviously mismatched options to improve the efficiency and accuracy of the model.
[0040] For example, first set two empty sets, represented as and . Iterate over the dataset D ,for D Each piece of data in , traverse Each element in , forming a new sample And join Then according to Each sample in Construct positive and negative samples.
[0041] Specifically, you can directly add the elements in the ID list As a positive sample, the element in the ID list It is the ID of the standard cost list, which is used to identify the corresponding standard cost list.
[0042] The text descriptions of all standard cost lists in the standard list library are input into the BERT model one by one, encoded through the BERT model, and their vectorized representation results are obtained, that is, the target vector is obtained.
[0043] The vectorized index of the target vector in the above steps is established by using the Hierarchical Navigable Small World graphs (HNSW) graph construction method of the Facebook AI Similarity Search (FAISS) vectorized retrieval library and the inner product as the distance measurement.
[0044] Using the target vector, we retrieve the vectorized index and get In this embodiment, we select The top 30 similar results are taken as similarity vectors and recorded as .
[0045] Based on similarity vector and ID list ,use Get the difficult negative sample set, denoted as . In the difficult negative sample set We randomly select a sample from as a difficult negative sample, denoted as .
[0046] Ten samples are randomly sampled from the standard cost list library as simple negative samples, denoted as .
[0047] The first i The text description of the income, i Article 1 of the income k Positive samples and their corresponding difficult negative samples and simple negative samples As a training data, insert , get the training data set.
[0048] The cost list matching method for business systems provided by the embodiment of the present invention enables the model to learn more detailed feature distinctions by constructing positive samples, difficult negative samples and simple negative samples, thereby improving its generalization ability. At the same time, the use of the BERT model for text encoding and the HNSW index structure for fast retrieval can effectively process large-scale text data.
[0049] In some embodiments of the present invention, the training of the ColBERT model based on the training data to obtain the matching model includes: The ColBERT model is used to cross-match the token representation matrix corresponding to the text description of each income with the token representation matrix corresponding to the text description of the standard cost list to obtain a similarity matrix. Calculating a first loss function between the positive sample and the negative sample, and a second loss function between the difficult negative sample and the simple negative sample based on the similarity matrix; The first loss function and the second loss function are optimized by a weighted multi-task learning method to obtain the matching model.
[0050] In some embodiments of the present invention, the expression of the first loss function is as follows:
[0051] in, represents the first loss function, represents the user's income, represents a positive sample, Represents the first in the set of positive and negative samples i samples, and τ represents a hyperparameter.
[0052] In some embodiments of the present invention, the expression of the second loss function is as follows:
[0053] in, represents the second loss function, Represents difficult negative samples.
[0054] This embodiment uses the Chinese RoBERTa pre-trained model as the basic text encoder and ColBERT as the model architecture.
[0055] The n-gram representation of each token is calculated in the form of convolution. At the same time, the token representation matrix A corresponding to the text description of each income and the token representation matrix B corresponding to the text description of the standard cost list are cross-matched to calculate multiple similarity matrices. C ,as follows:
[0056]
[0057]
[0058] Each similarity matrix C Kernel-pooling is used to extract soft matches of words to varying degrees, thereby obtaining the similarities between owner income items and standard cost list items from more angles and in a more granular manner.
[0059] The model training loss function selects InfoNCE loss, which is a loss function for self-supervised learning and can be used to train contrastive learning models such as autoencoders or neural networks. Based on the idea of contrastive learning, it aims to maximize the similarity of positive samples while minimizing the similarity of negative samples.
[0060] InfoNCEloss is established between positive samples and negative samples, and between difficult negative samples and simple negative samples, respectively, and recorded as the first loss function and the second loss function , the expression is as follows:
[0061]
[0062] in, represents the user's income, For positive samples, Represents the first in the set of positive samples and negative samples (i.e., the set of positive samples, difficult negative samples, and simple negative samples). i samples, τ is a hyperparameter, Represents hard negative samples.
[0063] The two loss functions are optimized simultaneously through weighted multi-task learning as follows:
[0064] in, and They represent weight parameters respectively, + =1.
[0065] During inference, the model input is the text description of a single owner income item and the text description of each standard cost list in the standard cost list library. The model output is the similarity probability (between 0 and 1) between the text description of a single owner income item and each standard cost list in the standard cost list library.
[0066] The cost list matching method suitable for a business system provided in an embodiment of the present invention optimizes multiple objectives simultaneously by utilizing a multi-task learning framework, thereby making the model more robust in processing complex matching tasks. By constructing the InfoNCEloss loss function, the model can not only learn the characteristics of positive samples, but also effectively identify and distinguish difficult negative samples, thereby further improving the accuracy of cost list matching in the business system.
[0067] Optionally, Figure 2 The second method flow chart of an embodiment of the cost list matching method applicable to a business system provided by the present invention is as follows: Figure 2 As shown, the cost list matching methods applicable to business systems include: S1. Data acquisition and cleaning.
[0068] Collect the cost list matching data completed manually or by other means. Filter the data not in the existing standard list library to obtain the data set D .
[0069] For the dataset D The i Data , which can be expressed as , Indicates i A text description of the cost and income of the data item. Indicates iA list of IDs of the standard cost lists that match the data item.
[0070] S2. Dataset construction.
[0071] The dataset D To further decompose, the steps are as follows: S2.1. Set empty set and ; S2.2. Traversing the Dataset D ; S2.3. For D Each piece of data in , traverse Each element in , forming a new sample And join .
[0072] S3. For Each sample in Construct positive and negative samples.
[0073] S3.1, positive sample: ; S3.2, difficult negative samples; S3.2.1. Input the text descriptions of all standard cost lists in the standard list library into the BERT model one by one to obtain their vectorized representation results; S3.2.2, using the HNSW mapping method of FAISS, using the inner product as the distance measurement method, the vectorized representation results of the standard cost lists in all standard list libraries in S3.2.1 are used to establish a vectorized index; S3.2.3, using the results obtained in S3.2.1 The vectorized representation result is retrieved from S3.2.2, and the vectorized index is obtained. The top30 similar results are recorded as ; S3.2.4, use Get a set of difficult negative samples ; S3.2.5. We randomly select one of them as a difficult negative sample, denoted as ; S3.2.6. Randomly sample ten samples from the standard cost list database as simple negative samples, denoted as ; S3.2.7. i The text description of the cost and income of the data item, i The first data kPositive samples and their corresponding difficult negative samples and simple negative samples As a training data, insert .
[0074] S4. Model design and training.
[0075] S4.1. Use the Chinese RoBERTa pre-trained model as the basic text encoder and ColBERT as the model architecture.
[0076] S4.2. Calculate the n-gram representation of each token in the form of convolution, and cross-match the token representation matrix A corresponding to the owner's income item and the token representation matrix B corresponding to the standard cost list item description to calculate multiple similarity matrices C .
[0077]
[0078]
[0079]
[0080] Each similarity matrix C Kernel-pooling is used to extract soft matches of words to varying degrees, thereby obtaining the similarities between owner income items and standard cost list items from more angles and in a more granular manner.
[0081] S4.3. Select InfoNCE loss as the model training loss function, and establish two InfoNCE losses for positive sample-negative sample and difficult negative sample-simple negative sample respectively.
[0082] S4.3.1. InfoNCE loss between positive samples and negative samples:
[0083] in, represents the owner's income item, For positive samples, Represents the first in the set of positive samples plus difficult negative samples plus simple negative samples i samples, and τ is a hyperparameter.
[0084] S4.3.2. InfoNCE loss between difficult negative samples and simple negative samples:
[0085] in, Represents hard negative samples.
[0086] S4.4. Simultaneously optimize two loss functions through weighted multi-task learning.
[0087] S4.4.1, ,in + =1 S4.5. During inference, the model input is the text description of a single owner income item and the text description of each standard cost list in the standard cost list library.
[0088] The model output is the similarity probability (between 0 and 1) between the text description of a single owner income item and each standard cost list in the standard cost list library.
[0089] The cost list matching method applicable to the business system provided by the embodiment of the present invention solves the semantic matching problem of synonyms and antonyms by means of vectorized representation; the vectorized representation using deep learning reasoning can directly process the relevance of words, and end-to-end model the semantic relevance of candidate cost list items and contract revenue; the deep learning model has good generalization performance, and when the application field of the business system is changed, it only needs to recalculate the vectorized representation of the candidate cost list item and create an index, and it can be used, avoiding the manpower cost of redevelopment. When the cost list item is expanded, it only needs to perform deep learning model reasoning on the expanded cost list item to obtain the vectorized representation of the item and add it to the index, avoiding the cost of secondary development.
[0090] Figure 3 A schematic diagram of the structure of the cost list matching system applicable to the business system provided by the present invention, such as Figure 3 As shown in the figure, first, the system receives two sets of text input: owner list text and standard list text. Then, these texts are calculated through the advanced "text encoder" and converted into vectors.
[0091] Based on the encoding, the system calculates high-order features through the model: the first is the word similarity calculation, which directly compares the similarity between words in two groups of texts; the second is the word-word sentence meaning similarity calculation, which uses natural language processing technology to evaluate the similarity of words in context; the third is the word-word literal matching degree calculation, which measures the direct corresponding matching of words.
[0092] Next, the system combines the above three calculation results to preliminarily form the overall similarity features of the text. In order to extract more critical feature information, the system also applies maximum pooling and summation operations in the row and column directions to further refine the similarity features.
[0093] Finally, the system combines all key features through the "Concat" operation to form a comprehensive matching evaluation basis. After this series of complex processing procedures, the system finally outputs an accurate matching result.
[0094] The cost list matching method applicable to the business system provided by the embodiment of the present invention obtains vectorized representations of the standard cost list item text and the income description text item to be matched through deep learning model reasoning, and obtains semantic similarity through deep learning model reasoning. The semantic similarity and rouuge distance of the vectorized representation are calculated and re-sorted to obtain the final cost list matching result.
[0095] In order to better implement the cost list matching method applicable to the business system in the embodiment of the present invention, based on the cost list matching method applicable to the business system, the embodiment of the present invention also provides a cost list matching device applicable to the business system. Figure 4 A schematic diagram of the structure of an embodiment of a cost list matching device applicable to a business system provided by the present invention is shown in FIG. Figure 4 As shown, the cost list matching device 400 applicable to the business system includes: An input module 410 is used to input the text description of the user's income and the text description of each standard cost list in the standard cost list library into the trained matching model to obtain the similarity probability output by the matching model; A matching module 420, configured to determine a standard cost list matching the user income based on the similarity probability; The matching model is trained in the following way: Based on the cost list matching data, construct positive and negative samples; Constructing training data based on the positive samples and the negative samples; The ColBERT model is trained based on the training data to obtain the matching model.
[0096] The cost list matching device 400 applicable to the business system provided in the above embodiment can implement the technical solution described in the above embodiment of the cost list matching method applicable to the business system. The specific implementation principles of the above modules or units can refer to the corresponding contents in the embodiment of the cost list matching method applicable to the business system, which will not be repeated here.
[0097] like Figure 5 As shown, the present invention also provides an electronic device 500. The electronic device 500 includes a processor 501, a memory 502 and a display 503. Figure 5Only some components of the electronic device 500 are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0098] In some embodiments, the processor 501 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 502, such as the cost list matching method applicable to a business system in the present invention.
[0099] In some embodiments, the processor 501 may be a single server or a server group. The server group may be centralized or distributed. In some embodiments, the processor 501 may be local or remote. In some embodiments, the processor 501 may be implemented in a cloud platform. In some embodiments, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, a multi-cloud, etc., or any combination thereof.
[0100] In some embodiments, the memory 502 may be an internal storage unit of the electronic device 500, such as a hard disk or memory of the electronic device 500. In other embodiments, the memory 502 may also be an external storage device of the electronic device 500, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 500.
[0101] Furthermore, the memory 502 may include both an internal storage unit of the electronic device 500 and an external storage device. The memory 502 is used to store application software installed in the electronic device 500 and various data.
[0102] In some embodiments, the display 503 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an organic light-emitting diode (OLED) touch device, etc. The display 503 is used to display information on the electronic device 500 and to display a visual user interface. The components 501-503 of the electronic device 500 communicate with each other via a system bus.
[0103] In one embodiment, when the processor 501 executes the cost list matching program applicable to the business system in the memory 502, the following steps may be implemented: Input the text description of the user's income and the text description of each standard cost list in the standard cost list library into the trained matching model to obtain the similarity probability output by the matching model; Determining a standard cost list matching the user's income based on the similarity probability; The matching model is trained in the following way: Based on the cost list matching data, construct positive and negative samples; Constructing training data based on the positive samples and the negative samples; The ColBERT model is trained based on the training data to obtain the matching model.
[0104] It should be understood that: when the processor 501 executes the cost list matching program applicable to the business system in the memory 502, in addition to the above functions, other functions may also be implemented. For details, please refer to the description of the corresponding method embodiment above.
[0105] Furthermore, the embodiment of the present invention does not specifically limit the type of the electronic device 500 mentioned, and the electronic device 500 may be a portable electronic device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of portable electronic devices include but are not limited to portable electronic devices equipped with IOS, Android, Microsoft or other operating systems. The above-mentioned portable electronic device may also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, the electronic device 500 may not be a portable electronic device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).
[0106] Accordingly, an embodiment of the present invention also provides a computer-readable storage medium, which is used to store computer-readable programs or instructions. When the program or instructions are executed by a processor, it can implement the steps or functions of the cost list matching method applicable to the business system provided in the above-mentioned method embodiments.
[0107] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0108] The above is a detailed introduction to the cost list matching method, device and storage medium applicable to the business system provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A cost list matching method suitable for a business system, characterized in that: include: Input the text description of the user's income and the text description of each standard cost list in the standard cost list library into the trained matching model to obtain the similarity probability output by the matching model; Determining a standard cost list matching the user's income based on the similarity probability; The matching model is trained in the following way: Based on the cost list matching data, construct positive and negative samples; Constructing training data based on the positive samples and the negative samples; The ColBERT model is trained based on the training data to obtain the matching model.
2. The cost list matching method applicable to a business system according to claim 1, characterized in that: The cost list matching data includes a text description of each income and an ID list of a standard cost list that matches each income; the negative samples include difficult negative samples and simple negative samples; The method of constructing positive samples and negative samples based on the cost list matching data includes: Constructing the positive sample based on the elements in the ID list; Based on the text descriptions of all standard cost lists in the standard cost list library, a difficult negative sample set is constructed; Randomly select a sample from the difficult negative sample set as the difficult negative sample; Ten samples are randomly selected from the standard cost list library as the simple negative samples.
3. The cost list matching method applicable to a business system according to claim 2, characterized in that: The step of constructing a difficult negative sample set based on the text descriptions of all standard cost lists in the standard cost list library includes: Encode the text descriptions of all standard cost lists based on the BERT model to obtain the target vector; Based on the HNSW index structure of the vectorized retrieval library, a vectorized index of the target vector is established; Based on the target vector and the vectorized index, obtaining similar vectors of the elements in the ID list; The difficult negative sample set is determined based on the similarity vector and the ID list.
4. The cost list matching method applicable to a business system according to claim 2, characterized in that: The expression of the training data is as follows: in, Indicates i A text description of the income, Indicates i Article 1 of the income k Positive samples, Indicates i Article 1 of the income k hard negative examples, Indicates i Article 1 of the income k A simple negative sample.
5. The cost list matching method applicable to a business system according to claim 2, characterized in that: The step of training the ColBERT model based on the training data to obtain the matching model includes: The ColBERT model is used to cross-match the token representation matrix corresponding to the text description of each income with the token representation matrix corresponding to the text description of the standard cost list to obtain a similarity matrix. Calculating a first loss function between the positive sample and the negative sample, and a second loss function between the difficult negative sample and the simple negative sample based on the similarity matrix; The first loss function and the second loss function are optimized by a weighted multi-task learning method to obtain the matching model.
6. The cost list matching method applicable to a business system according to claim 5, characterized in that: The expression of the first loss function is as follows: in, represents the first loss function, represents the user's income, represents a positive sample, Represents the first in the set of positive and negative samples i samples, and τ represents a hyperparameter.
7. The cost list matching method applicable to a business system according to claim 6, characterized in that: The expression of the second loss function is as follows: in, represents the second loss function, Represents difficult negative samples.
8. A cost list matching device suitable for a business system, characterized in that: include: An input module, used for inputting the text description of the user's income and the text description of each standard cost list in the standard cost list library into the trained matching model to obtain the similarity probability output by the matching model; A matching module, configured to determine a standard cost list matching the user's income based on the similarity probability; The matching model is trained in the following way: Based on the cost list matching data, construct positive and negative samples; Constructing training data based on the positive samples and the negative samples; The ColBERT model is trained based on the training data to obtain the matching model.
9. An electronic device, characterized in that: comprising a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the cost list matching method applicable to a business system as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the cost list matching method applicable to a business system as claimed in any one of claims 1 to 7 is implemented.