Model training method, hotel non-room product classification method, system and equipment

CN118708970APending Publication Date: 2024-09-27CTRIP COMP TECH SHANGHAI
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410854489.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

[0003]本公开要解决的技术问题是为了克服现有技术中的自然语言处理方式,存在语义理解和上下文分析能力差的缺陷,提供一种模型训练方法、酒店非房产品的分类方法、系统及设备

Benefits of technology

[0059] A seventh aspect of the present disclosure provides a computer program product, which includes a computer program. When executed by a processor, the computer program implements the model training method as described in the first aspect, or executes the hotel non-room maintenance method as described in the third aspect. How to classify products.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118708970A
    Figure CN118708970A
Patent Text Reader

Abstract

The invention provides a model training method, a hotel non-room product classification method, system and device, and the method comprises the steps: obtaining a historical training data set which comprises the historical hotel non-room product data as the input and the historical classification category corresponding to the historical hotel non-room product data as the output; and training a bert model based on historical hotel non-room product data and historical classification categories to obtain a classification model. According to the method, the historical hotel non-room product data and the historical classification categories corresponding to the historical hotel non-room product data in the hotel OTA industry are fully utilized to construct the classification model of the non-room products, and the classification model is used for classification prompting when the names of the non-room products are input, so that the rejection rate of operation during auditing is reduced; and the assembly line efficiency of inputting the whole product to online is improved, and the semantic comprehension capability and the context analysis capability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to a model training method, a classification method, a system and a device for hotel non-room products. Background Art

[0002] Natural language processing is one of the important branches in the field of artificial intelligence. Its technology has been widely used in sub-fields such as text analysis, machine translation, and sentiment analysis. At present, traditional rule-based methods rely heavily on manually defined grammatical rule bases, which often have difficulty in handling the complexity and flexibility of language. Statistical methods, such as bag-of-words models and word2vec models, use corpora for training. These methods still have shortcomings in semantic understanding and context analysis. Summary of the invention

[0003] The technical problem to be solved by the present disclosure is to overcome the defects of poor semantic understanding and context analysis capabilities of the natural language processing method in the prior art, and to provide a model training method, a classification method, system and equipment for hotel non-room products.

[0004] The present invention solves the above technical problems through the following technical solutions:

[0005] A first aspect of the present disclosure provides a model training method, the model training method comprising:

[0006] Acquire a historical training data set, the historical training data set including historical hotel non-room product data as input and historical classification categories corresponding to the historical hotel non-room product data as output;

[0007] A BERT model is trained based on the historical hotel non-room product data and the historical classification categories to obtain a classification model.

[0008] Preferably, after the step of obtaining a historical training data set, the model training method further comprises:

[0009] Performing stop word removal and data deduplication processing on the historical training data set to obtain a processed historical training data set;

[0010] Performing data cleaning on the processed historical training data set to obtain a historical training data set after data cleaning;

[0011] Performing data enhancement processing on the historical training data set after the data cleaning processing to obtain a historical training data set after data enhancement;

[0012] The BERT model is used to fine-tune the historical training data set after the data enhancement.

[0013] Preferably, the step of performing data cleaning on the processed historical training data set to obtain the historical training data set after data cleaning comprises:

[0014] Obtain the prediction probability of the BERT model in each historical classification category through five-fold cross validation;

[0015] Calculating and calibrating a count matrix using the predicted probability to obtain a joint distribution of noise labels and true labels of the processed historical training data set;

[0016] Acquire a set of incorrectly labeled samples in the processed historical training data set based on the joint distribution;

[0017] Performing a secondary check on the incorrectly labeled sample set, and adding the incorrectly labeled sample set after the secondary check to the processed historical training data set to obtain a historical training data set after data cleaning processing;

[0018] and / or,

[0019] The step of fine-tuning the data-enhanced historical training data set using the BERT model includes:

[0020] Use the dictionary in the BERT model to perform word segmentation on the data-enhanced historical training data set to obtain the word segmentation-processed historical training data set;

[0021] Dividing the historical training data set after the word segmentation processing into a training set and a verification set according to a preset ratio;

[0022] Perform fine-tuning training on the training set by using the BERT model combined with label smoothing technology and adversarial training technology;

[0023] The classification model is validated using the validation set.

[0024] A second aspect of the present disclosure provides a model training system, the model training system comprising:

[0025] A historical training data set acquisition module, used to acquire a historical training data set, the historical training data set including historical hotel non-room product data as input and historical classification categories corresponding to the historical hotel non-room product data as output;

[0026] A training module is used to train a BERT model based on the historical hotel non-room product data and the historical classification categories to obtain a classification model.

[0027] Preferably, the model training system further includes:

[0028] A preprocessing module, used to remove stop words and data duplication from the historical training data set to obtain a processed historical training data set;

[0029] A data cleaning processing module is used to perform data cleaning on the processed historical training data set to obtain the historical training data set after data cleaning;

[0030] A data enhancement processing module is used to perform data enhancement processing on the historical training data set after the data cleaning processing to obtain a historical training data set after data enhancement;

[0031] The fine-tuning processing module is used to use the BERT model to perform fine-tuning on the historical training data set after the data enhancement.

[0032] Preferably, the data cleaning processing module includes:

