Semantic model optimization method, system and device, medium and program product
By constructing product data sets and weighted fusion of multiple fine-tuned semantic models, the problem of low accuracy and high cost of semantic models in the tourism industry in the existing technology is solved, and more efficient semantic understanding and generalization capabilities are achieved.
Patent Information
- Application Number
- CN202410751828.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2024-10-15
AI Technical Summary
It is difficult for existing semantic models to accurately understand industry-specific terms and nouns in the tourism industry. The generalization ability of a single model is unstable, and the data set construction relies on manual labor, which leads to high costs.
By obtaining the product data set, we use incremental constraint and similarity constraint sampling strategies to build a positive and negative sample pool, fine-tune multiple single semantic basic models and perform weighted fusion to form a new composite semantic model.
It improves the accuracy and generalization ability of the semantic model, reduces resource dependence and cost, and significantly improves the stability and accuracy of application in tourism scenarios.
Smart Images

Figure CN118779401A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of language processing technology, and in particular to a semantic model optimization method, system, device, medium and program product. Background Art
[0002] Existing semantic models such as BERT and GPT have demonstrated excellent generality in many fields, but they face obvious limitations in specific vertical fields, especially in the tourism industry. Tourism scenarios contain a large amount of specific terms and geographic location name information. These professional terms often exceed the training scope of general models, resulting in the model's inability to effectively understand these terms and definitions. For example, industry-specific terms such as "free travel" and "all-inclusive tour" often lack sufficient semantic representation in general models.
[0003] A single semantic model can indeed improve its performance in specific scenarios by fine-tuning it in a vertical field. However, the semantic generalization ability of this single model is not stable and will show unpredictable performance as the training data changes, especially when faced with the diversity and complexity of user queries. In addition, although the use of multiple semantic models in parallel can enhance the stability and accuracy of the model in a vertical field, this method is too low-cost in practical applications, especially difficult to implement when resources are limited.
[0004] Existing semantic models face several key problems in specific industry applications such as tourism scenarios: first, it is difficult for existing semantic models to accurately understand and process industry-specific professional terms and nouns; second, fine-tuning of a single semantic model in a vertical scenario often leads to unstable generalization capabilities; finally, existing dataset construction methods rely too much on manual labor and are too costly. Summary of the invention
[0005] The technical problem to be solved by the present disclosure is to overcome the defects of low accuracy, low generalization ability and high cost of the semantic model in the prior art, and to provide a semantic model optimization method, system, device, medium and program product.
[0006] The present invention solves the above technical problems through the following technical solutions:
[0007] A first aspect of the present disclosure provides a method for optimizing a semantic model, the method comprising:
[0008] Get product datasets;
[0009] Fine-tune the multiple single semantic base models based on the product data set to obtain multiple fine-tuned single semantic base models;
[0010] The fine-tuned multiple single semantic basic models are fused to obtain a new composite semantic model.
[0011] Preferably, the step of acquiring the product data set includes:
[0012] An incremental constrained sampling strategy is used to match samples containing product query terms and extended terms of product query terms from the sample database to form a positive sample pool;
[0013] A similarity-constrained sampling strategy is used to filter out samples from the sample database that are semantically irrelevant but similar to the product query terms and the extended terms of the product query terms to form a negative sample pool.
[0014] A product data set is constructed based on the positive sample pool and the negative sample pool.
[0015] Preferably, the step of fusing the fine-tuned multiple single semantic basic models to obtain a new composite semantic model comprises:
[0016] Obtain parameter weights of multiple single fine-tuned semantic base models;
[0017] Weighting the parameter weights of multiple single fine-tuned semantic base models to obtain weighted parameter weights;
[0018] A new composite semantic model is obtained based on the weighted parameter weights.
[0019] Preferably, the step of constructing a product data set based on the positive sample pool and the negative sample pool comprises:
[0020] The positive sample pool is traversed circularly according to the product query words, and random sampling is performed from the negative sample pool to construct the product data set.
[0021] Preferably, the step of fine-tuning a plurality of single semantic base models based on the product data set to obtain a plurality of fine-tuned single semantic base models comprises:
[0022] Based on the product data set, multiple single semantic base models are trained to obtain multiple fine-tuned single semantic base models.
[0023] Preferably, the optimization method further comprises:
[0024] The product sample quantity and product sample quality are controlled to optimize the product data set.
[0025] A second aspect of the present disclosure provides a semantic model optimization system, the optimization system comprising:
[0026] The acquisition module is used to obtain product data sets;
[0027] A fine-tuning module, used to fine-tune the multiple single semantic base models based on the product data set to obtain multiple fine-tuned single semantic base models;
[0028] The fusion module is used to fuse the multiple single semantic basic models after fine-tuning to obtain a new composite semantic model.
[0029] Preferably, the acquisition module includes:
[0030] A matching unit, used for matching samples containing product query words and extended words of product query words from a sample database by adopting an incremental constrained sampling strategy to form a positive sample pool;
[0031] A screening unit, used to screen out samples that are semantically irrelevant but similar to the product query term and the extended terms of the product query term from the sample database by adopting a similarity constraint sampling strategy, to form a negative sample pool;
[0032] A construction unit is used to construct a product data set based on the positive sample pool and the negative sample pool.
[0033] Preferably, the fusion module includes:
[0034] A first acquisition unit, used to acquire parameter weights of multiple single fine-tuned semantic base models;
[0035] A weighting unit, used for weighting the parameter weights of multiple single fine-tuned semantic basic models to obtain weighted parameter weights;
[0036] The second acquisition unit is used to obtain a new composite semantic model based on the weighted parameter weights.
[0037] Preferably, the construction unit is used to loop through the positive sample pool according to product query terms, and randomly sample from the negative sample pool to construct the product data set.
[0038] Preferably, the fine-tuning module is used to train multiple single semantic base models based on the product data set to obtain multiple fine-tuned single semantic base models.
[0039] Preferably, the optimization system further comprises:
[0040] The control module is used to control the quantity and quality of product samples to optimize the product data set.
[0041] A third aspect of the present disclosure provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and used to run on the processor, wherein the processor implements the semantic model optimization method described in the first aspect when executing the computer program.
[0042] A fourth aspect of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for optimizing the semantic model described in the first aspect is implemented.
[0043] A fifth aspect of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the semantic model optimization method as described in the first aspect.
[0044] On the basis of being in accordance with the common sense in the art, the above-mentioned preferred conditions can be arbitrarily combined to obtain the preferred embodiments of the present disclosure.
[0045] The positive and progressive effects of this disclosure are:
[0046] The present invention constructs a product data set and fine-tunes multiple single semantic base models, and then fuses the multiple single semantic base models after fine-tuning to obtain a new composite semantic model, which can effectively reduce resource dependence while improving the accuracy and generalization ability of the semantic model and reducing costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 A flowchart of the optimization method of the semantic model provided in the disclosed embodiment 1.
[0048] Figure 2 A module diagram of the semantic model optimization system provided in Example 2 of the present disclosure.
[0049] Figure 3 This is a schematic diagram of the structure of an electronic device for implementing the optimization method of the semantic model according to Embodiment 3 of the present disclosure. DETAILED DESCRIPTION
[0050] The present disclosure is further described below by way of examples, but the present disclosure is not limited to the scope of the examples.
[0051] Prefixes such as "first" and "second" are used in the embodiments of the present disclosure only to distinguish different description objects, and have no limiting effect on the position, order, priority, quantity or content of the described objects. The use of prefixes such as ordinal numbers to distinguish description objects in the embodiments of the present disclosure does not constitute a limitation on the described objects. For the statement of the described objects, please refer to the description in the context of the claims or embodiments, and no unnecessary limitation should be constituted due to the use of such prefixes. In addition, in the description of the present embodiment, unless otherwise specified, the meaning of "plurality" is two or more.
[0052] In the embodiments of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0053] Example 1
[0054] Figure 1 This is a flowchart of a semantic model optimization method provided in this embodiment. It should be noted that the semantic model optimization method disclosed in this disclosure can be applied to different application scenarios, for example, it can be applied to tourism scenarios, and can also be applied to other scenarios. Figure 1 As shown, the optimization method includes:
[0055] S1. Obtain product data set;
[0056] S2. Fine-tune multiple single semantic base models based on the product dataset to obtain multiple fine-tuned single semantic base models;
[0057] In this embodiment, based on the constructed product dataset, the open source RetroMAE architecture is used to perform targeted fine-tuning on multiple open source single semantic basic models, thereby improving the applicability and accuracy of the models in tourism scenarios, and thus obtaining a private semantic model that can understand the semantic information of tourism scenarios.
[0058] It should be noted that multiple single semantic basic models may include BGE (BAAI General Embedding) (a general semantic vector model created by the AI Research Institute) model and GTE (general text embedding) (a general semantic vector model open-sourced by the DAMO Academy) model, and may also include other semantic basic models.
[0059] In addition, considering the inadequacies of general semantic models in processing tourism-specific terms and named entities, the present invention aims to develop a semantic model specifically customized for the tourism field that can more accurately understand and process tourism-related professional terms and user queries.
[0060] S3. Fuse multiple fine-tuned single semantic basic models to obtain a new composite semantic model.
[0061] In this embodiment, in order to improve the generalization ability and stability of the privatized semantic model, the present invention adopts a linear weighting strategy to fuse multiple fine-tuned single semantic base models (for example, fine-tuned BGE and GTE models), and the fused model can maintain a high degree of stability and accuracy during the iteration process. Furthermore, multiple single semantic base models are fused into a new composite semantic model, aiming to improve the generalization ability and stability of the single semantic base model while reducing resource consumption. The reliability of the service and the consistency of the user experience are ensured.
[0062] This embodiment constructs a product data set and fine-tunes multiple single semantic base models, and then fuses the multiple single semantic base models after fine-tuning to obtain a new composite semantic model, which can effectively reduce resource dependence while improving the accuracy and generalization ability of the semantic model and reducing costs.
[0063] In an optional embodiment, S1 includes:
[0064] S11, using an incremental constrained sampling strategy to match samples containing product query terms and extended terms of product query terms from a sample database to form a positive sample pool;
[0065] In this embodiment, the expression for forming a positive sample pool using an incremental constrained sampling strategy is shown in formula (1):
[0066]
[0067] Among them, D pos Represents the positive sample pool, x represents the product query term and the corresponding expansion term of the product query term, and y represents the sample data. contain() represents the sample that matches x from y. inc() represents the number of samples, which is determined by the number of expansion terms. The specific rules are as follows:
[0068] When the number of extended words is equal to 0, the total sampling volume inc = 10
[0069] When the number of extended words is less than or equal to 5, the total sampling volume inc = 40
[0070] When the number of extended words is less than 10, the total sampling volume inc=80
[0071] When the number of extended words is less than or equal to 16, the total sampling volume inc = 130
[0072] When the number of extended words is greater than 16, the total sampling amount inc = 180;
[0073] S12, using a similarity constraint sampling strategy to filter out samples that are semantically unrelated but similar to the product query term and the extended terms of the product query term from the sample database to form a negative sample pool;
[0074] In this embodiment, the expression of forming a negative sample pool using a similarity constraint sampling strategy is shown in formula (2):
[0075]
[0076] Among them, D neg Represents the negative sample pool, rele() represents the calculation of the cosine similarity of x and y, and threshold represents the default threshold interval.
[0077] S13. Build a product dataset based on the positive sample pool and the negative sample pool.
[0078] In this embodiment, for example, taking the tourism scene as an example, by screening the proper nouns commonly used in the tourism scene and semantically expanding each query word, a query word and its expansion word system specifically for the tourism scene is formed. Using the similarity constraint sampling strategy, samples that are semantically irrelevant but highly close to the query word and its expansion word are screened out from the sample database through similarity calculation to form a negative sample pool. At the same time, a sampling strategy with incremental constraints is used to accurately match samples containing query words and their expansion words from the sample database, and the total sampling amount is determined by the number of expansion words to form a positive sample pool. These strategies ensure that the product data set meets the requirements of semantic model training in both quality and quantity.
[0079] It should be noted that the above-mentioned new product data set construction and sampling method can effectively generate positive and negative samples related to the query. This method will use automation technology to achieve efficient construction of product data sets, greatly improving the speed and quality of data processing.
[0080] In addition, by constructing a data set tailored to the unique needs of the tourism industry, the semantic accuracy in specific industry scenarios is improved, and the accuracy of the model in processing tourism-related queries is significantly improved. Through a deep understanding of common terms and proper nouns in the tourism industry and their correct application in the semantic model, the model can more accurately understand and respond to user needs, thereby providing more accurate information services in practical applications.
[0081] In an optional embodiment, S3 includes:
[0082] S31, obtaining parameter weights of multiple single fine-tuned semantic base models;
[0083] S32, weighting the parameter weights of the multiple single fine-tuned semantic basic models to obtain weighted parameter weights;
[0084] S33. Obtain a new composite semantic model based on the weighted parameter weights.
[0085] In this embodiment, the stability and performance of the model are enhanced by reasonably adjusting the weights of each single model. Specifically, all model parameter weights of multiple single fine-tuned semantic basic models are obtained, and the parameters are updated in a weighted combination manner. The update formula is shown in formula (3). Assume that the parameter vector of each model is represented by Pk, k = 1, 2, ..., n. The parameter weight is represented by w = (w1, w2, ...):
[0086]
[0087] Among them, P new,k represents the weighted parameter weight, P i,k represents the kth vector parameter of the ith model.
[0088] It is necessary to explain that the above formula can be used to weight the parameter weights of multiple single fine-tuned semantic basic models to obtain a new composite semantic model. Here, the parameter weight is set to w = (0.5, 0.5).
[0089] In an optional embodiment, S13 includes:
[0090] S131. Loop through the positive sample pool according to the product query terms, and randomly sample from the negative sample pool to build a product data set.
[0091] In this embodiment, the positive sample pool is traversed according to the product query word, and then randomly sampled from the negative sample pool to form a triple: {query:str,pos:[list],neg:[list]}. In the tourism scenario, the number of pos can be set to 1 and the number of neg can be set to 15.
[0092] In an optional embodiment, S2 includes:
[0093] S21. Train multiple single semantic base models based on the product dataset to obtain multiple fine-tuned single semantic base models.
[0094] In this embodiment, multiple open source single semantic basic models are trained offline on the open source RetroMAE framework using the constructed product dataset.
[0095] In an optional embodiment, the optimization method further includes:
[0096] Control the number and quality of product samples to optimize the product data set.
[0097] In this embodiment, the sampling strategy with increment constraint and similarity constraint optimizes the product data set by precisely controlling the quantity and quality of product samples.
[0098] This embodiment enhances the generalization ability and stability of the model by fine-tuning and optimizing the fusion of multiple single semantic basic models. The model fusion strategy of this embodiment not only maintains the accuracy of the model, but also significantly improves the applicability and stability of the model in different tourism scenarios. This enhanced stability enables the model to effectively adapt to the changing user query behavior and complex scenario requirements, ensuring the continuity and reliability of the service; it simplifies and optimizes the training and application of semantic models in tourism scenarios, and improves the professionalism of the model.
[0099] It should be noted that the traditional product data set construction often relies on a lot of manual intervention. The present invention significantly reduces the reliance on manual resources through automated data screening and sampling strategies, while improving the ability to process large-scale data. This improvement not only reduces the burden of labor costs, but also improves the speed and efficiency of data processing, providing stronger support for model training and real-time query.
[0100] Compared with the existing single semantic model, the dataset construction method and model training strategy of the present invention are more suitable for processing vertical industry scenarios, which can effectively reduce resource dependence while improving the accuracy and generalization ability of the model. In addition, through the dataset and model fusion strategy designed specifically for tourism scenarios, the performance and efficiency of the model in practical applications can be significantly improved.
[0101] In addition, the present invention not only achieves technological innovation, but also demonstrates obvious commercial value and improvement in user experience in practical applications, and has important practical and promotional value.
[0102] Example 2
[0103] Corresponding to the aforementioned embodiment of a semantic model optimization method, the present disclosure also provides an embodiment of a semantic model optimization system.
[0104] Figure 2 This is a module diagram of a semantic model optimization system provided by an embodiment of the present disclosure. It should be noted that the semantic model optimization system of the present disclosure can be applied to different application scenarios, for example, it can be applied to tourism scenarios, and can also be applied to other scenarios. Figure 2 As shown, the optimization system includes: an acquisition module 21, a fine-tuning module 22, and a fusion module 23;
[0105] An acquisition module 21 is used to acquire a product data set;
[0106] A fine-tuning module 22, configured to fine-tune the plurality of single semantic base models based on the product data set to obtain the plurality of single semantic base models after fine-tuning;
[0107] In this embodiment, based on the constructed product dataset, the open source RetroMAE architecture is used to perform targeted fine-tuning on multiple open source single semantic basic models, thereby improving the applicability and accuracy of the models in tourism scenarios, and thus obtaining a private semantic model that can understand the semantic information of tourism scenarios.
[0108] It should be noted that the multiple single semantic basic models may include a BGE model and a GTE model, and may also include other semantic basic models.
[0109] In addition, considering the inadequacies of general semantic models in processing tourism-specific terms and named entities, the present invention aims to develop a semantic model specifically customized for the tourism field that can more accurately understand and process tourism-related professional terms and user queries.
[0110] The fusion module 23 is used to fuse the fine-tuned single semantic basic models to obtain a new composite semantic model.
[0111] In this embodiment, in order to improve the generalization ability and stability of the privatized semantic model, the present invention adopts a linear weighting strategy to fuse multiple fine-tuned single semantic base models (for example, fine-tuned BGE and GTE models), and the fused model can maintain a high degree of stability and accuracy during the iteration process. Furthermore, multiple single semantic base models are fused into a new composite semantic model, aiming to improve the generalization ability and stability of the single semantic base model while reducing resource consumption. The reliability of the service and the consistency of the user experience are ensured.
[0112] This embodiment constructs a product data set and fine-tunes multiple single semantic base models, and then fuses the multiple single semantic base models after fine-tuning to obtain a new composite semantic model, which can effectively reduce resource dependence while improving the accuracy and generalization ability of the semantic model and reducing costs.
[0113] In an optional embodiment, the acquisition module includes:
[0114] A matching unit, used for matching samples containing product query words and extended words of product query words from a sample database by adopting an incremental constrained sampling strategy to form a positive sample pool;
[0115] In this embodiment, the expression for forming the positive sample pool using the incremental constrained sampling strategy is shown in formula (1) in Embodiment 1.
[0116] A screening unit, used to screen out samples that are semantically irrelevant but similar to the product query term and the extended terms of the product query term from the sample database by adopting a similarity constraint sampling strategy, to form a negative sample pool;
[0117] In this embodiment, the expression for forming a negative sample pool using a similarity constraint sampling strategy is shown in formula (2) in Embodiment 1.
[0118] A construction unit is used to construct a product dataset based on the positive sample pool and the negative sample pool.
[0119] In this embodiment, for example, taking the tourism scene as an example, by screening the proper nouns commonly used in the tourism scene and semantically expanding each query word, a query word and its expansion word system specifically for the tourism scene is formed. Using the similarity constraint sampling strategy, samples that are semantically irrelevant but highly close to the query word and its expansion word are screened out from the sample database through similarity calculation to form a negative sample pool. At the same time, a sampling strategy with incremental constraints is used to accurately match samples containing query words and their expansion words from the sample database, and the total sampling amount is determined by the number of expansion words to form a positive sample pool. These strategies ensure that the product data set meets the requirements of semantic model training in both quality and quantity.
[0120] It should be noted that the above-mentioned new product data set construction and sampling method can effectively generate positive and negative samples related to the query. This method will use automation technology to achieve efficient construction of product data sets, greatly improving the speed and quality of data processing.
[0121] In addition, by constructing a data set tailored to the unique needs of the tourism industry, the semantic accuracy in specific industry scenarios is improved, and the accuracy of the model in processing tourism-related queries is significantly improved. Through a deep understanding of common terms and proper nouns in the tourism industry and their correct application in the semantic model, the model can more accurately understand and respond to user needs, thereby providing more accurate information services in practical applications.
[0122] In an optional embodiment, the fusion module includes:
[0123] A first acquisition unit, used to acquire parameter weights of multiple single fine-tuned semantic base models;
[0124] A weighting unit, used for weighting the parameter weights of multiple single fine-tuned semantic basic models to obtain weighted parameter weights;
[0125] The second acquisition unit is used to obtain a new composite semantic model based on the weighted parameter weights.
[0126] In this embodiment, the stability and performance of the model are enhanced by reasonably adjusting the weights of each single model. Specifically, all model parameter weights of multiple single fine-tuned semantic basic models are obtained, and the parameters are updated in a weighted combination manner. The update formula is shown in formula (3) in Example 1.
[0127] It is necessary to explain that the above formula can be used to weight the parameter weights of multiple single fine-tuned semantic basic models to obtain a new composite semantic model. Here, the parameter weight is set to w = (0.5, 0.5).
[0128] In an optional embodiment, the construction unit is used to loop through the positive sample pool according to the product query terms and randomly sample from the negative sample pool to construct a product data set.
[0129] In this embodiment, the positive sample pool is traversed according to the product query word, and then randomly sampled from the negative sample pool to form a triple: {query:str,pos:[list],neg:[list]}. In the tourism scenario, the number of pos can be set to 1 and the number of neg can be set to 15.
[0130] In an optional embodiment, the fine-tuning module is used to train multiple single semantic base models based on the product data set to obtain multiple single semantic base models after fine-tuning.
[0131] In this embodiment, multiple open source single semantic basic models are trained offline on the open source RetroMAE framework using the constructed product dataset.
[0132] In an optional embodiment, the optimization system further includes:
[0133] The control module is used to control the quantity and quality of product samples to optimize the product data set.
[0134] In this embodiment, the sampling strategy with increment constraint and similarity constraint optimizes the product data set by precisely controlling the number and quality of product samples.
[0135] This embodiment enhances the generalization ability and stability of the model by fine-tuning and optimizing the fusion of multiple single semantic basic models. The model fusion strategy of this embodiment not only maintains the accuracy of the model, but also significantly improves the applicability and stability of the model in different tourism scenarios. This enhanced stability enables the model to effectively adapt to the changing user query behavior and complex scenario requirements, ensuring the continuity and reliability of the service; it simplifies and optimizes the training and application of semantic models in tourism scenarios, and improves the professionalism of the model.
[0136] It should be noted that the traditional product data set construction often relies on a lot of manual intervention. The present invention significantly reduces the reliance on manual resources through automated data screening and sampling strategies, while improving the ability to process large-scale data. This improvement not only reduces the burden of labor costs, but also improves the speed and efficiency of data processing, providing stronger support for model training and real-time query.
[0137] Compared with the existing single semantic model, the dataset construction method and model training strategy of the present invention are more suitable for processing vertical industry scenarios, which can effectively reduce resource dependence while improving the accuracy and generalization ability of the model. In addition, through the dataset and model fusion strategy designed specifically for tourism scenarios, the performance and efficiency of the model in practical applications can be significantly improved.
[0138] In addition, the present invention not only achieves technological innovation, but also demonstrates obvious commercial value and improvement in user experience in practical applications, and has important practical and promotional value.
[0139] As for the system embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The system embodiment described above is only illustrative, wherein the units described as separate components may or may not be physically separated, and the components as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the disclosed solution.
[0140] Example 3
[0141] Figure 3 This is a structural diagram of an electronic device shown in Embodiment 3 of the present disclosure, wherein the electronic device includes a memory, a processor, and a computer program stored in the memory and used to run on the processor, and when the processor executes the computer program, the method for optimizing the semantic model described in any of the above embodiments is implemented. Figure 3 The electronic device 90 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0142] like Figure 3 As shown, the electronic device 90 may be in the form of a general-purpose computing device, for example, it may be a server device. The components of the electronic device 90 may include, but are not limited to: at least one processor 91, at least one memory 92, and a bus 93 connecting different system components (including the memory 92 and the processor 91).
[0143] The bus 93 includes a data bus, an address bus, and a control bus.
[0144] The memory 92 may include a volatile memory, such as a random access memory (RAM) 921 and / or a cache memory 922 , and may further include a read-only memory (ROM) 923 .
[0145] The memory 92 may also include a program tool 925 (or utility) having a set (at least one) of program modules 924, such program modules 924 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include an implementation of a network environment.
[0146] The processor 91 executes various functional applications and data processing by running the computer program stored in the memory 92, such as the optimization method of the semantic model provided in any of the above embodiments.
[0147] The electronic device 90 may also communicate with one or more external devices 94 (e.g., keyboards, pointing devices, etc.). Such communication may be performed via an input / output (I / O) interface 95. Furthermore, the electronic device 90 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 96. Figure 3 As shown, the network adapter 96 communicates with other modules of the electronic device 90 via the bus 93. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 90, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems, etc.
[0148] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules to be embodied.
[0149] Example 4
[0150] Embodiment 4 of the present disclosure further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method for optimizing the semantic model provided in any of the above embodiments is implemented.
[0151] The readable storage medium may include but is not limited to: a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device or any suitable combination of the above.
[0152] Example 5
[0153] Embodiment 5 of the present disclosure further provides a computer program product, including a computer program, which, when executed by a processor, implements any of the semantic model optimization methods described above.
[0154] Among them, the program code for executing the computer program product of the present disclosure can be written in any combination of one or more programming languages, and the program code can be executed completely on the user device, partially on the user device, as an independent software package, partially on the user device and partially on a remote device, or completely on the remote device.
[0155] Although the specific embodiments of the present disclosure are described above, those skilled in the art should understand that this is only an example, and the protection scope of the present disclosure is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present disclosure, but these changes and modifications all fall within the protection scope of the present disclosure.
Claims
1. A semantic model optimization method, It is characterized in that The optimization method comprises: Get product datasets; Fine-tune the multiple single semantic base models based on the product data set to obtain multiple fine-tuned single semantic base models; The fine-tuned multiple single semantic basic models are fused to obtain a new composite semantic model.
2. The method for optimizing a semantic model according to claim 1, It is characterized in that The step of obtaining the product data set includes: An incremental constrained sampling strategy is used to match samples containing product query terms and extended terms of product query terms from the sample database to form a positive sample pool; A similarity-constrained sampling strategy is used to filter out samples from the sample database that are semantically irrelevant but similar to the product query terms and the extended terms of the product query terms to form a negative sample pool. A product data set is constructed based on the positive sample pool and the negative sample pool.
3. The method for optimizing a semantic model according to claim 1, It is characterized in that The step of fusing the fine-tuned multiple single semantic basic models to obtain a new composite semantic model comprises: Obtain parameter weights of multiple single fine-tuned semantic base models; Weighting the parameter weights of multiple single fine-tuned semantic base models to obtain weighted parameter weights; A new composite semantic model is obtained based on the weighted parameter weights.
4. The method for optimizing a semantic model according to claim 2, It is characterized in that The step of constructing a product data set based on the positive sample pool and the negative sample pool comprises: The positive sample pool is traversed circularly according to the product query words, and random sampling is performed from the negative sample pool to construct the product data set.
5. The method for optimizing a semantic model according to claim 1, It is characterized in that The step of fine-tuning a plurality of single semantic base models based on the product data set to obtain a plurality of fine-tuned single semantic base models comprises: Based on the product data set, multiple single semantic base models are trained to obtain multiple fine-tuned single semantic base models.
6. The method for optimizing a semantic model according to claim 1, It is characterized in that The optimization method further comprises: The product sample quantity and product sample quality are controlled to optimize the product data set.
7. A semantic model optimization system, It is characterized in that The optimization system comprises: The acquisition module is used to obtain product data sets; A fine-tuning module, used to fine-tune the multiple single semantic base models based on the product data set to obtain multiple fine-tuned single semantic base models; The fusion module is used to fuse the multiple single semantic basic models after fine-tuning to obtain a new composite semantic model.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and for running on the processor, It is characterized in that When the processor executes the computer program, the method for optimizing the semantic model according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method for optimizing the semantic model according to any one of claims 1 to 6 is implemented.
10. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the method for optimizing the semantic model according to any one of claims 1 to 6 is implemented.
