Guide word mining method, device, server and storage medium
Through multi-stage processing of the candidate word mining model, scoring model and sequence labeling model, the problem of incomplete semantics in the existing technology is solved, the accuracy of the guide words is improved, and it makes it more suitable for the current context.
Patent Information
- Application Number
- CN202111400251.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-24
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-11-24
AI Technical Summary
When the existing technology trains the BERT scoring model, the candidate word positive samples and negative samples used are phrases with incomplete semantics, resulting in inaccurate guide words being mined and failing to consider the actual context.
Using a multi-stage processing process of candidate word mining model, candidate word scoring model and sequence labeling model, candidate words are mined from the corpus to be mined, and scored at the semantic, contextual and part-of-speech levels, and finally semantically complete guide words are obtained.
The accuracy of the guiding words is improved, making the excavated words semantically complete and more suitable for the current context.
Smart Images

Figure CN114138955B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of Internet technology, and in particular to a guide word mining method, device, server and storage medium. Background Art
[0002] With the development of Internet technology and the popularization of mobile smart devices, users are increasingly relying on the services provided by life service applications for their daily lives. Life service applications provide users with a large amount of information on food, drink, entertainment, etc. When users use life service applications, life service applications will show them some high-quality guide words, which can help users quickly search for information of interest and obtain the required services.
[0003] At present, the relevant technologies mainly use the following methods to mine guide words:
[0004] 1. Extract multiple words with a frequency higher than a preset frequency from the corpus to be mined as multiple first candidate words.
[0005] 2. Based on the characteristics of frequency, closeness, information and completeness, each first candidate word is scored, and based on the scoring results, the first candidate word with a score greater than the first preset score is obtained as the second candidate word.
[0006] 3. Input the second candidate word into the BERT (Bidirectional Encoder Representation from Transformers) scoring model, output the scoring result, and use the second candidate word with a score greater than the second preset score as the guide word. The BERT scoring model is trained based on candidate word positive samples and candidate word negative samples.
[0007] However, the candidate word positive samples and candidate word negative samples used to train the BERT scoring model are semantically incomplete phrases, which results in the trained BERT scoring model being inaccurate. The model simply mines out phrases with higher scores from the corpus to be mined without considering the actual context of these phrases, resulting in inaccurate guide words mined. Summary of the invention
[0008] The embodiments of the present disclosure provide a guide word mining method, device, server and storage medium, which can improve the accuracy of the mined guide words. The technical solution is as follows:
[0009] In a first aspect, a guide word mining method is provided, the method comprising:
[0010] Inputting a plurality of corpora to be mined into a candidate word mining model, and outputting a plurality of first candidate words and a first score corresponding to each first candidate word, wherein the candidate word mining model is used to mine candidate words from the corpora to be mined;
[0011] From the plurality of first candidate words, obtaining a plurality of second candidate words whose first scores are greater than a first preset score;
[0012] Inputting the plurality of second candidate words into a candidate word scoring model, and outputting a second score for each of the plurality of second candidate words, wherein the candidate word scoring model is used to score the candidate words at a semantic level;
[0013] From the plurality of second candidate words, obtaining a plurality of third candidate words whose second scores are greater than a second preset score;
[0014] Inputting the plurality of third candidate words and the corresponding corpus to be mined into a sequence labeling model, and outputting a third score for each of the plurality of third candidate words, wherein the sequence labeling model is used to score the candidate words at the context and part-of-speech level;
[0015] Third candidate words whose third scores are greater than a third preset score are obtained as a plurality of guide words.
[0016] In another embodiment of the present disclosure, the training process of the candidate word mining model is:
[0017] Taking words in a knowledge base as supervision information, a plurality of first training sample corpora are obtained, wherein the first training sample corpora are annotated with at least one guide word, and the knowledge base includes at least one of words in a specified search engine, named entities, or mined guide words;
[0018] Based on the multiple first training sample corpora, an initial candidate word mining model is trained to obtain the candidate word mining model.
[0019] In another embodiment of the present disclosure, the training process of the candidate word scoring model is:
[0020] Inputting a plurality of second training sample corpora into the candidate word mining model, outputting a plurality of first training candidate words and their first scores, wherein the second training sample corpora have a second annotation score;
[0021] Based on the first scores of the plurality of first training candidate words, the first preset scores and the user search log, determining a plurality of first training candidate word positive samples and a plurality of first training candidate word negative samples from the plurality of first training candidate words;
[0022] Based on the multiple first training candidate word positive samples and the multiple first training candidate word negative samples, the initial candidate word scoring model is trained to obtain a first trained candidate word scoring model;
[0023] The candidate word scoring model trained for the first time is iteratively trained to obtain the candidate word scoring model.
[0024] In another embodiment of the present disclosure, the determining, based on the first scores of the plurality of first training candidate words, the first preset scores, and the user search log, a plurality of first training candidate word positive samples and a plurality of first training candidate word negative samples from the plurality of first training candidate words comprises:
[0025] Based on the first scores of the plurality of first training candidate words and the first preset scores, obtaining a plurality of first training candidate word reference positive samples and a plurality of first training candidate word reference negative samples, wherein the first scores of the first training candidate word reference positive samples are greater than the first preset scores, and the first scores of the first training candidate word reference negative samples are less than the first preset scores;
[0026] Acquire words in the plurality of first training candidate word reference positive samples that overlap with the search words in the user search log to obtain the plurality of first training candidate word positive samples;
[0027] The words that overlap with the search words in the user search log are deleted from the multiple first training candidate word reference negative samples to obtain the multiple first training candidate word negative samples.
[0028] In another embodiment of the present disclosure, the initial candidate word scoring model is trained based on the multiple first training candidate word positive samples and the multiple first training candidate word negative samples to obtain a first trained candidate word scoring model, including:
[0029] Inputting the plurality of first training candidate word positive samples and the plurality of first training candidate word negative samples into the initial candidate word scoring model, and outputting second scores of the plurality of first training candidate word positive samples and the plurality of first training candidate word negative samples;
[0030] Based on the second scores and the second labeled scores of the multiple first training candidate word positive samples, and the second scores and the second labeled scores of the multiple first training candidate word negative samples, the model parameters of the initial candidate word scoring model are adjusted to obtain the candidate word scoring model for the first training.
[0031] In another embodiment of the present disclosure, the iterative training of the candidate word scoring model trained for the first time to obtain the candidate word scoring model includes:
[0032] Scoring the plurality of first training candidate words based on the candidate word scoring model trained for the first time to obtain second scores for the plurality of first training candidate words;
[0033] Based on the second scores of the plurality of first training candidate words and the second preset scores, obtaining a plurality of second training candidate word reference positive samples and a plurality of second training candidate word reference negative samples, wherein the second scores of the second training candidate word reference positive samples are greater than the second preset scores, and the second scores of the second training candidate word reference negative samples are less than the second preset scores;
[0034] Determine a plurality of second training candidate word positive samples and a plurality of second training candidate word negative samples based on the plurality of second training candidate word reference positive samples, the plurality of second training candidate word reference negative samples, and the search words in the user search log;
[0035] Based on the plurality of second training candidate word positive samples and the plurality of second training candidate word negative samples, training the candidate word scoring model of the first training;
[0036] The above training process is repeated until the number of iterations reaches a preset number, and the model obtained when the number of iterations reaches the preset number is determined as the candidate word scoring model.
[0037] In another embodiment of the present disclosure, the training process of the sequence labeling model is:
[0038] Acquire a plurality of third training sample corpora, wherein the third training sample corpora are corpora annotated with at least one of guide words or non-guide words, entity names, and parts of speech;
[0039] Based on the plurality of third training sample corpora, an initial sequence labeling model is trained to obtain the sequence labeling model.
[0040] In a second aspect, a guide word mining device is provided, the device comprising:
[0041] A first input-output module, used for inputting a plurality of corpora to be mined into a candidate word mining model, and outputting a plurality of first candidate words and a first score corresponding to each first candidate word, wherein the candidate word mining model is used for mining candidate words from the corpora to be mined;
[0042] A first acquisition module, configured to acquire, from the plurality of first candidate words, a plurality of second candidate words whose first scores are greater than a first preset score;
[0043] The second input-output module is further used to input the plurality of second candidate words into a candidate word scoring model and output a second score for each of the plurality of second candidate words, wherein the candidate word scoring model is used to score the candidate words at a semantic level;
[0044] A second acquisition module, configured to acquire, from the plurality of second candidate words, a plurality of third candidate words whose second scores are greater than a second preset score;
[0045] A third input-output module, used for inputting the plurality of third candidate words and the corresponding corpus to be mined into a sequence labeling model, and outputting a third score of each of the plurality of third candidate words, wherein the sequence labeling model is used for scoring the candidate words at the context and part-of-speech level;
[0046] The third acquisition module is used to acquire third candidate words whose third scores are greater than a third preset score as a plurality of guide words.
[0047] In another embodiment of the present disclosure, the apparatus for training the candidate word mining model includes:
[0048] A fourth acquisition module is used to acquire a plurality of first training sample corpora using words in a knowledge base as supervision information, wherein the first training sample corpora are annotated with at least one guide word, and the knowledge base includes at least one of words in a specified search engine, named entities, or mined guide words;
[0049] The first training module is used to train the initial candidate word mining model based on the multiple first training sample corpora to obtain the candidate word mining model.
[0050] In another embodiment of the present disclosure, the apparatus for training the candidate word scoring model includes:
[0051] a fourth input-output module, configured to input a plurality of second training sample corpora into the candidate word mining model, and output a plurality of first training candidate words and their first scores, wherein the second training sample corpora have second annotation scores;
[0052] a determination module, configured to determine a plurality of first training candidate word positive samples and a plurality of first training candidate word negative samples from the plurality of first training candidate words based on the first scores of the plurality of first training candidate words, the first preset scores, and a user search log;
[0053] A second training module is used to train the initial candidate word scoring model based on the multiple first training candidate word positive samples and the multiple first training candidate word negative samples to obtain a first trained candidate word scoring model;
[0054] The third training module is used to iteratively train the candidate word scoring model trained for the first time to obtain the candidate word scoring model.
[0055] In another embodiment of the present disclosure, the determination module is used to obtain multiple first training candidate word reference positive samples and multiple first training candidate word reference negative samples based on the first scores of the multiple first training candidate words and the first preset score, the first score of the first training candidate word reference positive sample is greater than the first preset score, and the first score of the first training candidate word reference negative sample is less than the first preset score; obtain the words in the multiple first training candidate word reference positive samples that overlap with the search words in the user search log to obtain the multiple first training candidate word positive samples; delete the words that overlap with the search words in the user search log from the multiple first training candidate word reference negative samples to obtain the multiple first training candidate word negative samples.
[0056] In an embodiment of the present disclosure, the second training module is used to input the multiple first training candidate word positive samples and the multiple first training candidate word negative samples into the initial candidate word scoring model, and output the second scores of the multiple first training candidate word positive samples and the second scores of the multiple first training candidate word negative samples; based on the second scores and second labeled scores of the multiple first training candidate word positive samples, and the second scores and second labeled scores of the multiple first training candidate word negative samples, the model parameters of the initial candidate word scoring model are adjusted to obtain the candidate word scoring model for the first training.
[0057] In another embodiment of the present disclosure, the third training module is used to score the multiple first training candidate words based on the candidate word scoring model of the first training to obtain second scores of the multiple first training candidate words; based on the second scores of the multiple first training candidate words and the second preset scores, obtain multiple second training candidate word reference positive samples and multiple second training candidate word reference negative samples, the second score of the second training candidate word reference positive sample is greater than the second preset score, and the second score of the second training candidate word reference negative sample is less than the second preset score; based on the multiple second training candidate word reference positive samples, the multiple second training candidate word reference negative samples and the search words in the user search log, determine multiple second training candidate word positive samples and multiple second training candidate word negative samples; based on the multiple second training candidate word positive samples and the multiple second training candidate word negative samples, train the candidate word scoring model of the first training; repeat the above training process until the number of iterations reaches the preset number, and determine the model obtained when the number of iterations reaches the preset number as the candidate word scoring model.
[0058] In another embodiment of the present disclosure, the apparatus for training the sequence labeling model includes:
[0059] A fifth acquisition module, used to acquire a plurality of third training sample corpora, wherein the third training sample corpora are corpora annotated with at least one of guide words or non-guide words, entity names, and parts of speech;
[0060] The fourth training module trains the initial sequence labeling model based on the plurality of third training sample corpora to obtain the sequence labeling model.
[0061] In a third aspect, a server is provided, the server comprising a processor and a memory, the memory storing at least one program code, the at least one program code being loaded and executed by the processor to implement the guide word mining method as described in the first aspect.
[0062] In a fourth aspect, a computer-readable storage medium is provided, wherein at least one program code is stored in the storage medium, and the at least one program code is loaded and executed by a processor to implement the guide word mining method as described in the first aspect.
[0063] In a fifth aspect, a computer program product is provided, including a computer program, which, when executed by a processor, implements the guide word mining method described in the first aspect.
[0064] The technical solution provided by the embodiments of the present disclosure has the following beneficial effects:
[0065] The corpus to be mined is sequentially input into the candidate word mining model, the candidate word scoring model and the sequence labeling model for processing. Based on the candidate word mining model, multiple first candidate words that may be used as guide words can be mined from the corpus to be mined, and the first score of each first candidate word can be output. Then, the multiple first candidate words mined are preliminarily screened according to the first score, and the second candidate words with relatively high accuracy can be obtained. Then, based on the candidate word scoring model, the second candidate words are scored at the semantic level, and the third candidate words with high scores are screened out. Then, based on the sequence labeling model, the third candidate words are scored at the context and part of speech level, and finally the candidate words with high scores at the semantic, context and part of speech levels are obtained as guide words. The guide words mined by this method are semantically complete and more in line with the current context, so they are more accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0067] Figure 1is a flow chart of a guide word mining method provided by an embodiment of the present disclosure;
[0068] Figure 2 is a flow chart of another guide word mining method provided by an embodiment of the present disclosure;
[0069] Figure 3 is a flow chart of a guide word mining process provided by an embodiment of the present disclosure;
[0070] Figure 4 is a structural schematic diagram of a guide word mining device provided by an embodiment of the present disclosure;
[0071] Figure 5 The diagram is a schematic diagram of the structure of a server for guiding word mining according to an exemplary embodiment. DETAILED DESCRIPTION
[0072] In order to make the objectives, technical solutions and advantages of the present disclosure more clear, the embodiments of the present disclosure will be further described in detail below with reference to the accompanying drawings.
[0073] It can be understood that the terms "each", "multiple", and "any" used in the embodiments of the present disclosure include two or more, each refers to each of the corresponding multiple, and any refers to any one of the corresponding multiple. For example, the multiple words include 10 words, and each word refers to each word of the 10 words, and any word refers to any one of the 10 words.
[0074] The present disclosure provides a guide word mining method. Figure 1 , the method flow provided by the embodiment of the present disclosure includes:
[0075] 101. Input a plurality of corpora to be mined into a candidate word mining model, and output a plurality of first candidate words and a first score corresponding to each first candidate word.
[0076] Among them, the candidate word mining model is used to mine candidate words from the corpus to be mined.
[0077] 102. From the plurality of first candidate words, obtain a plurality of second candidate words whose first scores are greater than a first preset score.
[0078] 103. Input multiple second candidate words into the candidate word scoring model, and output a second score of each of the multiple second candidate words.
[0079] Among them, the candidate word scoring model is used to score the candidate words at the semantic level.
[0080] 104. From the plurality of second candidate words, obtain a plurality of third candidate words whose second scores are greater than a second preset score.
[0081] 105. Input multiple third candidate words and corresponding corpus to be mined into the sequence labeling model, and output the third score of each third candidate word in the multiple third candidate words.
[0082] Among them, the sequence labeling model is used to score the candidate words at the context and part-of-speech levels.
[0083] 106. Obtain third candidate words whose third scores are greater than a third preset score as multiple guide words.
[0084] The method provided by the embodiment of the present disclosure sequentially inputs the corpus to be mined into the candidate word mining model, the candidate word scoring model and the sequence labeling model for processing. Based on the candidate word mining model, multiple first candidate words that may serve as guide words can be mined from the corpus to be mined, and the first score of each first candidate word can be output. Then, the multiple first candidate words mined are preliminarily screened according to the first score, and second candidate words with relatively high accuracy can be obtained. Then, based on the candidate word scoring model, the second candidate words are scored at the semantic level, and the third candidate words with higher scores are screened out. Then, based on the sequence labeling model, the third candidate words are scored at the context and part of speech level, and finally, the candidate words with higher scores at the semantic, context and part of speech levels are obtained as guide words. The guide words mined by this method are semantically complete and more in line with the current context, so they are more accurate.
[0085] In another embodiment of the present disclosure, the training process of the candidate word mining model is:
[0086] Taking words in the knowledge base as supervision information, a plurality of first training sample corpora are obtained, wherein the first training sample corpora are annotated with at least one guide word, and the knowledge base includes at least one of words in a specified search engine, named entities, or mined guide words;
[0087] Based on a plurality of first training sample corpora, an initial candidate word mining model is trained to obtain a candidate word mining model.
[0088] In another embodiment of the present disclosure, the training process of the candidate word scoring model is:
[0089] Inputting a plurality of second training sample corpora into a candidate word mining model, outputting a plurality of first training candidate words and their first scores, and the second training sample corpora having a second annotation score;
[0090] Based on the first scores of the plurality of first training candidate words, the first preset scores and the user search log, determining a plurality of first training candidate word positive samples and a plurality of first training candidate word negative samples from the plurality of first training candidate words;
[0091] Based on a plurality of first training candidate word positive samples and a plurality of first training candidate word negative samples, an initial candidate word scoring model is trained to obtain a first trained candidate word scoring model;
[0092] The candidate word scoring model trained for the first time is iteratively trained to obtain a candidate word scoring model.
[0093] In another embodiment of the present disclosure, based on the first scores of the plurality of first training candidate words, the first preset scores and the user search log, a plurality of first training candidate word positive samples and a plurality of first training candidate word negative samples are determined from the plurality of first training candidate words, including:
[0094] Based on the first scores and the first preset scores of the plurality of first training candidate words, obtaining a plurality of first training candidate word reference positive samples and a plurality of first training candidate word reference negative samples, wherein the first scores of the first training candidate word reference positive samples are greater than the first preset scores, and the first scores of the first training candidate word reference negative samples are less than the first preset scores;
[0095] Acquire words in multiple first training candidate word reference positive samples that overlap with search words in the user search log to obtain multiple first training candidate word positive samples;
[0096] Words that overlap with search words in the user search log are deleted from the plurality of first training candidate word reference negative samples to obtain a plurality of first training candidate word negative samples.
[0097] In another embodiment of the present disclosure, based on a plurality of first training candidate word positive samples and a plurality of first training candidate word negative samples, an initial candidate word scoring model is trained to obtain a first trained candidate word scoring model, including:
[0098] Inputting a plurality of first training candidate word positive samples and a plurality of first training candidate word negative samples into an initial candidate word scoring model, and outputting a second score of the plurality of first training candidate word positive samples and a second score of the plurality of first training candidate word negative samples;
[0099] Based on the second scores and second labeled scores of multiple first training candidate word positive samples, and the second scores and second labeled scores of multiple first training candidate word negative samples, the model parameters of the initial candidate word scoring model are adjusted to obtain the candidate word scoring model for the first training.
[0100] In another embodiment of the present disclosure, the candidate word scoring model trained for the first time is iteratively trained to obtain the candidate word scoring model, including:
[0101] Scoring the plurality of first training candidate words based on the candidate word scoring model trained for the first time to obtain second scores for the plurality of first training candidate words;
[0102] Based on the second scores and the second preset scores of the plurality of first training candidate words, obtaining a plurality of second training candidate word reference positive samples and a plurality of second training candidate word reference negative samples, wherein the second scores of the second training candidate word reference positive samples are greater than the second preset score, and the second scores of the second training candidate word reference negative samples are less than the second preset score;
[0103] Determine a plurality of second training candidate word positive samples and a plurality of second training candidate word negative samples based on a plurality of second training candidate word reference positive samples, a plurality of second training candidate word reference negative samples, and search words in a user search log;
[0104] Based on a plurality of second training candidate word positive samples and a plurality of second training candidate word negative samples, training the candidate word scoring model trained for the first time;
[0105] The above training process is repeated until the number of iterations reaches a preset number, and the model obtained when the number of iterations reaches the preset number is determined as the candidate word scoring model.
[0106] In another embodiment of the present disclosure, the training process of the sequence labeling model is:
[0107] Acquire a plurality of third training sample corpora, where the third training sample corpora are corpora annotated with at least one of guide words or non-guide words, entity names, and parts of speech;
[0108] Based on the plurality of third training sample corpora, the initial sequence labeling model is trained to obtain a sequence labeling model.
[0109] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present disclosure, and will not be described in detail here.
[0110] The embodiment of the present disclosure provides a guide word mining method. Taking the server executing the embodiment of the present disclosure as an example, the server can be a separate physical server, or a server cluster or distributed system composed of multiple physical servers. The embodiment of the present disclosure does not limit the specific form of the server. Figure 2 , the method flow provided by the embodiment of the present disclosure includes:
[0111] 201. The server trains the candidate word mining model.
[0112] The candidate word mining model is used to mine candidate words from the corpus to be mined. When training the candidate word mining model, the server adopts the following method:
[0113] 2011. The server uses the words in the knowledge base as supervision information to obtain multiple first training sample corpora.
[0114] Among them, the knowledge base is a database composed of words that can be used as guide words. The sources of words in the knowledge base include three aspects: words in a specified search engine, named entities in a named entity library, and mined guide words. When the server obtains the first training sample corpus, it can be obtained from group order descriptions, merchant information, user comments, note data, etc. stored in life service applications. The first training sample corpus is annotated with at least one guide word, so that in the subsequent training process of the candidate word mining model, it can be trained based on the annotated guide word. In order to improve the accuracy of the annotated guide words in the first training corpus, thereby ensuring the accuracy of the trained candidate word mining model, the server will use the words in the knowledge base as supervision information to supervise the annotated guide words in the first training sample corpus. If the annotated guide words in the first training sample corpus are not in the knowledge base, it is necessary to re-annotate the expected guide words in the first training sample, or discard the first training sample corpus.
[0115] 2012. The server trains an initial candidate word mining model based on a plurality of first training sample corpora to obtain a candidate word mining model.
[0116] The initial candidate word mining model can be an AutoPhrase framework, which is an open source framework for obtaining high-quality phrases from text corpora. The framework proposes to use the POS-Guided phrase segmentation method to segment phrases from text corpora. The initial candidate word mining model is remotely supervised and trained using positive samples. The trained candidate word mining model does not require additional manpower and can quickly and effectively mine potential high-quality phrases in the text corpus.
[0117] The process of the server training the initial candidate word mining model based on multiple first training sample corpora is as follows: the server sets initial values for the model parameters of the initial candidate word mining model in advance, inputs the obtained multiple first training sample corpora into the initial candidate word mining model, and outputs multiple candidate words and a first score, the score value of the first score is between 0 and 1. The first annotation score of the annotated guide word is set to 1, and the first annotation score of the unannotated guide word is set to 0, and the first scores and the first annotation scores of the multiple candidate words are input into the pre-constructed first target loss function to obtain the function value of the first target loss function. If the function value is greater than the first specified threshold, the initial value of the model parameter of the initial candidate word mining model is adjusted until the function value of the obtained first target loss function is less than the first specified threshold, and the first specified threshold can be determined according to the processing accuracy of the server. The server obtains the parameter value of the model parameter when the function value of the first target loss function is less than the first specified threshold, and obtains the candidate word mining model.
[0118] 202. The server trains the candidate word scoring model.
[0119] Among them, the candidate word scoring model is used to score the candidate words at the semantic level. Taking into account the extremely unbalanced distribution of text phrase data in the vertical field, and the candidate word mining model is only trained using very weak supervision information, resulting in uneven quality of phrases generated by the trained candidate word mining model. In order to improve the accuracy of the mined guide words, the method provided by the embodiment of the present disclosure will also train a candidate word scoring model, and re-score the mined candidate words based on the candidate word scoring model to reduce the noise in the candidate words and improve the accuracy of the mined candidate words. When training the candidate word scoring model, the server mainly adopts the following methods:
[0120] 2021. The server inputs multiple second training sample corpora into the candidate word mining model, and outputs multiple first training candidate words and their first scores.
[0121] The server obtains a plurality of second training sample corpora annotated with second annotation scores, inputs the obtained plurality of second training sample corpora into the candidate word mining model, and outputs a plurality of first training candidate words and their first scores.
[0122] 2022. Based on the first scores of the plurality of first training candidate words, the first preset scores, and the user search log, the server determines a plurality of first training candidate word positive samples and a plurality of first training candidate word negative samples from the plurality of first training candidate words.
[0123] The user search log includes multiple search terms, which are input by the user when searching in the life service application. The server determines multiple first training candidate word positive samples and multiple first training candidate word negative samples from the multiple first training candidate words based on the first scores of the multiple first training candidate words, the first preset scores and the user search log, using the following method:
[0124] 20221. The server obtains a plurality of first training candidate word reference positive samples and a plurality of first training candidate word reference negative samples based on the first scores and the first preset scores of the plurality of first training candidate words.
[0125] The first preset score may be 0.8, 0.9, etc., and the first preset score is not specifically limited in the embodiment of the present disclosure. The server compares the first scores of the plurality of first training candidate words with the first preset score, and for any first training candidate word, if the first score of the first training candidate word is greater than the first preset score, the first training candidate word is used as a reference positive sample of the first training candidate word, and if the first score of the first training candidate word is less than the first preset score, the first training candidate word is used as a reference negative sample of the first training candidate word.
[0126] 20222. The server obtains words from multiple first training candidate word reference positive samples that overlap with search words in the user search log, and obtains multiple first training candidate word positive samples.
[0127] The server matches the obtained multiple first training candidate word reference positive samples with the search words in the user search log, obtains words that overlap with the search words in the user search log from the multiple first training candidate word reference positive samples, and then uses the obtained words as multiple first training candidate word positive samples.
[0128] 20223. The server deletes words that overlap with search words in the user search log from multiple first training candidate word reference negative samples to obtain multiple first training candidate word negative samples.
[0129] The server will match multiple first training candidate word reference negative samples with the search words in the user search log, obtain words that overlap with the search words in the user search log from the multiple first training candidate word reference negative samples, and then delete the words that overlap with the search words in the user search log from the multiple first training candidate word reference negative samples to obtain multiple first training candidate word negative samples.
[0130] 2023. Based on multiple first training candidate word positive samples and multiple first training candidate word negative samples, the server trains the initial candidate word scoring model to obtain a first trained candidate word scoring model.
[0131] Among them, the initial candidate word scoring model can be an MT-BERT model, which is a vertical field pre-training model based on the Transformer structure. The model shows good generalization performance in tasks such as single sentence classification, inter-sentence relations, and sequence labeling.
[0132] The process of the server training the initial candidate word scoring model based on multiple first training candidate word positive samples and multiple first training candidate word negative samples is as follows: the server inputs multiple first training candidate word positive samples and multiple first training candidate word negative samples into the initial candidate word scoring model, and outputs the second scores of multiple first training candidate word positive samples and the second scores of multiple first training candidate word negative samples. Then, based on the second scores and second annotation scores of multiple first training candidate word positive samples and the second scores and second annotation scores of multiple first training candidate word negative samples, the server inputs the second scores and second annotation scores of multiple first training candidate word positive samples and the second scores and second annotation scores of multiple first training candidate word negative samples into the pre-constructed second target loss function, outputs the function value of the second target loss function, and if the function value is greater than the second specified threshold, adjusts the initial value of the model parameter of the initial candidate word scoring model until the function value of the obtained second target loss function is less than the second specified threshold, and the second specified threshold can be determined according to the processing accuracy of the server. The server obtains the parameter value of the model parameter when the function value of the second target loss function is less than the second specified threshold, and obtains the candidate word scoring model trained for the first time.
[0133] 2024. The server iteratively trains the candidate word scoring model trained for the first time to obtain a candidate word scoring model.
[0134] The process of iterative training of the candidate word scoring model trained for the first time by the server is as follows:
[0135] In the first step, the server scores the multiple first training candidate words based on the candidate word scoring model trained for the first time, and obtains the second scores of the multiple first training candidate words.
[0136] In the second step, the server compares the second scores of the plurality of first training candidate words with the second preset scores based on the second scores of the plurality of first training candidate words and the second preset scores. For any first training candidate word, if the second score of the first training candidate word is greater than the second preset score, the first training candidate word is used as a reference positive sample of the second training candidate word. If the second score of the first training candidate word is less than the second preset score, the first training candidate word is used as a reference negative sample of the second training candidate word. By processing the plurality of first training candidate words using the above method, the plurality of first training candidate words can be divided into a plurality of reference positive samples of the second training candidate words and a plurality of reference negative samples of the second training candidate words.
[0137] In the third step, the server matches the obtained multiple second training candidate word reference positive samples with the search words in the user search log, obtains the words that overlap with the search words in the user search log from the multiple second training candidate word reference positive samples, and then uses the obtained words as multiple second training candidate word positive samples. The server matches the multiple second training candidate word reference negative samples with the search words in the user search log, obtains the words that overlap with the search words in the user search log from the multiple second training candidate word reference negative samples, and then deletes the words that overlap with the search words in the user search log from the multiple second training candidate word reference negative samples to obtain multiple second training candidate word negative samples.
[0138] In the fourth step, the server inputs multiple second training candidate word positive samples and multiple second training candidate word negative samples into the candidate word scoring model trained for the first time, outputs the output results of the multiple second training candidate word positive samples and the multiple second training candidate word negative samples, and then adjusts the parameter values of the model parameters of the candidate word scoring model trained for the first time according to the output results and the labeling results corresponding to the multiple second training candidate word positive samples and the multiple second training candidate word negative samples.
[0139] In the fifth step, the server repeats the above training process until the number of iterations reaches a preset number, and determines the model obtained when the number of iterations reaches the preset number as the candidate word scoring model.
[0140] 203.Server training sequence labeling model.
[0141] Although many high-quality guide words have been mined based on the trained candidate word mining model and candidate word scoring model, the training and prediction of the candidate word scoring model only scores the guide words mined by the candidate word mining model, resulting in the problems of the mined guide words shown in Table 1:
[0142] Table 1
[0143]
[0144]
[0145] In order to solve the above-mentioned problem of incomplete semantics, if "Mexican chicken burrito" is a positive example, "Mexican chicken burrito" will also be mistakenly classified as a positive example. In the embodiment of the present disclosure, a sequence labeling task can be constructed to label guide words. The sequence labeling task can more accurately segment phrases according to context information. For example, "Mexican chicken burrito" will be labeled as "is a guide word" in the original sentence, and the other parts of the original sentence will be labeled as "is not a guide word", and then the sequence labeling model is trained based on the third training sample corpus labeled with guide words and non-guide words.
[0146] In response to the unreasonable amount of information in the guide words mentioned above, for example, if "dessert" is a positive example, "a little sweet" will also be mistakenly classified as a positive example. The disclosed embodiment integrates the named entity recognition task and the part-of-speech tagging task in the sequence labeling model for multi-task learning. The multi-task learning method can enable the trained sequence labeling model to effectively learn the named entity information and part-of-speech information, thereby solving the problem of unreasonable amount of phrase information, such as "dessert" is a noun, and "a little sweet" is an adverb + adjective. Since the named entity recognition task and the part-of-speech tagging task are both sequence labeling tasks, they can share an encoder, namely BERT, and then use different CRFs for decoding, and finally add the loss functions for training.
[0147] In the embodiment of the present disclosure, the training process of the sequence labeling model is:
[0148] 2031. The server obtains a plurality of third training sample corpora.
[0149] The third training sample corpus is a corpus that is annotated with at least one of a guide word or a non-guide word, an entity name, and a part of speech, and the third training sample corpus has an annotation score.
[0150] 2032. The server trains the initial sequence labeling model based on multiple third training sample corpora to obtain a sequence labeling model.
[0151] Among them, the initial sequence annotation model can be a BERT+CRF model. The server sets initial values for the model parameters of the initial sequence annotation model in advance, and inputs the obtained multiple third training sample corpora into the initial sequence annotation model, outputs the third score of each third training sample corpus, and inputs the third scores and annotation scores of the multiple third training sample corpora into the pre-constructed third target loss function to obtain the function value of the third target loss function. If the function value is greater than the third specified threshold, the initial value of the model parameter of the initial sequence annotation model is adjusted until the function value of the obtained third target loss function is less than the third specified threshold, and the third specified threshold can be determined according to the processing accuracy of the server. The server obtains the parameter value of the model parameter when the function value of the third target loss function is less than the third specified threshold, and obtains the sequence annotation model. The sequence annotation model has good generalization ability, and the sequence annotation model can be used alone to conduct guide word mining on the corpus to be mined.
[0152] It should be noted that the above is explained by taking the first training sample corpus to train the candidate word mining model, the second training sample corpus to train the candidate word mining model, and the third training sample corpus to train the sequence labeling model as an example. In fact, Figure 3 The same training sample corpus is used to train the above three models.
[0153] 204. The server inputs a plurality of corpora to be mined into a candidate word mining model, and outputs a plurality of first candidate words and a first score corresponding to each first candidate word.
[0154] In order to mine guide words from multiple corpora to be mined, the server may input the multiple corpora to be mined into a candidate word mining model, and the candidate word mining model outputs multiple mined first candidate words and a first score corresponding to each first candidate word.
[0155] 205. The server obtains, from the plurality of first candidate words, a plurality of second candidate words whose first scores are greater than a first preset score.
[0156] The server compares the first scores of multiple first candidate words with the first preset score. For any first candidate word, if the first score of the first candidate word is greater than the first preset score, the first candidate word is used as the second candidate word. Using this method, the server can obtain multiple second candidate words whose first scores are greater than the first preset score from the multiple first candidate words.
[0157] 206. The server inputs the multiple second candidate words into the candidate word scoring model, and outputs a second score for each of the multiple second candidate words.
[0158] Based on the obtained multiple second candidate words, the server inputs the multiple second candidate words into a candidate word scoring model, and outputs a second score for each of the multiple second candidate words.
[0159] 207. The server obtains a plurality of third candidate words whose second scores are greater than a second preset score from the plurality of second candidate words.
[0160] The server compares the second scores of the plurality of second candidate words with the second preset scores. For any second candidate word, if the second score of the second candidate word is greater than the second preset score, the second candidate word is used as the third candidate word. By adopting this method, the server can obtain a plurality of second candidate words whose second scores are greater than the second preset scores from the plurality of second candidate words.
[0161] 208. The server inputs the multiple third candidate words and the corresponding corpus to be mined into the sequence labeling model, and outputs the third score of each of the multiple third candidate words.
[0162] Based on the obtained multiple third candidate words, the server obtains the corpus to be mined corresponding to each third candidate word, inputs the multiple third candidate words and the corresponding corpus to be mined into the sequence labeling model, and outputs the third score of each third candidate word in the multiple third candidate words.
[0163] 209. The server obtains third candidate words whose third scores are greater than a third preset score as multiple guide words.
[0164] The server compares the third score of the third candidate word with the third preset score, and obtains a third candidate word with a third score greater than the third preset score from multiple third candidate words as a guide word. The guide word is a candidate word with a higher score at the semantic, context and part of speech levels, which overcomes the problems of incomplete semantics and unreasonable information amount existing in the related technology, and the mined guide word is more accurate.
[0165] The method provided by the embodiment of the present disclosure sequentially inputs the corpus to be mined into the candidate word mining model, the candidate word scoring model and the sequence labeling model for processing. Based on the candidate word mining model, multiple first candidate words that may serve as guide words can be mined from the corpus to be mined, and the first score of each first candidate word can be output. Then, the multiple first candidate words mined are preliminarily screened according to the first score, and second candidate words with relatively high accuracy can be obtained. Then, based on the candidate word scoring model, the second candidate words are scored at the semantic level, and the third candidate words with higher scores are screened out. Then, based on the sequence labeling model, the third candidate words are scored at the context and part of speech level, and finally, the candidate words with higher scores at the semantic, context and part of speech levels are obtained as guide words. The guide words mined by this method are semantically complete and more in line with the current context, so they are more accurate.
[0166] See also Figure 4 , the embodiment of the present disclosure provides a guide word mining device, the device comprising:
[0167] A first input-output module 401 is used to input a plurality of corpora to be mined into a candidate word mining model, and output a plurality of first candidate words and first scores corresponding to the plurality of first candidate words, wherein the candidate word mining model is used to mine candidate words from the corpora to be mined;
[0168] A first acquisition module 402 is used to acquire, from the plurality of first candidate words, a plurality of second candidate words whose first scores are greater than a first preset score;
[0169] The second input-output module 403 is further used to input the plurality of second candidate words into the candidate word scoring model and output a second score for each of the plurality of second candidate words, wherein the candidate word scoring model is used to score the candidate words at a semantic level;
[0170] The second acquisition module 404 is used to acquire a plurality of third candidate words whose second scores are greater than a second preset score from the plurality of second candidate words;
[0171] A third input-output module 405 is used to input multiple third candidate words and corresponding corpus to be mined into a sequence labeling model, and output a third score of each third candidate word in the multiple third candidate words. The sequence labeling model is used to score the candidate words at the context and part-of-speech level;
[0172] The third acquisition module 406 is used to acquire third candidate words with a third score greater than a third preset score as a plurality of guide words.
[0173] In another embodiment of the present disclosure, a device for training a candidate word mining model includes:
[0174] A fourth acquisition module is used to acquire a plurality of first training sample corpora using words in the knowledge base as supervision information, wherein the first training sample corpora are annotated with at least one guide word, and the knowledge base includes at least one of words in a specified search engine, named entities, or mined guide words;
[0175] The first training module is used to train the initial candidate word mining model based on a plurality of first training sample corpora to obtain the candidate word mining model.
[0176] In another embodiment of the present disclosure, a device for training a candidate word scoring model includes:
[0177] A fourth input-output module, for inputting a plurality of second training sample corpora into the candidate word mining model, outputting a plurality of first training candidate words and their first scores, and the second training sample corpora having a second annotation score;
[0178] A determination module, configured to determine a plurality of first training candidate word positive samples and a plurality of first training candidate word negative samples from the plurality of first training candidate words based on the first scores of the plurality of first training candidate words, the first preset scores and the user search log;
[0179] A second training module is used to train the initial candidate word scoring model based on a plurality of first training candidate word positive samples and a plurality of first training candidate word negative samples to obtain a first trained candidate word scoring model;
[0180] The third training module is used to iteratively train the candidate word scoring model trained for the first time to obtain a candidate word scoring model.
[0181] In another embodiment of the present disclosure, a determination module is used to obtain multiple first training candidate word reference positive samples and multiple first training candidate word reference negative samples based on the first scores and first preset scores of multiple first training candidate words, the first scores of the first training candidate word reference positive samples being greater than the first preset score, and the first scores of the first training candidate word reference negative samples being less than the first preset score; obtain words from the multiple first training candidate word reference positive samples that overlap with search words in a user search log to obtain multiple first training candidate word positive samples; delete words from the multiple first training candidate word reference negative samples that overlap with search words in the user search log to obtain multiple first training candidate word negative samples.
[0182] In an embodiment of the present disclosure, a second training module is used to input multiple first training candidate word positive samples and multiple first training candidate word negative samples into an initial candidate word scoring model, and output second scores of multiple first training candidate word positive samples and second scores of multiple first training candidate word negative samples; based on the second scores and second labeled scores of multiple first training candidate word positive samples, as well as the second scores and second labeled scores of multiple first training candidate word negative samples, the model parameters of the initial candidate word scoring model are adjusted to obtain a candidate word scoring model for the first training.
[0183] In another embodiment of the present disclosure, a third training module is used to score multiple first training candidate words based on the candidate word scoring model trained for the first time to obtain multiple second scores of the first training candidate words; based on the second scores and second preset scores of the multiple first training candidate words, obtain multiple second training candidate word reference positive samples and multiple second training candidate word reference negative samples, the second score of the second training candidate word reference positive sample is greater than the second preset score, and the second score of the second training candidate word reference negative sample is less than the second preset score; based on the multiple second training candidate word reference positive samples, the multiple second training candidate word reference negative samples and the search words in the user search log, determine multiple second training candidate word positive samples and multiple second training candidate word negative samples; based on the multiple second training candidate word reference positive samples, the multiple second training candidate word reference negative samples and the search words in the user search log, train the candidate word scoring model trained for the first time, based on the multiple second training candidate word positive samples and the multiple second training candidate word negative samples; repeat the above training process until the number of iterations reaches the preset number, and determine the model obtained when the number of iterations reaches the preset number as the candidate word scoring model.
[0184] In another embodiment of the present disclosure, an apparatus for training a sequence labeling model includes:
[0185] A fifth acquisition module is used to acquire a plurality of third training sample corpora, where the third training sample corpora are corpora annotated with at least one of guide words or non-guide words, entity names, and parts of speech;
[0186] The fourth training module trains the initial sequence labeling model based on a plurality of third training sample corpora to obtain a sequence labeling model.
[0187] In summary, the device provided by the embodiment of the present disclosure sequentially inputs the corpus to be mined into the candidate word mining model, the candidate word scoring model and the sequence labeling model for processing. Based on the candidate word mining model, multiple first candidate words that may serve as guide words can be mined from the corpus to be mined, and the first score of each first candidate word can be output. Then, the multiple first candidate words mined are preliminarily screened according to the first score, and the second candidate words with relatively high accuracy can be obtained. Then, based on the candidate word scoring model, the second candidate words are scored at the semantic level, and the third candidate words with higher scores are screened out. Then, based on the sequence labeling model, the third candidate words are scored at the context and part of speech levels, and finally, the candidate words with higher scores at the semantic, context and part of speech levels are obtained as guide words. The guide words mined by this method are semantically complete and more in line with the current context, so they are more accurate.
[0188] Figure 5 A server for guiding word mining is shown according to an exemplary embodiment. Figure 5 The server 500 includes a processing component 522, which further includes one or more processors, and a memory resource represented by a memory 532 for storing instructions that can be executed by the processing component 522, such as an application. The application stored in the memory 532 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 522 is configured to execute instructions to perform the functions performed by the server in the above-mentioned guide word mining method.
[0189] The server 500 may also include a power supply component 526 configured to perform power management of the server 500, a wired or wireless network interface 550 configured to connect the server 500 to a network, and an input / output (I / O) interface 558. The server 500 may operate based on an operating system stored in the memory 532, such as Windows Server 2000. TM , Mac OSX TM , Unix TM ,Linux TM , FreeBSD TM or similar.
[0190] The server provided by the embodiment of the present disclosure sequentially inputs the corpus to be mined into the candidate word mining model, the candidate word scoring model and the sequence labeling model for processing. Based on the candidate word mining model, multiple first candidate words that may serve as guide words can be mined from the corpus to be mined, and the first score of each first candidate word can be output. Then, the multiple first candidate words mined are preliminarily screened according to the first score, and a second candidate word with a relatively high accuracy can be obtained. Then, based on the candidate word scoring model, the second candidate words are scored at the semantic level, and a third candidate word with a higher score is screened out. Then, based on the sequence labeling model, the third candidate word is scored at the context and part of speech level, and finally a candidate word with a higher score at the semantic, context and part of speech level is obtained as a guide word. The guide word mined by this method is semantically complete and more in line with the current context, so it is more accurate.
[0191] The embodiment of the present disclosure provides a computer-readable storage medium, in which at least one program code is stored, and the at least one program code is loaded and executed by a processor to implement a guide word mining method. The computer-readable storage medium can be non-transient. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device.
[0192] The computer-readable storage medium provided by the embodiment of the present disclosure sequentially inputs the corpus to be mined into the candidate word mining model, the candidate word scoring model and the sequence labeling model for processing. Based on the candidate word mining model, multiple first candidate words that may serve as guide words can be mined from the corpus to be mined, and the first score of each first candidate word can be output. Then, the multiple first candidate words mined are preliminarily screened according to the first score, and the second candidate words with relatively high accuracy can be obtained. Then, based on the candidate word scoring model, the second candidate words are scored at the semantic level, and the third candidate words with high scores are screened out. Then, based on the sequence labeling model, the third candidate words are scored at the context and part of speech level, and finally the candidate words with high scores at the semantic, context and part of speech levels are obtained as guide words. The guide words mined by this method are semantically complete and more suitable for the current context, so the accuracy is higher.
[0193] An embodiment of the present disclosure provides a computer program product, including a computer program, which implements a guide word mining method when executed by a processor.
[0194] The computer program product provided by the embodiment of the present disclosure sequentially inputs the corpus to be mined into the candidate word mining model, the candidate word scoring model and the sequence labeling model for processing. Based on the candidate word mining model, multiple first candidate words that may be used as guide words can be mined from the corpus to be mined, and the first score of each first candidate word can be output. Then, the multiple first candidate words mined are preliminarily screened according to the first score, and the second candidate words with relatively high accuracy can be obtained. Then, based on the candidate word scoring model, the second candidate words are scored at the semantic level, and the third candidate words with high scores are screened out. Then, based on the sequence labeling model, the third candidate words are scored at the context and part of speech level, and finally the candidate words with high scores at the semantic, context and part of speech levels are obtained as guide words. The guide words mined by this method are semantically complete and more suitable for the current context, so the accuracy is higher.
[0195] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0196] The above description is only an optional embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A guide word mining method, characterized in that: The method comprises: Inputting a plurality of corpora to be mined into a candidate word mining model, and outputting a plurality of first candidate words and a first score corresponding to each first candidate word, wherein the candidate word mining model is used to mine candidate words from the corpora to be mined; From the plurality of first candidate words, obtaining a plurality of second candidate words whose first scores are greater than a first preset score; Inputting the plurality of second candidate words into a candidate word scoring model, and outputting a second score for each of the plurality of second candidate words, wherein the candidate word scoring model is used to score the candidate words at a semantic level; From the plurality of second candidate words, obtaining a plurality of third candidate words whose second scores are greater than a second preset score; Inputting the plurality of third candidate words and the corresponding corpus to be mined into a sequence labeling model, and outputting a third score for each of the plurality of third candidate words, wherein the sequence labeling model is used to score the candidate words at the context and part-of-speech level; Acquire third candidate words whose third scores are greater than a third preset score as a plurality of guide words; The training process of the candidate word scoring model is as follows: Inputting a plurality of second training sample corpora into the candidate word mining model, outputting a plurality of first training candidate words and their first scores, wherein the second training sample corpora have a second annotation score; Based on the first scores of the plurality of first training candidate words, the first preset scores and the user search log, determining a plurality of first training candidate word positive samples and a plurality of first training candidate word negative samples from the plurality of first training candidate words; Based on the multiple first training candidate word positive samples and the multiple first training candidate word negative samples, the initial candidate word scoring model is trained to obtain a first trained candidate word scoring model; Iteratively training the candidate word scoring model trained for the first time to obtain the candidate word scoring model; The determining, based on the first scores of the plurality of first training candidate words, the first preset scores and the user search log, a plurality of first training candidate word positive samples and a plurality of first training candidate word negative samples from the plurality of first training candidate words comprises: Based on the first scores of the plurality of first training candidate words and the first preset scores, obtaining a plurality of first training candidate word reference positive samples and a plurality of first training candidate word reference negative samples, wherein the first scores of the first training candidate word reference positive samples are greater than the first preset scores, and the first scores of the first training candidate word reference negative samples are less than the first preset scores; Acquire words in the plurality of first training candidate word reference positive samples that overlap with the search words in the user search log to obtain the plurality of first training candidate word positive samples; The words that overlap with the search words in the user search log are deleted from the multiple first training candidate word reference negative samples to obtain the multiple first training candidate word negative samples.
2. The method according to claim 1, characterized in that: The training process of the candidate word mining model is as follows: Taking words in a knowledge base as supervision information, a plurality of first training sample corpora are obtained, wherein the first training sample corpora are annotated with at least one guide word, and the knowledge base includes at least one of words in a specified search engine, named entities, or mined guide words; Based on the multiple first training sample corpora, an initial candidate word mining model is trained to obtain the candidate word mining model.
3. The method according to claim 1, characterized in that: The step of training the initial candidate word scoring model based on the plurality of first training candidate word positive samples and the plurality of first training candidate word negative samples to obtain a first trained candidate word scoring model includes: Inputting the plurality of first training candidate word positive samples and the plurality of first training candidate word negative samples into the initial candidate word scoring model, and outputting second scores of the plurality of first training candidate word positive samples and the plurality of first training candidate word negative samples; Based on the second scores and the second labeled scores of the multiple first training candidate word positive samples, and the second scores and the second labeled scores of the multiple first training candidate word negative samples, the model parameters of the initial candidate word scoring model are adjusted to obtain the candidate word scoring model for the first training.
4. The method according to claim 1, characterized in that: The iterative training of the candidate word scoring model trained for the first time to obtain the candidate word scoring model includes: Scoring the plurality of first training candidate words based on the candidate word scoring model trained for the first time to obtain second scores for the plurality of first training candidate words; Based on the second scores of the plurality of first training candidate words and the second preset scores, obtaining a plurality of second training candidate word reference positive samples and a plurality of second training candidate word reference negative samples, wherein the second scores of the second training candidate word reference positive samples are greater than the second preset scores, and the second scores of the second training candidate word reference negative samples are less than the second preset scores; Determine a plurality of second training candidate word positive samples and a plurality of second training candidate word negative samples based on the plurality of second training candidate word reference positive samples, the plurality of second training candidate word reference negative samples, and the search words in the user search log; Based on the plurality of second training candidate word positive samples and the plurality of second training candidate word negative samples, training the candidate word scoring model of the first training; The above training process is repeated until the number of iterations reaches a preset number, and the model obtained when the number of iterations reaches the preset number is determined as the candidate word scoring model.
5. The method according to claim 1, characterized in that: The training process of the sequence labeling model is: Acquire a plurality of third training sample corpora, wherein the third training sample corpora are corpora annotated with at least one of guide words or non-guide words, entity names, and parts of speech; Based on the plurality of third training sample corpora, an initial sequence labeling model is trained to obtain the sequence labeling model.
6. A guide word mining device, characterized in that: The device comprises: A first input-output module, used for inputting a plurality of corpora to be mined into a candidate word mining model, and outputting a plurality of first candidate words and a first score corresponding to each first candidate word, wherein the candidate word mining model is used for mining candidate words from the corpora to be mined; A first acquisition module, configured to acquire, from the plurality of first candidate words, a plurality of second candidate words whose first scores are greater than a first preset score; The second input-output module is further used to input the plurality of second candidate words into a candidate word scoring model and output a second score for each of the plurality of second candidate words, wherein the candidate word scoring model is used to score the candidate words at a semantic level; A second acquisition module, configured to acquire, from the plurality of second candidate words, a plurality of third candidate words whose second scores are greater than a second preset score; A third input-output module, used for inputting the plurality of third candidate words and the corresponding corpus to be mined into a sequence labeling model, and outputting a third score of each of the plurality of third candidate words, wherein the sequence labeling model is used for scoring the candidate words at the context and part-of-speech level; A third acquisition module, used to acquire third candidate words with a third score greater than a third preset score as a plurality of guide words; The training process of the candidate word scoring model is as follows: Inputting a plurality of second training sample corpora into the candidate word mining model, outputting a plurality of first training candidate words and their first scores, wherein the second training sample corpora have a second annotation score; Based on the first scores of the plurality of first training candidate words, the first preset scores and the user search log, determining a plurality of first training candidate word positive samples and a plurality of first training candidate word negative samples from the plurality of first training candidate words; Based on the multiple first training candidate word positive samples and the multiple first training candidate word negative samples, the initial candidate word scoring model is trained to obtain a first trained candidate word scoring model; Iteratively training the candidate word scoring model trained for the first time to obtain the candidate word scoring model; The determining, based on the first scores of the plurality of first training candidate words, the first preset scores and the user search log, a plurality of first training candidate word positive samples and a plurality of first training candidate word negative samples from the plurality of first training candidate words comprises: Based on the first scores of the plurality of first training candidate words and the first preset scores, obtaining a plurality of first training candidate word reference positive samples and a plurality of first training candidate word reference negative samples, wherein the first scores of the first training candidate word reference positive samples are greater than the first preset scores, and the first scores of the first training candidate word reference negative samples are less than the first preset scores; Acquire words in the plurality of first training candidate word reference positive samples that overlap with the search words in the user search log to obtain the plurality of first training candidate word positive samples; The words that overlap with the search words in the user search log are deleted from the multiple first training candidate word reference negative samples to obtain the multiple first training candidate word negative samples.
7. A server, characterized in that: The server includes a processor and a memory, wherein at least one program code is stored in the memory, and the at least one program code is loaded and executed by the processor to implement the guide word mining method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The storage medium stores at least one program code, and the at least one program code is loaded and executed by the processor to implement the guide word mining method according to any one of claims 1 to 5.
9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the guide word mining method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Phrase mining method and device
CN107463548A
Search recall method and device, server and storage medium
CN107491518A