[0033] A first acquisition unit is used to obtain the prediction probability of the BERT model in each historical classification category through five-fold cross validation;

[0034] A second acquisition unit is used to calculate and calibrate a count matrix using the predicted probability to obtain a joint distribution of noise labels and true labels of the processed historical training data set;

[0035] A third acquisition unit, configured to acquire a set of erroneous label samples in the processed historical training data set based on the joint distribution;

[0036] A secondary verification unit is used to perform secondary verification on the wrong label sample set, and add the wrong label sample set after secondary verification to the processed historical training data set to obtain the historical training data set after data cleaning processing;

[0037] and / or,

[0038] The fine-tuning processing module comprises:

[0039] A word segmentation processing unit, used to perform word segmentation processing on the data-enhanced historical training data set using the dictionary in the BERT model to obtain the historical training data set after word segmentation processing;

[0040] A division unit, used to divide the historical training data set after the word segmentation processing into a training set and a verification set according to a preset ratio;

[0041] A fine-tuning training unit, used to perform fine-tuning training on the training set by using the BERT model combined with label smoothing technology and adversarial training technology;

[0042] A verification unit is used to verify the classification model using the verification set.

[0043] A third aspect of the present disclosure provides a classification method for hotel non-room products, the classification method comprising:

[0044] Obtain hotel non-room product data to be classified;

[0045] Inputting the hotel non-room product data to be classified into a classification model for classification, and obtaining a predicted classification category corresponding to the hotel non-room product data to be classified;

[0046] Wherein, the classification model is trained using the model training method described in the first aspect above.

[0047] Preferably, the step of inputting the hotel non-room product data to be classified into a classification model for classification to obtain a predicted classification category corresponding to the hotel non-room product data to be classified comprises:

[0048] deploying the classification model as an algorithm interface;

[0049] The hotel non-room product data to be classified is input into the algorithm interface for classification, and a predicted classification category corresponding to the hotel non-room product data to be classified is obtained.

[0050] A fourth aspect of the present disclosure provides a classification system for hotel non-room products, the classification system comprising:

[0051] Product information acquisition module, used to obtain hotel non-room product data to be classified;

[0052] A classification module, used for inputting the hotel non-room product data to be classified into a classification model for classification, and obtaining a predicted classification category corresponding to the hotel non-room product data to be classified;

[0053] Wherein, the classification model is trained using the model training system described in the second aspect above.

[0054] Preferably, the classification module comprises:

[0055] A deployment unit, used to deploy the classification model as an algorithm interface;

[0056] The classification unit is used to input the hotel non-room product data to be classified into the algorithm interface for classification, and obtain the predicted classification category corresponding to the hotel non-room product data to be classified.

[0057] A fifth 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 when the processor executes the computer program, the model training method described in the first aspect is implemented, or the classification method of hotel non-room products described in the third aspect is executed.

[0058] A sixth aspect of the present disclosure provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the model training method described in the first aspect is implemented, or the classification method for hotel non-room products described in the third aspect is executed.

[0059] A seventh aspect of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the model training method as described in the first aspect, or executes the classification method for hotel non-room products as described in the third aspect.

[0060] 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.

[0061] The positive and progressive effects of this disclosure are:

[0062] The present invention makes full use of the historical hotel non-room product data in the hotel OTA industry and the historical classification categories corresponding to the historical hotel non-room product data to construct a classification model for non-room products, which is used for classification prompts when entering the names of non-room products, thereby reducing the rejection rate of operations during review, improving the overall product entry to online assembly line efficiency, and enhancing semantic understanding capabilities and context analysis capabilities. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 A flowchart of the model training method provided in Example 1 of the present disclosure.

[0064] Figure 2 A schematic diagram of data enhancement processing using a large language model provided in Examples 1 and 2 of the present disclosure.

[0065] Figure 3 A framework diagram of the confidence learning algorithm provided for Embodiments 1 and 2 of the present disclosure.

[0066] Figure 4 A schematic diagram of the modules of the model training system provided in Embodiment 2 of the present disclosure.

[0067] Figure 5 It is a schematic diagram of the structure of the electronic device of embodiments 3 and 8 of the present disclosure.

[0068] Figure 6 A flowchart of a method for classifying hotel non-room products provided in Example 6 of the present disclosure.

[0069] Figure 7 A module diagram of a classification system for hotel non-room products provided in Example 7 of the present disclosure. DETAILED DESCRIPTION

[0070] The present disclosure is further described below by way of examples, but the present disclosure is not limited to the scope of the examples.

[0071] 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.

[0072] 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.

[0073] Example 1

[0074] Figure 1 A flowchart of a model training method provided in Example 1 of the present disclosure, such as Figure 1 As shown, the model training method includes:

[0075] S11, obtaining a historical training data set, where the historical training data set includes historical hotel non-room product data as input and historical classification categories corresponding to the historical hotel non-room product data as output;

[0076] In this embodiment, the historical training data set can be understood as the historical audit data of the hotel OTA industry.

[0077] In this embodiment, in the hotel OTA industry, non-room x items (i.e., hotel non-room products) refer to products or services other than hotel rooms, such as afternoon tea, dinner, etc. The hotel business needs to select the appropriate category through the system and fill in the required information of the corresponding category to upload the hotel's non-room x item information. Then the operation will review the information uploaded by the business, and only the x items that have passed the review can be sold.

