Method, device and equipment for data query, medium and program product
By receiving user queries in the digital assistant, determining keywords and expanding them into search conditions, and generating data query instructions, the accuracy problem of the digital assistant in processing fuzzy semantic queries is solved and the quality of data queries is improved.
Patent Information
- Application Number
- CN202411365181.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-14
AI Technical Summary
When digital assistants deal with user queries with fuzzy semantics, it is difficult for digital assistants to accurately understand user needs, resulting in a decline in the quality of data query.
By receiving user queries, keywords are determined, and search conditions for the target field are obtained by expanding the keywords, and data query instructions are generated to match the data queried by the user from the target data object.
It improves the accuracy of data query, enables digital assistants to better handle fuzzy semantic query problems, and improves the quality of data query.
Smart Images

Figure CN119311734A_ABST
Abstract
Description
Technical Field
[0001] Example embodiments of the present disclosure generally relate to the field of computers, and more particularly, to methods, devices, apparatuses, computer-readable storage media, and computer program products for data query. Background Art
[0002] Digital assistants are provided to assist users with various task processing needs in different applications and scenarios. Digital assistants usually have intelligent dialogue and task processing capabilities. During the interaction with the digital assistant, the user inputs an interactive message, and the digital assistant provides a reply message in response to the user input. For example, a digital assistant is used to query data based on user input, and the queried data is used as a reply message. However, the data query capability of the digital assistant still needs to be improved. Summary of the invention
[0003] In a first aspect of the present disclosure, a method for data query is provided. The method includes: in response to receiving a user query, determining at least one keyword indicating the query requirement of the user query; obtaining at least one retrieval condition for a target field by expanding the at least one keyword, the target field being selected from a plurality of predetermined fields of a target data object targeted by the user query; generating a data query instruction based on the at least one retrieval condition; and determining target data matching the user query from the target data object by executing the data query instruction.
[0004] In a second aspect of the present disclosure, a device for data query is provided. The device includes: a determination module configured to determine at least one keyword indicating the query requirement of the user query in response to receiving the user query; an expansion module configured to obtain at least one retrieval condition for a target field by expanding the at least one keyword, the target field being selected from a plurality of predetermined fields of a target data object targeted by the user query; a generation module configured to generate a data query instruction based on the at least one retrieval condition; and a query module configured to determine target data matching the user query from the target data object by executing the data query instruction.
[0005] In a third aspect of the present disclosure, an electronic device is provided. The device includes at least one processing unit; and at least one memory, the at least one memory is coupled to the at least one processing unit and stores instructions for execution by the at least one processing unit. When the instructions are executed by the at least one processing unit, the electronic device executes the method of the first aspect.
[0006] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein a computer program is stored on the medium, and when the computer program is executed by a processor, the method of the first aspect is implemented.
[0007] In a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the method according to the first aspect of the present disclosure is implemented.
[0008] It should be understood that the content described in this section is not intended to limit the key features or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:
[0010] Figure 1 A schematic diagram showing an example environment in which embodiments of the present disclosure can be implemented;
[0011] Figure 2 A flowchart showing a process for data query according to some embodiments of the present disclosure is shown;
[0012] Figure 3 A schematic structural block diagram of an apparatus for data query according to some embodiments of the present disclosure is shown; and
[0013] Figure 4 A block diagram of an electronic device in which one or more embodiments of the present disclosure may be implemented is shown. DETAILED DESCRIPTION
[0014] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0015] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may also be included below.
[0016] Herein, unless explicitly stated, executing a step “in response to A” does not mean executing the step immediately after “A” but may include one or more intermediate steps.
[0017] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition, use, storage or deletion of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0018] It is understandable that before using the technical solutions disclosed in the various embodiments of the present disclosure, the types, scopes of use, usage scenarios, etc. of the information involved in the present disclosure should be informed to relevant users and their authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations. The relevant users may include any type of right holders, such as individuals, enterprises, and groups.
[0019] For example, in response to receiving an active request from a user, a prompt message is sent to the relevant user to clearly prompt the relevant user that the operation requested to be performed will require obtaining and using the information of the relevant user, so that the relevant user can independently choose whether to provide information to software or hardware such as an electronic device, application, server or storage medium that executes the operation of the technical solution of the present disclosure based on the prompt message.
[0020] As an optional but non-limiting implementation, in response to receiving an active request from a relevant user, a prompt message is sent to the relevant user, for example, in the form of a pop-up window, in which the prompt message may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to select "agree" or "disagree" to provide information to the electronic device.
[0021] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0022] As used herein, the term "model" can learn the association between the corresponding input and output from the training data, so that after the training is completed, the corresponding output can be generated for a given input. The generation of the model can be based on machine learning technology. Deep learning is a machine learning algorithm that processes inputs and provides corresponding outputs by using multi-layer processing units. A neural network model is an example of a model based on deep learning. In this article, "model" may also be referred to as "machine learning model", "learning model", "machine learning network" or "learning network", and these terms are used interchangeably in this article.
[0023] A "neural network" is a machine learning network based on deep learning. A neural network is capable of processing inputs and providing corresponding outputs, and typically includes an input layer and an output layer and one or more hidden layers between the input layer and the output layer. Neural networks used in deep learning applications typically include many hidden layers, thereby increasing the depth of the network. The layers of a neural network are connected in sequence so that the output of the previous layer is provided as input to the next layer, where the input layer receives the input of the neural network and the output of the output layer serves as the final output of the neural network. Each layer of a neural network includes one or more nodes (also called processing nodes or neurons), each of which processes input from the previous layer.
[0024] Generally, machine learning can be roughly divided into three stages, namely the training stage, the testing stage, and the application stage (also called the inference stage). In the training stage, a given model can be trained using a large amount of training data, and the parameter values are continuously updated iteratively until the model can obtain consistent inferences that meet the expected goals from the training data. Through training, the model can be considered to be able to learn the association from input to output (also called the mapping of input to output) from the training data. The parameter values of the trained model are determined. In the testing stage, the test input is applied to the trained model to test whether the model can provide the correct output, thereby determining the performance of the model. In the application stage, the model can be used to process the actual input based on the parameter values obtained from the training to determine the corresponding output.
[0025] Figure 1 A schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented is shown. Environment 100 involves an application management platform 110, which can support the creation of applications and / or the running of applications. In some embodiments, the portion of the application management platform 110 that supports the creation of applications can also be referred to as an application creation portion. In some embodiments, the portion of the application management platform 110 that supports the running of applications can also be referred to as an application running portion.
[0026] like Figure 1 As shown, the application creation part can provide the user 105 with an environment for creating and publishing applications. User 105 can be referred to as an application creation user or creator. In some embodiments, the application creation part can be a low-code platform that provides a collection of tools for application creation. The application creation part can support visual development of various types of applications, so that developers can skip the manual coding process and speed up the application development cycle and cost. The application creation part can support any appropriate platform for users to develop one or more types of applications, for example, it can include a platform based on Application Platform as a Service (aPaaS). Such a platform can support users to efficiently develop applications and implement operations such as application creation and application function adjustment.
[0027] The application creation part can be deployed locally on the terminal device of user 105, and / or can be supported by a server-side device. For example, the terminal device of user 105 can run a client of the application creation part, which can support the interaction between the user and the application creation part provided by the server. In the case where the application creation part runs locally on the user's terminal device, the user 105 can directly interact with the local application creation part using the terminal device. In the case where the application creation part runs on the server-side device, the server-side device can, based on the communication connection with the terminal device, implement service provision for the client running in the terminal device. The application creation part can present a corresponding page 130 to the user 105 based on the operation of the user 105, so as to output to the user 105 and / or receive from the user 105 information related to application creation.
[0028] In some embodiments, the application creation part can be associated with a corresponding database, which stores data or information required for the application creation process supported by the application creation part. For example, the database can store the code and description information corresponding to each functional module that constitutes the application. The application creation part can also perform operations such as calling, adding, deleting, and updating the functional modules in the database. The database can also store operations that can be performed on different functional blocks. Exemplarily, in a scenario where an application is to be created, the application creation part can call the corresponding functional blocks from the database to build the application.
[0029] In an embodiment of the present disclosure, a user 105 can create a target application 120 as needed on the application creation part and publish the target application 120. The target application 120 can be published to any appropriate application running part, as long as the application running part can support the operation of the target application 120. After publishing, the target application 120 can be used to be operated by one or more terminal users 145. The terminal user 145 can operate the target application 120 through an associated terminal device 146, and then interact with the application management platform 110. The terminal user 145 can be referred to as the terminal user of the target application 120. In some embodiments, the target application 120 may include or be implemented as a digital assistant 122.
[0030] The digital assistant 122 can be configured to have the ability of intelligent dialogue. In the example shown in the figure, the digital assistant 122 can be integrated into the target application 120, as part of the target application 120 to assist in the task processing within the target application 120. In other examples, the digital assistant 122 can be configured as an independently running application, such as a web application or other types of applications. In such an example, the digital assistant 122 and the target application 120 can be regarded as the same application. The digital assistant 122 is provided to assist users in various task processing requirements in different applications and scenarios. In the interaction process with the digital assistant 122, the user inputs an interactive message, and the digital assistant 122 provides a reply message in response to the user input. Typically, the digital assistant 122 can support users to input questions in a natural language, and perform tasks and provide replies based on the understanding of natural language input and logical reasoning ability.
[0031] In some embodiments, digital assistant 122 can interact with end user 145 as a contact of end user 145. For example, digital assistant 122 can be implemented in an instant messaging (IM) application. Digital assistant 122 can interact with end user 145 in a single chat session with end user 145. In some embodiments, digital assistant 122 can interact with multiple users in a group chat session including multiple users.
[0032] For each terminal user 145, the client of the application running part can present an interactive window 142 of the target application 120 or the digital assistant 122 in the client interface, such as a conversation window with the digital assistant 122. The terminal user 145 can enter a conversation message in the conversation window, and the target application 120 can determine the reply message of the digital assistant 122 based on the created configuration information and present it to the user in the interactive window 142. In some embodiments, depending on the configuration of the target application 120, the interactive message with the target application 120 may include a message in a multimodal form, such as a text message (e.g., a natural language text), a voice message, an image message, a video message, and the like.
[0033] Similar to the application creation part, the application running part can be deployed locally on the terminal device of each terminal user 145, and / or can be supported by the server device. For example, the terminal device of the terminal user 145 can run a client with the application running part, and the client can support the interaction between the user and the application running part provided by the server. In the case where the application running part runs locally on the user's terminal device, the terminal user 145 can directly use the terminal device to interact with the local application running part. In the case where the application running part runs on the server device, the server device can realize the service supply to the client running in the terminal device based on the communication connection with the terminal device. The application running part can present the corresponding application page to the terminal user 145 based on the operation of the terminal user 145, so as to output and / or receive information related to the use of the application to the terminal user 145.
[0034] In some embodiments, the implementation of at least part of the functions of the target application 120, and / or the implementation of at least part of the functions of the digital assistant 122 in the target application 120 can be implemented based on a machine learning model. During the creation or operation of the target application 120, one or more machine learning models, such as a machine learning model 155, can be called. The machine learning model 155 may include one or more machine learning models, for example, a machine learning model 155-1, a machine learning model 155-2, a machine learning model 155-3, a machine learning model 155-4, a machine learning model 155-5, ..., a machine learning model 155-N, and so on, where N is a positive integer. For the convenience of description, one or more machine learning models are collectively referred to as machine learning models 160 herein. In the target application 120, the digital assistant 122 can use the machine learning model 155 to understand the user input and provide a reply to the user based on the output of the machine learning model 155.
[0035] During the creation process, the application management platform 110 needs to use the machine learning model 155 to test the target application 120 to determine whether the operation result of the target application 120 meets expectations. During the operation process, in response to different operation requests of the user of the target application 120, the application operation part may need to use the machine learning model 155 to determine the response result to the user.
[0036] Although shown as being independent of the application management platform 110, one or more machine learning models 155 may run on the application management platform 110, or other remote servers. In some embodiments, the machine learning model 155 may be a machine learning model, a deep learning model, a learning model, a neural network, etc. In some embodiments, the model may be based on a language model (LM). The language model can have question-answering capabilities by learning from a large amount of corpus. The model 155 may also be based on other appropriate models.
[0037] The application management platform 110 can run on appropriate electronic devices. The electronic devices here can be any type of device with computing capabilities, including terminal devices or server devices. The terminal device can be any type of mobile terminal, fixed terminal or portable terminal, including mobile phones, desktop computers, laptop computers, notebook computers, netbook computers, tablet computers, media computers, multimedia tablets, personal communication systems (PCS) devices, personal navigation devices, personal digital assistants (PDAs), audio / video players, digital cameras / camcorders, positioning devices, television receivers, radio broadcast receivers, e-book devices, gaming devices, or any combination of the foregoing, including accessories and peripherals of these devices or any combination thereof. The server device can include, for example, a computing system / server, such as a mainframe, an edge computing node, a computing device in a cloud environment, and the like. In some embodiments, the management platform 110 can be implemented based on cloud services.
[0038] It should be understood that the structure and functionality of the environment 100 are described for exemplary purposes only and do not imply any limitation on the scope of the present disclosure. For example, although a single user interacting with the application creation portion and a single user interacting with the application execution portion are shown, in reality multiple users can access the application management platform 110 to each create a digital assistant, and each digital assistant can be used to interact with multiple users.
[0039] As mentioned above, digital assistants are provided to assist users in various task processing needs in different applications and scenarios. Digital assistants usually have intelligent dialogue and task processing capabilities. During the interaction with the digital assistant, the user inputs an interaction message, and the digital assistant provides a reply message in response to the user input.
[0040] In some application scenarios, digital assistants can be used to query data based on user input and use the queried data as a reply message. However, during the interaction process, the interactive information entered by the user is likely to contain some ambiguous words, or enter some ambiguous query questions, which makes the digital assistant unable to accurately understand the data that the user needs to query, affecting the data query quality of the digital assistant.
[0041] In view of this, an embodiment of the present disclosure provides an improved solution for data query. In the solution, in response to receiving a user query, at least one keyword indicating the query requirement of the user query is determined. At least one retrieval condition for a target field is obtained by expanding the at least one keyword, and the target field is selected from a plurality of predetermined fields of a target data object targeted by the query requirement. Based on the at least one retrieval condition, a data query instruction is generated. Thereafter, by executing the data query instruction, target data matching the user query is determined from the target data object.
[0042] In an embodiment of the present disclosure, a user query can be mapped to a target field of a data object, and at least one retrieval condition for the target field can be obtained by expanding the semantic meaning of the user query. Data query can be performed based on the at least one retrieval condition, which can improve the accuracy of the data query and enable the digital assistant to support query problems with fuzzy semantics.
[0043] Some example embodiments of the present disclosure will be described in detail below with reference to examples of the accompanying drawings.
[0044] The information processing process described in the embodiments of the present disclosure may be implemented in an application management platform, a terminal device installed with the application management platform, and / or a server corresponding to the application management platform. In the following examples, for the purpose of discussion, the description is from the perspective of the application management platform, for example Figure 1 The application management platform 110 shown. The user interface presented by the application management platform 110 can be presented via the terminal device of the user 145, and the application management platform 110 can receive user input via the terminal device of the user 145. In some embodiments of the present disclosure, the user 145 is the terminal user of the target application 120. It should be understood that the user interface presented by the application management platform 110 can also be presented via the terminal device of the user 105, and the application management platform 110 can also receive user input via the terminal device of the user 105. In some embodiments of the present disclosure, the user 105 is the creator, manager or maintainer of the target application 120.
[0045] Figure 2 1 is a flowchart of a process 200 for data query according to some embodiments of the present disclosure. The process 200 may be implemented in the application management platform 110, for example, by the application running part of the application management platform 110. Figure 1 To describe Figure 2 Process 200 is shown.
[0046] In box 210 of process 200, the application management platform 110 determines at least one keyword indicating the query demand of the user query in response to receiving the user query. The user query here may include user input requesting to perform a data query, such as text, audio, video, etc. input by the user. The user query may indicate a query for various types of data. In different application scenarios of the digital assistant, the data type indicated by the user query may be different. The embodiments of the present disclosure do not limit the data type input by the user and the data type queried. The query demand may indicate the user's demand for data query, for example, the query demand may indicate the query purpose of the user query, the data object of the user query, the data range of the user query, the data content of the user query, etc. It can be understood that the content indicated by the above query demand is only exemplary. In actual application, the demand for user query can be described from multiple dimensions.
[0047] In some embodiments, the digital assistant 120 may be configured to provide data query services. On this basis, the user inputs input by the user to the digital assistant 120 may be regarded as user queries. In some embodiments, the digital assistant 120 may also be configured to provide multiple services. In this case, the application management platform 110 may determine whether the received user input indicates the execution of a data query operation in response to receiving the user input. In the case where it is determined that the user input indicates the execution of a data query operation, it is determined that the user query is received. Exemplarily, the application management platform 110 may generate prompt information (e.g., prompt words) of the machine learning model 155-1 based on the user input, and provide the prompt information to the machine learning model 155-1. Determine whether the user input indicates the execution of a data query operation based on the model output of the machine learning model 155-1. Of course, the application management platform 110 may also determine whether the user input indicates the execution of a data query operation based on, for example, semantic analysis, and should not be understood as being limited to using the machine learning model 155-1 to determine whether the user input indicates the execution of a data query operation.
[0048] In some embodiments, the application management platform 110 can extract at least one keyword that can indicate the query demand from the user query. For example, the user query may include "Who has overseas work experience", and the application management platform 110 can determine "overseas" and "work experience" as keywords. For another example, the user query may include "Who in the team has done 2B business", and the application management platform 110 can determine "2B business" as a keyword. It should be noted that the "2B" here and the "ToB" in the following text usually refer to "To Business", that is, "for enterprises".
[0049] In some embodiments, the application management platform 110 may determine the query requirements of the user query in response to receiving the user query. Generate a query statement that describes the semantics of the query requirements. Based on the query statement, determine at least one keyword indicating the query requirements. In this way, the fuzzy user query can be converted into a semantic representation that can relatively accurately and completely describe the query requirements, and then accurately determine at least one keyword indicating the query requirements.
[0050] Alternatively or additionally, the application management platform 110 may determine the context of the user query in response to receiving the user query. Based on the user query and the context of the user query, the query requirement of the user query is determined. By combining the context of the user query, the semantic representation of the user query can be improved, which is conducive to accurately determining the query requirement of the user query.
[0051] Alternatively or additionally, when the user query requirement is determined, the user query can be expanded into a query statement with a relatively complete semantic representation based on the user query requirement. Afterwards, the application management platform 110 can extract one or more keywords from the query statement with a complete semantic representation. In this way, more accurate and richer keywords can be extracted.
[0052] In block 220 of process 200, the application management platform 110 obtains at least one search condition for a target field by expanding at least one keyword, and the target field is selected from a plurality of predetermined fields of the target data object targeted by the user query. Alternatively or additionally, the application management platform 110 may determine the target data object targeted by the user query and a plurality of predetermined fields of the target data object. The application management platform 110 may determine the target field from a plurality of predetermined fields. For example, the application management platform 110 may determine a target field that matches the at least one keyword from a plurality of predetermined fields. Afterwards, at least one search condition for the target field is obtained by expanding the at least one keyword. The data object may include various data structures for organizing and storing data, and the types of the predetermined fields may be different when the data structures of the data objects are different. For example, the data object targeted by the user query may include a table, and the predetermined fields may include rows, columns, indexes, and the like of the table. The search condition may include a field value (e.g., a value, text, a value range, and the like) given for the target field, and the search condition may also include a logical relationship (e.g., AND, OR, NOT, and the like) between the field values.
[0053] In some embodiments, the application management platform 110 may obtain description information of multiple candidate data objects. Based on the description information of the multiple candidate data objects, the target data object targeted by the user query and multiple predetermined fields of the target data object are determined from the multiple candidate data objects. Based on the expansion of at least one keyword, the target field and at least one search condition for the target field are determined from the multiple predetermined fields. The description information here may include description information of one or more dimensions such as the name, data content, and data structure of the candidate data object.
[0054] Exemplarily, the application management platform 110 may generate prompt information for the machine learning model 155-2 based on user input. The prompt information is provided to the machine learning model 155-2 to obtain the model output of the machine learning model 155-2. In the case where the model output includes a data query instruction (e.g., List Table Name) for querying multiple candidate data objects, the application management platform 110 may query, for example, the name of a table based on the data query instruction.
[0055] The application management platform 110 can also generate prompt information of the machine learning model 155-2 based on the queried table name and user input. Receive the model output generated by the machine learning model 155-2 based on the prompt information. The application management platform 110 can determine the target data object (e.g., the target table targeted by the user query) based on the model output, and the application management platform 110 can also obtain a data query instruction for querying multiple predetermined fields of the target data object based on the model output. Based on the data query instruction, for example, the rows and columns of the target table can be queried.
[0056] The application management platform 110 can select at least one row or at least one column from the rows and columns of the target table as the target field, and obtain the search term for the at least one row or the at least one column by expanding the at least one keyword. It can be understood that one or more target fields can be determined for the user query, and one or more search conditions can be determined for each target field.
[0057] In some embodiments, the application management platform 110 may generate prompt information (i.e., first prompt information) for a trained machine learning model 155-3 (sometimes also referred to herein as a first machine learning model) based on at least one keyword and multiple predetermined fields. The prompt information may instruct the machine learning model 155-3 to generate at least one search condition formed by an extension of at least one keyword for at least one target field among the multiple predetermined fields. The application management platform 110 receives the model output of the machine learning model 155-3 based on the prompt information feedback. The target field and at least one search condition for the target field are determined based on the model output.
[0058] Exemplarily, the application management platform 110 may query multiple columns of the target table using a data query instruction. Based on the determined at least one keyword and the multiple columns queried, a prompt word for the machine learning model 155-3 is generated. The prompt word may instruct the machine learning model 155-3 to determine the columns related to the query requirements, and to form a search word for the columns related to the query requirements by expanding the at least one keyword.
[0059] Alternatively or additionally, the prompt information may further include at least one prompt example, the prompt example including a user query example, at least one keyword example matching the user query example, multiple predetermined field examples, a target field example determined from the multiple predetermined field examples, and at least one retrieval condition example for the target field example. In this way, the machine learning model 155-3 can determine the target field and at least one retrieval condition for the target field in an example manner, which is conducive to improving the accuracy and standardization of the retrieval conditions.
[0060] For example, the prompt information may include sample content as shown in the following table.
[0061] Table 1
[0062]
[0063] In some embodiments, the application management platform 110 may generate prompt information (also referred to herein as the second prompt information) for the machine learning model 155-4 (sometimes also referred to herein as the second machine learning model) based on receiving a user query, multiple predetermined fields, and requirements. The requirements here may instruct the machine learning model 155-4 to determine at least one keyword and determine a target field and at least one retrieval condition for the target field from multiple predetermined fields based on an extension of the at least one keyword. The application management platform 110 receives the model output (also referred to herein as the second model output) fed back by the machine learning model 155-4 based on the prompt information. The target field and at least one retrieval condition for the target field are determined based on the model output.
[0064] Exemplarily, the digital assistant 120 can be configured to provide data query services in a specific field. The requirements can indicate that the machine learning model 155-4 has skill 1 and skill 2. Skill 1 is to parse query requirements. The specific process includes: understanding and identifying the query requirements in a specific field proposed by the user. While mastering the user's query requirements, the interlocutor's request will be expanded into a query statement with complete semantics and applicable to relevant scenarios. Skill 2 is to recommend retrieval conditions. The specific process includes: recommending retrieval conditions for predetermined fields based on the parsed keywords. In this way, the machine learning model 155-4 receives the prompt information, first determines the query requirements, and expands the user query (that is, the interlocutor's request) into a query statement with complete semantics. Afterwards, the keywords are parsed from the query statement, and the retrieval conditions for predetermined fields are recommended based on the keywords.
[0065] The requirement may also instruct the machine learning model 155-4 to recommend search conditions for predetermined fields related to the user's query requirements, and not to recommend them at random. On this basis, the predetermined fields with search conditions included in the model output are the target fields, and the search conditions included are the search conditions for the target fields. The application management platform 110 may extract the target field and at least one search condition of the target field from the model output.
[0066] The following user query "Who has done toB business?" is used as an example to illustrate an exemplary model output.
[0067] Table 2
[0068]
[0069] As shown in Table 2, the "work_experience.past_job" and "work_experience.job_description" fields in the above model output are the target fields determined by machine learning model 155-4. The keywords "TOB sales, TOB market, TOB product manager, TOB R&D, TOB operation" are the search conditions for the "work_experience.past_job" field. "B-end business, TOB business, B-end development, B-end design, B-end products" are the search conditions for the "work_experience.job_description" field. It should be noted that the "B" in "B-end" here usually refers to "Business", and "B-end business" is also "business for enterprises".
[0070] In some embodiments, the application management platform 110 can determine the first target field from a plurality of predetermined fields based on at least one keyword. At least one first search condition for the first target field is generated by extending at least one keyword. The first target field here may include a field in the target data object that does not have a predetermined input content. Exemplarily, in a table for saving data, fields such as "previous companies, previous positions, job descriptions, work experience, work experience" usually do not have predetermined field values, and users can enter any appropriate content in the corresponding fields according to actual conditions. For such fields (i.e., the first target fields), the application management platform 110 can generate at least one search condition (i.e., the first search condition) that is compatible with such fields by extending the at least one keyword. For example, as shown in Table 2, for the "work_experience.job_description" field, the application management platform 110 can generate the search conditions of "B-side business, TOB business, B-side development, B-side design, B-side product" based on the "toB business" keyword.
[0071] In some embodiments, the application management platform 110 can determine the second target field from multiple predetermined fields based on at least one keyword. Select at least one second search condition that matches the at least one keyword from multiple predetermined search conditions associated with the second target field. The second target field here may include a field with predetermined input content in the target data object. At this time, the multiple predetermined input contents of the second target field are actually the multiple predetermined search conditions of the second target field. The application management platform 110 can determine the predetermined input content that matches the at least one keyword from the multiple predetermined input contents of the second target field as the second search condition.
[0072] Exemplarily, in a table for storing data, the "school label" field usually includes predetermined input content such as "Type A school", "Type B school", "Type C school", and "Type D school". When writing data into the table, the field value of the "school label" field is usually selected from multiple predetermined input contents, and custom input content is usually not entered into the "school label" field. If the application management platform 110 determines such fields with predetermined input content (such as the "school label" field) as target fields, at least one predetermined input content of such fields (that is, the second target field) can be selected as a retrieval condition to ensure that the correct data content can be queried.
[0073] In block 230 of process 200, the application management platform 110 generates a data query instruction based on at least one search condition. It is understandable that the data query instruction here corresponds to the target data object. In the case where the target data object includes a table in a database, the application management platform 110 can write the data query instruction using structured query language (SQL) based on the determined at least one search condition.
[0074] In some embodiments, the application management platform 110 may obtain the syntax or writing requirements of the query instruction of the target data object, and generate the query instruction for the target data object based on the syntax or writing requirements of the query instruction. For example, the application management platform 110 may obtain the writing requirements of the SQL language, and generate the SQL data query instruction based on the writing requirements of the SQL language.
[0075] In some embodiments, the application management platform 110 may generate prompt information (i.e., third prompt information) for the machine learning model 155-5 (sometimes also referred to herein as the third machine learning model) based on at least one retrieval condition. The prompt information is provided to the machine learning model 155-5, and the model output (i.e., third model output) generated by the machine learning model 155-5 based on the prompt information is received. A data query instruction is obtained based on the model output. Exemplarily, the application management platform 110 may obtain the writing requirements of the query instruction of the target data object, and generate a prompt word for the machine learning model 155-5 based on the writing requirements of the query instruction and the at least one retrieval condition. The prompt word is provided to the machine learning model 155-5 to generate a data query instruction using the machine learning model 155-5.
[0076] It should be understood that the above method for generating data query instructions is only exemplary, and in actual application, any appropriate method can be selected to generate data query instructions according to actual needs. The embodiment of the present disclosure does not limit the method for generating data query instructions.
[0077] It should also be noted that the above-mentioned machine learning model 155-1, machine learning model 155-2, machine learning model 155-3, machine learning model 155-4 and machine learning model 155-5 can be implemented as the same machine learning model or as different machine learning models. The embodiments of the present disclosure are not limited in this regard.
[0078] In box 240 of process 200, the application management platform 110 determines the target data matching the user query from the target data object by executing the data query instruction. The target data object here can be stored in the terminal device 146, or in the server device or other remote device. In the case where the target data object is stored in the terminal device 146, the application management platform 110 can execute the data query instruction to query the target data from the target data object of the terminal device 146. In the case where the target data object is stored in the server device or other remote device, the application management platform 110 can send a data query request to, for example, the server device or other remote device based on the data query instruction, requesting the server device or other remote device to query the target data from the target data object based on the data query instruction. Afterwards, the application management platform 110 can receive the target data fed back by the server device or other remote device. Of course, the query process of the above target data is only exemplary, and any appropriate method can be selected according to actual needs to query the target data from the target data object.
[0079] The above describes the specific process for data query according to the embodiment of the present disclosure. By mapping the user query to the target field of the data object, expanding the semantic meaning of the user query to obtain at least one retrieval condition for the target field, and performing data query based on the at least one retrieval condition, the accuracy of the data query can be improved, so that the digital assistant can support query problems with fuzzy semantics.
[0080] The training process of the target model will be introduced below. It should be understood that such a training process can be performed by appropriate training equipment, which may include but is not limited to the terminal device 146, the server device or other remote devices.
[0081] In an embodiment of the present disclosure, a training device may obtain training samples. The training samples may include a user query sample, at least one keyword sample matching the user query sample, a plurality of predetermined field samples, a target field sample determined from the plurality of predetermined field samples, and at least one retrieval condition sample for the target field sample. The machine learning model 155-3 (i.e., the first machine learning model) is trained using the training samples.
[0082] Exemplarily, for a specific scenario, query questions that frequently appear in the specific scenario can be selected as user query samples. The training device can extract at least one keyword sample that can indicate the query requirement from the query question. The training device can determine multiple predetermined field samples based on the data object queried by the user query sample. For example, multiple columns in the queried table can be used as predetermined field samples. Then, a predetermined field sample that matches the query requirement can be determined from the multiple predetermined field samples as a target field sample, and at least one retrieval condition sample is constructed for the target field sample.
[0083] During the training process, the training device can generate prompt words for the machine learning model 155-3 from the training samples, and the prompt words can include user training samples, keyword samples, predetermined field samples, target field samples, and at least one retrieval condition sample for the target field sample. Afterwards, the prompt words are input into the machine learning model 155-3, and the machine learning model 155-3 is trained using, for example, a loss function. When the machine learning model 155-3 meets the training end condition, the training device can determine that the training of the machine learning model 155-3 is completed.
[0084] The embodiments of the present disclosure also provide corresponding devices for implementing the above methods or processes. Figure 3 A schematic structural block diagram of an apparatus 300 for data query according to some embodiments of the present disclosure is shown. The apparatus 300 may be implemented in or included in the application management platform 110, for example. Each module / component in the apparatus 300 may be implemented by hardware, software, firmware, or any combination thereof.
[0085] As shown in the figure, the device 300 may include a determination module 310, an expansion module 320, a generation module 330 and a query module 340. The determination module 310 is configured to determine at least one keyword indicating the query requirement of the user query in response to receiving the user query. The expansion module 320 is configured to obtain at least one retrieval condition for a target field by expanding at least one keyword, and the target field is selected from a plurality of predetermined fields of the target data object targeted by the user query. The generation module 330 is configured to generate a data query instruction based on at least one retrieval condition. The query module 340 is configured to determine the target data matching the user query from the target data object by executing the data query instruction.
[0086] In some embodiments, the determination module 310 is further configured to: determine the query requirement of the user query in response to receiving the user query; generate a query statement describing the semantics of the query requirement; and determine at least one keyword indicating the query requirement based on the query statement.
[0087] In some embodiments, the expansion module 320 is further configured to: obtain description information of multiple candidate data objects; determine the target data object targeted by the user query from the multiple candidate data objects based on the description information of the multiple candidate data objects, and determine multiple predetermined fields of the target data object; and determine the target field and at least one retrieval condition for the target field from the multiple predetermined fields based on the expansion of the at least one keyword.
[0088] In some embodiments, the expansion module 320 is further configured to: determine a first target field from the plurality of predetermined fields based on the at least one keyword; and generate at least one first search condition for the first target field by expanding the at least one keyword.
[0089] In some embodiments, the expansion module 320 is further configured to: determine a second target field from the multiple predetermined fields based on the at least one keyword; and select at least one second search condition that matches the at least one keyword from the multiple predetermined search conditions associated with the second target field.
[0090] In some embodiments, the expansion module 320 is further configured to: generate first prompt information for a trained first machine learning model based on the at least one keyword and the multiple predetermined fields, the first prompt information being used to instruct the first machine learning model to generate at least one retrieval condition formed by the extension of the at least one keyword for at least one target field among the multiple predetermined fields; receive a first model output of the first machine learning model based on feedback of the first prompt information; and determine the target field and at least one retrieval condition for the target field based on the first model output.
[0091] In some embodiments, the device 300 also includes: a training module, configured to obtain training samples, the training samples including a user query sample, at least one keyword sample matching the user query sample, a plurality of predetermined field samples, a target field sample determined from the plurality of predetermined field samples, and at least one retrieval condition sample for the target field sample; and using the training samples to train the first machine learning model.
[0092] In some embodiments, the first prompt information includes at least one prompt example, and the prompt example includes a user query example, at least one keyword example matching the user query example, multiple predetermined field examples, a target field example determined from the multiple predetermined field examples, and at least one retrieval condition example for the target field example.
[0093] In some embodiments, the expansion module 320 is further configured to: generate second prompt information for a second machine learning model based on receiving the user query, the multiple predetermined fields and the requirement, the requirement being used to instruct the second machine learning model to determine the at least one keyword and determine the target field and at least one retrieval condition for the target field from the multiple predetermined fields based on the expansion of the at least one keyword; receive a second model output of the second machine learning model based on the second prompt information feedback; and determine the target field and at least one retrieval condition for the target field based on the second model output.
[0094] In some embodiments, the generation module 330 is further configured to: generate third prompt information for a third machine learning model based on the at least one retrieval condition; receive a third model output generated by the third machine learning model based on the third prompt information; and obtain the data query instruction based on the third model output.
[0095] The units and / or modules included in the device 300 can be implemented in various ways, including software, hardware, firmware, or any combination thereof. In some embodiments, one or more units and / or modules can be implemented using software and / or firmware, such as machine executable instructions stored on a storage medium. In addition to or as an alternative to machine executable instructions, some or all of the units and / or modules in the device 300 can be implemented at least in part by one or more hardware logic components. As an example and not limitation, exemplary types of hardware logic components that can be used include field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0096] Figure 4 4 shows a block diagram of an electronic device 400 in which one or more embodiments of the present disclosure may be implemented. It should be understood that Figure 4 The electronic device 400 shown is merely exemplary and should not constitute any limitation on the functionality and scope of the embodiments described herein. Figure 4 The electronic device 400 shown may include or be implemented as Figure 1 application management platform 110, or Figure 3 device 300.
[0097] like Figure 4As shown, the electronic device 400 is in the form of a general electronic device. The components of the electronic device 400 may include, but are not limited to, one or more processors or processing units 410, a memory 420, a storage device 430, one or more communication units 440, one or more input devices 450, and one or more output devices 460. The processing unit 410 may be an actual or virtual processor and is capable of performing various processes according to a program stored in the memory 420. In a multi-processor system, multiple processing units execute computer executable instructions in parallel to improve the parallel processing capability of the electronic device 400.
[0098] The electronic device 400 typically includes a plurality of computer storage media. Such media may be any accessible media that is accessible to the electronic device 400, including but not limited to volatile and non-volatile media, removable and non-removable media. The memory 420 may be a volatile memory (e.g., a register, a cache, a random access memory (RAM)), a non-volatile memory (e.g., a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. The storage device 430 may be a removable or non-removable medium, and may include a machine-readable medium, such as a flash drive, a disk, or any other medium, which may be capable of being used to store information and / or data and may be accessed within the electronic device 400.
[0099] The electronic device 400 may further include additional removable / non-removable, volatile / non-volatile storage media. Figure 4 As shown in , a disk drive for reading or writing from a removable, non-volatile disk (e.g., a "floppy disk") and an optical drive for reading or writing from a removable, non-volatile optical disk may be provided. In these cases, each drive may be connected to the bus (not shown) by one or more data media interfaces. The memory 420 may include a computer program product 425 having one or more program modules that are configured to perform various methods or actions of various embodiments of the present disclosure.
[0100] The communication unit 440 implements communication with other electronic devices through a communication medium. Additionally, the functions of the components of the electronic device 400 can be implemented with a single computing cluster or multiple computing machines that can communicate through a communication connection. Therefore, the electronic device 400 can operate in a networked environment using a logical connection with one or more other servers, a network personal computer (PC), or another network node.
[0101] The input device 450 may be one or more input devices, such as a mouse, a keyboard, a tracking ball, etc. The output device 460 may be one or more output devices, such as a display, a speaker, a printer, etc. The electronic device 400 may also communicate with one or more external devices (not shown) through the communication unit 440 as needed, such as a storage device, a display device, etc., communicate with one or more devices that allow a user to interact with the electronic device 400, or communicate with any device that allows the electronic device 400 to communicate with one or more other electronic devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface (not shown).
[0102] According to an exemplary implementation of the present disclosure, a computer-readable storage medium is provided, on which computer-executable instructions are stored, wherein the computer-executable instructions are executed by a processor to implement the method described above. According to an exemplary implementation of the present disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, and the computer-executable instructions are executed by a processor to implement the method described above.
[0103] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices, equipment, and computer program products implemented according to the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0104] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0105] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, so that the instructions executed on the computer, other programmable data processing apparatus, or other device implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0106] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple implementations of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of a module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some implementations as replacements, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a special hardware-based system that performs the function or action of the specification, or can be realized by a combination of special hardware and computer instructions.
[0107] The above descriptions of various implementations of the present disclosure are exemplary, non-exhaustive, and not limited to the disclosed implementations. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described implementations. The selection of terms used herein is intended to best explain the principles of the implementations, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the various implementations disclosed herein.
Claims
1. A method for data query, comprising: In response to receiving a user query, determining at least one keyword indicating a query requirement of the user query; By expanding the at least one keyword, at least one search condition for a target field is obtained, wherein the target field is selected from a plurality of predetermined fields of the target data object targeted by the user query; generating a data query instruction based on the at least one search condition; as well as By executing the data query instruction, target data matching the user query is determined from the target data object.
2. The method according to claim 1, wherein determining at least one keyword indicating the query requirement of the user query comprises: In response to receiving the user query, determining a query requirement of the user query; Generate a query statement describing the semantics of the query requirement; as well as Based on the query statement, at least one keyword indicating the query requirement is determined.
3. The method according to claim 1, wherein obtaining at least one search condition for the target field comprises: Obtain description information of multiple candidate data objects; Based on the description information of the multiple candidate data objects, determining the target data object targeted by the user query from the multiple candidate data objects, and determining multiple predetermined fields of the target data object; as well as Based on the expansion of the at least one keyword, the target field and at least one search condition for the target field are determined from the plurality of predetermined fields.
4. The method according to claim 1, wherein obtaining at least one search condition for the target field comprises: Based on the at least one keyword, determining a first target field from the plurality of predetermined fields; as well as At least one first search condition for the first target field is generated by expanding the at least one keyword.
5. The method according to claim 1, wherein obtaining at least one search condition for the target field comprises: Based on the at least one keyword, determining a second target field from the plurality of predetermined fields; as well as At least one second search condition matching the at least one keyword is selected from a plurality of predetermined search conditions associated with the second target field.
6. The method according to claim 1, wherein obtaining at least one search condition for the target field comprises: Based on the at least one keyword and the multiple predetermined fields, generating first prompt information for a trained first machine learning model, the first prompt information being used to instruct the first machine learning model to generate at least one search condition formed by an expansion of the at least one keyword for at least one target field among the multiple predetermined fields; Receive a first model output of the first machine learning model based on the first prompt information feedback; as well as Based on the first model output, the target field and at least one search condition for the target field are determined.
7. The method according to claim 6, further comprising: Acquire a training sample, wherein the training sample includes a user query sample, at least one keyword sample matching the user query sample, a plurality of predetermined field samples, a target field sample determined from the plurality of predetermined field samples, and at least one retrieval condition sample for the target field sample; as well as The first machine learning model is trained using the training samples.
8. The method according to claim 6, wherein the first prompt information includes at least one prompt example, the prompt example including a user query example, at least one keyword example matching the user query example, multiple predetermined field examples, a target field example determined from the multiple predetermined field examples, and at least one retrieval condition example for the target field example.
9. The method according to claim 1, wherein obtaining at least one search condition for a target field comprises: generating second prompt information for a second machine learning model based on receiving the user query, the plurality of predetermined fields, and a requirement, wherein the requirement is used to instruct the second machine learning model to determine the at least one keyword and determine the target field and at least one search condition for the target field from the plurality of predetermined fields based on an expansion of the at least one keyword; Receive a second model output of the second machine learning model based on the second prompt information feedback; as well as The target field and at least one search condition for the target field are determined based on the second model output.
10. The method according to claim 1, wherein generating a data query instruction based on at least one search condition comprises: generating third prompt information for a third machine learning model based on the at least one search condition; Receive a third model output generated by the third machine learning model based on the third prompt information; as well as Based on the third model output, the data query instruction is obtained.
11. A device for data query, comprising: a determination module, configured to, in response to receiving a user query, determine at least one keyword indicating a query requirement of the user query; an expansion module configured to obtain at least one search condition for a target field by expanding the at least one keyword, the target field being selected from a plurality of predetermined fields of the target data object targeted by the user query; A generating module, configured to generate a data query instruction based on the at least one search condition; as well as The query module is configured to determine target data matching the user query from the target data object by executing the data query instruction.
12. An electronic device comprising: at least one processing unit; as well as At least one memory, the at least one memory being coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions causing the electronic device to perform the method according to any one of claims 1 to 10 when executed by the at least one processing unit.
13. A computer-readable storage medium having a computer program stored thereon, wherein the computer program can be executed by a processor to implement the method according to any one of claims 1 to 10.
14. A computer program product, comprising a computer program, wherein the computer program implements the method according to any one of claims 1 to 10 when executed by a processor.