Search

CN-116628287-B - Query method and device and electronic equipment

CN116628287BCN 116628287 BCN116628287 BCN 116628287BCN-116628287-B

Abstract

The application provides a query method, a query device and electronic equipment. The method comprises the steps of responding to obtaining a query text facing a first table, obtaining the first table, wherein the query text comprises a selection text and a conditional text, the first table is added with a new column on the basis of a second table, the new column corresponds to a first expression, the first expression is used for carrying out induction analysis on a plurality of lines of texts in the second table, at least one line of target texts conforming to the conditional text is queried in the first table, according to the selection text, a target column is determined in the first table, the column name of the target column and the selection text belong to the same semantic meaning, and a target value corresponding to the target column in the at least one line of target texts is determined as a result text corresponding to the query text.

Inventors

  • YANG XUQIANG
  • Jiang Zongheng
  • LUO XUEFENG

Assignees

  • 阿里巴巴(中国)有限公司

Dates

Publication Date
20260508
Application Date
20230524

Claims (10)

  1. 1.A method of querying, comprising: responding to the acquired query text facing the first table, acquiring the first table, wherein the query text comprises a selection text and a conditional text, the first table is added with a new column on the basis of a second table, the new column corresponds to a first expression, and the first expression is used for carrying out induction analysis on a plurality of lines of texts in the second table; Querying at least one row of target texts meeting the condition text in the first table; Determining a target column in the first table according to the selection text, wherein the column name of the target column and the selection text belong to the same semantic; And determining a target value corresponding to the target column in the at least one row of target texts as a result text corresponding to the query text, wherein the target value is determined according to the expression.
  2. 2. The query method of claim 1, wherein the obtaining the first table comprises: Determining a new column name and a first expression of the new column according to the query text and the second table; And adding a new added column in the second table, and establishing a corresponding relation between the new added column and a first expression to obtain the first table, wherein the new added column has the new added column name in the first table.
  3. 3. The query method of claim 2, wherein the first expression is generated by: generating a second expression according to the query text and the newly added column name; And checking the second expression, and determining the second expression as the first expression under the condition that the second expression passes the check.
  4. 4. A method of querying as in claim 3, wherein the generating a second expression from the query text and the added column name comprises: And determining the second expression according to the semantics of the query text and the semantics of the newly added column name.
  5. 5. A method of querying as in claim 3, wherein the generating a second expression from the query text and the added column name comprises: And inputting the query text and the newly added column name into a pre-trained generation model for processing, and obtaining the second expression.
  6. 6. The query method of any one of claims 3 to 5, wherein said verifying said second expression comprises: Checking whether the second expression accords with a preset expression rule; If yes, checking whether the data type of the data determined according to the second expression is consistent with the data type of the newly added column; and if so, determining that the second expression passes the verification.
  7. 7. The query method of any one of claims 1 to 5, wherein the additional columns have corresponding additional column names, and wherein the querying the result text in the first table according to the query text is preceded by: and if the condition text contains the newly added column name, rewriting the query text according to the semantic meaning of the query text to obtain a new query text.
  8. 8. A query method, applied to a terminal device, the query method comprising: acquiring a query text; The query text is sent to a cloud server, and the query text is used for indicating the cloud server to rewrite the query text into a query text; Receiving a result text sent by a cloud server, wherein the result text is determined by the cloud server according to the query method of any one of claims 1 to 7.
  9. 9. A query device, comprising: The system comprises an acquisition module, a first table and a second table, wherein the acquisition module is used for acquiring a query text facing the first table in response to the acquisition of the query text, the query text comprises a selection text and a conditional text, the first table is added with a new column on the basis of the second table, the new column corresponds to a first expression, and the first expression is used for carrying out induction analysis on a plurality of lines of texts in the second table; a query module, configured to query the first table for at least one line of target text that meets the condition text; the first determining module is used for determining a target column in the first table according to the selection text, and the column name of the target column and the selection text belong to the same semantic; And the second determining module is used for determining that the target value corresponding to the target column in the at least one row of target texts is the result text corresponding to the query text, wherein the target value is determined according to the expression.
  10. 10. An electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the processor implementing the querying method according to any of claims 1 to 8 when executing the computer program.

Description

Query method and device and electronic equipment Technical Field The present application relates to the field of computer technologies, and in particular, to a query method, a query device, and an electronic device. Background The form question-answering is a question-answering engine that gives an answer based on natural language technology from the form content. For example, based on the query text of the user, answer text of the query text is queried in the form to reply to the user. Currently, the answer text is queried in a form based on the user's query text. However, in some cases, data wanted by the user is not directly stored in the form, so that the questions of the user cannot be accurately answered, and the application of the form questions and answers is limited. Disclosure of Invention The application provides a query method, a query device and electronic equipment, so as to improve the application range of form questions and answers. The first aspect of the embodiment of the application provides a query method, which comprises the steps of responding to the acquisition of a query text facing a first table, acquiring the first table, wherein the query text comprises a selection text and a conditional text, the first table is added with a new column on the basis of a second table, the new column corresponds to a first expression, the first expression is used for carrying out induction analysis on a plurality of lines of texts in the second table, at least one line of target texts conforming to the conditional text is queried in the first table, a target column is determined in the first table according to the selection text, the column name of the target column and the selection text belong to the same semantic meaning, and the target value corresponding to the target column in at least one line of target texts is determined as a result text corresponding to the query text, wherein the target value is determined according to the expression. The second aspect of the embodiment of the application provides a query method applied to terminal equipment, which comprises the steps of obtaining query texts, sending the query texts to a cloud server, wherein the query texts are used for indicating the cloud server to rewrite the query texts into query texts, and receiving result texts sent by the cloud server, and the result texts are determined by the cloud server according to the query method of the first aspect. A third aspect of the embodiment of the present application provides a query device, applied to a cloud server, including: the acquisition module is used for responding to the acquired query text facing the first table, acquiring the first table, wherein the query text comprises a selection text and a conditional text, the first table is added with a new column on the basis of the second table, the new column corresponds to a first expression, and the first expression is used for carrying out induction analysis on a plurality of lines of texts in the second table; the query module is used for querying at least one row of target texts which meet the condition text in the first table; The first determining module is used for determining a target column in the first table according to the selected text, and the column name of the target column and the selected text belong to the same semantic; and the second determining module is used for determining that the target value corresponding to the target column in at least one row of target text is the result text corresponding to the query text, wherein the target value is determined according to the expression. A fourth aspect of an embodiment of the application provides an electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the processor implementing a query method as in the first and/or second aspect when executing the computer program. A fifth aspect of the embodiments of the present application provides a computer readable storage medium storing a computer program which, when executed by a processor, causes the processor to implement a query method as in the first and/or second aspects. The method and the device are applied to a question-answer scene based on the table, query texts facing the first table are obtained through response, the query texts comprise selection texts and conditional texts, the first table is added with new columns on the basis of the second table, the new columns are corresponding to first expressions, the first expressions are used for carrying out induction analysis on multiple lines of texts in the second table, at least one line of target texts meeting the conditional texts are queried in the first table, target columns are determined in the first table according to the selection texts, column names of the target columns and the selection texts belong to the same semantic meaning, target values corresponding to the target columns are determi