[0078] It should be noted that the historical audit data of the hotel OTA industry is about 100,000. According to the classification rules of non-room x items, there are 36 categories of x items.

[0079] S12. Train the BERT model based on historical hotel non-room product data and historical classification categories to obtain a classification model.

[0080] In this embodiment, a deep neural network is used to train a BERT model from historical audit data of the hotel OTA industry, and the classification model obtained by the training is used to classify the newly entered x item names on the system.

[0081] This embodiment makes full use of the historical hotel non-room product data in the hotel OTA industry and the historical classification categories corresponding to the historical hotel non-room product data to construct a classification model for non-room products, which is used for classification prompts when entering the names of non-room products, thereby reducing the rejection rate of operations during review, improving the overall product entry to online assembly line efficiency, and enhancing semantic understanding capabilities and context analysis capabilities.

[0082] In an optional embodiment, after S11, the model training method further includes:

[0083] S111, performing stop word removal and data deduplication processing on the historical training data set to obtain a processed historical training data set;

[0084] In this embodiment, the majority voting method is used to remove duplicate text and stop words from the x-item names on the historical training data set.

[0085] S112, performing data cleaning on the processed historical training data set to obtain a historical training data set after data cleaning;

[0086] In this embodiment, a confidence learning algorithm is used to clean the processed historical training data set to find out the wrong label samples in the processed historical training data set to improve the data quality.

[0087] S113, performing data enhancement processing on the historical training data set after data cleaning processing to obtain a historical training data set after data enhancement;

[0088] In this embodiment, the prompt project of the large language model is used for data enhancement processing, and samples are generated for categories with a small number of samples; specifically, Figure 2 As shown, the large language model used in this embodiment is GPT4. Combined with the prompt word project, GPT4 is used to generate text for categories with small sample sizes in the data set, thereby achieving the purpose of data enhancement; and the enhanced data is added to the data set to obtain the final historical training data set after data enhancement.

[0089] S114. Use the BERT model to fine-tune the historical training data set after data enhancement.

[0090] In this embodiment, the BERT model is used to perform fine-tuning training on the historical training data set after data enhancement, and adversarial training technology is used to enhance the robustness of the model.

[0091] It should be noted that the BERT model in this embodiment is the BERT-Base-Chinese model, which is a Chinese pre-trained model based on the Transformer architecture and uses a large amount of Chinese corpus for training. BERT-Base-Chinese has a 12-layer Transformer encoder with about 1.1 million parameters. It performs well in multiple Chinese natural language processing tasks, such as text classification, named entity recognition, and sentiment analysis.

[0092] In an optional embodiment, S112 includes:

[0093] S1121. Obtain the prediction probability of the BERT model in each historical classification category through five-fold cross validation;

[0094] S1122, using the predicted probability to calculate and calibrate the count matrix, to obtain the joint distribution of the noise labels and true labels of the processed historical training data set;

[0095] S1123, obtaining a set of incorrectly labeled samples in the processed historical training data set based on the joint distribution;

[0096] S1124, perform a second verification on the wrong label sample set, and add the wrong label sample set after the second verification to the processed historical training data set to obtain the historical training data set after data cleaning processing.

