CN116881419A - Data query method, device, medium and equipment - Google Patents
Data query method, device, medium and equipment Download PDFInfo
- Publication number
- CN116881419A CN116881419A CN202310882651.7A CN202310882651A CN116881419A CN 116881419 A CN116881419 A CN 116881419A CN 202310882651 A CN202310882651 A CN 202310882651A CN 116881419 A CN116881419 A CN 116881419A
- Authority
- CN
- China
- Prior art keywords
- text
- keyword
- statement
- intention
- ascertaining
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 51
- 238000004891 communication Methods 0.000 claims description 19
- 238000005516 engineering process Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 238000004458 analytical method Methods 0.000 description 2
- 238000007405 data analysis Methods 0.000 description 2
- 206010012601 diabetes mellitus Diseases 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000003745 diagnosis Methods 0.000 description 1
- 230000035487 diastolic blood pressure Effects 0.000 description 1
- 201000010099 disease Diseases 0.000 description 1
- 208000037265 diseases, disorders, signs and symptoms Diseases 0.000 description 1
- 238000005065 mining Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000011022 operating instruction Methods 0.000 description 1
- 230000001172 regenerating effect Effects 0.000 description 1
- 230000035488 systolic blood pressure Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/332—Query formulation
- G06F16/3329—Natural language query formulation or dialogue systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/3331—Query processing
- G06F16/334—Query execution
- G06F16/3344—Query execution using natural language analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
- G06F40/289—Phrasal analysis, e.g. finite state techniques or chunking
- G06F40/295—Named entity recognition
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Mathematical Physics (AREA)
- Human Computer Interaction (AREA)
- Health & Medical Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- General Health & Medical Sciences (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application discloses a data query method, a device, a medium and equipment, and relates to the field of digital medical treatment, wherein the method comprises the following steps: receiving a data query text, carrying out keyword recognition on the data query text to obtain at least one text keyword, and generating an intention ascertaining statement based on the text keyword; sending the intention ascertaining statement to a user side, receiving feedback information of the intention ascertaining statement from the user side, and determining a target keyword based on the text keyword, the intention ascertaining statement and the feedback information when the intention ascertaining of the data query text is determined to be completed based on the feedback information; and generating a data query statement matched with the target keyword, and querying target data in a database based on the data query statement. The target keywords are accurately determined through intention ascertaining sentences and corresponding feedback information, the data query sentences generated according to the target keywords are more accurate, the target data are accurately queried from the database, and the accuracy and the efficiency of data query are greatly improved.
Description
Technical Field
The present application relates to the field of computer technology and digital medical technology, and in particular, to a data query method, apparatus, medium and device.
Background
Data query refers to the discovery of rules and trends in data by analyzing and mining the data, so that support and guidance are provided for decision making of enterprises. In the information age today, data querying has become one of the important means for enterprises and organizations to make decisions. For example, in the medical field, medical record information required by a doctor is queried from a huge amount of electronic medical records, and a reference is provided for diagnosis and treatment of the doctor.
Data querying is particularly important for group type enterprises, and the group type enterprises have PB-level data which are stored in thousands of library tables, and it is important that the data querying accurately queries the library tables for data meeting the conditions. Because of the diversity of service scenarios, the data query is required to understand both the service language and the underlying data structure, so that the existing data query work usually needs to be done by dedicated personnel, while such comprehensive talents (both understand the service and understand the technology) are scarce, and the working efficiency of manually performing the data query is very low.
Therefore, an intelligent data query method is provided, a query tag is obtained through a language identification model, an SQL query statement is generated based on the query tag, data meeting the tag condition in a database is queried by the SQL query statement, and analysis data is obtained. Whether the analysis data can be accurately and comprehensively obtained depends on the reliability of the language identification model. For Text-to-SQL technology (Text-to-SQL is a technology for converting natural language into SQL query sentences), regarding code execution accuracy, the most influential ChatGPT (language recognition model) can only reach 40.08% at the highest, and a great gap exists between the current ChatGPT and the manpower 92.96%. For example, when the average value of the sbp of the client is to be checked, the sbp represents the diastolic blood pressure "systolic blood pressure", the language recognition model cannot accurately recognize the keyword, and the accuracy of the data to be checked is low.
How to improve the accuracy of data query is still a problem that needs to be continuously explored.
Disclosure of Invention
In view of the above, the present application provides a data query method, device, medium and apparatus, and aims to solve the problem of low accuracy of data query at present.
According to one aspect of the present application, there is provided a data query method comprising:
receiving a data query text, carrying out keyword recognition on the data query text to obtain at least one text keyword, and generating an intention ascertaining statement based on the text keyword;
the intention ascertaining statement is sent to a user side, feedback information of the intention ascertaining statement by the user side is received, and when the intention ascertaining of the data query text is determined to be completed based on the feedback information, a target keyword is determined based on the text keyword, the intention ascertaining statement and the feedback information;
and generating a data query statement matched with the target keyword, and querying target data in a database based on the data query statement.
Optionally, generating the intention ascertaining statement based on the text keyword includes:
Acquiring a first business keyword matched with the text keyword from a preset business knowledge base, and generating an intention ascertaining statement based on the first business keyword, wherein the intention ascertaining statement is used for ascertaining whether the first business keyword is the query intention of the text keyword;
and if the service keywords matched with the text keywords do not exist in the preset service knowledge base, generating descriptive information inquiry sentences based on the text keywords, wherein the descriptive information inquiry sentences are used for inquiring descriptive information of the text keywords.
Optionally, after the generating the descriptive information query statement, the method further includes:
outputting the description information inquiry statement, and determining a new text keyword based on the received text keyword description information;
and acquiring a second business keyword matched with the new text keyword from a preset business knowledge base, and generating an intention ascertaining statement based on the second business keyword.
Optionally, generating the intention ascertaining statement based on the text keyword includes:
generating intention ascertaining sentences corresponding to each text keyword respectively based on each text keyword;
Accordingly, the intention ascertaining statement is sent to a user side, feedback information of the intention ascertaining statement by the user side is received, and when the intention ascertaining of the data query text is determined to be completed based on the feedback information, a target keyword is determined based on the text keyword, the intention ascertaining statement and the feedback information, and the method comprises the following steps:
the method comprises the steps of sending a first intention ascertaining statement to a user side, receiving first feedback information of the user side on the first intention ascertaining statement, and sending a second intention ascertaining statement to the user side when the first feedback information indicates that the business keywords in the first intention ascertaining statement are query intentions of the text keywords, until the business keywords in each intention ascertaining statement are determined to be query intentions of the text keywords;
and taking the business keyword corresponding to each text keyword as a target keyword.
Optionally, after the determining the target keyword, the method further includes:
generating a query information description text containing the target keywords;
accordingly, the querying the target data in the database based on the data query statement includes:
Storing the target data under a target address and generating an address link pointing to the target address;
and outputting the query information description text and the address link.
Optionally, after the keyword recognition is performed on the data query text, the method further includes:
identifying query relationships among the text keywords based on the data query text;
correspondingly, the generating the data query statement matched with the target keyword comprises the following steps:
determining query relationships among the target keywords based on the query relationships among the text keywords, and generating the data query statement based on the target keywords and the query relationships;
correspondingly, the generating the query information description text containing the target keywords comprises the following steps:
and generating query information description text containing the query relation among the target keywords.
Optionally, the generating the data query sentence matched with the target keyword includes:
acquiring related keywords corresponding to the target keywords, wherein the related keywords are other description modes of the target keywords;
And constructing a target keyword group based on each target keyword and the corresponding related keywords, and generating a data query statement matched with the target keyword group.
According to another aspect of the present application, there is provided a data query apparatus comprising:
the first generation module of the intention ascertaining statement is used for receiving a data query text, carrying out keyword recognition on the data query text to obtain at least one text keyword, and generating the intention ascertaining statement based on the text keyword;
the target keyword determination is used for sending the intention ascertaining statement to a user side, receiving feedback information of the user side on the intention ascertaining statement, and determining a target keyword based on the text keyword, the intention ascertaining statement and the feedback information when the intention ascertaining of the data query text is determined to be completed based on the feedback information;
and the target data query module is used for generating a data query statement matched with the target keyword and querying target data in a database based on the data query statement.
Optionally, generating the intention ascertaining statement based on the text keyword includes:
Acquiring a first business keyword matched with the text keyword from a preset business knowledge base, and generating an intention ascertaining statement based on the first business keyword, wherein the intention ascertaining statement is used for ascertaining whether the first business keyword is the query intention of the text keyword;
and if the service keywords matched with the text keywords do not exist in the preset service knowledge base, generating descriptive information inquiry sentences based on the text keywords, wherein the descriptive information inquiry sentences are used for inquiring descriptive information of the text keywords.
Optionally, the data query device further includes:
the new text keyword determining module is used for outputting the description information inquiry statement and determining new text keywords based on the received text keyword description information;
and the intention ascertaining statement second generation module is used for acquiring a second business keyword matched with the new text keyword from a preset business knowledge base and generating an intention ascertaining statement based on the second business keyword.
Optionally, generating the intention ascertaining statement based on the text keyword includes:
generating intention ascertaining sentences corresponding to each text keyword respectively based on each text keyword;
Accordingly, the intention ascertaining statement is sent to a user side, feedback information of the intention ascertaining statement by the user side is received, and when the intention ascertaining of the data query text is determined to be completed based on the feedback information, a target keyword is determined based on the text keyword, the intention ascertaining statement and the feedback information, and the method comprises the following steps:
the method comprises the steps of sending a first intention ascertaining statement to a user side, receiving first feedback information of the user side on the first intention ascertaining statement, and sending a second intention ascertaining statement to the user side when the first feedback information indicates that the business keywords in the first intention ascertaining statement are query intentions of the text keywords, until the business keywords in each intention ascertaining statement are determined to be query intentions of the text keywords;
and taking the business keyword corresponding to each text keyword as a target keyword.
Optionally, the data query device further includes:
the first generation module of the query information description text is used for generating the query information description text containing the target keywords;
the address link generation module is used for storing the target data under a target address and generating an address link pointing to the target address;
And the output module is used for outputting the query information description text and the address link.
Optionally, the data query device further includes:
the query relation recognition module is used for recognizing query relations among the text keywords based on the data query text;
the data query statement generation module is used for determining query relations among the target keywords based on the query relations among the text keywords and generating the data query statement based on the target keywords and the query relations;
and the second generation module of the query information description text is used for generating the query information description text containing the target keywords and the query relation among the target keywords.
Optionally, the generating the data query sentence matched with the target keyword includes:
acquiring related keywords corresponding to the target keywords, wherein the related keywords are other description modes of the target keywords;
and constructing a target keyword group based on each target keyword and the corresponding related keywords, and generating a data query statement matched with the target keyword group.
According to another aspect of the present application, there is provided a storage medium having stored therein at least one executable instruction for causing a processor to perform operations corresponding to the above-described data query method.
According to another aspect of the present application, there is provided a computer apparatus comprising: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the data query method.
By means of the technical scheme, the technical scheme provided by the embodiment of the application has at least the following advantages:
according to the data query method, the device, the equipment and the medium, keyword recognition is carried out on the data query text, text keywords are obtained, intention query sentences corresponding to the meanings of the text keywords are generated and output according to the text keywords, whether the intention query text is obtained or not is determined according to feedback information of the intention query sentences, when the intention query text is not obtained, new intention query sentences are continuously output until the intention query text is obtained according to the feedback information is determined, target keywords are determined according to the text keywords, the intention query sentences and the feedback information, data query sentences matched with the target keywords are generated, target data are queried in a database according to the data query sentences, the intention of the data query text is accurately determined according to the intention query sentences and the corresponding feedback information of the intention query sentences, the target keywords generated based on the text keywords, the intention query sentences and the feedback information are more accurate, the data query sentences generated according to the target keywords are further more accurate, the data query sentences generated according to the target keywords are accurately queried from a database, and the data query efficiency is greatly improved.
The foregoing description is only an overview of the present application, and is intended to be implemented in accordance with the teachings of the present application in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present application more readily apparent.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
FIG. 1 shows a flow chart of a data query method provided by an embodiment of the application;
FIG. 2 is another flow chart of a data query method according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating a data query method according to an embodiment of the present application;
FIG. 4 is a flowchart of a data query method according to an embodiment of the present application;
FIG. 5 is another flow chart of a data query method according to an embodiment of the present application;
FIG. 6 is a block diagram showing a data query device according to an embodiment of the present application;
fig. 7 shows a schematic structural diagram of a computer device according to an embodiment of the present application.
Wherein,,
in fig. 6: 602-ascertaining a statement first generation module; 604-target keyword determination; 606—a target data query module;
in fig. 7: 702-a processor; 704-a communication interface; 706-memory; 708-a communication bus; 710-procedure.
Detailed Description
The application will be described in detail hereinafter with reference to the drawings in conjunction with embodiments. It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other.
In order to further describe the technical means and effects adopted for achieving the preset aim of the application, the following detailed description refers to the specific implementation, structure, characteristics and effects according to the application of the application with reference to the accompanying drawings and preferred embodiments. In the following description, different "an embodiment" or "an embodiment" do not necessarily refer to the same embodiment. Furthermore, the particular features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
Aiming at the problem of low accuracy of data query at present, the embodiment of the application provides a data query method, as shown in fig. 1, which comprises the following steps:
102: receiving a data query text, carrying out keyword recognition on the data query text to obtain at least one text keyword, and generating an intention ascertaining statement based on the text keyword;
in this embodiment, the data query text may be a text for querying medical data, and may be a text for querying insurance data, for example, the data query text is a text for a doctor to query a case, so that the doctor can learn about the patient characteristics and treatment condition of the case. The data query method is applied to the digital medical scene.
Text keywords are words that can indicate the characteristics of the query information, for example, the data medical question is "age of diabetes patient", and the identified text keywords are "diabetes" and "age".
The intention ascertaining statement is an intention inquiring statement generated according to the text keyword, and whether the identified text keyword accords with the meaning of the client is judged.
In one embodiment of the application, vectorization is carried out on the data query text to obtain a data query text vector, the data query text vector is matched with a word stock, and words with high matching degree are used as text keywords. And when the matching degree is low, re-performing text vectorization until a text keyword with high matching degree is identified.
In another embodiment of the present invention, for further definition and explanation, as shown in fig. 2, generating the intention ascertaining sentence based on the text keyword includes:
202: acquiring a first business keyword matched with a text keyword from a preset business knowledge base, and generating an intention ascertaining statement based on the first business keyword, wherein the intention ascertaining statement is used for ascertaining whether the first business keyword is the query intention of the text keyword;
204: if no business keyword matched with the text keyword exists in the preset business knowledge base, generating a descriptive information inquiry statement based on the text keyword, wherein the descriptive information inquiry statement is used for inquiring descriptive information of the text keyword.
In this embodiment, text keywords identified in a data query text are matched with text in a preset service knowledge base, and when a first service keyword matched with the text keyword exists, an intention ascertaining statement including the first service keyword is generated. For example, the data query text is "find clients who are ill," the identified text keyword is "ill," the first business keyword that matches the text keyword is "no ill-mark," and the generated intent-to-ascertain statement is "do not ill refer to no ill-mark? ".
When no business keyword matched with the text keyword exists in the preset business knowledge base, generating a description information inquiry statement according to the text keyword to inquire other description modes of the text keyword, and determining a new text keyword according to feedback information of the description information. For example, the data query text is "find customers who have money", the identified text keyword is "have money", there is no first business keyword matching the text keyword, and the generated descriptive information query sentence is "what you feel is a money customer? ".
In another embodiment of the present invention, for further limitation and illustration, after generating the descriptive information query statement, as shown in fig. 3, the method further includes:
302: outputting a descriptive information inquiry sentence, and determining a new text keyword based on the received text keyword descriptive information;
304: and acquiring a second business keyword matched with the new text keyword from a preset business knowledge base, and generating an intention ascertaining statement based on the second business keyword.
In this embodiment, after the received text keyword description information, a new text keyword is determined, a second service keyword matched with the new text keyword is obtained, and according to the second service keyword, an intention ascertaining statement is generated, so as to determine whether the second service keyword is the query intention of the new text keyword according to new feedback assurance, and when not, the description information ascertaining statement is continuously output until the new text keyword is determined.
For example, the data query text is "please help me find the customers who have money and do not have the illness and do not buy insurance", the preset business knowledge base does not have the business keywords matched with the text keywords of "having money", the output description information query statement "what customers you feel as having money customers", the received text keyword description information is "group high net value customer bar", the preset business knowledge base has the business keywords matched with the text keywords of "high net value" and has the net value higher than the preset threshold ", and the intention ascertaining statement comprising the intention that the net value of the business keywords is" high net value is higher than the preset threshold "is generated so as to ascertain whether the new business keywords are the intention of the customers.
In one embodiment of the present invention, based on each text keyword, an intent-to-ascertain sentence corresponding to each text keyword is generated.
In this embodiment, for each text keyword, an intention recognition sentence corresponding to the text keyword is generated, and the text keyword is accurately and sufficiently determined.
104: sending the intention ascertaining statement to a user side, receiving feedback information of the intention ascertaining statement from the user side, and determining a target keyword based on the text keyword, the intention ascertaining statement and the feedback information when the intention ascertaining of the data query text is determined to be completed based on the feedback information;
In this embodiment, the intent ascertaining of the data query text is determined according to the feedback information of each intent ascertaining statement, and when the feedback information of any one intent ascertaining statement cannot determine the intent ascertaining of the data query text, the text keywords are modified, and the intent ascertaining statement is regenerated until the feedback information of the intent ascertaining statement can determine the intent ascertaining of the data query text.
In another embodiment of the present invention, generating an intent-to-ascertain sentence based on text keywords includes:
based on each text keyword, an intention ascertaining sentence corresponding to each text keyword is generated.
In another embodiment of the present invention, for further limitation and explanation, as shown in fig. 4, the method includes sending an intention ascertaining statement to a user side, receiving feedback information of the intention ascertaining statement from the user side, and determining a target keyword based on a text keyword, the intention ascertaining statement, and the feedback information when it is determined that the intention ascertaining of the query text is completed based on the feedback information, including:
402: the method comprises the steps of sending a first intention ascertaining statement to a user side, receiving first feedback information of the user side on the first intention ascertaining statement, and sending a second intention ascertaining statement to the user side when the first feedback information indicates that the business keywords in the first intention ascertaining statement are query intentions of text keywords, until the query intentions of the business keywords in each intention ascertaining statement are determined to be the text keywords;
404: and taking the business keyword corresponding to each text keyword as a target keyword.
In the present embodiment, for each text keyword, an intention-to-ascertain sentence corresponding to the text keyword is generated. When the first feedback information of the first intention ascertaining statement can indicate that the business keywords in the first intention ascertaining statement are the query intentions of the text keywords, the second intention ascertaining statement is continuously output until the feedback information of all intention ascertaining statements can indicate that the business keywords in the diagram ascertaining statement are the query intentions of the text keywords.
When the feedback information of any intention ascertaining statement cannot indicate the query intention that the business keywords in the intention ascertaining statement are text keywords, modifying the business keywords in the intention ascertaining statement or modifying the text keywords, and regenerating the intention ascertaining statement until the feedback information of the intention ascertaining statement can indicate the query intention that the business keywords in the drawing ascertaining statement are text keywords.
106: and generating a data query statement matched with the target keyword, and querying target data in a database based on the data query statement.
In this embodiment, a data query statement is generated based on the target keyword, and the data query statement queries the database for target data that meets the target keyword condition.
In one embodiment, attribute information of the target data is determined based on the target keyword; determining data matching the attribute information based on the target data; a data analysis table is generated based on the target keyword, the attribute information of the target data, and the data matching the attribute information. For example, the attributes of the target data include the total number of people, the female ratio, the average age, the family property, the city, etc., and the data corresponding to the attributes of the total number of people, the female ratio, the average age, etc. are counted according to the target number.
In one embodiment, after determining the target keyword, the method further comprises:
generating a query information description text containing target keywords;
accordingly, querying the database for the target data based on the data query statement includes:
storing the target data under a target address and generating an address link pointing to the target address;
and outputting query information description text and address links.
In this embodiment, after determining the target keyword, a query information description text containing the target keyword is generated, and when target data is queried in the database and stored at a specified target address, an address connection is generated, at this time, the address connection and the query information description text containing the target keyword are output so that the user knows the description information of the data stored in the address connection.
For example, the query text is "help you find: in group high net clients, there is no disease mark and no group status of buying medical insurance, "the address links are" generated content, please see: data analysis ID:12345678".
In one embodiment, after keyword recognition of the data query text, the method further comprises:
based on the data query text, identifying query relations among text keywords;
accordingly, generating a data query statement that matches the target keyword, comprising:
determining query relationships among the target keywords based on the query relationships among the text keywords, and generating data query sentences based on the target keywords and the query relationships;
accordingly, generating a query information description text containing the target keywords includes:
query information description text containing target keywords and query relationships between the target keywords is generated.
In this embodiment, when a plurality of text keywords exist, a query relationship between the plurality of text keywords is first determined, then a query relationship between target keywords is determined, and a data query sentence and a query information description text are generated based on the query relationship between the target keywords and the target keywords.
For example, the text keywords include money and no illness, the query relationship between the text keywords is "money and no illness", "money or no illness", and when it is determined that the query relationship between the two keywords is "money and no illness" based on the recognition result of the data query text, the target keyword corresponding to money is "high net value", the target keyword corresponding to no illness is "no illness mark", and both the data query sentence and the query information description text include the query relationship between the target keyword and the target keyword "high net value and no illness mark customer".
In another embodiment of the present invention, for further definition and explanation, as shown in fig. 5, generating a data query sentence matching a target keyword includes:
502: acquiring related keywords corresponding to the target keywords, wherein the related keywords are other description modes of the target keywords;
504: and constructing a target keyword group based on each target keyword and the corresponding related keywords, and generating a data query statement matched with the target keyword group.
In this embodiment, the target keyword has other words of description, which are also called related keywords, such as short term, full term, generic term, and technical term. When the data is stored in the database, the names of the stored keywords are different according to different needs, and based on the target keywords and other corresponding description modes, matched data query sentences are generated, so that query data are comprehensively acquired, and the accuracy of data query is improved.
Compared with the prior art, the application provides a data query method, which is characterized in that keyword recognition is carried out on a data query text to obtain text keywords, intention query sentences corresponding to the meanings of the text keywords are generated and output according to the text keywords, whether the intention query text is obtained or not is determined according to feedback information of the intention query sentences, when the intention query text is not obtained, new intention query sentences are continuously output until the intention query text is determined to be obtained according to the feedback information, target keywords are determined according to the text keywords, the intention query sentences and the feedback information, data query sentences matched with the target keywords are generated, the intention of the data query sentences is accurately determined according to the data query sentences and the corresponding feedback information of the intention query sentences, the intention of the data query text is more accurately determined based on the intention query sentences and the feedback information, and further the data query sentences generated according to the target keywords are more accurately queried from a database, so that the accuracy and the efficiency of data query are greatly improved.
Further, as an implementation of the method shown in fig. 1, an embodiment of the present application provides a data query device, as shown in fig. 6, where the device includes:
the intention ascertaining statement first generation module 602 is configured to receive the data query text, identify a keyword for the data query text, obtain at least one text keyword, and generate an intention ascertaining statement based on the text keyword;
a target keyword determination 604, configured to send an intention ascertaining statement to a user side, receive feedback information of the intention ascertaining statement from the user side, and determine a target keyword based on the text keyword, the intention ascertaining statement, and the feedback information when it is determined that intention ascertaining on the query text is completed based on the feedback information;
the target data query module 606 is configured to generate a data query statement that matches the target keyword, and query the database for target data based on the data query statement.
Compared with the prior art, the data query device provided by the application has the advantages that the keyword recognition is carried out on the data query text to obtain the text keyword, the intention query statement corresponding to the meaning of the text keyword is generated and output according to the text keyword, whether the intention query text is obtained or not is determined according to the feedback information of the intention query statement, when the intention query text is not obtained, the new intention query statement is continuously output until the intention query text is determined to be obtained according to the feedback information, the target keyword is determined according to the text keyword, the intention query statement and the feedback information, the data query statement matched with the target keyword is generated, the intention of the data query text is accurately determined according to the data query statement and the corresponding feedback information, the intention of the data query text is more accurately determined based on the intention query statement and the feedback information, and the data query statement generated according to the target keyword is more accurately, so that the data query statement generated according to the target keyword is more accurately queried from the data database, and the accuracy and the data query efficiency are greatly improved.
In one embodiment, generating the intent-to-ascertain statement based on the text keyword includes:
acquiring a first business keyword matched with a text keyword from a preset business knowledge base, and generating an intention ascertaining statement based on the first business keyword, wherein the intention ascertaining statement is used for ascertaining whether the first business keyword is the query intention of the text keyword;
if no business keyword matched with the text keyword exists in the preset business knowledge base, generating a descriptive information inquiry statement based on the text keyword, wherein the descriptive information inquiry statement is used for inquiring descriptive information of the text keyword.
In one embodiment, the data query device further comprises:
the new text keyword determining module is used for outputting descriptive information inquiry sentences and determining new text keywords based on the received text keyword descriptive information;
the intention ascertaining statement second generation module is used for acquiring a second business keyword matched with the new text keyword from a preset business knowledge base and generating an intention ascertaining statement based on the second business keyword.
In one embodiment, generating the intent-to-ascertain statement based on the text keyword includes:
Generating intention ascertaining sentences corresponding to each text keyword respectively based on each text keyword;
accordingly, the intention ascertaining statement is sent to the user side, the feedback information of the intention ascertaining statement from the user side is received, and when the intention ascertaining on the data query text is determined to be completed based on the feedback information, the target keyword is determined based on the text keyword, the intention ascertaining statement and the feedback information, including:
the method comprises the steps of sending a first intention ascertaining statement to a user side, receiving first feedback information of the user side on the first intention ascertaining statement, and sending a second intention ascertaining statement to the user side when the first feedback information indicates that the business keywords in the first intention ascertaining statement are query intentions of text keywords, until the query intentions of the business keywords in each intention ascertaining statement are determined to be the text keywords;
and taking the business keyword corresponding to each text keyword as a target keyword.
In one embodiment, the data query device further comprises:
the first generation module of the query information description text is used for generating the query information description text containing the target keywords;
the address link generation module is used for storing the target data under the target address and generating an address link pointing to the target address;
And the output module is used for outputting the query information description text and the address link.
In one embodiment, the data query device further comprises:
the query relation recognition module is used for recognizing query relations among text keywords based on the data query text;
the data query sentence generation module is used for determining the query relation between the target keywords based on the query relation between the text keywords and generating a data query sentence based on the target keywords and the query relation;
and the second generation module is used for generating query information description text containing target keywords and query relations among the target keywords.
In one embodiment, generating a data query statement that matches a target keyword includes:
acquiring related keywords corresponding to the target keywords, wherein the related keywords are other description modes of the target keywords;
and constructing a target keyword group based on each target keyword and the corresponding related keywords, and generating a data query statement matched with the target keyword group.
According to one embodiment of the present invention, there is provided a storage medium storing at least one executable instruction for performing the data query method in any of the above-described method embodiments.
Fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present invention, and the specific embodiment of the present invention is not limited to the specific implementation of the computer device.
As shown in fig. 7, the computer device may include: a processor 702, a communication interface (Communications Interface), a memory 706, and a communication bus 708.
Wherein: processor 702, communication interface 704, and memory 706 perform communication with each other via a communication bus 708.
A communication interface 704 for communicating with network elements of other devices, such as clients or other servers.
The processor 702 is configured to execute the program 710, and may specifically perform relevant steps in the above-described data query method embodiment.
In particular, program 710 may include program code including computer-operating instructions.
The processor 702 may be a Central Processing Unit (CPU), or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement embodiments of the present invention. The one or more processors included in the computer device may be the same type of processor, such as one or more CPUs; but may also be different types of processors such as one or more CPUs and one or more ASICs.
Memory 706 for storing programs 710. The memory 706 may comprise high-speed RAM memory or may further comprise non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 710 may be specifically configured to cause the processor 702 to:
receiving a data query text, carrying out keyword recognition on the data query text to obtain at least one text keyword, and generating an intention ascertaining statement based on the text keyword;
outputting an intention ascertaining statement, receiving feedback information of the intention ascertaining statement, and determining a target keyword based on the text keyword, the intention ascertaining statement and the feedback information when the intention ascertaining of the data query text is determined to be completed based on the feedback information;
and generating a data query statement matched with the target keyword, and querying target data in a database based on the data query statement.
It will be apparent to those skilled in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, and in one embodiment they may be implemented in program code executable by a computing device, so that they may be stored in a memory device for execution by a computing device, and in some cases, the steps shown or described may be performed in a different order than what is shown or described, or they may be separately fabricated into individual integrated circuit modules, or a plurality of modules or steps in them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above embodiments are only exemplary embodiments of the present application and are not intended to limit the present application, the scope of which is defined by the claims. Various modifications and equivalent arrangements of this application will occur to those skilled in the art, and are intended to be within the spirit and scope of the application.
Claims (10)
1. A method of querying data, comprising:
receiving a data query text, carrying out keyword recognition on the data query text to obtain at least one text keyword, and generating an intention ascertaining statement based on the text keyword;
the intention ascertaining statement is sent to a user side, feedback information of the intention ascertaining statement by the user side is received, and when the intention ascertaining of the data query text is determined to be completed based on the feedback information, a target keyword is determined based on the text keyword, the intention ascertaining statement and the feedback information;
and generating a data query statement matched with the target keyword, and querying target data in a database based on the data query statement.
2. The data query method of claim 1, wherein generating an intent-to-ascertain statement based on the text keyword comprises:
Acquiring a first business keyword matched with the text keyword from a preset business knowledge base, and generating an intention ascertaining statement based on the first business keyword, wherein the intention ascertaining statement is used for ascertaining whether the first business keyword is the query intention of the text keyword;
and if the service keywords matched with the text keywords do not exist in the preset service knowledge base, generating descriptive information inquiry sentences based on the text keywords, wherein the descriptive information inquiry sentences are used for inquiring descriptive information of the text keywords.
3. The data query method of claim 2, wherein after the generating the descriptive information query statement, the method further comprises:
outputting the description information inquiry statement, and determining a new text keyword based on the received text keyword description information;
and acquiring a second business keyword matched with the new text keyword from a preset business knowledge base, and generating an intention ascertaining statement based on the second business keyword.
4. The data query method of claim 2, wherein generating an intent-to-ascertain statement based on the text keyword comprises:
Generating intention ascertaining sentences corresponding to each text keyword respectively based on each text keyword;
accordingly, the intention ascertaining statement is sent to a user side, feedback information of the intention ascertaining statement by the user side is received, and when the intention ascertaining of the data query text is determined to be completed based on the feedback information, a target keyword is determined based on the text keyword, the intention ascertaining statement and the feedback information, and the method comprises the following steps:
the method comprises the steps of sending a first intention ascertaining statement to a user side, receiving first feedback information of the user side on the first intention ascertaining statement, and sending a second intention ascertaining statement to the user side when the first feedback information indicates that the business keywords in the first intention ascertaining statement are query intentions of the text keywords, until the business keywords in each intention ascertaining statement are determined to be query intentions of the text keywords;
and taking the business keyword corresponding to each text keyword as a target keyword.
5. The data query method of any one of claims 1 to 4, wherein after said determining the target keyword, the method further comprises:
Generating a query information description text containing the target keywords;
accordingly, the querying the target data in the database based on the data query statement includes:
storing the target data under a target address and generating an address link pointing to the target address;
and outputting the query information description text and the address link.
6. The data query method of claim 5, wherein after keyword recognition of the data query text, the method further comprises:
identifying query relationships among the text keywords based on the data query text;
correspondingly, the generating the data query statement matched with the target keyword comprises the following steps:
determining query relationships among the target keywords based on the query relationships among the text keywords, and generating the data query statement based on the target keywords and the query relationships;
correspondingly, the generating the query information description text containing the target keywords comprises the following steps:
and generating query information description text containing the query relation among the target keywords.
7. The data query method of any one of claims 1 to 4, wherein said generating a data query statement that matches the target keyword comprises:
acquiring related keywords corresponding to the target keywords, wherein the related keywords are other description modes of the target keywords;
and constructing a target keyword group based on each target keyword and the corresponding related keywords, and generating a data query statement matched with the target keyword group.
8. A data query device, comprising:
the intention ascertaining statement generation module is used for receiving a data query text, carrying out keyword recognition on the data query text to obtain at least one text keyword, and generating an intention ascertaining statement based on the text keyword;
the target keyword determination is used for sending the intention ascertaining statement to a user side, receiving feedback information of the user side on the intention ascertaining statement, and determining a target keyword based on the text keyword, the intention ascertaining statement and the feedback information when the intention ascertaining of the data query text is determined to be completed based on the feedback information;
And the target data query module is used for generating a data query statement matched with the target keyword and querying target data in a database based on the data query statement.
9. A storage medium having stored therein at least one executable instruction for causing a processor to perform operations corresponding to the data query method of any one of claims 1 to 7.
10. A computer device, comprising: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus;
the memory is configured to store at least one executable instruction, where the executable instruction causes the processor to perform the operations corresponding to the data query method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310882651.7A CN116881419A (en) | 2023-07-18 | 2023-07-18 | Data query method, device, medium and equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310882651.7A CN116881419A (en) | 2023-07-18 | 2023-07-18 | Data query method, device, medium and equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116881419A true CN116881419A (en) | 2023-10-13 |
Family
ID=88254578
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310882651.7A Pending CN116881419A (en) | 2023-07-18 | 2023-07-18 | Data query method, device, medium and equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116881419A (en) |
-
2023
- 2023-07-18 CN CN202310882651.7A patent/CN116881419A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11392775B2 (en) | Semantic recognition method, electronic device, and computer-readable storage medium | |
US9280569B2 (en) | Schema matching for data migration | |
US11775767B1 (en) | Systems and methods for automated iterative population of responses using artificial intelligence | |
US10430469B2 (en) | Enhanced document input parsing | |
CN111078837B (en) | Intelligent question-answering information processing method, electronic equipment and computer readable storage medium | |
CN112559865B (en) | Information processing system, computer-readable storage medium, and electronic device | |
CN110135590B (en) | Information processing method, information processing apparatus, information processing medium, and electronic device | |
CN112925898B (en) | Question-answering method and device based on artificial intelligence, server and storage medium | |
CN113407677B (en) | Method, apparatus, device and storage medium for evaluating consultation dialogue quality | |
CN113836314B (en) | Knowledge graph construction method, device, equipment and storage medium | |
US8862609B2 (en) | Expanding high level queries | |
CN109087688B (en) | Patient information acquisition method, apparatus, computer device and storage medium | |
CN113221570A (en) | Processing method, device, equipment and storage medium based on-line inquiry information | |
CN111984745A (en) | Dynamic expansion method, device, equipment and storage medium for database field | |
CN117273167A (en) | Training method, medical method, device, equipment and storage medium for medical model | |
CN114399343B (en) | Intelligent robot online auxiliary selling method and system | |
CN116010461A (en) | Data blood relationship analysis method and device, storage medium and electronic equipment | |
CN116881419A (en) | Data query method, device, medium and equipment | |
CN114416847A (en) | Data conversion method, device, server and storage medium | |
CN115733787A (en) | Network identification method, device, server and storage medium | |
CN111695031A (en) | Label-based searching method, device, server and storage medium | |
CN113806356B (en) | Data identification method and device and computing equipment | |
CN116127053B (en) | Entity word disambiguation, knowledge graph generation and knowledge recommendation methods and devices | |
CN115458103B (en) | Medical data processing method, medical data processing device, electronic equipment and readable storage medium | |
CN110911015B (en) | Disease name standardization rapid calculation method based on profile implicit Markov model |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |