Sample data generation method and device, electronic equipment and computer readable medium
Automatically generate sample data through electronic devices, solving the problems of low sample data acquisition efficiency and high labor costs in the prior art, and achieving efficient and automated sample data generation.
Patent Information
- Application Number
- CN202311456126.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-02
- Publication Date
- 2025-05-06
AI Technical Summary
The prior art is less efficient and requires a lot of labor costs when acquiring sample data for training a specific domain model.
The electronic device determines a specified feature that has a logical association relationship with at least one service, generates feature combinations and service combinations, automatically generates sample data, and reduces the need for manual orchestration.
It improves the efficiency of sample data acquisition, reduces the demand for manpower, and reduces labor costs.
Smart Images

Figure CN119939203A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data technology, and more specifically, to a sample data generation method, device, electronic device and computer-readable medium. Background Art
[0002] At present, with the development of electronic information technology, models in specific fields can be trained through sample data. However, the efficiency of obtaining sample data for training models in specific fields is low and the manpower cost required is high. Summary of the invention
[0003] The present application proposes a sample data generation method, device, electronic device and computer-readable medium.
[0004] In a first aspect, an embodiment of the present application provides a sample data generation method, which is applied to an electronic device, and the method includes: determining a first specified feature that has a logical association relationship with at least one first service, the first specified feature including at least one of a user portrait feature and a user scenario feature; based on the first specified feature, generating a feature combination corresponding to each of the first services; determining at least one service combination based on a pre-acquired service library, the service combination including at least two second services, and there is no logical relationship conflict between each second service included in the same service combination; generating at least one sample data based on the feature combination and the service combination, the sample data including a second service that meets an association condition with the first specified feature.
[0005] In the second aspect, the embodiment of the present application also provides a sample data generation device, which is applied to an electronic device, and the device includes: a first determination unit, a first generation unit, a second determination unit, and a second generation unit. Among them, the first determination unit is used to determine a first specified feature that has a logical association relationship with at least one first service, and the first specified feature includes at least one of a user portrait feature and a user scene feature; the first generation unit is used to generate a feature combination corresponding to each first service based on the first specified feature; the second determination unit is used to determine at least one service combination based on a pre-acquired service library, and the service combination includes at least two second services, and there is no logical relationship conflict between each second service included in the same service combination; the second generation unit is used to generate at least one sample data based on the feature combination and the service combination, and the sample data includes a second service that meets the association condition with the first specified feature.
[0006] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: one or more processors; a memory; and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the above method.
[0007] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a program code executable by a processor, and when the program code is executed by the processor, the processor executes the method described in the first aspect.
[0008] The sample data generation method, device, electronic device and computer-readable medium provided in the present application, the method first determines a first specified feature that has a logical association relationship with at least one first service; then, based on the first specified feature, generates a feature combination corresponding to each first service; then, based on a pre-acquired service library, determines at least one service combination; finally, based on the feature combination and the service combination, generates at least one sample data, the sample data includes a second service that satisfies the association condition with the first specified feature. It can be understood that if the services and features are combined manually and then the sample data is further generated, the efficiency is low and more manpower is required. In the present application, at least one sample data can be generated by an electronic device based on the feature combination and the service combination, without the need for manual arrangement of the sample data, which reduces the demand for manpower and improves the efficiency of obtaining sample data.
[0009] Other features and advantages of the embodiments of the present application will be described in the subsequent description, and partly become apparent from the description, or be understood by practicing the embodiments of the present application. The purposes and other advantages of the embodiments of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present application, 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 application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0011] Figure 1 An application scenario diagram of the sample data generation method provided in an embodiment of the present application is shown;
[0012] Figure 2 A method flow chart of a sample data generation method provided by an embodiment of the present application is shown;
[0013] Figure 3 A schematic diagram showing a shortcut command provided in an embodiment of the present application is shown;
[0014] Figure 4 A method flow chart of a sample data generation method provided by another embodiment of the present application is shown;
[0015] Figure 5 A method flow chart showing a method for generating sample data provided by another embodiment of the present application is shown;
[0016] Figure 6 A method flow chart of a sample data generation method provided by another embodiment of the present application is shown;
[0017] Figure 7 A unit block diagram of a sample data generating device provided in an embodiment of the present application is shown;
[0018] Figure 8 A schematic diagram of an electronic device provided by an embodiment of the present application is shown;
[0019] Fig. 9 A structural block diagram of a computer-readable storage medium provided in an embodiment of the present application is shown;
[0020] Fig.10 A structural block diagram of a computer program product provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0021] In order to make those skilled in the art better understand the present application scheme, the technical scheme in the present application embodiment will be clearly and completely described below in conjunction with the drawings in the present application embodiment. Obviously, the described embodiment is only a part of the present application embodiment, rather than all the embodiments. The components of the present application embodiment usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the present application for protection, but merely represents the selected embodiment of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0022] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0023] At present, with the development of electronic information technology, models in specific fields can be trained through sample data. However, the efficiency of obtaining sample data for training models in specific fields is low and the manpower cost is high. How to obtain sample data more efficiently and reduce the manpower required is an urgent problem to be solved.
[0024] Thanks to the development of interactive software for smartphones in recent years, the graphical user interface (GUI) has been well developed. The information of terminal devices can be presented to users in a variety of forms. For example, services can be presented in the form of service cards. Among them, service cards, as a form of information presentation, can be presented in a more concise, efficient, beautiful and rich style. At the same time, in order to meet the user's needs for quick display and interaction of a series of related services, service cards can form a chain service collection to meet the user's daily needs.
[0025] Although pre-trained models generally have the ability to have conversations and simulate thinking, they are generally pre-trained based on general texts, so the conversation and simulated thinking abilities obtained are general. For some specific vertical fields, the form of input and output data and the logical relationship between input and output data are unknown, and the effect of directly applying the pre-trained model to the vertical field is poor. Therefore, sample data related to the field can be obtained to further train the pre-trained model. Currently, sample data for further training of the pre-trained model can be obtained through manual arrangement.
[0026] However, the inventors found in their research that obtaining sample data for further training of the pre-trained model through manual arrangement would result in high demand for manpower and low efficiency in obtaining sample data.
[0027] Therefore, in order to overcome the above-mentioned defects, the embodiments of the present application provide a sample data generation method, device, electronic device and computer-readable medium to solve or partially solve the above-mentioned problems.
[0028] See also Figure 1 , Figure 1 An application scenario diagram of the sample data generation method provided in an embodiment of the present application is shown, namely, a sample data generation scenario 100 , which may include an electronic device 110 and a server 120 , wherein the electronic device 110 is connected to the server 120 .
[0029] The electronic device 110 can access the Internet and thereby establish a connection with the server 120 which is also connected to the Internet. The electronic device 110 can access the Internet wirelessly, such as through wireless communication technologies such as Wi-Fi and Bluetooth, etc.; the electronic device 110 can also access the Internet through a wired method, such as through an Rj45 network cable or an optical fiber.
[0030] The user can control the electronic device 110 so that the electronic device executes the sample data generation method. For details, please refer to the subsequent embodiments. For example, the user can directly operate the electronic device 110 to control the electronic device to execute the sample data generation method; the user can also operate the server 120 that has established a communication connection with the electronic device 110, so as to control the electronic device to execute the sample data generation method through the server 120. The server 120 can be a cloud server or a local server.
[0031] See also Figure 2 , Figure 2 A sample data generation method provided by an embodiment of the present application is shown, and the method can be applied to an electronic device, and the execution subject of the method can be a processor in the electronic device. Specifically, the method includes steps S110 to S140.
[0032] Step S110: Determine a first specified feature that has a logical association with at least one first service, wherein the first specified feature includes at least one of a user portrait feature and a user scenario feature.
[0033] At present, the data can be processed through the vertical domain model to obtain the output of the vertical domain model. Among them, the vertical domain model refers to a model that is specially adapted to a specific field. Generally, the use of the vertical domain model in this field can obtain better results than the general model. For example, the specific field can be the financial field, the medical field, or the service field provided by electronic equipment.
[0034] For some embodiments, in the service field provided by the electronic device, the acquired user portrait features or the scene features of the user can be used as input and input into the vertical domain model obtained after training, so that the service output by the vertical domain model can be obtained, and the service chain output by the vertical domain model can also be obtained, and the service chain can be a sequence including multiple services. Exemplarily, the service or service chain output by the vertical domain model can be used to provide ubiquitous services to users, and the ubiquitous service can be used to provide users with various services, such as sleep, commuting, catering recommendations, takeout, express delivery, aviation, trains, taxis, buses, subways, weather, audio and video, hotels, news consultation, etc. The ubiquitous service is to actively push related services to users before the user actively initiates the need to use a certain service through an electronic device. For example, the service can be pushed to the user in the form of a service card, so that the user can interact with the corresponding service card as needed to achieve the service corresponding to the service card, for example, by clicking on the service card.
[0035] In another exemplary embodiment, the service or service chain output by the vertical domain model can also provide shortcut instructions for the user's electronic device, which can include, for example, payment scenarios, convenient life, practical tools, traffic navigation, travel, life entertainment, online shopping, etc. A shortcut instruction is a shortcut used by the user to simplify the user's subsequent operation process of using the service when the user actively initiates the need to use a certain service through an electronic device. For example, a shortcut instruction can be an icon, and the user can quickly use the service by clicking the icon corresponding to the service.
[0036] For example, see Figure 3 , Figure 3 A schematic diagram of shortcut instructions provided in an embodiment of the present application is shown. Figure 3 , a display interface 300 of an electronic device is shown, and the display interface 300 includes a plurality of shortcut command categories and shortcut commands corresponding to each shortcut command category. For example, Figure 3 The shortcut command categories in the app include My Subscriptions, Recommended for You, First Payment App Life Services, Convenient Life, Utilities, Traffic Navigation, Travel, Social Entertainment, and Online Shopping. Among them, the shortcut commands in My Subscriptions include First Payment App Scan, First Payment App Pay, Second Payment App Pay, Smart Object Recognition, etc.; the shortcut commands in Recommended for You include Second Payment App Pay, First Payment App Ride Code, and Second Payment App Ride Code, etc.; the shortcut commands in First Payment App Life Services include First Payment App Pay, First Payment App Scan, First Payment App Ride Code, Life Manor, and Life Forest, etc. For the shortcut commands included in other shortcut command categories, please refer to Figure 3 Therefore, users can directly communicate with Figure 3 Interact with each shortcut command shown in, for example, click, to quickly use the service corresponding to the shortcut command.
[0037] In some embodiments, the electronic device may have intelligent perception capabilities, for example, an intelligent perception system may be running in the electronic device, so that the intelligent perception system can be used to perceive and obtain features related to the user. The feature may have a logical association with the service. Among them, having a logical association can be used to characterize that there is a logical relationship between the feature and the service. For example, it can be inferred that there may be features with a logical association with the service due to the existence of the service. Exemplarily, if the service includes a food delivery service, and the features include that the food delivery application is running and the user is at home, then it can be confirmed that the food delivery service has a logical association with the food delivery application being running and the user being at home. Subsequently, the required sample data can be generated based on the features and services, and there is no need to manually arrange and obtain the sample data.
[0038] Thus, the first specified feature having a logical association relationship with the first service can be determined first. Optionally, the first service can be one or more, that is, the first specified feature having a logical association relationship with at least one first service can be determined. For some embodiments, the first service can be determined based on a pre-acquired service library, wherein the service library can include multiple services. A detailed description can be referred to in subsequent embodiments.
[0039] The first specified feature may include at least one of a user portrait feature and a feature of the scene the user is in. The user portrait feature may be used to characterize the user's preferences. For example, the user's record of using an application may be learned through an electronic device or the cloud to construct a user personal tag, and the user personal tag may characterize the user's preferences.
[0040] Exemplarily, user portrait features may include the user's application usage habits. For example, the user's application usage habits, such as application type, application usage time, the N applications with the longest usage time, and the habits of using applications in different time periods, can be recorded and learned through electronic devices or the cloud, such as the habitual use of applications in different time periods such as morning, noon, and night; and the habitual use of applications on weekdays and non-workdays. Usage habits may also include the time periods when users are more active and inactive in using applications, which can be further subdivided into the time periods when users are more active and inactive in using applications on weekdays and non-workdays, etc.
[0041] Furthermore, the user portrait features may also include the user's living habits. For example, the user's living habits may be analyzed and learned through electronic devices or the cloud, such as sleeping habits, commuting habits, taxi habits, music habits, takeout habits, charging habits, electronic device power usage habits, network usage habits, common charging location portraits, and dependence on power and the network.
[0042] It should be noted that the user portrait features shown above are only an introduction to the user portrait features in the embodiments of the present application. In actual applications, the required user portrait features can be flexibly set as needed.
[0043] The characteristics of the scene in which the user is located can be used to characterize the user scenario, the application usage scenario or the current external environment. Exemplarily, the application currently used by the user can be obtained first, and then the application usage scenario can be determined. For example, the application usage scenario may include scenes such as ongoing meetings, ongoing audio and video calls, navigating, working, studying, holidays, and playing games. The user's geographic location information can also be obtained through electronic devices, and then the near-field recognition and geographic location information can be combined to obtain the user's current external environment. For example, information such as being close to subways, train stations, bus stops, airports, shopping malls, places of interest, indoors, outdoors, inside and outside elevators, etc. In addition, user scenarios can also be obtained through electronic devices. For example, stillness, resting, walking, running, cycling, traveling by public transportation, driving, etc.
[0044] Optionally, the latitude and longitude information of the user may also be obtained, so as to search for nearby restaurants, hotels, scenic spots and other points of interest (POI) based on the latitude and longitude information of the user.
[0045] Optionally, the user's daily life status can also be perceived based on the scene characteristics of the user. For example, the scene characteristics of the user can be analyzed and processed by an electronic device or the cloud, so as to obtain sleep information, step information, flight itinerary status information, train itinerary status information, online car-hailing status information, takeaway status information, express delivery status information, weather warning information, shopping mall restaurant recommendation information, etc.
[0046] For some implementations, logical reasoning can be performed through thought chains to determine the first specified feature that has a logical association with the first service. For a specific introduction, please refer to the subsequent embodiments.
[0047] Optionally, the first designated feature having a logical association with the first service may be determined directly through a pre-trained language model.
[0048] Step S120: Based on the first specified characteristics, generate a feature combination corresponding to each of the first services.
[0049] For some implementations, the first specified feature may include one feature or multiple features. Further, based on the first specified feature obtained above, a feature combination corresponding to each of the first services may be generated. Since the first specified feature has a logical association with the first service, the feature combination also corresponds to the first service. Each of the feature combinations may include a second specified feature, and the second specified feature may be obtained based on the first specified feature. For a detailed description, please refer to the subsequent embodiments.
[0050] Exemplarily, at least part of the first specified features corresponding to the first service may be randomly selected as the feature combination corresponding to the first service. Detailed description may be referred to in subsequent embodiments.
[0051] Step S130: determining at least one service combination based on the pre-acquired service library, wherein the service combination includes at least two second services, and there is no logical relationship conflict between each second service included in the same service combination.
[0052] For some implementations, a service library may be obtained in advance, and the service library may include at least one service
[0053] It is understandable that if some services exist at the same time, there may be conflicts in logical relationship. For example, if a sleep service and a fitness service exist at the same time, there may be conflicts in logical relationship. Therefore, at least one service combination can be determined based on a pre-acquired service library, so that the service combination includes at least two second services, and there is no logical conflict between each second service included in the same service combination. Among them, a service can be selected from the service library as the second service.
[0054] Exemplarily, the service combination may include a restaurant recommendation service and a takeaway service. In this example, there is no logical conflict between the restaurant recommendation service and the takeaway service in the service combination.
[0055] The service combination determined based on the pre-acquired service library may be one or more. For a detailed description, please refer to the subsequent embodiments.
[0056] Step S140: generating at least one sample data based on the feature combination and the service combination, wherein the sample data includes a second service that satisfies an association condition with the first specified feature.
[0057] After the feature combination and service combination are acquired through the above steps, at least one sample data may be further generated based on the feature combination and the service combination, wherein the sample data includes a second service that meets an association condition with the first specified feature.
[0058] It should be noted that more than one sample data may be obtained, and each sample data may include the first specified feature and the second service. For some sample data, there may be no logical association between the first specified feature and the second service, so these sample data do not include the second service that meets the association condition with the first specified feature. For other sample data, there may be a logical association between the first specified feature and the second service, so these sample data include the second service that meets the association condition with the first specified feature.
[0059] In some implementations, the sample format may be preset, so that the generated sample data may be generated in the sample format according to the preset sample format.
[0060] For example, please refer to Table 1 for sample format.
[0061] Table 1 Sample format
[0062]
[0063] Among them, the sample format shown in Table 1 includes input and output, the input includes task description, all features, trigger information, user input, and the output includes service. Task description can be used to characterize the overall description of sample data, for example, it can be based on what input the model trained by the sample data generates output; all features can include each user portrait feature and each user scene feature, and all features can also include parameter value range, wherein the parameter value range is used to limit the value range of the first feature parameter, and the first feature parameter can further describe or limit the feature, for example, the first specified feature can be further limited or described by the first feature parameter, and the detailed introduction can refer to the subsequent embodiment introduction; trigger information and user input can constitute event information, and the details can refer to the subsequent embodiment introduction, and trigger information and user input are not necessary in Table 1; output can include service, which can be a service or a service chain composed of multiple services, and the service chain includes multiple linearly arranged services. Thus, in some embodiments, sample data can include input and output.
[0064] Thus, the vertical domain model can be trained based on the acquired sample data. Each sample data can also have the same sample format, that is, the embodiment of the present application realizes the automatic generation of data with fixed or semi-fixed input format and output as a combination of services.
[0065] The sample data generation method provided in the present application first determines a first specified feature that has a logical association relationship with at least one first service; then, based on the first specified feature, generates a feature combination corresponding to each of the first services; then, based on a pre-acquired service library, determines at least one service combination; finally, based on the feature combination and the service combination, generates at least one sample data, and the sample data includes a second service that satisfies an association condition with the first specified feature. It is understandable that if the services and features are combined manually and then the sample data is further generated, the efficiency is low and more manpower is required. In the present application, at least one sample data can be generated based on the feature combination and the service combination by an electronic device, without the need for manual arrangement of the sample data, which reduces the demand for manpower and improves the efficiency of obtaining sample data.
[0066] See also Figure 4 , Figure 4 A sample data generation method provided by an embodiment of the present application is shown, and the method can be applied to an electronic device, and the execution subject of the method can be a processor in the electronic device. Specifically, the method includes steps S210 to S2110.
[0067] Step S210: Determine a service from the service library as the first service.
[0068] Step S220: Input the first service, user portrait features and user scenario features into the pre-acquired thinking chain, and obtain the target feature output by the logical reasoning of the thinking chain as the first designated feature that has a logical association with the first service.
[0069] As can be seen from the foregoing introduction, a service library can be acquired in advance, and the service library can include at least one service. Therefore, when determining a first specified feature that has a logical association with at least one first service, a service can be first determined from the service library as the first service. Exemplarily, a service can be randomly selected from the service library as the first service; or a service can be selected from the service library through a preset algorithm as the first service, which is not specifically limited in the embodiments of the present application.
[0070] Furthermore, the first service can be logically inferred through the pre-acquired thinking chain to obtain a first specified feature that has a logical association with the first service. It can be understood that, since it is necessary to find the first specified feature that has a logical association with the first service, the first service and the preset feature can be used as input together, input into the thinking chain, and logical reasoning is performed through the thinking chain to obtain the target feature output by the thinking chain. The target feature can be used as the first specified feature that has a logical association with the first service. Among them, the preset features can include user portrait features and user scene features. For the introduction of user portrait features and user scene features, please refer to the aforementioned embodiment, which will not be repeated here.
[0071] Among them, the thinking chain can have simulated thinking and reasoning capabilities. For example, the thinking chain can include simulated thinking and reasoning forms such as CoT, ToT, AutoGPT, and GoT.
[0072] Optionally, in some embodiments, the thought chain may also be included in the language model, so that the first service and the preset feature are used as inputs, and can also be input into the language model including the thought chain, so that the input is inferred through the thought chain included in the language model to obtain the target feature, which can be used as the first designated feature with a logical association relationship with the first service. The language model can be a large language model, such as GPT3, GPT3.5, GPT4, Cl aude, Cl aude2, PaLM, PaLM2, Gemin i, LLaMA2, etc.
[0073] Optionally, when outputting the target feature, the thinking chain can also output the first feature parameter corresponding to the target feature, so as to further limit and describe the first specified feature through the first feature parameter. Among them, each feature in the first specified feature can also have a corresponding first feature parameter, and the feature can be further described or limited by the first feature parameter. Exemplarily, if the first specified feature includes that the food delivery application is running and the user is at home, the first feature parameter corresponding to the food delivery application can include that the food delivery has been ordered and is being delivered, and the first feature parameter corresponding to the user is at home can include that the user is stationary; for another example, the first feature parameter corresponding to the food delivery application can also include that the food delivery order is being received, and the first feature parameter corresponding to the user is at home can include that the user is walking.
[0074] Among them, the above-mentioned first characteristic parameter can be characterized by a numerical value or an interval range. Specifically, the parameter value range can be obtained in advance, and the parameter value range includes all numerical values or interval ranges corresponding to each feature, and also includes the specific meaning of each numerical value or interval range to limit or describe the corresponding feature. It can be understood that for some features, each first characteristic parameter corresponding to the feature can be enumerated, so the first characteristic parameter corresponding to the feature can be a numerical value; while for other features, the value range can be used as the first characteristic parameter of the feature. Optionally, for some other features, a value template can be pre-set, so that the value template is used as the first characteristic parameter of the feature.
[0075] Therefore, the corresponding features can be described or limited directly based on the numerical value or interval range as the first characteristic parameter. For example, the parameter value range may include the numerical value of the first characteristic parameter corresponding to the food delivery application, which may include 1 and 2, where 1 is used to indicate that the food delivery has been ordered and is being delivered, and 2 is used to indicate that the food delivery order is being received; the numerical value of the first characteristic parameter corresponding to the user being at home may include 1 and 2, where 1 is used to indicate that the user is stationary, and 2 is used to indicate that the user is walking.
[0076] That is, for some implementations, the parameter value range can also be input as input to the thought chain or to the language model including the thought chain. Optionally, when the thought chain outputs the target feature, it can also output the relevant explanation of the detailed reasoning process of obtaining the target feature through the input.
[0077] Step S230: Return to execute determining a service from the service library as the first service and subsequent steps until each service in the service library is traversed to obtain a plurality of first services respectively corresponding to the first specified features with a logical association relationship.
[0078] In some implementations, there may be multiple first services, and the service library may include multiple services. Thus, each service in the service library may be traversed to obtain first specified features that have logical associations corresponding to the multiple first services.
[0079] Specifically, the process may return to execute step S210 and step S220 until each service in the service library is traversed to obtain first designated features that have logical associations corresponding to a plurality of first services.
[0080] Thus, each service in the service library is taken as the first service, and the first designated feature corresponding to the first service is determined. A large number of first designated features can be obtained, which facilitates the subsequent acquisition of a large number of sample data and improves the efficiency of obtaining sample data.
[0081] Step S240: Based on the first specified feature, obtain a plurality of different second specified features.
[0082] Step S250: Based on the pre-acquired parameter value range, determine the first feature parameter corresponding to each of the second specified features.
[0083] Step S260: Generate the feature combination based on each of the second specified features and the first feature parameter.
[0084] In order to subsequently generate more diverse sample data, at least one feature combination may be generated. In some implementations, multiple feature combinations may be generated.
[0085] Among them, the feature combination may include a second specified feature and a first feature parameter used to further define or describe the features in the second specified feature, and the second specified feature can be obtained based on at least part of the features in the first specified feature, so the first feature parameter can also be regarded as used to further define or describe at least part of the first specified feature.
[0086] As can be seen from the foregoing introduction, the first specified feature may include multiple features. Therefore, for some embodiments, based on the first specified feature, multiple different second specified features are obtained, which may be determined from the first specified feature to obtain multiple different second specified features. Exemplarily, the first specified feature may include feature 1, feature 2, and feature 3, and the determined at least part of the first specified feature may include feature 1 and feature 2 as the second specified feature; it may also be determined that at least part of the first specified feature includes feature 2 and feature 3 as another second specified feature. Thus, multiple second specified features can be obtained from one first specified feature, which facilitates the subsequent acquisition of sample data.
[0087] Furthermore, the first characteristic parameter corresponding to each of the second specified features and the first specified features can be determined based on the pre-acquired parameter value range. The parameter value range has been introduced in the aforementioned embodiment and will not be repeated here. It can be understood that determining the first characteristic parameter corresponding to each of the second specified features and the first specified features can be determining the first characteristic parameter corresponding to each feature in the second specified features. Exemplarily, if the second specified features include feature 1 and feature 2, then the first characteristic parameter corresponding to feature 1 and the first characteristic parameter corresponding to feature 2 can be determined based on the pre-acquired parameter value range.
[0088] For some embodiments, a second specified feature that satisfies a specified distribution may be selected from a plurality of obtained second specified features, and then a first feature parameter corresponding to a feature in each selected second specified feature may be determined based on a pre-acquired parameter value range. Exemplarily, the first feature parameter may be a first feature parameter randomly determined based on a pre-acquired parameter value range. In other words, each feature included in each selected second specified feature may correspond to a first feature parameter. The specified distribution may be a Poisson distribution. Subsequently, a plurality of feature combinations may be generated based on each of the second specified features and the first feature parameter. The number of feature combinations obtained in this embodiment is medium.
[0089] For some other embodiments, it is also possible to implement traversal by arranging and combining the features in the first specified feature, so as to obtain multiple second specified features. For example, if the first specified feature includes feature 1, feature 2 and feature 3, then seven second specified features can be obtained by arranging and combining feature 1, feature 2 and feature 3. Specifically, the first second specified feature can include feature 1; the second second specified feature can include feature 2; the third second specified feature can include feature 3; the fourth second specified feature can include feature 1 and feature 2; the fifth second specified feature can include feature 1 and feature 3; the sixth second specified feature can include feature 2 and feature 3; the seventh second specified feature can include feature 1, feature 2 and feature 3. And when determining the first feature parameter corresponding to each of the second specified features based on the pre-acquired parameter value range, all possible values of the first feature parameter of each feature in the second specified feature are determined, and then multiple feature combinations can be generated based on each of the second specified features and the first feature parameter. In this embodiment, the number of feature combinations obtained is relatively large.
[0090] For some other embodiments, after obtaining the second specified feature, the first feature parameters corresponding to the features included in each second specified feature can be combined through the language model, and the first feature parameters corresponding to the features included in the second specified feature in the parameter value range are non-repeatedly traversed in a permutation and combination manner, thereby obtaining multiple feature combinations for output. Among them, since multiple feature combinations are obtained through a language model, the language model can also analyze the logic represented by the obtained feature combination, and only output logically reasonable feature combinations. Among them, logical rationality can represent that there is no logical conflict between the second specified feature and the first feature parameter included in the feature combination. Exemplarily, if the second specified feature includes sleeping habits and fitness habits, the first feature parameter corresponding to the sleeping habit represents 10 o'clock in the evening, and the first feature parameter corresponding to the fitness habit includes 9:30 to 10:30 in the evening, then the feature combination obtained in this example is logically unreasonable. The number of feature combinations obtained in this embodiment is medium.
[0091] In some implementations, the feature combination format may also be pre-set. For example, please refer to Table 2 for the feature combination format.
[0092] Table 2 Feature combination format
[0093]
[0094] Among them, the feature combination format shown in Table 2 includes input and output, the input includes task description, all features, and the first service, and the output includes feature combination. The task description can be used to characterize the overall description of the sample data, for example, it can be based on what input the model trained by the sample data generates output; all features can include each user portrait feature and each user scene feature, and all features can also include parameter value ranges, where the parameter value range is used to limit the value range of the first feature parameter, and the first feature parameter can further describe or limit the feature, for example, the second specified feature can be further limited or described by the first feature parameter; the output can include feature parameters, for example, it can be the second specified feature included in the output feature parameter and the first feature parameter.
[0095] Step S270: determining at least one service combination based on the pre-acquired service library, wherein the service combination includes at least two second services, and there is no logical relationship conflict between each second service included in the same service combination.
[0096] The detailed description of step S270 can be found in the above-mentioned embodiment and will not be repeated here.
[0097] Step S280: obtaining a first score for each feature combination based on a pre-acquired language model, wherein the first score is positively correlated with a first degree of association, and the first degree of association is used to characterize a logical degree of association between the feature combination and the first service.
[0098] Step S290: Whether the first score is greater than or equal to a first threshold score.
[0099] Among the acquired feature combinations, there may be feature combinations that have no logical association relationship with the first service. Therefore, in some embodiments, the first score of each feature combination can also be acquired based on the pre-acquired language model, wherein the first score is positively correlated with the first degree of association, and the first degree of association is used to characterize the degree of logical association between the feature combination and the first service. In other words, the closer the logical association relationship between the feature combination and the first service, the higher the logical association degree between the feature combination and the first service, and thus the higher the first score; conversely, if the logical association relationship between the feature combination and the first service is more distant, the logical association degree between the feature combination and the first service is lower, and thus the first score is lower.
[0100] Furthermore, the first threshold score and the first score may be compared to determine whether the first score is greater than or equal to the first threshold score. If the first score is greater than or equal to the first threshold score, the process jumps to step S2100; if the first score is less than the first threshold score, the process jumps to step S2130.
[0101] Step S2100: taking a first score that is greater than or equal to a first threshold score as a first target score.
[0102] Step S2110: taking the feature combination corresponding to the first target score as the target feature combination.
[0103] The first score that is greater than or equal to the first threshold score is used as the first target score. Thus, the feature combination corresponding to the first target score can be used as the target feature combination.
[0104] Step S2120: Generate at least one sample data based on the target feature combination and the service combination.
[0105] Further, when at least one sample data is subsequently generated based on the feature combination and the service combination, at least one sample data may be generated based on the target feature combination and the service combination. In the embodiment provided by the present application, the target feature combination has a logical association relationship with the first service, and some feature combinations that do not have a logical association relationship with the first service may be excluded first. Thus, when sample data is subsequently generated based on the target feature combination and the service combination, the probability of including sample data of the second service that meets the association condition with the first specified feature may be increased.
[0106] Step S2130: discard the feature combination corresponding to the first score that is less than the first threshold score.
[0107] In the case where the first score is less than the first threshold score, the feature combination corresponding to the first score less than the first threshold score may be discarded.
[0108] The sample data generation method provided by the present application can determine a first target score, and then use the feature combination corresponding to the first target score as the target feature combination, so that the target feature combination has a logical association relationship with the first service, and some feature combinations that do not have a logical association relationship with the first service can be excluded first. Thus, the subsequent generation of sample data based on the target feature combination and the service combination can increase the probability of including sample data of the second service that meets the association condition with the first specified feature. In addition, in an embodiment of the present application, each service in the service library can be traversed to obtain the first specified features that have a logical association relationship with multiple first services. Thus, each service in the service library is used as the first service, and the first specified feature corresponding to the first service is determined. A large number of first specified features can be obtained, which facilitates the subsequent acquisition of a large number of sample data and improves the efficiency of obtaining sample data.
[0109] See also Figure 5 , Figure 5 A sample data generation method provided by an embodiment of the present application is shown, and the method can be applied to an electronic device, and the execution subject of the method can be a processor in the electronic device. Specifically, the method includes steps S310 to S3130.
[0110] Step S310: Determine a first specified feature that has a logical association with at least one first service, wherein the first specified feature includes at least one of a user portrait feature and a user scenario feature.
[0111] Step S320: Based on the first specified characteristics, generate a feature combination corresponding to each of the first services.
[0112] Among them, step S310 and step S320 have been introduced in detail in the above embodiments and will not be repeated here.
[0113] Step S330: Whether event information is detected.
[0114] In some implementations, a service combination may be generated based on whether event information is detected. The event information may include at least one of trigger information of a specified application and user input (query) information. Specifically, if event information is detected, the process may jump to step S340; if event information is not detected, the process may jump to step S370.
[0115] Step S340: If event information is detected, semantic analysis is performed on the event information based on a pre-acquired language model to determine a third service corresponding to the event information, wherein the event information includes at least one of trigger information of a specified application and information input by a user.
[0116] Step S350: Determine the second service having a logical association relationship with the third service from the service library.
[0117] Step S360: Obtain at least one service combination based on the second service.
[0118] If event information is detected, it indicates that at least one of the trigger information of the specified application and the information input by the user is detected. For some embodiments, the event information may be text information, so that the event information may be semantically analyzed based on a pre-acquired language model to determine the third service corresponding to the event information.
[0119] For example, if the event information includes trigger information of an application, the application is a food delivery application, and the trigger information is detection of a food delivery store search through the food delivery application, then the event information can be semantically analyzed based on a pre-acquired language model to determine that the event information corresponds to a food delivery service as the third service.
[0120] In another exemplary embodiment, if the event information includes information input by the user, for example, the user inputs the name of a takeaway shop, then the event information can be semantically analyzed using a pre-acquired language model to determine that the event information corresponds to a takeaway service as the third service.
[0121] As can be seen from the above introduction, the service library may include multiple services, so the second service having a logical association relationship with the third service can be determined from the service library. For example, if the third service is a takeaway service, it can be determined that payment services, bank services, and transfer services can have a logical association relationship with the third service.
[0122] Further, at least one service combination can be obtained based on the second service. For some implementations, the second services can be sorted according to Poisson distribution based on the closeness of the logical association between each second service and the third service, and then at least one service combination can be determined based on the sorted second services.
[0123] For some other implementations, the second service may be directly arranged and combined to determine at least one service combination. For example, if the second service includes service 1, service 2, and service 3, then seven service combinations may be obtained by arranging and combining service 1, service 2, and service 3. Specifically, the first service combination may include service 1; the second service combination may include service 2; the third service combination may include service 3; the fourth service combination may include service 1 and service 2; the fifth service combination may include service 1 and service 3; the sixth service combination may include service 2 and service 3; and the seventh service combination may include service 1, service 2, and service 3.
[0124] For some further implementations, the second service can also be directly processed through a language model to output at least one service combination, which can be obtained by sorting through the language model. For example, it can be sorted by the language model based on the closeness of the logical association between the service combination and the third service.
[0125] Therefore, in the embodiment provided in the present application, at least one service combination can be acquired based on the third service, thereby facilitating the subsequent acquisition of sample data.
[0126] In some implementations, a service combination format may be preset, so that the service combination may be generated according to the preset service combination format. For example, please refer to Table 3 for the service combination format.
[0127] Table 3 Service combination format
[0128]
[0129] The service combination format shown in Table 3 includes input and output, the input includes task description, all features, trigger information, user input, and the output includes service. Task description can be used to characterize the overall description of sample data, for example, it can be based on what input the model trained by the sample data generates output; all features can include each user portrait feature and each user scene feature, and all features can also include parameter value range, where the parameter value range is used to limit the value range of the first feature parameter, and the first feature parameter can further describe or limit the feature, for example, the first specified feature can be further limited or described by the first feature parameter; trigger information and user input can constitute event information, and the details can be referred to the subsequent embodiments. Trigger information and user input are optional in Table 3. Output can include service combination, and the service combination can include a second service.
[0130] Step S370: If no event information is detected, a fourth service is determined based on the service library, and the second service having a logical association relationship with the fourth service is determined.
[0131] If no event information is detected, the fourth service can be determined directly based on the service library. Exemplarily, a service can be randomly selected from the service library as the fourth service; in another exemplary embodiment, the service ranked first can also be selected from the service library as the fourth service. Then the second service that has a logical association with the fourth service is determined. Among them, the method of determining the second service that has a logical association with the fourth service is similar to the aforementioned method of determining the second service that has a logical association with the third service from the service library, and will not be repeated here.
[0132] Further, after obtaining the second service, the process may jump to step S360 to obtain at least one service combination.
[0133] Step S380: Generate at least one sample data based on the feature combination and the service combination, wherein the sample data includes a second service that satisfies an association condition with the first specified feature.
[0134] Among them, step S380 has been introduced in detail in the above embodiment and will not be repeated here.
[0135] Step S390: obtaining a second score for each sample data based on a pre-acquired language model, wherein the second score is positively correlated with a second degree of association, and the second degree of association is used to characterize a logical degree of association between the second service and the first specified feature in the sample data.
[0136] Step S3100: Whether the second score is greater than or equal to the second threshold score.
[0137] As can be seen from the above introduction, more than one sample data may be obtained, and each sample data may include the first specified feature and the second service. For some sample data, there may be no logical association between the first specified feature and the second service, so these sample data do not include the second service that meets the association condition with the first specified feature. For other sample data, there may be a logical association between the first specified feature and the second service, so these sample data include the second service that meets the association condition with the first specified feature.
[0138] Whether the association condition is satisfied can be determined by the degree of logical association between the second service and the first specified feature in the sample data.
[0139] Therefore, after obtaining the sample data, the second score of each sample data can also be obtained based on the pre-acquired language model, and the second score is positively correlated with the second association degree, and the second association degree is used to characterize the logical association degree between the second service and the first specified feature in the sample data. In other words, the closer the logical association relationship between the second service and the first specified feature, the higher the logical association degree between the second service and the first specified feature, and thus the higher the second score; conversely, if the logical association relationship between the second service and the first specified feature is more distant, the logical association degree between the second service and the first specified feature is lower, and thus the lower the second score is.
[0140] Thus, the second degree of association can be characterized by the second score. When the second score is greater than or equal to the second threshold score, the execution can jump to step S3110; when the second score is less than the second threshold score, the execution can jump to S3130. When the second score is greater than or equal to the second threshold score, it can be regarded that the first specified feature in the sample data corresponding to the second score and the second service meet the association condition; when the second score is less than the second threshold score, it can be regarded that the first specified feature in the sample data corresponding to the second score and the second service do not meet the association condition.
[0141] Among them, the second threshold score can be pre-set. For example, the second threshold score that meets the target demand quantity can be determined based on the second score of each of the sample data, and the target demand quantity includes the number of target sample data required. It can be understood that the adjustment of the second threshold score will affect the target sample quantity obtained subsequently, that is, the second threshold score can be reasonably adjusted according to the target demand quantity for the sample data. Exemplarily, if the target demand quantity is large, a smaller second threshold score can be set at this time to obtain more target demand quantities; and if the target demand quantity is small, a larger second threshold score can be set at this time to obtain sample data with a closer logical association relationship between the first specified feature and the second service.
[0142] Step S3110: taking a second score that is greater than or equal to a second threshold score as a second target score.
[0143] Step S3120: taking the sample data corresponding to the second target score as target sample data.
[0144] Therefore, the second score greater than or equal to the second threshold score can be used as the second target score, and the sample data corresponding to the second target score can be used as the target sample data, thereby achieving screening and filtering of the sample data to a certain extent.
[0145] Step S3130: discard the sample data corresponding to the second score that is less than the second threshold score.
[0146] When the second score is less than the second threshold score, the sample data corresponding to the second score less than the second threshold score may be discarded.
[0147] The sample data generation method provided by the present application can further screen and filter the sample data after obtaining the sample data. Specifically, the second score of each sample data can be obtained, and then the second score greater than or equal to the second threshold score can be used as the second target score, and the sample data corresponding to the second target score can be determined as the target sample data. Since the second score is positively correlated with the second degree of association, the second degree of association is used to characterize the degree of logical association between the second service and the first specified feature in the sample data. Therefore, the degree of logical association between the second service and the first specified feature in the target sample data obtained after screening and filtering is relatively high.
[0148] See also Figure 6 , Figure 6 A sample data generation method provided by an embodiment of the present application is shown, and the method can be applied to an electronic device, and the execution subject of the method can be a processor in the electronic device. Specifically, the method includes steps S310 to S3130.
[0149] Step S410: Determine a first specified feature that has a logical association with at least one first service, wherein the first specified feature includes at least one of a user portrait feature and a user scenario feature.
[0150] Step S420: Based on the first specified characteristics, generate a feature combination corresponding to each of the first services.
[0151] Step S430: determining at least one service combination based on the pre-acquired service library, wherein the service combination includes at least two second services, and there is no logical relationship conflict between each second service included in the same service combination.
[0152] Among them, step S410 to step S430 have been introduced in detail in the above embodiments and will not be repeated here.
[0153] Step S440: Combine each of the first services in the service combination with the first specified feature in the feature combination to obtain a first service with the first specified feature.
[0154] Step S450: linearly arrange the first services with the first specified characteristic to obtain a service chain.
[0155] Step S460: Generate the sample data based on the service chain.
[0156] In some implementations, each of the first services in the service combination may be combined with the first specified feature in the feature combination to obtain a first service with the first specified feature. The first services with the first specified feature are then arranged linearly to obtain a service chain.
[0157] Thus, the sample data can be generated based on the service chain. In other words, the generated sample data includes the service chain, and the vertical domain model can be trained later through the sample data.
[0158] In some embodiments, the first specified feature in the feature combination can be further defined or described by the first feature parameter. Therefore, optionally, the first service with the first specified feature can be further defined or described by the first feature parameter to obtain the first service with the first feature parameter and the first specified feature. Then, the first service with the first feature parameter and the first specified feature is linearly arranged to obtain a service chain.
[0159] The sample data generation method provided in the present application can combine each of the first services in the service combination with the first specified feature in the feature combination to obtain a first service with the first specified feature; then linearly arrange the first services with the first specified feature to obtain a service chain; and then generate the sample data based on the service chain. Thus, in the embodiment of the present application, the sample data can include a service chain, and then the vertical domain model can be trained by the sample data including the service chain, so that the vertical domain model can learn to output the service chain.
[0160] See also Figure 7 , which shows a structural block diagram of a sample data generating device 700 provided in an embodiment of the present application, which is applied to an electronic device, and the device includes: a first determining unit 710, a first generating unit 720, a second determining unit 730 and a second generating unit 740.
[0161] The first determination unit 710 is used to determine a first specified feature that has a logical association relationship with at least one first service, where the first specified feature includes at least one of a user portrait feature and a user scenario feature.
[0162] Optionally, the first determination unit 710 can also be used to determine a service from the service library as the first service; input the first service, user portrait features, and user scenario features into a pre-acquired thinking chain, and obtain the target features output by the logical reasoning of the thinking chain as the first designated feature that has a logical association with the first service; return to execute the determination of a service from the service library as the first service and subsequent steps until each service in the service library is traversed, and multiple first services are obtained, respectively corresponding to the first designated features that have a logical association.
[0163] The first generating unit 720 is configured to generate a feature combination corresponding to each of the first services based on the first specified features.
[0164] Optionally, the first generation unit 720 can also be used to obtain multiple different second specified features based on the first specified feature; determine the first feature parameter corresponding to each of the second specified features based on a pre-acquired parameter value range; and generate the feature combination based on each of the second specified features and the first feature parameter.
[0165] The second determining unit 730 is configured to determine at least one service combination based on the pre-acquired service library, wherein the service combination includes at least two second services, and there is no logical relationship conflict between each second service included in the same service combination.
[0166] Optionally, the second determination unit 730 can also be used to perform semantic analysis on the event information based on a pre-acquired language model if event information is detected, to determine a third service corresponding to the event information, wherein the event information includes at least one of trigger information of a specified application and information input by a user; determine the second service that has a logical association with the third service from the service library; and obtain at least one service combination based on the second service.
[0167] The second generating unit 740 is configured to generate at least one sample data based on the feature combination and the service combination, where the sample data includes a second service that satisfies an association condition with the first specified feature.
[0168] Optionally, the second generation unit 740 can also be used to obtain a first score for each feature combination based on a pre-acquired language model, the first score is positively correlated with a first degree of association, and the first degree of association is used to characterize the degree of logical association between the feature combination and the first service; taking a first score greater than or equal to a first threshold score as a first target score; taking the feature combination corresponding to the first target score as a target feature combination; and generating at least one sample data based on the feature combination and the service combination, including: generating at least one sample data based on the target feature combination and the service combination.
[0169] Optionally, the second generation unit 740 can also be used to obtain a second score for each of the sample data based on a pre-acquired language model, the second score being positively correlated with a second degree of association, the second degree of association being used to characterize the degree of logical association between the second service and the first specified feature in the sample data; taking a second score greater than or equal to a second threshold score as a second target score; and taking the sample data corresponding to the second target score as target sample data.
[0170] Optionally, the second generating unit 740 may also be configured to determine the second threshold score that satisfies a target required quantity based on the second score of each sample data, where the target required quantity includes the required quantity of target sample data.
[0171] Optionally, the second generation unit 740 can also be used to combine each of the first services in the service combination with the first specified feature in the feature combination to obtain a first service with the first specified feature; linearly arrange the first services with the first specified feature to obtain a service chain; and generate the sample data based on the service chain.
[0172] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0173] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.
[0174] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0175] See also Figure 8 , which shows a structural block diagram of an electronic device provided in an embodiment of the present application. The electronic device 110 can be an electronic device such as a smart phone, a tablet computer, an e-book, etc. that can run applications. The electronic device 110 in the present application may include one or more of the following components: a processor 111, a memory 112, and one or more applications, wherein the processor 111 is connected to the memory 112. One or more applications may be stored in the memory 112 and configured to be executed by one or more processors 111, and one or more programs are configured to execute the method described in the aforementioned method embodiment.
[0176] The processor 111 may include one or more processing cores. The processor 111 uses various interfaces and lines to connect various parts of the entire electronic device 110, and executes various functions and processes data of the electronic device 110 by running or executing instructions, programs, code sets or instruction sets stored in the memory 112, and calling data stored in the memory 112. Optionally, the processor 111 can be implemented in at least one hardware form of digital signal processing (DSP), field programmable gate array (FPGA), and programmable logic array (PLA). The processor 111 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 111, but may be implemented separately through a communication chip.
[0177] The memory 112 may include a random access memory (RAM) or a read-only memory (ROM). The memory 112 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 112 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function, instructions for implementing the following various method embodiments, etc. The data storage area may also store data created by the electronic device 110 during use, etc.
[0178] Please refer to Fig. 9 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 900 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.
[0179] The computer readable storage medium 900 can be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 900 includes a non-transitory computer-readable storage medium. The computer readable storage medium 900 has storage space for program code 910 that performs any method step in the above method. These program codes can be read from or written into one or more computer program products. The program code 910 can be compressed, for example, in an appropriate form.
[0180] Please refer to Fig.10 , which shows a structural block diagram of a computer program product provided in an embodiment of the present application. The computer program product 1000 includes a computer program / instruction 1010, and the steps of the above method are implemented when the computer program / instruction 1010 is executed by a processor.
[0181] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for generating sample data, characterized in that: Applied to electronic equipment, the method comprises: Determine a first specified feature that has a logical association relationship with at least one first service, where the first specified feature includes at least one of a user portrait feature and a user scenario feature; Based on the first specified feature, generating a feature combination corresponding to each of the first services; Determine at least one service combination based on the pre-acquired service library, wherein the service combination includes at least two second services, and there is no logical relationship conflict between each second service included in the same service combination; At least one sample data is generated based on the feature combination and the service combination, where the sample data includes a second service that satisfies an association condition with the first specified feature.
2. The method according to claim 1, characterized in that The determining at least one service combination based on the pre-acquired service library includes: If event information is detected, semantic analysis is performed on the event information based on a pre-acquired language model to determine a third service corresponding to the event information, wherein the event information includes at least one of trigger information of a specified application and information input by a user; Determine, from the service library, the second service that has a logical association relationship with the third service; At least one service combination is obtained based on the second service.
3. The method according to claim 1, characterized in that The generating, based on the first specified feature, a feature combination corresponding to each of the first services includes: Based on the first specified feature, obtain a plurality of different second specified features; Determine, based on the pre-acquired parameter value range, a first feature parameter corresponding to each of the second specified features; The feature combination is generated based on each of the second specified features and the first feature parameter.
4. The method according to claim 1, characterized in that There are multiple first services, the service library includes multiple services, and determining a first specified feature that has a logical association relationship with at least one first service includes: Determine a service from the service library as a first service; Input the first service, user portrait features, and user scenario features into a pre-acquired thought chain, and obtain a target feature output by logical reasoning of the thought chain as a first designated feature having a logical association relationship with the first service; Return to execute determining a service from the service library as the first service and subsequent steps until each service in the service library is traversed to obtain a plurality of first services respectively corresponding to the first specified features with a logical association relationship.
5. The method according to claim 1, characterized in that Before generating at least one sample data based on the feature combination and the service combination, the method further includes: Acquire a first score for each feature combination based on a pre-acquired language model, where the first score is positively correlated with a first association degree, and the first association degree is used to characterize a logical association degree between the feature combination and the first service; taking a first score that is greater than or equal to a first threshold score as a first target score; Using the feature combination corresponding to the first target score as the target feature combination; The generating at least one sample data based on the feature combination and the service combination includes: At least one sample data is generated based on the target feature combination and the service combination.
6. The method according to claim 1, characterized in that After generating at least one sample data based on the feature combination and the service combination, the method further includes: Acquire a second score for each sample data based on a pre-acquired language model, where the second score is positively correlated with a second association degree, and the second association degree is used to characterize a logical association degree between the second service and the first specified feature in the sample data; taking a second score that is greater than or equal to a second threshold score as a second target score; The sample data corresponding to the second target score is used as target sample data.
7. The method according to claim 6, characterized in that Before taking the second score greater than or equal to the second threshold score as the second target score, the method further includes: The second threshold score satisfying a target required quantity is determined based on the second score of each of the sample data, where the target required quantity includes the required quantity of target sample data.
8. The method according to claim 1, characterized in that The generating at least one sample data based on the feature combination and the service combination includes: Combining each of the first services in the service combination with the first specified feature in the feature combination to obtain a first service with the first specified feature; Linearly arranging the first service with the first specified characteristic to obtain a service chain; The sample data is generated based on the service chain.
9. A sample data generating device, characterized in that: Applied to electronic equipment, the device comprises: A first determining unit, configured to determine a first specified feature having a logical association relationship with at least one first service, wherein the first specified feature includes at least one of a user portrait feature and a user scenario feature; A first generating unit, configured to generate a feature combination corresponding to each of the first services based on the first specified feature; A second determining unit, configured to determine at least one service combination based on a pre-acquired service library, wherein the service combination includes at least two second services, and there is no logical relationship conflict between each second service included in the same service combination; The second generating unit is configured to generate at least one sample data based on the feature combination and the service combination, wherein the sample data includes a second service that satisfies an association condition with the first specified feature.
10. An electronic device, characterized in that: include: one or more processors; Memory; One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1-8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 8.