[0097] In this embodiment, the joint distribution of noise labels and true labels is estimated by five-fold cross validation; based on the joint distribution, the set of wrong label samples W = {(text0, y0), (text1, y1), …, (text i ,y i )}, where text i Represents the text of the i-th sample in the error sample set, y iRepresents the correct classification that the algorithm believes the i-th sample should belong to; the obtained incorrectly labeled sample set W is manually verified twice, and the incorrectly labeled sample set W` after the manual secondary verification is added to the processed historical training data set. Specifically, the base model used for the five-fold cross-validation is the pre-trained BERT-Base-Chinese model. First, the historical training data set is divided into five parts, and each fold of training has one part as a verification set, so that each sample obtains the predicted probability of the BERT model in each historical classification category; the predicted probability is used to calculate and calibrate the counting matrix, and finally generate the joint distribution of noise labels and true labels. This embodiment uses the Prune by Noise Rate (PBNR) method to find incorrectly labeled samples. This method selects n*p samples for filtering for the non-diagonal units of the counting matrix, and p is the probability corresponding to the unit of the counting matrix in the joint distribution matrix. The incorrectly labeled sample set is manually verified twice to obtain the historical training data set after the confidence learning data cleaning process, such as Figure 3 This is the framework diagram of the confidence learning algorithm;

[0098] In the specific implementation process, the Bert model is first used to perform a five-fold cross-validation on the processed historical training data set to calculate the predicted probability p of the i-th sample in the j-th category. ij , and then calculate the average probability t for each manually calibrated category j j As the confidence threshold. For sample i, its true label y* is the maximum predicted probability among j categories, as shown in formula (1):

[0099] y * = argmax j∈(1,2,..,m) p ij (1)

[0100] Among them, m represents the total number of categories.

[0101] Then calculate the count matrix in represents manually labeled labels, It indicates the number of samples that are manually labeled as category i but predicted by the actual model as category j.

[0102] The count matrix is ​​calibrated to ensure that the total count is consistent with the total number of manually labeled samples. The calculation formula is shown in formula (2), where represents the total number of samples manually marked as category i; m represents the total number of categories;

[0103]

[0104] in, It indicates the number of calibrated samples that are manually labeled as category i but predicted by the actual model as category j.

[0105] Finally, the noise label can be estimated based on the count matrix and the true label y * The joint distribution of As shown in formula (3):

[0106]

[0107] In an optional embodiment, S114 includes:

[0108] S1141, use the dictionary in the BERT model to perform word segmentation on the historical training data set after data enhancement to obtain the historical training data set after word segmentation;

[0109] S1142, dividing the historical training data set after word segmentation processing into a training set and a verification set according to a preset ratio;

[0110] S1143, fine-tuning the training set using the BERT model combined with label smoothing technology and adversarial training technology;

[0111] S1144. Use the validation set to validate the classification model.

[0112] In this embodiment, a dictionary supporting the Bert-Base-Chinese model is used, and the dictionary format adopts label-encoding form, such as: {"people": 0, ...}; all texts in the historical training data set after data enhancement are segmented, and the segmented words are mapped into index form through the dictionary; the historical training data set after word segmentation is divided into a training set and a verification set according to a preset ratio (for example, the preset ratio can be 3:1, or can be set to other values); the training set is used to train the model, and the verification set is used to evaluate the model effect (for example, verify the generalization of the model). Specifically, the pre-trained Bert model is used to fine-tune the training set, and the label smoothing technology and adversarial training technology are combined to alleviate the overfitting problem of the Bert model; after the training is completed, the model effect is verified on the verification set, and a classification model of x items (that is, a multi-classifier model for x-item classification) is generated.

[0113] Specifically, after the pre-trained BERT model obtains the hidden layer representation vector of the text, it is connected to a fully connected layer and then activated by the softmax function to obtain the predicted category. In order to alleviate the problem of unbalanced category distribution in the multi-classification model, the loss function of the BERT model selects the label smoothed cross entropy loss function, denoted as cross-entropyloss, as shown in formula (4):

[0114]

[0115] The label smoothing loss function requires that the weight of the correct category of the BERT model is no longer 1, but becomes 1-, and the total weight of other categories is reset to ∈. Label smoothing is a regularization technique that can alleviate the problem of model overfitting. In addition, the loss function of the BERT model is the label smoothed cross entropy function, which increases the robustness of the model by improving the loss function.

[0116] During fine-tuning, adversarial training techniques are used to improve the accuracy of model predictions. Adversarial training is a training method that can effectively improve the robustness and generalization ability of a model. Its basic principle is to add adversarial perturbations to the original input to obtain adversarial samples, and then use adversarial samples for training to improve the performance of the model. The problem can be abstracted into such an adversarial training model, as shown in formula (5):

[0117] min θ -logP(y|x+r adv ;θ)(5)

[0118] Among them, r adv represents the disturbance added to the model, and θ represents the model parameters. It is hoped that the loss function value of the model training under the disturbance is minimized. The main function of adversarial training technology is to improve the robustness of the model in dealing with malicious adversarial samples and improve the generalization ability.

[0119] During the fine-tuning process, all parameters will be fine-tuned. The BERT model runs for 100 rounds and the early stopping round is set to 10 rounds. In addition, adversarial training technology is added to the fine-tuning process to reduce the overfitting phenomenon of the model and improve the generalization ability of the model. It should be noted that the adversarial training technology used in this embodiment is Fast Gradient Method (FGM), which perturbs the input embedding vector. The specific formula is shown in formulas (6)-(7):

[0120] r adv =∈×g / ||g||2 (6)

[0121]

[0122] Among them, x represents the embedding vector of the input text sequence, g represents the gradient obtained by the forward loss and back propagation of the BERT model, ∈ represents the size of the perturbation, It means to find the gradient of x, and L means the loss function of the bert model.

[0123] Furthermore, the trained classification model is verified on the validation set. The evaluation method of this embodiment is macrof1-score, which is an indicator used to evaluate the performance of multi-class classification models and fully considers the situation of class imbalance. The value of macrof1-score of the validation set in this embodiment is 0.7830.

[0124] This embodiment makes full use of the x-item audit data in the hotel OTA industry to construct a classification model for non-room x-items, which is used for classification prompts when the business enters the name of the x-item in the system, thereby reducing the rejection rate of the operation during the audit and improving the overall product line efficiency from entry to launch. This model classification type also proposes corresponding optimization solutions in terms of data cleaning and model training, which are mainly reflected in: on the one hand, the confidence learning algorithm is used to clean the dirty data of the data set, thereby optimizing the overall data quality of the training data and providing data guarantee for the training of subsequent models, thereby improving the accuracy, robustness and reliability of the model. On the other hand, adversarial training and label smoothing techniques are used to alleviate the overfitting problem of the model, thereby solving the disadvantage of extremely unbalanced label distribution of x-item classification data, thereby improving the recognition accuracy of the model.

[0125] Example 2

[0126] Corresponding to the aforementioned model training method embodiment, the present disclosure also provides an embodiment of a model training system.

[0127] Figure 4 A schematic diagram of a module of a model training system provided in Embodiment 2 of the present disclosure, such as Figure 4 As shown, the model training system includes: a historical training data set acquisition module 21 and a training module 22;

[0128] A historical training data set acquisition module 21 is used to acquire a historical training data set, wherein the historical training data set includes historical hotel non-room product data as input and historical classification categories corresponding to the historical hotel non-room product data as output;

[0129] In this embodiment, the historical training data set can be understood as the historical audit data of the hotel OTA industry.

[0130] In this embodiment, in the hotel OTA industry, non-room x items (i.e., hotel non-room products) refer to products or services other than hotel rooms, such as afternoon tea, dinner, etc. The hotel business needs to select the appropriate category through the system and fill in the required information of the corresponding category to upload the hotel's non-room x item information. Then the operation will review the information uploaded by the business, and only the x items that have passed the review can be sold.

[0131] It should be noted that the historical audit data of the hotel OTA industry is about 100,000. According to the classification rules of non-room x items, there are 36 categories of x items.

[0132] The training module 22 is used to train the BERT model based on historical hotel non-room product data and historical classification categories to obtain a classification model.

[0133] In this embodiment, a deep neural network is used to train a BERT model from historical audit data of the hotel OTA industry, and the classification model obtained by the training is used to classify the newly entered x item names on the system.

[0134] This embodiment makes full use of the historical hotel non-room product data in the hotel OTA industry and the historical classification categories corresponding to the historical hotel non-room product data to construct a classification model for non-room products, which is used for classification prompts when entering the names of non-room products, thereby reducing the rejection rate of operations during review, improving the overall product entry to online assembly line efficiency, and enhancing semantic understanding capabilities and context analysis capabilities.

[0135] In an optional embodiment, the model training system further includes:

[0136] A preprocessing module is used to remove stop words and duplicate data from the historical training data set to obtain a processed historical training data set;

[0137] In this embodiment, the majority voting method is used to remove duplicate text and stop words from the x-item names on the historical training data set.

[0138] A data cleaning processing module is used to perform data cleaning on the processed historical training data set to obtain the historical training data set after data cleaning;

[0139] In this embodiment, a confidence learning algorithm is used to clean the processed historical training data set to find out the wrong label samples in the processed historical training data set to improve the data quality.

[0140] A data enhancement processing module is used to perform data enhancement processing on the historical training data set after data cleaning processing to obtain a historical training data set after data enhancement;

[0141] In this embodiment, the prompt project of the large language model is used for data enhancement processing, and samples are generated for categories with a small number of samples; specifically, Figure 2As shown, the large language model used in this embodiment is GPT4. Combined with the prompt word project, GPT4 is used to generate text for categories with small sample sizes in the data set, thereby achieving the purpose of data enhancement; and the enhanced data is added to the data set to obtain the final historical training data set after data enhancement.

[0142] The fine-tuning processing module is used to use the BERT model to fine-tune the historical training data set after data enhancement.

[0143] In this embodiment, the BERT model is used to perform fine-tuning training on the historical training data set after data enhancement, and adversarial training technology is used to enhance the robustness of the model.

[0144] It should be noted that the BERT model in this embodiment is the BERT-Base-Chinese model, which is a Chinese pre-trained model based on the Transformer architecture and uses a large amount of Chinese corpus for training. BERT-Base-Chinese has a 12-layer Transformer encoder with about 1.1 million parameters. It performs well in multiple Chinese natural language processing tasks, such as text classification, named entity recognition, and sentiment analysis.

[0145] In an optional embodiment, the data cleaning processing module includes:

[0146] The first acquisition unit is used to obtain the prediction probability of the BERT model in each historical classification category through five-fold cross validation;

[0147] The second acquisition unit is used to calculate and calibrate the count matrix using the predicted probability to obtain the joint distribution of the noise labels and the true labels of the processed historical training data set;

[0148] A third acquisition unit is used to acquire a set of incorrectly labeled samples in the processed historical training data set based on the joint distribution;

[0149] The secondary verification unit is used to perform secondary verification on the wrong label sample set, and add the wrong label sample set after secondary verification to the processed historical training data set to obtain the historical training data set after data cleaning processing.

[0150] In this embodiment, the joint distribution of noise labels and true labels is estimated by five-fold cross validation; based on the joint distribution, the set of wrong label samples W = {(text0, y0), (text1, y1), …, (text i ,y i )}, where text iRepresents the text of the i-th sample in the error sample set, y i Represents the correct classification that the algorithm believes the i-th sample should belong to; the obtained incorrectly labeled sample set W is manually verified twice, and the incorrectly labeled sample set W` after the manual secondary verification is added to the processed historical training data set. Specifically, the base model used for the five-fold cross-validation is the pre-trained BERT-Base-Chinese model. First, the historical training data set is divided into five parts, and each fold of training has one part as a verification set, so that each sample obtains the predicted probability of the BERT model in each historical classification category; the predicted probability is used to calculate and calibrate the counting matrix, and finally generate the joint distribution of noise labels and true labels. This embodiment uses the Prune by Noise Rate (PBNR) method to find incorrectly labeled samples. This method selects n*p samples for filtering for the non-diagonal units of the counting matrix, and p is the probability corresponding to the unit of the counting matrix in the joint distribution matrix. The incorrectly labeled sample set is manually verified twice to obtain the historical training data set after the confidence learning data cleaning process, such as Figure 3 This is the framework diagram of the confidence learning algorithm;

