A method and device for labeling data
By using a text generation model based on behavioral data training in the query process, the label query statements are automated, and the problems of high cost and low efficiency of manual labeling in the existing technology are solved, and efficient sample data output is achieved.
Patent Information
- Application Number
- CN202010320672.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-22
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2040-04-22
AI Technical Summary
In the prior art, the annotation of data samples mainly relies on manual labor, resulting in high cost and low efficiency. Especially when it is necessary to train query models for new application scenarios, the cost and efficiency of manually labeling sample data is particularly prominent.
By using the text generation model obtained by training based on behavioral data in the query process, query target data with label information is processed, and a new query statement with label information is generated, and the automated annotation of query statements is realized.
Automatic labeling of query statements is realized, which greatly reduces the cost of manual labeling and improves the output efficiency of sample data, so that the number of new query statements can reach the order of query target data.
Smart Images

Figure CN113535932B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data analysis, and in particular to a method and device for labeling data. Background Art
[0002] Information retrieval is the main way for users to search and obtain information, and it is a method and means of finding information. Information retrieval also refers to information query, which is the process of finding the required information from the information collection by users according to their needs, using certain methods and retrieval tools. With the rise and development of artificial intelligence, this search process can be realized by applying the query model of artificial intelligence algorithm to quickly and accurately match the information required by users, so that users can match the required information through simpler query statements. However, the premise for the query model to achieve accurate matching is that a large amount of model training is required, so a large number of labeled data samples are required.
[0003] At present, the annotation of data samples, including the annotation of query statements in data samples and the annotation of matching information, still mainly relies on manual work. For the amount of user query statement data that can be collected, the labor cost required to convert it into sample data will be very high. In addition, the application cost of these manually annotated sample data will be very high due to their strong application scenarios. That is, when it is necessary to train a query model for a new application scenario, it is also necessary to manually produce sample data for the scenario to ensure the query accuracy of the query model in the scenario. It can be seen that the existing method based on manually annotated query statements has the problems of high cost and low efficiency. Summary of the invention
[0004] In view of the above problems, the present invention proposes a method and device for annotating data, the main purpose of which is to automatically annotate user query statements and improve the output efficiency of sample data.
[0005] In order to achieve the above object, the present invention mainly provides the following technical solutions:
[0006] In one aspect, the present invention provides a method for labeling data, which specifically includes:
[0007] Acquire query target data with annotation information, wherein the annotation information includes at least one core word;
[0008] The query target data is processed using a text generation model to obtain a new query sentence with the annotation information, wherein the text generation model is trained based on the behavioral data during the query process.
[0009] Preferably, the method further comprises:
[0010] Acquire the user's behavior data during the query process, wherein the behavior data includes the query statement input by the user and the query target data selected by the user;
[0011] The text generation model is trained using the behavior data, wherein the input of the text generation model is the query target data and the output is the query statement.
[0012] Preferably, the using the behavior data to train the text generation model includes:
[0013] Acquiring the behavior data includes a data pair consisting of the query statement and the selected query target data, wherein the query target data carries the annotation information;
[0014] The text generation model is trained using the data pairs, and the text generation model is a sequence-to-sequence model.
[0015] Preferably, the method further comprises:
[0016] The configuration parameters of the text generation model are set, where the configuration parameters are used to control the number of query statements with annotation information output by the text generation model.
[0017] Preferably, the method further comprises:
[0018] If there are multiple central words in the query target data, and the number of configuration parameter settings is multiple, each query sentence obtained by the text generation model contains at least one of the central words.
[0019] Preferably, the method further comprises:
[0020] The new query sentence is used to train a central word model, and the central word model is used to annotate the central word of the query sentence input by the user, and output the annotation information of the query sentence.
[0021] In another aspect, the present invention provides a device for labeling data, specifically comprising:
[0022] An acquisition unit, configured to acquire query target data having annotation information, wherein the annotation information includes at least one core word;
[0023] A generating unit is used to process the query target data obtained by the acquiring unit by using a text generating model to obtain a new query sentence with the annotation information, wherein the text generating model is trained based on the behavioral data in the query process.
[0024] Preferably, the device further comprises:
[0025] A collection unit, used to obtain the user's behavior data during the query process, wherein the behavior data includes the query statement input by the user and the query target data selected by the user;
[0026] The first model training unit is used to train the text generation model using the behavior data obtained by the acquisition unit, wherein the input of the text generation model is the query target data and the output is the query statement.
[0027] Preferably, the first model training unit is also used to obtain the behavior data including a data pair consisting of the query statement and the query target data, wherein the query target data carries the annotation information; and use the data pair to train the text generation model, wherein the text generation model is a sequence-to-sequence model.
[0028] Preferably, the device further comprises:
[0029] A setting unit is used to set configuration parameters of the text generation model, and the configuration parameters are used to control the number of query sentences with annotation information output by the text generation model.
[0030] Preferably, the generation unit is also used for, if there are multiple central words in the query target data and the number of configuration parameter settings is multiple, each query sentence obtained by the text generation model contains at least one of the central words.
[0031] Preferably, the device further comprises:
[0032] The second model training unit is used to train a core word model using the new query sentence, wherein the core word model is used to annotate the core words of the query sentence input by the user and output the annotation information of the query sentence.
[0033] On the other hand, the present invention provides a processor, which is used to run a program, wherein the program executes the above-mentioned method of marking data when running.
[0034] By means of the above technical solution, the present invention provides a method and device for annotating data, which uses a text generation model trained based on the behavior data of the query user to process the query target data with annotation information, thereby obtaining a new query statement, and the new query statement contains the annotation information carried by the query target data. It can be seen that the present invention trains a text generation model for generating new query statements based on the association between the query statement reflected in the behavior data and the query target data, so as to generate a new query statement with annotation information. In this way, a large number of new query statements with annotation information are obtained based on the user's behavior data, so that the number of new query statements can reach the order of the query target data, and the automatic annotation of the query statements is realized, which greatly reduces the cost of manual annotation.
[0035] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0037] Figure 1 A flow chart of a method for labeling data proposed by an embodiment of the present invention is shown;
[0038] Figure 2 A flowchart of another method for labeling data proposed by an embodiment of the present invention is shown;
[0039] Figure 3 A block diagram showing a device for labeling data according to an embodiment of the present invention is shown;
[0040] Figure 4 A block diagram showing the composition of another device for labeling data proposed in an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0042] The present invention provides a method for labeling data. The specific steps of the method are as follows: Figure 1 As shown, the method includes:
[0043] Step 101: Acquire query target data with annotation information.
[0044] The query target data in this step refers to the data information selected by the user based on the user's query needs during the query process. For example, in the query process in the e-commerce field, after the user enters the required query statement, the user can obtain matching query content, and the query content finally selected by the user is the query target data.
[0045] In this step, the query target data obtained carries annotation information, wherein the annotation information includes at least one central word, and the central word is used to represent the core content of the query target data. Generally, the central word in the annotation information is set by the data provider of the query target data, or is obtained based on word segmentation statistics after text processing. Taking the e-commerce field as an example, merchants will set a title for the provided product content for users to query and preview. The content of the title is the query target data. Users can set several words in the title content as central words as needed, or perform word segmentation statistics based on the text of the detailed content of the product to determine the central word corresponding to the title.
[0046] In this embodiment, the query target data is based on existing data maintained in a database, and therefore, the execution of this step is to extract the query target data with annotation information from the database.
[0047] Step 102: Use the text generation model to process the query target data to obtain a new query statement with annotation information.
[0048] Among them, the text generation model is a model trained based on the behavioral data in the query process. The design idea of the text generation model is to generate query statements from query target data. For this purpose, a sequence-to-sequence model (seq2seq model) is adopted in this embodiment, and the input sequence is the query target data, and the output sequence is a new query statement.
[0049] In this embodiment, the behavior data used to train the text generation model is based on the behavior data generated by the user during the query process, and the behavior data includes the user's query statement and the query target data selected by the user. It should be noted that the query statement does not need to be labeled. The text generation model is trained through the correspondence between the query statement and the query target data in the behavior data, so that the model can accurately predict the query statement that the user may construct based on the query target data obtained in the previous step.
[0050] By executing this step, a new query statement output by the text generation model can be obtained, and the new query statement carries annotation information, which is derived from the annotation information of the query target data, that is, part or all of the annotation information in the query target data is used as the annotation information of the new query statement.
[0051] Through the description of the above embodiments, a method for annotating data provided by the present invention is to train a text generation model using behavioral data in the query process, and the text generation model processes the query target data with annotation information to generate a corresponding new query statement, and applies the annotation information to the new query statement to obtain a query statement with annotation information. Since user behavior data can be collected in large quantities, a relatively accurate text generation model can be obtained. At the same time, since the query target data is also existing data generated by the data provider, a query statement with annotation information of the same order of magnitude as the query target data can be obtained through a sequence-to-sequence text generation model, realizing batch generation and automatic annotation of query statements, thereby improving the output efficiency of sample data.
[0052] Furthermore, in the implementation Figure 1 Before the data annotation method shown, an available text generation model needs to be obtained. For this purpose, the text generation model needs to be trained first. In the embodiment of the present invention, the sample data used to train the text generation model comes from the user's behavior data. According to the application scenario of the text generation model, different types of behavior data need to be obtained. For example, in the query scenario, the user's behavior data in the query process needs to be obtained, and in the scenario of judging the user's preferences, the user's behavior data such as adding attention or adding to the shopping cart during the browsing process needs to be obtained. Generally, when obtaining behavior data, it is necessary to pre-set the type of behavior data obtained, or to classify the obtained behavior data according to the preset type, so as to train the corresponding text generation model with different types of behavior data. Taking the behavior data in the query process as an example, the behavior data at least records the query statement input by the user and the query target data selected by the user. By collecting a large amount of user behavior data, a sample for training the text generation model can be obtained. In this embodiment, the specific form of the sample can be expressed as a set of data pairs, that is, a data pair consisting of a query statement and a query target data, that is, the user's query statement and the query target data selected by the user are extracted from a piece of behavior data to form a data pair to obtain a sample. These samples are used to train the text generation model, and by inputting the query target data in the samples, the output new query statements are made to be the same or similar to the query statements in the samples.
[0053] The text generation model used in this embodiment can be a statistical machine translation model used in machine translation, or a neural network machine translation model. Preferably, a general sequence-to-sequence neural network model (Tensor2Tensor, T2T) is used. Tensor2Tensor is a set of deep learning systems based on TensorFlow that Google Brain Team has opened on Github. The system uses the Attention method to model sequence-to-sequence (Sequence-to-Sequence, Seq2Seq) problems, and as the system continues to expand, T2T supports more and more functions. Currently, the problems that can be modeled include: image classification, language model, sentiment analysis, speech recognition, text summarization, and machine translation. The specific training and application of this model are not described in detail in this embodiment.
[0054] Furthermore, when applying the trained text generation model, the number of generated query statements can be controlled by setting the configuration parameters of the text model, i.e., the hyperparameters of the model. That is, by setting the configuration parameters, the text generation model can obtain multiple corresponding new query statements by inputting a query target data. The multiple new query statements outputted are finally outputted according to the accuracy, i.e., the text generation model can match and generate multiple new query statements according to the input query target data, and different new query statements have different matching accuracy. When a new query statement needs to be outputted, the new query statement with the highest accuracy is selected as the output. When multiple new query statements need to be outputted, multiple new query statements are selected as the output according to the accuracy sorting.
[0055] In addition, when applying the trained text generation model, the input query target data carries the annotation information, and the output new query statement uses the annotation information in the query target data to annotate itself. In this regard, when there is only one center word in the annotation information, the center word will also be the annotation information of the new query statement. When there are multiple center words in the annotation information, the annotation information of the new query statement includes at least one of the multiple center words, and when multiple new query statements need to be output, each new query statement contains at least one of the multiple center words.
[0056] Further, according to the above description of each step in the embodiment, the present invention uses a text generation model to generate a large number of new query statements carrying annotation information, but these new query statements are not the query statements input by the user in the actual query process. Therefore, in order to annotate the query statements actually generated by the user, the present invention can also use the new query statements obtained by the text generation model as training samples to train the central word model, and the output of the central word model is a query statement, and the output is the annotation information with the central word. Afterwards, the central word model is used to process the query statements generated by the user in the actual query process, and the corresponding annotation information is output, so as to realize the automatic annotation of the existing query statements.
[0057] Based on the above embodiments, the present invention also proposes a method for labeling data, the specific steps are as follows: Figure 2 As shown, including:
[0058] Step 201: Obtain the user's behavior data during the query process, and convert the behavior data into a data pair consisting of a query statement and query target data.
[0059] Step 202: Generate a model for training text using data.
[0060] Step 203: Set configuration parameters of the text generation model.
[0061] Step 204: Acquire query target data with annotation information.
[0062] It should be noted that there is no logical sequence relationship between the execution of this step and the execution of the above steps 201-203.
[0063] Step 205: Use the text generation model to process the query target data to obtain a new query statement with annotation information.
[0064] Step 206: Use the new query sentence to train the central word model.
[0065] Step 207: Use the central word model to annotate the central word of the query sentence input by the user, and output the annotation information of the query sentence.
[0066] Based on the above Figure 2 The execution steps shown are as follows, taking the user query scenario in the e-commerce field as an example to illustrate the process of marking the user's query statement.
[0067] First, based on the e-commerce platform, a large number of product titles provided by merchants can be obtained. These product titles are used to display in the user query interface for users to select and view. The product title is the query target data. In the product title, the merchant can specify several words as the central word, thereby forming the annotation information of the product title. In this way, during the user's search, if the user enters a query statement, such as "Summer women's long skirt", multiple matching product titles will be matched in the search interface, and the user then clicks on one of the product titles "2020 New Summer Fashion Ruffles Casual V-neck Women's Sweater Knitted Long Skirt". At this time, the user's click behavior will be collected as a behavior data, which records the user's query statement and the clicked product title, and the behavior data constitutes a training sample, that is, a data pair consisting of the query statement and the query target data selected by the user is generated, such as <Summer women's long skirt, 2020 New Summer Fashion Ruffles Casual V-neck Women's Sweater Knitted Long Skirt>. Among them, the annotation information carried in the product title is the central word (long skirt), and the query statement has no annotation information.
[0068] Afterwards, the text generation model is trained using the large number of training samples collected and generated, the product title is input, and a new query statement is output, so that the new query statement is the same or similar to the query statement in the sample.
[0069] After completing the training of the text generation model, the number of new query statements to be output can be further determined by adjusting the model hyperparameters. Although more query statements with labeled information can be obtained, the correlation between these query statements and the query target data is worse, and the accuracy is also lower. Therefore, when setting this number in actual applications, it is necessary to take into account both the accuracy and quantity of the output query statements, such as the number of query target data and the number of samples required for training the model.
[0070] After that, the text generation model is used to process the product titles provided in the e-commerce platform, that is, the product title is input to obtain a new query statement. For example, if "2020 New Summer Fashion Ruffle Casual V-neck Women's Sweater Knitted Long Skirt" is input, the new query statement output is "Summer Long Skirt" or "Knitted Long Skirt", etc., and since the annotation information of the product title is the central word (long skirt), the central word will be used as the annotation information of the new query statement, that is, the central word in the annotation information of "Summer Long Skirt" or "Knitted Long Skirt" is also long skirt. In this way, a large number of product titles can be used to generate new query statements of the same order of magnitude, and these new query statements all have annotation information.
[0071] Afterwards, the central word model can be trained using these new query statements with annotation information, so that the central word model can more accurately perform central annotation on the query statements input by the user, thereby obtaining annotation information to replace manual annotation.
[0072] The above examples are specific descriptions of the application of the data annotation method proposed in the present invention in the e-commerce scenario. Similarly, the data annotation method proposed in the embodiment of the present invention can also be applied to scenarios such as search engines. In the search scenario, the user's query statement, that is, the user's behavior data, can also be obtained based on the user query interface. The behavior data and the query result corresponding to the query statement form a data pair. The query result is the statement with annotation information selected by the user. However, the search engine has multiple query results matched by the user. After that, the data pair is used to train the text generation model, and the trained text generation model is used to process other query results matched by the search engine, so as to obtain a new query statement with annotation information. Finally, the new query statement is used to train the central word model, and the central word model annotates the query statement input by the user with the central word, outputs the annotation information of the query statement, and realizes the automatic annotation of the query statement. It can be seen that the data annotation method proposed in the embodiment of the present invention is also applicable to various data query scenarios with interactive behaviors with users. In the absence of user query statements, more query data can be generated through existing data to train the model for these scenarios, thereby providing users with a better data query experience.
[0073] Furthermore, as a response to the above Figure 1 and Figure 2 In order to realize the method shown in the figure, the embodiment of the present invention provides a device for labeling data, which is mainly used for automatically labeling user query statements to improve the output efficiency of sample data. For the sake of ease of reading, this device embodiment will not repeat the details of the above method embodiments one by one, but it should be clear that the device in this embodiment can correspond to all the contents of the above method embodiments. The device is as follows Figure 3 As shown, specifically including:
[0074] An acquisition unit 31 is used to acquire query target data with annotation information, where the annotation information includes at least one core word;
[0075] The generating unit 32 is used to process the query target data obtained by the obtaining unit 31 by using a text generation model to obtain a new query sentence with the annotation information, wherein the text generation model is trained based on the behavior data in the query process.
[0076] Further, such as Figure 4 As shown, the device also includes:
[0077] A collection unit 33 is used to obtain the behavior data of the user during the query process, wherein the behavior data includes the query statement input by the user and the query target data selected by the user;
[0078] The first model training unit 34 is used to train the text generation model using the behavior data obtained by the acquisition unit 33, wherein the input of the text generation model is the query target data and the output is the query statement.
[0079] Furthermore, the first model training unit 34 is also used to obtain the behavior data including a data pair consisting of the query statement and the selected query target data, wherein the query target data carries the annotation information; and use the data pair to train the text generation model, which is a sequence-to-sequence model.
[0080] Further, such as Figure 4 As shown, the device also includes:
[0081] The setting unit 35 is used to set the configuration parameters of the text generation model, and the configuration parameters are used to control the number of query sentences with annotation information output by the text generation model.
[0082] Furthermore, the generating unit 32 is also used for, if there are multiple central words in the query target data and the number of the configuration parameter settings is multiple, each query sentence obtained by the text generation model contains at least one of the central words.
[0083] Further, such as Figure 4 As shown, the device also includes:
[0084] A second model training unit 36, used to train a central word model using the new query sentence obtained by the generating unit 32;
[0085] The labeling unit 37 is used to label the central word of the query sentence input by the user by using the central word model obtained by the second model training unit 36, and output the labeling information of the query sentence.
[0086] In addition, an embodiment of the present invention further provides a processor, which is used to run a program, wherein the program executes the method for labeling data provided by any one of the above embodiments when running.
[0087] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0088] It is understandable that the related features in the above methods and devices can be referenced to each other. In addition, the "first", "second" and the like in the above embodiments are used to distinguish the embodiments, but do not represent the advantages and disadvantages of the embodiments.
[0089] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0090] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description of the above specific languages is for disclosing the preferred embodiment of the present invention.
[0091] In addition, the memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash memory.
[0092] (flash RAM), the memory includes at least one memory chip.
[0093] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0094] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0095] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0096] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0097] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0098] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0099] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0100] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0101] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0102] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for labeling data, the method comprising: Acquire query target data with annotation information, wherein the annotation information includes at least one core word, the query target data is selected from query contents matching the original query sentence input by the user, and the query target data is used to represent the query demand of the user; The query target data is processed using a text generation model to obtain a new query sentence with the annotation information, wherein the text generation model is trained based on the behavioral data during the query process.
2. The method according to claim 1, characterized in that The method further comprises: Acquire the user's behavior data during the query process, wherein the behavior data includes the query statement input by the user and the query target data selected by the user; The text generation model is trained using the behavior data, wherein the input of the text generation model is the query target data and the output is the query statement.
3. The method according to claim 2, characterized in that The using the behavior data to train the text generation model includes: The behavior data includes a data pair consisting of the query statement and the selected query target data, wherein the query target data carries the annotation information; The text generation model is trained using the data pairs, and the text generation model is a sequence-to-sequence model.
4. The method according to claim 1, characterized in that: The method further comprises: The configuration parameters of the text generation model are set, where the configuration parameters are used to control the number of query statements with annotation information output by the text generation model.
5. The method according to claim 4, characterized in that The method further comprises: If there are multiple central words in the query target data, and the number of configuration parameter settings is multiple, each query sentence obtained by the text generation model contains at least one of the central words.
6. The method according to claim 1, characterized in that The method further comprises: The new query sentence is used to train a central word model, and the central word model is used to annotate the central word of the query sentence input by the user and output the annotation information of the query sentence.
7. A device for annotating data, the device comprising: an acquisition unit, configured to acquire query target data having annotation information, wherein the annotation information includes at least one core word, the query target data being selected from query contents matching an original query sentence input by a user, and the query target data being used to represent the query demand of the user; A generating unit is used to process the query target data obtained by the acquiring unit by using a text generating model to obtain a new query sentence with the annotation information, wherein the text generating model is trained based on the behavioral data in the query process.
8. The device according to claim 7, characterized in that The device also includes: A collection unit, used to obtain the user's behavior data during the query process, wherein the behavior data includes the query statement input by the user and the query target data selected by the user; The first model training unit is used to train the text generation model using the behavior data obtained by the acquisition unit, wherein the input of the text generation model is the query target data and the output is the query statement.
9. The device according to claim 8, characterized in that The first model training unit is also used to convert the behavior data into a data pair consisting of the query statement and query target data, wherein the query target data carries the annotation information; and use the data pair to train the text generation model, which is a sequence-to-sequence model.
10. The device according to claim 7, characterized in that The device also includes: A setting unit is used to set configuration parameters of the text generation model, and the configuration parameters are used to control the number of query sentences with annotation information output by the text generation model.
11. The device according to claim 10, characterized in that The generation unit is further configured to, when there are multiple central words in the query target data and the number of configuration parameter settings is multiple, each query sentence obtained by the text generation model contains at least one of the central words.
12. The device according to claim 7, characterized in that The device also includes: The second model training unit is used to train a core word model using the new query sentence, wherein the core word model is used to annotate the core words of the query sentence input by the user and output the annotation information of the query sentence.
13. A processor, characterized in that: The processor is used to run a program, wherein the program, when running, executes the method for labeling data described in any one of claims 1 to 6.
Citation Information
Patent Citations
Information processing method, device and equipment
CN110852801A
Construction method and device of query rewriting model and application thereof
CN110909021A