An information query method and device, electronic equipment and storage medium
By switching to an internal information database when no results are found in the public information database of the intelligent question-answering system, the problem of low accuracy and completeness of the intelligent question-answering system on complex or specific questions is solved, and higher information query accuracy and user experience are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING YOUTEJIE INFORMATION TECH
- Filing Date
- 2023-07-17
- Publication Date
- 2026-04-17
AI Technical Summary
Existing intelligent question-answering systems have low accuracy and completeness when dealing with complex or specific questions, and cannot provide satisfactory answers.
By obtaining the current information query statement, the system first queries the public information database. If no results are found, it queries the internal information database to generate information query results. The results are then combined with those from the internal information database to improve the accuracy and completeness of the query.
It improved the accuracy and completeness of information retrieval, enhanced the user experience, and ensured the security and reliability of sensitive data.
Smart Images

Figure CN117112595B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of data processing technology, and in particular to an information query method, apparatus, electronic device and storage medium. Background Technology
[0002] In people's daily work, situations inevitably arise where they need to consult or inquire about problems. With the increasing capabilities of AI (Artificial Intelligence), the adoption of automated customer service continues to expand. Automated customer service technology primarily relies on AI chatbots to provide fast and accurate customer service. Currently, there is a high overall preference for chatbots as the primary communication method for customer service, and this technology has been widely applied and continues to develop and improve.
[0003] However, while AI question-answering systems can handle many common and pre-defined questions, their ability to understand and process complex or specific questions is often limited. If the question posed exceeds the scope of the training dataset corresponding to the AI question-answering system, the system may be unable to provide a satisfactory answer. Summary of the Invention
[0004] This invention provides an information query method, apparatus, electronic device, and storage medium, which can improve the accuracy and completeness of information queries, thereby enhancing the user experience of information queries.
[0005] According to one aspect of the present invention, an information retrieval method is provided, comprising:
[0006] Obtain the current information query statement, and query the public information database based on the current information query statement;
[0007] If the result of querying the public information database according to the current information query statement is empty, then query the internal information database according to the current information query statement.
[0008] The information query result of the current information query statement is generated based on the query results of the internal information database.
[0009] According to another aspect of the present invention, an information query device is provided, comprising:
[0010] The public information database query module is used to obtain the current information query statement and query the public information database according to the current information query statement;
[0011] The internal information database query module is used to query the internal information database according to the current information query statement when it is determined that the result of querying the public information database according to the current information query statement is empty.
[0012] The information query result generation module is used to generate the information query result of the current information query statement based on the query result of the internal information database.
[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0014] At least one processor; and
[0015] A memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the information query method according to any embodiment of the present invention.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the information query method described in any embodiment of the present invention.
[0018] This invention addresses the problems of low accuracy and completeness in information queries in existing intelligent question-and-answer systems by querying a public information database based on the current information query statement. If the result of querying the public information database based on the current information query statement is empty, an internal information database is queried based on the current information query statement. The information query result of the current information query statement is then generated based on the query result of the internal information database. This improves the accuracy and completeness of information queries and thus enhances the user experience of information queries.
[0019] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a flowchart of an information query method provided in Embodiment 1 of the present invention;
[0022] Figure 2This is a flowchart of an information query method provided in Embodiment 2 of the present invention;
[0023] Figure 3 This is a schematic diagram of an information query device provided in Embodiment 3 of the present invention;
[0024] Figure 4 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. Detailed Implementation
[0025] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0026] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0027] Example 1
[0028] Figure 1 This is a flowchart of an information query method provided in Embodiment 1 of the present invention. This embodiment is applicable to situations where information queries are performed by combining public information databases and internal information databases. The method can be executed by an information query device, which can be implemented in software and / or hardware, and is generally integrated into an electronic device. This electronic device can be a terminal device or a server device, as long as it possesses the functionality of an intelligent question-and-answer system. The present invention does not limit the specific type of electronic device. Correspondingly, as... Figure 1 As shown, the method includes the following operations:
[0029] S110. Obtain the current information query statement and query the public information database according to the current information query statement.
[0030] The current information query statement refers to the query statement initiated to the intelligent question-answering system to retrieve certain information. The current information query statement can be either a voice query or a text query, and this embodiment of the invention does not impose any limitations on this. It is understood that if the current information query statement is a voice query statement, the intelligent question-answering system can first convert it into a text query statement to facilitate subsequent query processing by the intelligent question-answering system. The public information database can be a database pre-constructed based on publicly available information.
[0031] In this embodiment of the invention, when a user initiates a current information query statement to the intelligent question-and-answer system, the intelligent stability system can first query the public information database according to the current information query statement in order to retrieve query results that match the current information query statement from the public information database.
[0032] S120. If it is determined that the result of querying the public information database according to the current information query statement is empty, query the internal information database according to the current information query statement.
[0033] The internal information database can be built upon a non-public internal knowledge base. This means that while the non-public internal knowledge base stores data sensitive to external users, it also stores data that is not sensitive to them. In other words, some data stored in the internal knowledge base can be publicly accessed. Simultaneously, all data in the internal knowledge base is publicly available to internal users with access permissions.
[0034] Optionally, internal information databases with different access levels can be configured based on the sensitivity of the data stored in the internal knowledge base. For example, for external users, non-sensitive data that can be publicly disclosed can be filtered from the internal knowledge base and further processed to generate an internal information database that can be used to query information queries initiated by external users. For internal users, all data in the internal knowledge base can be further processed to generate an internal information database that can be used to query information queries initiated by internal users.
[0035] Understandably, internal knowledge bases typically contain a wealth of valuable information and data. However, due to confidentiality and security considerations, the data stored in internal knowledge bases may not be permitted for training, thus reducing the comprehensive support capabilities of intelligent question-answering systems. Furthermore, intelligent question-answering systems relying on publicly available information databases may exhibit limited understanding and response capabilities. When a user's question exceeds the scope of the training dataset, they may be unable to provide a satisfactory answer, leading to a decrease in the accuracy and completeness of information retrieval.
[0036] To address the aforementioned issues, in this embodiment of the invention, when a user initiates a current information query and fails to find results in the publicly accessible information database, they can further query an internal information database to obtain the query results. For example, when the user initiating the current information query is an external user, they can query an internal information database publicly accessible to external users. When the user initiating the current information query is an internal user, they can query an internal information database publicly accessible to internal users. Therefore, not only external users can access intelligent question-and-answer services through the intelligent question-and-answer system, but internal users can also access these services to quickly obtain non-public internal information, facilitating efficient internal workflows for internal users.
[0037] Therefore, by combining information queries with internal information databases, the limitations of public information database datasets and access restrictions of internal information databases can be overcome, effectively improving the understanding and response capabilities of intelligent question-answering systems, enhancing the ability of intelligent question systems to provide comprehensive support, thereby improving the accuracy and completeness of information queries by intelligent question systems, and ultimately improving the user experience of intelligent question systems.
[0038] S130. Generate the information query result of the current information query statement based on the query result of the internal information database.
[0039] Optionally, the query results from the internal information database can be directly used as the query result for the current information query statement. Alternatively, to improve the intelligence of information retrieval, the query results from the internal information database can be further integrated, such as combining fragmented query results from the internal information database into information query results that conform to human language habits.
[0040] Accordingly, after obtaining the information query result for the current information query statement, the intelligent question-answering system can directly output the information query result. For example, it can output the information query result using text, voice, video, or a combination of text and images. This embodiment of the invention does not limit the method of outputting the information query result.
[0041] This invention addresses the problems of low accuracy and completeness in information queries in existing intelligent question-and-answer systems by querying a public information database based on the current information query statement. If the result of querying the public information database based on the current information query statement is empty, an internal information database is queried based on the current information query statement. The information query result of the current information query statement is then generated based on the query result of the internal information database. This improves the accuracy and completeness of information queries and thus enhances the user experience of information queries.
[0042] Example 2
[0043] Figure 2 This is a flowchart of an information query method provided in Embodiment 2 of the present invention. This embodiment is based on the above embodiment and is further specified. In this embodiment, various specific optional embodiments are given for querying public information databases and internal information databases according to the current information query statement, and generating information query results for the current information query statement. Accordingly, as... Figure 2 As shown, the method in this embodiment may include:
[0044] S210. Filter non-sensitive internal data from the internal knowledge base, and perform information extraction, tagging, and classification processing on the non-sensitive internal data to obtain the first internal information database.
[0045] S220. Extract, tag, and classify all the internal data of the internal knowledge base to obtain the second internal information database.
[0046] The first internal information database and the second internal information database include documents, document metadata, and document tags.
[0047] Non-sensitive internal data refers to data in the internal knowledge base that can be publicly disclosed. The first internal information database can be an internal information database that can be disclosed to external users. The second internal information database can be an internal information database that can be disclosed to internal users. It is understood that the second internal information database can include both non-sensitive and sensitive internal data. Taking a document retrieval scenario as an example, sensitive internal data in the second internal information database may include, but is not limited to, internal configuration information in product documents. Non-sensitive internal data may include, but is not limited to, the names of system functions and their defined numerical ranges. In other words, disclosing non-sensitive internal data externally will not result in the leakage of sensitive internal data.
[0048] Specifically, non-sensitive internal data can be filtered from the internal knowledge base, and this filtered non-sensitive internal data can be processed by information extraction, tagging, and classification to obtain the first internal information database. Simultaneously, all internal data in the internal knowledge base can be processed by information extraction, tagging, and classification to obtain the second internal information database.
[0049] In a specific example, taking a document retrieval application scenario, for the first internal information database, internal technical documents stored in the internal knowledge base, such as R&D design documents and product design documents, can be filtered to select documents that can be publicly disclosed, and then uniformly organized and indexed as non-sensitive internal data. For the second internal information database, internal technical documents stored in the internal knowledge base can be directly and uniformly organized and indexed.
[0050] When uniformly organizing and indexing data in the internal knowledge base (applicable to both the first and second internal information databases), key product information can be extracted first. For example, non-sensitive internal data can be extracted by specifying system function names and set numerical ranges, while sensitive data can be extracted by providing product configuration information. The initially extracted key product information is then tagged and categorized, and relevant attributes such as the project it belongs to and the corresponding product line are assigned. Simultaneously, the document's author, creation date, and last modification date can be further extracted as document metadata for the internal information database. Further, natural language processing technology can be used to extract key information again, such as extracting the topic, main points, and technical details as refined key information. Additionally, corresponding document tags can be assigned to the documents extracted from the internal knowledge base. These tags can be determined based on the document metadata and the extracted refined key information. For example, one or more topic tags can be assigned to each document, or the document can be tagged with "R&D Design" or "Product Research" based on its content. Finally, a Jira database (a project and transaction tracking tool) can be created as the internal information database based on the information obtained through the above operations. This database contains all documents, document metadata, and document tags.
[0051] The above technical solution, by dividing the internal information database into a first internal information database and a second internal information database, not only fully utilizes the publicly available data in the internal information database to provide intelligent question-and-answer services, but also ensures the security and reliability of sensitive data in the internal information database. Furthermore, it can provide intelligent question-and-answer services to internal users using sensitive data in the internal information database, such as allowing users to quickly query detailed configuration information of products and optimize products rapidly based on the queried detailed configuration information. This greatly improves the understanding and response capabilities of the intelligent question-and-answer system, thereby increasing the accuracy of information retrieval by the intelligent question-and-answer system.
[0052] S230. Obtain the current information query statement and query the public information database according to the current information query statement.
[0053] In an optional embodiment of the present invention, the step of querying a public information database according to the current information query statement may include: obtaining a vector set of the public information database; wherein the vector set includes vectors corresponding to information stored in the public information database, and each vector is identified by an index; obtaining the statement vector and feature information of the current information query statement; performing preliminary screening from the vector set to obtain a candidate vector set based on the matching results of the feature information and each of the indexes; calculating the similarity value between the statement vector and each candidate vector in the candidate vector set, and taking the candidate vectors with similarity values exceeding a threshold as target vectors; and obtaining public information query results matching the current information query statement based on the target vectors.
[0054] In an optional embodiment of the present invention, the current information query statement may include the current document information query statement. Correspondingly, the public information database may be a database storing product document-related data. For example, the public information database may be generated as follows: extracting FAQs (Frequently Asked Questions) from the enterprise knowledge base during the after-sales phase and directly training them into corpus vectors using the public information database. The training of the corpus vectors can be achieved using natural language processing techniques, such as text extraction and corpus vectorization. Optionally, all documents to be queried from the public information database can be read into memory, semantically recognized using NLTK (Natural Language Toolkit), segmented into small text segments, and converted into a structure conforming to LLM (Large Language Model).
[0055] Correspondingly, the converted text segments can be sent to the application interface of a large language model, such as the chartGPT-3 (third-generation general language prediction model) application interface. The large language model application interface will vectorize each converted text segment, obtain the corresponding text vector, and store the text vector in a local file for reading by the public information database. By converting text form into vector form, subsequent text processing is facilitated. In addition, this embodiment of the invention can extract feature information from each text vector, create an index for the text vector based on the feature information, and add the index to the corresponding text vector. By creating an index, the query speed during searching can be accelerated. For example, after obtaining the text vectors corresponding to 20 text segments, the indexed text vectors are used to construct a vector set. Therefore, the vector set includes the text vectors corresponding to each text segment in the query document, and each text vector is identified by an index. It should be noted that the above technical solution converts the document to be queried into vector form and saves it to the public information database in the form of a vector set in a local file. Subsequent document queries are mainly based on similarity matching, which can accelerate document query efficiency.
[0056] Optionally, when processing the statement vector and feature information of the current information query statement, the current information query statement can first be segmented by keywords to obtain the segmented query question, and then the segmented query question can be sent to the application interface of the large language model, such as the chartGPT-3 application interface. The application interface of the large language model can process the segmented query question to obtain the question vector corresponding to the segmented query question, and further extract key information from the question vector to obtain the feature information of the question vector.
[0057] In a specific example, when performing an information query, the user's current information query statement, such as "Please tell me what the interface for obtaining the communication list is?", can be received through a human-computer interaction interface. The query statement is then segmented using keywords to obtain the segmented query question. For example, the segmented document query question might be "Get user list API". This segmented query question is then sent to the chartGPT-3 application interface. The chartGPT-3 application interface will then vectorize the segmented query question to obtain the corresponding question vector. Furthermore, there is no need to perform LLM structure transformation on the segmented document query question before it can be directly input into the chartGPT-3 application interface to obtain the question vector. It should be noted that after obtaining the question vector, key information is extracted from it and used as the feature information of the question vector. The method for extracting feature information from the question vector is roughly the same as that for text vectors, and will not be elaborated further.
[0058] Accordingly, after obtaining the statement vector and feature information of the current information query statement, a preliminary selection of candidate vector sets can be performed from the vector set based on the matching results of the feature information and each index. Specifically, the feature information of the question vector can be matched with each index to obtain the target index, where the feature information of the target index is the same as that of the question vector. The text vector identified by the target index is used as a candidate vector, and a candidate vector set is constructed based on the candidate vectors. Further, the similarity value between the question vector and each candidate vector in the candidate vector set is calculated, and candidate vectors with similarity values exceeding a threshold are used as target vectors. Optionally, when calculating the similarity value between the question vector and each candidate vector in the candidate vector set, the first absolute value of the question vector and the second absolute value of each candidate vector can be obtained, and the first product result of the question vector and each candidate vector, as well as the second product result of the first absolute value and the second absolute value, can be calculated. Finally, the ratio of the first product result to the second product result is used as the similarity value. Accordingly, after determining the target vector, the public information query results matching the current information query statement can be obtained based on the target vector. When obtaining document query results that match the document query question based on the target vector, the target text segment corresponding to each target vector can be obtained, and the target text segments can be merged according to the specified rules. Based on the fusion result, the document query results that match the document query question can be obtained.
[0059] In a specific example, taking a document query application scenario, before calculating the vector similarity between the query question and the document, the vector set is first initially filtered using indexes. For example, the vector set contains text vectors corresponding to 20 text segments, and each text vector is identified by an index. Since the index is created based on the feature information of the text vectors, it contains the feature information of each text vector. For example, if the feature information of the question vector is 'a', then the target index containing feature information 'a' is obtained. When five target indices are identified, the text vectors identified by the five target indices—vector A1, vector A2, vector A3, vector A4, and vector A5—are selected as candidate vectors, and a candidate vector set X = {vector A1, vector A2, vector A3, vector A4, vector A5} is constructed based on these candidate vectors. After obtaining the candidate vector set, the similarity between each candidate vector and the question vector can be calculated. Then, the Faiss vector similarity search engine is used to perform a similarity search on the question within the document vector set to obtain the search results.
[0060] Optionally, cosine similarity can be used to calculate the similarity between the problem vector and each candidate vector in the candidate vector set. Cosine similarity is a measure of the similarity between two non-zero vectors in an inner product space; it measures the cosine of the angle between them. For example, when the problem vector is determined to be B, the similarity between vector A and vector B can be calculated using the following formula:
[0061] Cosine similarity = (A*B) / (||A||*||B||)
[0062] Where A is the candidate vector, B is the question vector, and ||A|| and ||B|| are the magnitudes of the vectors. A*B is taken as the first product result, and ||A||*||B|| is taken as the second product result. Therefore, the cosine similarity between each candidate vector and the question vector can be calculated using the above formula. Of course, this embodiment only uses cosine similarity calculation as an example for illustration and does not limit the specific calculation method used to calculate the similarity between vectors.
[0063] It should be noted that in this embodiment of the invention, a threshold can be preset, and candidate vectors with similarity values exceeding the threshold can be used as target vectors. For example, if the threshold is set to 3, but calculations determine that only candidate vectors A1, A2, and A3 have similarity values exceeding 3 with the question vector, then candidate vectors A1, A2, and A3 can be used as target vectors. Accordingly, after obtaining the target vectors based on the search results, OpenAI's combine function can be called to fuse them, integrating the fragmented candidate results into an output that conforms to human language habits. In a specific implementation, this can involve obtaining target text segments 1, 2, and 3 corresponding to target vectors A1, A2, and A3, respectively, and fusing each target text segment according to a specified rule. For example, the fused result can be obtained by concatenating them sequentially, such as "The interfaces of the communication list are interface 1, interface 2, and interface 3," and the fused result can be used as the document query result matching the document query question "Please tell me what the interface for obtaining the communication list is?"
[0064] The above technical solution transforms the information to be queried and the information query statement into vector form, performs preliminary screening using a stable vector index, and then obtains the target vector by comparing the similarity value between the information query statement and the candidate vectors. The target vector is then output in a readable form, which improves the efficiency of information retrieval, saves the manual cost of searching, and greatly enhances the user experience.
[0065] S240. Determine whether the query result of the public information database is empty. If yes, execute S260; otherwise, execute S250.
[0066] S250. Generate the information query results of the current information query statement based on the query results of the public information database.
[0067] In this embodiment of the invention, if a valid query result can be obtained by querying the public information database according to the current information query statement, the information query result of the current information query statement can be directly generated based on the query result of the public information database. Optionally, the query result of the public information database can be directly used as the information query result of the current information query statement. Alternatively, to improve the intelligence of information query, the query results of the public information database can be further integrated, such as integrating fragmented query results of the public information database into information query results that conform to human language habits.
[0068] S260. Determine the query permissions that match the current information query statement.
[0069] Understandably, different types of users will have different query permissions when initiating information queries. For example, if the current information query is initiated by an external user, it will have a first-level query permission. If the current information query is initiated by an internal user, it will have a second-level query permission.
[0070] S270. Determine whether the query permission matched by the current information query statement is the first level query permission. If yes, execute S280; otherwise, execute S290.
[0071] The first level of query permission allows you to query the first internal information database. The second level of query permission allows you to query the second internal information database.
[0072] S280, Query the first internal information database.
[0073] S290. Determine that the query permission matched by the current information query statement is the second level query permission, and query the second internal information database.
[0074] Accordingly, if the query permission matched by the current information query statement is determined to be Level 1, it indicates that the user initiating the query is an external user. To prevent the leakage of sensitive internal data, the first internal information database is only accessible to external users, therefore, the query results can be obtained by querying the first internal information database. If the query permission matched by the current information query statement is determined to be Level 2, it indicates that the user initiating the query is an internal user. The second internal information database is accessible to internal users, therefore, the query results can be obtained by querying the second internal information database.
[0075] In an optional embodiment of the present invention, the step of querying the internal information database according to the current information query statement may include: parsing the current information query statement through a large language model to obtain a query statement parsing result; determining the associated statement elements of the target query statement in the internal database according to the query statement parsing result; generating the structure of the target query statement in the internal database according to the associated statement elements and a preset structural logic; and querying the internal information database according to the target query statement in the internal database.
[0076] Here, a large language model, also known as a large model, refers to a powerful, pre-trained model. For example, a large language model may include, but is not limited to, GPT (Generative Pre-Trained Transformer) or LLaMA (Large Language Model Meta AI, an open-source foundational large language model). This embodiment of the invention does not limit the type of large language model. The query statement parsing result is the result obtained by parsing the current information query statement using the large language model. The target query statement can be a statement type generated by the intelligent question-answering system based on the current information query statement, used for querying the internal database. Related statement elements can be elements that constitute the target query statement. The preset structural logic can be predefined rule logic used to generate the target query statement for the internal database.
[0077] Specifically, when querying the internal information database based on the current information query statement, the query statement can first be preprocessed using a large language model. This preprocessing includes correcting grammatical errors, extracting key points, and guiding the user to provide sufficient information interactively. The query statement is then parsed to obtain the parsed query result. Further, an internal database target query statement can be constructed based on the parsed query result. Specifically, the associated statement elements of the internal database target query statement can be determined based on the parsed query result. The structure of the internal database target query statement is then built based on these associated statement elements and a predefined structural logic, generating the internal database target query statement. Finally, the internal information database is queried using the internal database target query statement.
[0078] In an optional embodiment of the present invention, determining the associated statement elements of the target query statement in the internal database based on the query statement parsing result may include: determining the element mapping method of the target query statement in the internal database; mapping the query statement parsing result to the associated statement elements of the target query statement in the internal database through the element mapping method; wherein, the query statement parsing result includes at least one of topic, object, and action; and the associated statement elements include at least one of field, operator, and target value.
[0079] The element mapping method may include, but is not limited to, a mapping table or a learning model. This embodiment of the invention does not limit the specific mapping type. The target value may be a value from a target query statement in the internal database.
[0080] Specifically, when determining the associated statement elements of the target query statement in the internal database based on the query statement parsing results, the element mapping method of the target query statement in the internal database can be determined, such as using a mapping table or a machine learning model, to map the query statement parsing results to the associated statement elements of the target query statement in the internal database. For example, the topic in the query statement parsing results can be mapped to a field in the target query statement in the internal database, the action in the query statement parsing results can be mapped to an operator in the target query statement in the internal database, and the object in the query statement parsing results can be mapped to a value in the target query statement in the internal database.
[0081] In an optional embodiment of the present invention, the step of generating the structure of the internal database target query statement based on the associated statement elements and the preset structural logic may include: determining the logical operators matching the associated statement elements based on the element type of the associated statement elements and the preset structural logic; and arranging and combining each of the associated statement elements through the logical operators matching the associated statement elements to obtain the structure of the internal database target query statement.
[0082] Logical operators are operators that perform logical operations, including but not limited to operators of the types "AND" and "OR".
[0083] In this embodiment of the invention, the logical operators matching the associated statement elements can be determined according to the element type and preset structural logic of the associated statement elements, so as to arrange and combine each associated statement element using the logical operators matching the associated statement elements, and finally obtain the structure of the target query statement of the internal database.
[0084] In a specific example, suppose a user's question cannot find a satisfactory answer from a public information database. The question can be parsed using a pre-defined GPT3 prompt, extracting information such as the topic, object, and action as the query result. Further, the query result is mapped to elements of a JQL query. For example, the question's topic might map to a field in the JQL query, the question's action to an operator, and the question's object to a value. Optionally, this mapping process can be automated by building a mapping table or using a machine learning model. Ultimately, a JQL query targeting an internal database can be retrieved as the target query for that internal database. During the generation of the target query, its specific structure can be determined using pre-defined logic. For instance, to determine whether to use the "AND" or "OR" operator, keyword information in the user's question can be considered. If the user's question contains "and" or "simultaneously," the "AND" operator can be used. If the user's question contains "or" or "any one," the "OR" operator can be used. In addition, the sorting method for query results can be determined based on specific keywords in the question. For example, if the question contains "latest", the query results can be sorted in descending order by date.
[0085] S2110. Generate the information query result of the current information query statement based on the query result of the internal information database.
[0086] In an optional embodiment of the present invention, after generating the information query result of the current information query statement based on the query result of the internal information database, the method may further include: performing natural language conversion and integration on the information query result of the current information query statement through a large language model to obtain an integrated query result; and outputting the integrated query result according to a preset output format template.
[0087] The integrated query results are the results obtained by converting and integrating the information query results of the current information query statement into natural language. The preset output format template can be a pre-configured template for the query result output, allowing for personalized configuration of the query result output.
[0088] For example, after obtaining relevant query results by querying the internal information database using JQL statements, the results are then converted and integrated using the GPT3 model. The query results are then processed a second time, and OpenAI's combine function is called to fuse them. The results are then integrated into an output that conforms to human language habits according to a preset output format template.
[0089] The aforementioned technical solution combines publicly available information databases and internal information databases as references for information retrieval. The public information database can be composed of FAQs and can be directly used to train the corpus. The internal information database contains more in-depth and specialized information, and can be divided into different access levels based on user access permissions. This not only ensures the security and confidentiality of sensitive data but also maximizes the accuracy and completeness of information retrieval by the intelligent question-answering system. Furthermore, by constructing a target query statement for retrieving information from the internal information database based on the user's input, the system can quickly query the internal information database, improving the query response efficiency of the internal information database.
[0090] It should be noted that any arrangement or combination of the technical features in the above embodiments also falls within the protection scope of this invention.
[0091] Example 3
[0092] Figure 3 This is a schematic diagram of an information query device provided in Embodiment 3 of the present invention, as shown below. Figure 3 As shown, the device includes: a public information database query module 310, an internal information database query module 320, and an information query result generation module 330, wherein:
[0093] The public information database query module 310 is used to obtain the current information query statement and query the public information database according to the current information query statement;
[0094] The internal information database query module 320 is used to query the internal information database according to the current information query statement when it is determined that the result of querying the public information database according to the current information query statement is empty.
[0095] The information query result generation module 330 is used to generate the information query result of the current information query statement based on the query result of the internal information database.
[0096] This invention addresses the problems of low accuracy and completeness in information queries in existing intelligent question-and-answer systems by querying a public information database based on the current information query statement. If the result of querying the public information database based on the current information query statement is empty, an internal information database is queried based on the current information query statement. The information query result of the current information query statement is then generated based on the query result of the internal information database. This improves the accuracy and completeness of information queries and thus enhances the user experience of information queries.
[0097] Optionally, the public information database query module 310 is specifically used for: obtaining a vector set of the public information database; wherein the vector set includes vectors corresponding to information stored in the public information database, and each vector is identified by an index; obtaining the statement vector and feature information of the current information query statement; performing preliminary screening from the vector set to obtain a candidate vector set based on the matching results of the feature information and each index; calculating the similarity value between the statement vector and each candidate vector in the candidate vector set, and taking the candidate vectors with similarity values exceeding a threshold as target vectors; and obtaining public information query results matching the current information query statement based on the target vectors.
[0098] Optionally, the internal information database query module 320 is specifically used to: determine the query permission matched by the current information query statement; if the query permission matched by the current information query statement is determined to be a first-level query permission, query the first internal information database; if the query permission matched by the current information query statement is determined to be a second-level query permission, query the second internal information database.
[0099] Optionally, the information query device further includes an internal information database generation module, used for: filtering non-sensitive internal data from an internal knowledge base, and performing information extraction, tagging, and classification processing on the non-sensitive internal data to obtain the first internal information database; performing information extraction, tagging, and classification processing on all internal data in the internal knowledge base to obtain the second internal information database; wherein the first internal information database and the second internal information database include documents, document metadata, and document tags.
[0100] Optionally, the internal information database query module 320 is specifically used for: parsing the current information query statement using a large language model to obtain the query statement parsing result; determining the associated statement elements of the internal database target query statement based on the query statement parsing result; generating the structure of the internal database target query statement based on the associated statement elements and preset structural logic; and querying the internal information database based on the internal database target query statement.
[0101] Optionally, the internal information database query module 320 is specifically used to: determine the element mapping method of the target query statement in the internal database; map the query statement parsing result to the associated statement element of the target query statement in the internal database through the element mapping method; wherein, the query statement parsing result includes at least one of topic, object and action; the associated statement element includes at least one of field, operator and target value.
[0102] Optionally, the internal information database query module 320 is specifically used to: determine the logical operator matching the associated statement element according to the element type of the associated statement element and the preset structural logic; and arrange and combine each associated statement element through the logical operator matching the associated statement element to obtain the structure of the target query statement of the internal database.
[0103] Optionally, the information query device also includes an integrated query result output module, used to: perform natural language conversion and integration on the information query results of the current information query statement through a large language model to obtain integrated query results; and output the integrated query results according to a preset output format template.
[0104] The information query device described above can execute the information query method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method. Technical details not described in detail in this embodiment can be found in the information query method provided in any embodiment of the present invention.
[0105] Since the information query device described above is capable of executing the information query method in the embodiments of the present invention, those skilled in the art can understand the specific implementation and various variations of the information query device in this embodiment based on the information query method described in the embodiments of the present invention. Therefore, how the information query device implements the information query method in the embodiments of the present invention will not be described in detail here. Any device used by those skilled in the art to implement the information query method in the embodiments of the present invention falls within the scope of protection of this application.
[0106] Example 4
[0107] Figure 4 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0108] like Figure 4As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0109] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0110] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as information query methods.
[0111] That is, the information query method may include: obtaining the current information query statement and querying a public information database according to the current information query statement; if it is determined that the result of querying the public information database according to the current information query statement is empty, querying an internal information database according to the current information query statement; and generating the information query result of the current information query statement based on the query result of the internal information database.
[0112] In some embodiments, the information query method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the information query method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to execute the information query method by any other suitable means (e.g., by means of firmware).
[0113] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0114] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0115] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0116] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0117] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0118] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
Claims
1. An information retrieval method, characterized in that, include: Obtain the current information query statement, and query the public information database based on the current information query statement; If the result of querying the public information database according to the current information query statement is empty, then query the internal information database according to the current information query statement. The information query result of the current information query statement is generated based on the query result of the internal information database. The query results of the current information query statement are converted and integrated using a large language model to obtain an integrated query result. The integrated query results are output according to a preset output format template; The step of querying the internal information database based on the current information query statement includes: The current information query statement is parsed using a large language model to obtain the query statement parsing result; Determine the element mapping method for the target query statement in the internal database; The query statement parsing result is mapped to the associated statement element of the target query statement in the internal database through the element mapping method; wherein, the query statement parsing result includes at least one of topic, object, and action; the associated statement element includes at least one of field, operator, and target value; The logical operator matching the associated statement element is determined based on the element type and preset structural logic of the associated statement element. The structure of the target query statement in the internal database is obtained by arranging and combining each of the related statement elements by using logical operators that match the related statement elements; The internal information database is queried according to the target query statement of the internal database.
2. The method according to claim 1, characterized in that, The step of querying the public information database based on the current information query statement includes: Obtain the vector set of the publicly available information database; wherein the vector set includes vectors corresponding to the information stored in the publicly available information database, and each vector is identified by an index; Obtain the statement vector and feature information of the current information query statement; Based on the matching results between the feature information and each of the indices, a preliminary screening is performed from the vector set to obtain a candidate vector set; Calculate the similarity value between the statement vector and each candidate vector in the candidate vector set, and take the candidate vector with the similarity value exceeding the threshold as the target vector; Based on the target vector, obtain the public information query results that match the current information query statement.
3. The method according to claim 1, characterized in that, The step of querying the internal information database based on the current information query statement includes: Determine the query permissions matching the current information query statement; If it is determined that the query permission matched by the current information query statement is the first level query permission, then query the first internal information database; If it is determined that the query permission matched by the current information query statement is the second level query permission, then query the second internal information database.
4. The method according to claim 3, characterized in that, Before obtaining the current information query statement and querying the public information database based on the current information query statement, the method further includes: Non-sensitive internal data is filtered from the internal knowledge base, and the non-sensitive internal data is processed by information extraction, tagging, and classification to obtain the first internal information database. The second internal information database is obtained by extracting, tagging, and classifying all the internal data of the internal knowledge base. The first internal information database and the second internal information database include documents, document metadata, and document tags.
5. An information query device, characterized in that, include: The public information database query module is used to obtain the current information query statement and query the public information database according to the current information query statement; The internal information database query module is used to query the internal information database according to the current information query statement when it is determined that the result of querying the public information database according to the current information query statement is empty. The information query result generation module is used to generate the information query result of the current information query statement based on the query result of the internal information database. The internal information database query module is specifically used for: The current information query statement is parsed using a large language model to obtain the query statement parsing result; Determine the element mapping method for the target query statement in the internal database; The query statement parsing result is mapped to the associated statement element of the target query statement in the internal database through the element mapping method; wherein, the query statement parsing result includes at least one of topic, object, and action; the associated statement element includes at least one of field, operator, and target value; The logical operator matching the associated statement element is determined based on the element type and preset structural logic of the associated statement element. The structure of the target query statement in the internal database is obtained by arranging and combining each of the related statement elements by using logical operators that match the related statement elements; Query the internal information database according to the target query statement of the internal database; The information query device further includes: The integrated query result output module is used to perform natural language conversion and integration on the information query results of the current information query statement through a large language model to obtain integrated query results; and output the integrated query results according to a preset output format template.
6. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the information query method according to any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that are used to cause a processor to execute the information query method according to any one of claims 1-4.
Citation Information
Patent Citations
A personalized security industry customer service system and method
CN109559144A
Data query method and device
CN112069203A
Query request response method and device
CN115114424A