[0151] In the specific implementation process, the Bert model is first used to perform a five-fold cross-validation on the processed historical training data set to calculate the predicted probability p of the i-th sample in the j-th category. ij , and then calculate the average probability t for each manually calibrated category j j As the confidence threshold. For sample i, its true label y* is the maximum predicted probability among j categories, as shown in formula (1) in Example 1;

[0152] Then calculate the count matrix in represents manually labeled labels, It indicates the number of samples that are manually labeled as category i but predicted by the actual model as category j.

[0153] The count matrix is ​​calibrated to ensure that the total count is consistent with the total number of manually labeled samples. The calculation formula is as shown in formula (2) in Example 1, where represents the total number of samples manually marked as category i; m represents the total number of categories;

[0154] Finally, the noise label can be estimated based on the count matrix and the true label y * The joint distribution of As shown in formula (3) in Example 1.

[0155] In an optional embodiment, the fine-tuning processing module includes:

[0156] A word segmentation processing unit is used to perform word segmentation processing on the historical training data set after data enhancement using the dictionary in the BERT model to obtain the historical training data set after word segmentation processing;

[0157] A division unit, used to divide the historical training data set after word segmentation processing into a training set and a verification set according to a preset ratio;

[0158] The fine-tuning training unit is used to fine-tune the training set using the BERT model combined with label smoothing technology and adversarial training technology;

[0159] The validation unit is used to validate the classification model using the validation set.

[0160] In this embodiment, a dictionary supporting the Bert-Base-Chinese model is used, and the dictionary format adopts label-encoding form, such as: {"people": 0, ...}; all texts in the historical training data set after data enhancement are segmented, and the segmented words are mapped into index form through the dictionary; the historical training data set after word segmentation is divided into a training set and a verification set according to a preset ratio (for example, the preset ratio can be 3:1, or can be set to other values); the training set is used to train the model, and the verification set is used to evaluate the model effect (for example, verify the generalization of the model). Specifically, the pre-trained Bert model is used to fine-tune the training set, and the label smoothing technology and adversarial training technology are combined to alleviate the overfitting problem of the Bert model; after the training is completed, the model effect is verified on the verification set, and a classification model of x items (that is, a multi-classifier model for x-item classification) is generated.

[0161] Specifically, after the pre-trained BERT model obtains the hidden layer representation vector of the text, it is connected to a fully connected layer and then passed through the softmax activation function to obtain the predicted category. In order to alleviate the problem of unbalanced category distribution in the multi-classification model, the loss function of the BERT model selects the label smoothed cross entropy loss function, denoted as cross-entropyloss, as shown in formula (4) in Example 1;

[0162] The label smoothing loss function requires that the weight of the correct category of the BERT model is no longer 1, but becomes 1-, and the total weight of other categories is reset to ∈. Label smoothing is a regularization technique that can alleviate the problem of model overfitting. In addition, the loss function of the BERT model is the label smoothed cross entropy function, which increases the robustness of the model by improving the loss function.

[0163] During fine-tuning, adversarial training technology is used to improve the accuracy of model prediction. Adversarial training is a training method that can effectively improve the robustness and generalization ability of the model. Its basic principle is to add adversarial perturbations to the original input to obtain adversarial samples, and then use adversarial samples for training to improve the performance of the model. The problem can be abstracted into such an adversarial training model, as shown in formula (5) in Example 1;

[0164] During the fine-tuning process, all parameters will be fine-tuned. The BERT model runs for 100 rounds, and the early stopping round is set to 10 rounds. In addition, adversarial training technology is added to the fine-tuning process to reduce the overfitting phenomenon of the model and improve the generalization ability of the model. It should be noted that the adversarial training technology used in this embodiment is Fast Gradient Method (FGM), which perturbs the input embedding vector. The specific formula is shown in formulas (6)-(7) in Example 1;

[0165] Furthermore, the trained classification model is verified on the validation set. The evaluation method of this embodiment is macrof1-score, which is an indicator used to evaluate the performance of multi-class classification models and fully considers the situation of class imbalance. The value of macrof1-score of the validation set in this embodiment is 0.7830.

[0166] This embodiment makes full use of the x-item audit data in the hotel OTA industry to construct a classification model for non-room x-items, which is used for classification prompts when the business enters the name of the x-item in the system, thereby reducing the rejection rate of the operation during the audit and improving the overall product line efficiency from entry to launch. This model classification type also proposes corresponding optimization solutions in terms of data cleaning and model training, which are mainly reflected in: on the one hand, the confidence learning algorithm is used to clean the dirty data of the data set, thereby optimizing the overall data quality of the training data and providing data guarantee for the training of subsequent models, thereby improving the accuracy, robustness and reliability of the model. On the other hand, adversarial training and label smoothing techniques are used to alleviate the overfitting problem of the model, thereby solving the disadvantage of extremely unbalanced label distribution of x-item classification data, thereby improving the recognition accuracy of the model.

[0167] 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.

[0168] Example 3

[0169] Figure 5 This is a schematic diagram of the structure of an electronic device shown in Embodiment 3 of the present disclosure. The electronic device includes a memory, a processor, and a computer program stored in the memory and used to run on the processor. When the processor executes the computer program, the model training method described in any of the above embodiments is implemented. Figure 5 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.

[0170] like Figure 5 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).

[0171] The bus 93 includes a data bus, an address bus, and a control bus.

[0172] 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 .

[0173] 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.

[0174] The processor 91 executes various functional applications and data processing by running the computer program stored in the memory 92, such as the model training method provided in any of the above embodiments.

[0175] 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. Through the network adapter 96 One or more networks (such as a local area network (LAN), a wide area network (WAN) (WAN) and / or public networks, such as the Internet). Figure 5As 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.

[0176] 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.

[0177] Example 4

[0178] Embodiment 4 of the present disclosure also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the model training method provided in any of the above embodiments.

[0179] 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.

[0180] Example 5

[0181] Embodiment 5 of the present disclosure also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned model training methods.

[0182] 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.

[0183] 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.

[0184] Example 6

[0185] Figure 6 This is a flow chart of a method for classifying hotel non-room products provided in Example 6 of the present disclosure, such as Figure 6 As shown, the classification method includes:

[0186] S21. Acquire hotel non-room product data to be classified;

[0187] S22, inputting the hotel non-room product data to be classified into the classification model for classification, and obtaining a predicted classification category corresponding to the hotel non-room product data to be classified;

[0188] The classification model is trained using the model training method of Example 1.

[0189] In an optional embodiment, S22 includes:

[0190] S221, deploying the classification model as an algorithm interface;

[0191] S222. Input the hotel non-room product data to be classified into the algorithm interface for classification, and obtain a predicted classification category corresponding to the hotel non-room product data to be classified.

[0192] In the specific implementation process, the classification model obtained by training is deployed as an algorithm interface for real-time model reasoning on the system. In this embodiment, the ONNX Runtime engine is used to accelerate the real-time reasoning of the model, thereby reducing the response time of the system. ONNX Runtime is an accelerator proposed by Microsoft for optimizing and accelerating machine learning reasoning; when the business enters the name of x items (for example, the hotel non-room product data to be classified), the algorithm interface is called, and the algorithm interface returns the predicted classification category corresponding to the name of x items, and assists the business in making judgments. Specifically, the algorithm interface obtains the input text of the name of x items, and performs data processing on the text of the name of x items, including but not limited to removing stop words and dictionary mapping; the classification model of the name of x items obtained by the above training is used to classify and predict the text of the name of x items, and return the category with the highest prediction probability of the text of the name of x items; the system displays the return category of the algorithm interface on the input interface, and assists the business in making judgments and entering subsequent information.

[0193] This embodiment uses a classification model of non-room product review intelligent text based on confidence learning and adversarial training to classify and predict hotel non-room products, so as to assist the business in the entry process of non-room x products, reduce the review rejection rate, speed up the pipeline efficiency of package x products from entry to review and approval to final launch, and improve the accuracy of classification prediction.

[0194] Example 7

[0195] Corresponding to the aforementioned embodiment of a method for classifying hotel non-room products, the present disclosure also provides an embodiment of a system for classifying hotel non-room products.

[0196] Figure 7 A module diagram of a classification system for hotel non-room products provided in Example 7 of the present disclosure, such as Figure 7 As shown, the classification system includes: a product information acquisition module 71, a classification module 72;

[0197] Product information acquisition module 71, used to obtain hotel non-room product data to be classified;

[0198] A classification module 72, for inputting the hotel non-room product data to be classified into a classification model for classification, and obtaining a predicted classification category corresponding to the hotel non-room product data to be classified;

[0199] Among them, the classification model is trained using the model training system of Example 2.

[0200] In an optional embodiment, the classification module includes:

[0201] A deployment unit, used to deploy the classification model as an algorithm interface;

[0202] The classification unit is used to input the hotel non-room product data to be classified into the algorithm interface for classification, and obtain the predicted classification category corresponding to the hotel non-room product data to be classified.

[0203] In the specific implementation process, the classification model obtained by training is deployed as an algorithm interface for real-time model reasoning on the system. In this embodiment, the ONNX Runtime engine is used to accelerate the real-time reasoning of the model, thereby reducing the response time of the system. ONNX Runtime is an accelerator proposed by Microsoft for optimizing and accelerating machine learning reasoning; when the business enters the name of x items (for example, the hotel non-room product data to be classified), the algorithm interface is called, and the algorithm interface returns the predicted classification category corresponding to the name of x items, and assists the business in making judgments. Specifically, the algorithm interface obtains the input text of the name of x items, and performs data processing on the text of the name of x items, including but not limited to removing stop words and dictionary mapping; the classification model of the name of x items obtained by the above training is used to classify and predict the text of the name of x items, and return the category with the highest prediction probability of the text of the name of x items; the system displays the return category of the algorithm interface on the input interface, and assists the business in making judgments and entering subsequent information.

[0204] This embodiment uses a classification model of non-room product review intelligent text based on confidence learning and adversarial training to classify and predict hotel non-room products, so as to assist the business in the entry process of non-room x products, reduce the review rejection rate, speed up the pipeline efficiency of package x products from entry to review and approval to final launch, and improve the accuracy of classification prediction.

[0205] 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.

[0206] Example 8

[0207] A schematic diagram of the structure of an electronic device provided in Embodiment 8 of the present disclosure is Figure 5 The structure is the same as that of the electronic device, which includes a memory, a processor, and a computer program stored in the memory and used to run on the processor. When the processor executes the computer program, the classification method for hotel non-room products described in any of the above embodiments is implemented. Figure 5 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.

[0208] like Figure 5 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).

[0209] The bus 93 includes a data bus, an address bus, and a control bus.

[0210] 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 .

[0211] 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.

[0212] The processor 91 executes various functional applications and data processing by running the computer program stored in the memory 92, such as the classification method of hotel non-room products provided in any of the above embodiments.

[0213] 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. Through the network adapter 96 One or more networks (such as a local area network (LAN), a wide area network (WAN) (WAN) and / or public networks, such as the Internet). Figure 5 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.

[0214] 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.

[0215] Example 9

[0216] Embodiment 9 of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the method for classifying hotel non-room products provided in any of the above embodiments is implemented.

[0217] 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.

[0218] Example 10

[0219] Embodiment 10 of the present disclosure further provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned methods for classifying hotel non-room products.

[0220] 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.

[0221] 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 model training method, characterized in that: The model training method comprises: Acquire a historical training data set, the historical training data set including historical hotel non-room product data as input and historical classification categories corresponding to the historical hotel non-room product data as output; A BERT model is trained based on the historical hotel non-room product data and the historical classification categories to obtain a classification model.

2. The model training method according to claim 1, characterized in that: After the step of obtaining the historical training data set, the model training method further includes: Performing stop word removal and data deduplication processing on the historical training data set to obtain a processed historical training data set; Performing data cleaning on the processed historical training data set to obtain a historical training data set after data cleaning; Performing data enhancement processing on the historical training data set after the data cleaning processing to obtain a historical training data set after data enhancement; The BERT model is used to fine-tune the historical training data set after the data enhancement.

3. The model training method according to claim 2, characterized in that: The step of performing data cleaning on the processed historical training data set to obtain the historical training data set after data cleaning comprises: Obtain the prediction probability of the BERT model in each historical classification category through five-fold cross validation; Calculating and calibrating a count matrix using the predicted probability to obtain a joint distribution of noise labels and true labels of the processed historical training data set; Acquire a set of incorrectly labeled samples in the processed historical training data set based on the joint distribution; Performing a secondary check on the incorrectly labeled sample set, and adding the incorrectly labeled sample set after the secondary check to the processed historical training data set to obtain a historical training data set after data cleaning processing; and / or, The step of fine-tuning the data-enhanced historical training data set using the BERT model includes: Use the dictionary in the BERT model to perform word segmentation on the data-enhanced historical training data set to obtain the word segmentation-processed historical training data set; Dividing the historical training data set after the word segmentation processing into a training set and a verification set according to a preset ratio; Perform fine-tuning training on the training set by using the BERT model combined with label smoothing technology and adversarial training technology; The classification model is validated using the validation set.

4. A model training system, characterized in that: The model training system comprises: A historical training data set acquisition module, used to acquire a historical training data set, the historical training data set including historical hotel non-room product data as input and historical classification categories corresponding to the historical hotel non-room product data as output; A training module is used to train a BERT model based on the historical hotel non-room product data and the historical classification categories to obtain a classification model.

5. A classification method for hotel non-room products, characterized in that: The classification method includes: Obtain hotel non-room product data to be classified; Inputting the hotel non-room product data to be classified into a classification model for classification, and obtaining a predicted classification category corresponding to the hotel non-room product data to be classified; Wherein, the classification model is trained using the model training method described in any one of claims 1 to 3.

6. The method for classifying hotel non-room products according to claim 5, characterized in that: The step of inputting the hotel non-room product data to be classified into a classification model for classification to obtain a predicted classification category corresponding to the hotel non-room product data to be classified comprises: deploying the classification model as an algorithm interface; The hotel non-room product data to be classified is input into the algorithm interface for classification, and a predicted classification category corresponding to the hotel non-room product data to be classified is obtained.

7. A classification system for hotel non-room products, characterized in that: The classification system includes: Product information acquisition module, used to obtain hotel non-room product data to be classified; A classification module, used for inputting the hotel non-room product data to be classified into a classification model for classification, and obtaining a predicted classification category corresponding to the hotel non-room product data to be classified; Wherein, the classification model is trained using the model training system described in claim 4 above.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and used to run on the processor, characterized in that: When the processor executes the computer program, it implements the model training method described in any one of claims 1-3, or executes the classification method for hotel non-room products described in any one of claims 5-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the model training method described in any one of claims 1-3, or executes the classification method for hotel non-room products described in any one of claims 5-6.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, it implements the model training method described in any one of claims 1-3, or executes the hotel non-room product classification method described in any one of claims 5-6.

Citation Information

Patent Citations

  • Word classification model training method based on artificial intelligence and word processing method and device

    CN111401066A

  • Text intention recognition method and system based on projection gradient descent and label smoothing

    CN111626063A

  • Information classification method and device, electronic equipment, and readable storage medium

    CN113626606A

  • Hotel service quality classification method, system, equipment and medium

    CN114596002A

  • Multi-label automatic classification method and system for commodities

    CN116186626A