Information retrieval method, device, computer equipment and storage medium

By parsing the question text to obtain entity information, generating and transforming templates to match the question and answer library, this solves the problem of ElasticSearch's accuracy in text retrieval with the same intent but different expressions, and achieves improved accuracy and speed in information retrieval.

CN116467428BActive Publication Date: 2025-10-03CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310369823.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-04
Publication Date
2025-10-03
Estimated Expiration
2043-04-04

AI Technical Summary

Technical Problem

ElasticSearch cannot effectively identify texts with the same intent but different expressions in information retrieval, resulting in low information retrieval accuracy.

Method used

The text entity information is obtained by parsing the question text, an initial template that matches the text entity information is selected, the template is filled and transformed to generate multiple question templates, the similarity between the template and the question template in the question and answer library is calculated, the matching inventory question template is determined and the answer information is obtained.

Benefits of technology

It improves the accuracy and speed of information retrieval, reduces the amount of calculation, and ensures comprehensive coverage of key information and accuracy of answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116467428B_ABST
    Figure CN116467428B_ABST
Patent Text Reader

Abstract

The embodiments of the present application belong to the field of artificial intelligence and relate to an information retrieval method, apparatus, computer equipment, and storage medium. The method comprises: parsing a question text to obtain text entity information, the text entity information including each entity in the question text, the entity type of each entity, and the entity relationship between each entity; selecting an initial template that matches the text entity information, and filling the initial template according to the text entity information to obtain a first question template; transforming the first question template to obtain multiple second question templates; calculating the similarity between the question template and each inventory question template in the question and answer library, the question template including the first question template and multiple second question templates; determining the inventory question template that matches the question template based on the obtained similarity, and determining the answer information corresponding to the inventory question template as the answer information of the question text. The present application also relates to blockchain technology, and the answer information can be stored in the blockchain. The present application improves the accuracy of information retrieval.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence, and in particular to an information retrieval method, apparatus, computer equipment, and storage medium. Background Art

[0002] With the development of computer technology, the application of intelligent question-and-answer (AIQ) has become increasingly widespread. For example, AIQ is often used in intelligent customer service. AIQ typically takes a user-entered question and searches a pre-set Q&A database for the corresponding answer.

[0003] ElasticSearch is a distributed search and analytics engine that provides near-real-time search and analysis for all types of data. The similarity matching mechanism provided by ElasticSearch is a similarity calculation based on word frequency and rules, but it is not an intent-based matching mechanism. In retrieval, if two texts have the same intent but are expressed in different ways, such as "What is the city flower of Shenzhen?" and "What is the city flower of Pengcheng?", although they express the same intent, ElasticSearch, which does not use intent matching, cannot effectively distinguish between them, resulting in low information retrieval accuracy. Summary of the Invention

[0004] The purpose of the embodiments of the present application is to provide an information retrieval method, apparatus, computer equipment and storage medium to solve the problem of low accuracy of information retrieval.

[0005] In order to solve the above technical problems, the present application provides an information retrieval method, which adopts the following technical solutions:

[0006] Get the input question text;

[0007] Parsing the question text to obtain text entity information, wherein the text entity information includes entities in the question text, entity types of the entities, and entity relationships between the entities;

[0008] Selecting an initial template that matches the text entity information, and filling the initial template according to the text entity information to obtain a first question template;

[0009] transforming the first question template to obtain a plurality of second question templates;

[0010] Calculating similarity between the question template and each inventory question template in the question-answer database, wherein the question template includes the first question template and the plurality of second question templates;

[0011] An inventory question template that matches the question template is determined based on the obtained similarity, and answer information corresponding to the inventory question template is determined as answer information of the question text.

[0012] In order to solve the above technical problems, the embodiment of the present application further provides an information retrieval device, which adopts the following technical solution:

[0013] Question acquisition module, used to obtain the input question text;

[0014] A question parsing module, configured to parse the question text to obtain text entity information, wherein the text entity information includes entities in the question text, entity types of the entities, and entity relationships between the entities;

[0015] A template selection module, configured to select an initial template that matches the text entity information, and fill the initial template with the text entity information to obtain a first question template;

[0016] a template transformation module, configured to transform the first question template to obtain a plurality of second question templates;

[0017] a similarity calculation module, configured to calculate the similarity between the question template and each inventory question template in the question-answer library, wherein the question template includes the first question template and the plurality of second question templates;

[0018] The answer determination module is used to determine an inventory question template that matches the question template according to the obtained similarity, and determine the answer information corresponding to the inventory question template as the answer information of the question text.

[0019] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:

[0020] Get the input question text;

[0021] Parsing the question text to obtain text entity information, wherein the text entity information includes entities in the question text, entity types of the entities, and entity relationships between the entities;

[0022] Selecting an initial template that matches the text entity information, and filling the initial template according to the text entity information to obtain a first question template;

[0023] transforming the first question template to obtain a plurality of second question templates;

[0024] Calculating similarity between the question template and each inventory question template in the question-answer database, wherein the question template includes the first question template and the plurality of second question templates;

[0025] An inventory question template that matches the question template is determined based on the obtained similarity, and answer information corresponding to the inventory question template is determined as answer information of the question text.

[0026] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:

[0027] Get the input question text;

[0028] Parsing the question text to obtain text entity information, wherein the text entity information includes entities in the question text, entity types of the entities, and entity relationships between the entities;

[0029] Selecting an initial template that matches the text entity information, and filling the initial template according to the text entity information to obtain a first question template;

[0030] transforming the first question template to obtain a plurality of second question templates;

[0031] Calculating similarity between the question template and each inventory question template in the question-answer database, wherein the question template includes the first question template and the plurality of second question templates;

[0032] An inventory question template that matches the question template is determined based on the obtained similarity, and answer information corresponding to the inventory question template is determined as answer information of the question text.

[0033] Compared with the prior art, the embodiments of the present application have the following main beneficial effects: obtaining a question text and parsing it to obtain text entity information. The text entity information includes each entity in the question text, the entity type of each entity, and the entity relationship between each entity, which can reflect the structure and semantics of the question text to a certain extent; selecting an initial template that matches the text entity information, and filling the initial template according to the text entity information to obtain a first question template. The first question template can carry the information in the text entity information and simplify the question text; transforming the first question template to obtain multiple second question templates. The second question templates are semantically similar to the first question template but have different text expressions, so as to cover all semantic expressions of the first question template as much as possible; calculating the similarity between the question template and each inventory question template in the question and answer library. The question template includes the first question template and multiple second question templates. Template-based retrieval can reduce the amount of calculation and improve the speed of information retrieval; determining the inventory question template that matches the question template based on the similarity, and determining the answer information corresponding to the inventory question template as the answer information of the question text to complete the information retrieval; the present application uses the template to carry the key information of the question text and obtains all semantic expressions of the key information as much as possible, thereby improving the speed of information retrieval while also improving the accuracy of information retrieval. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the solutions in this application, a brief introduction will be given below to the drawings required for use in the description of the embodiments of this application. Obviously, the drawings described below are some embodiments of this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0035] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;

[0036] Figure 2 is a flow chart of an embodiment of the information retrieval method according to the present application;

[0037] Figure 3 is a schematic structural diagram of an embodiment of an information retrieval device according to the present application;

[0038] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION

[0039] Unless otherwise defined, all technical and scientific terms used herein have the same meanings as commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of the application are for the purpose of describing specific embodiments only and are not intended to limit this application. The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of this application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0040] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0041] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0042] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. Network 104 is a medium for providing communication links between terminal devices 101, 102, 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables.

[0043] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0044] Terminal devices 101, 102, and 103 can be various electronic devices with display screens and support web browsing, including but not limited to smartphones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV), laptop computers, desktop computers, etc.

[0045] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .

[0046] It should be noted that the information retrieval method provided in the embodiments of the present application is generally executed by a server, and accordingly, the information retrieval device is generally set in the server.

[0047] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.

[0048] Continue to refer Figure 2 , shows a flow chart of an embodiment of the information retrieval method according to the present application. The information retrieval method comprises the following steps:

[0049] Step S201: Obtain input question text.

[0050] In this embodiment, the electronic device (eg Figure 1 The server shown in the figure) can communicate with the terminal through a wired connection or a wireless connection. It should be noted that the above-mentioned wireless connection method may include but is not limited to 3G / 4G / 5G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or to be developed in the future.

[0051] Specifically, the question text is obtained based on the user operation. The user can directly input the question text, or the user's question voice can be recognized to obtain the question text.

[0052] Step S202 , parsing the question text to obtain text entity information, wherein the text entity information includes each entity in the question text, the entity type of each entity, and the entity relationship between each entity.

[0053] Specifically, the question text is parsed to obtain the text entity information corresponding to the question text. Text entity information is information related to the entities contained in the question text. Specifically, it can include the entities existing in the question text, the entity types of each entity, and the entity relationships between entities. Entities can also have entity relationships, which are also included in the text entity information.

[0054] For example, the existing question text is "How many man-hours are needed to repair the AB front bumper", where AB, front bumper, repair and man-hours are entities; AB is a certain brand of car, and its entity type can be a car brand naming entity; the front bumper is a component on the car, and its entity type can be an auto accessory; the entity type of repair can be an action, and the entity type of man-hours can be a duration; AB is the subject of the question text, and the relationship between the front bumper and AB is that the front bumper is attached to AB, the object of repair is the AB front bumper, and man-hours are attached to repair, which is also the retrieval target. The above are all text entity information obtained by parsing.

[0055] Step S203: Select an initial template that matches the text entity information, and fill the initial template according to the text entity information to obtain a first question template.

[0056] Specifically, this application pre-sets multiple initial templates for different forms of question text. The initial template is a question template that has not yet been fully filled with information. The text entity information can reflect the structure and semantics of the question text to a certain extent. Therefore, a matching initial template can be selected based on the obtained text entity information. The selected initial template can carry various information in the text entity information. Filling the initial template with the text entity information can obtain a first question template, which is equivalent to a simplified form of the question text.

[0057] Step S204: transform the first question template to obtain multiple second question templates.

[0058] Specifically, after obtaining the first question template, the first question template can be transformed based on semantics to obtain multiple second question templates. Compared with the first question template, the second question template has a different text expression, but the semantics are similar and they are all the same question template, and cover all the semantic expressions of the first question template as much as possible.

[0059] Step S205 , calculating the similarity between the question template and each inventory question template in the question-answer database, wherein the question template includes a first question template and multiple second question templates.

[0060] Specifically, the first question template and its corresponding multiple second question templates constitute the question template used for retrieval. This application has pre-built a question-and-answer library based on ElasticSearch, which contains all possible questions and their corresponding answer information in the question-and-answer application scenario. Among them, the possible questions exist in the form of standardized inventory questions. The inventory questions also have inventory question templates. The inventory question templates can be regarded as simplified inventory questions. The process of generating an inventory question template based on the inventory question is the same as the process of generating the first question template based on the question text in the previous article. It will not be repeated here. The inventory question template and the first question template have the same logical connotation.

[0061] In order to reduce the amount of calculation and improve the speed of information retrieval, for each question template, this application calculates the similarity between the question template and each inventory question template in the question and answer library, and finally obtains the similarity between each question template and each inventory question template.

[0062] It should be emphasized that in order to further ensure the privacy and security of the answer information corresponding to the above inventory questions, the answer information corresponding to the above inventory questions can also be stored in a node of a blockchain.

[0063] The blockchain referred to in this application is a new application model for computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Blockchain is essentially a decentralized database, a series of data blocks generated using cryptographic methods. Each data block contains information about a batch of network transactions, which is used to verify the validity of this information (to prevent counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, the platform product service layer, and the application service layer.

[0064] Step S206 : determining an inventory question template that matches the question template based on the obtained similarity, and determining the answer information corresponding to the inventory question template as the answer information of the question text.

[0065] Specifically, after calculating the similarity, the inventory problem template that matches the problem template is determined based on the similarity. For example, the inventory problem template associated with the highest similarity value can be directly selected as the matching inventory problem template; alternatively, the inventory problem templates ranked in the top N numerical values ​​can be selected as the matching inventory problem templates.

[0066] In the question-and-answer database, inventory questions, inventory question templates, and answer information are pre-stored. After determining the inventory question template that matches the question template, the answer information corresponding to the inventory question template is determined as the answer information of the question text, and the answer information is returned to the retrieval terminal, where the retrieval terminal can be the terminal used by the user when performing information retrieval.

[0067] In this embodiment, a question text is obtained and parsed to obtain text entity information. The text entity information includes each entity in the question text, the entity type of each entity, and the entity relationship between each entity, which can reflect the structure and semantics of the question text to a certain extent; an initial template matching the text entity information is selected, and the initial template is filled in according to the text entity information to obtain a first question template. The first question template can carry the information in the text entity information and simplify the question text; the first question template is transformed to obtain multiple second question templates. The second question templates are semantically similar to the first question template but have different textual expressions, so as to cover all semantic expressions of the first question template as much as possible; the similarity between the question template and each inventory question template in the question and answer library is calculated. The question template includes the first question template and the multiple second question templates. Template-based retrieval can reduce the amount of calculation and improve the speed of information retrieval; the inventory question template matching the question template is determined based on the similarity, and the answer information corresponding to the inventory question template is determined as the answer information of the question text, thereby completing the information retrieval; the present application uses the template to carry the key information of the question text and obtains all semantic expressions of the key information as much as possible, thereby improving the speed of information retrieval while also improving the accuracy of information retrieval.

[0068] Furthermore, after the above step S202, it can also include: judging whether the question text meets the preset search conditions based on the text entity information; when the question text meets the search conditions, selecting an initial template that matches the text entity information, and filling the initial template according to the text entity information to obtain a first question template; when the question text does not meet the search conditions, returning search prompt information to the search terminal.

[0069] Specifically, before obtaining the question template, the question text can be determined to determine whether it meets the preset search criteria based on the text entity information. The text entity information can obtain the entities contained in the question text, entity types, and entity relationships between entities. If the text entity information determines that the question text contains sensitive words or involves the retrieval of sensitive information, the question text does not meet the search criteria.

[0070] The question retrieval system in this application may have a specific application scenario. If the question text is determined to have no relevance to the specific application scenario based on the text entity information, then the question text does not meet the search criteria. Sensitive words and information related to the application scenario can be configured in the search criteria.

[0071] If the question text meets the search criteria, an initial template matching the text entity information is selected and filled in with the initial template according to the text entity information to obtain a first question template. If the question text does not meet the search criteria, a search prompt is returned to the search terminal, informing the user that the current question text does not meet the search criteria and prompting the user to re-enter the question text.

[0072] In this embodiment, it is determined whether the question text meets the preset search conditions based on the text entity information; when it meets the conditions, an initial template matching the text entity information is selected, and the initial template is filled in according to the text entity information to obtain a first question template for information retrieval; when the question text does not meet the search conditions, a search prompt message is returned to the search terminal to remind the user to re-enter the question text, thereby achieving the limitation of the search content.

[0073] Furthermore, the above-mentioned step S204 may include: determining the transformable entity in the first question template; querying the synonyms and / or near synonyms of the transformable entity according to the preset vocabulary; and arranging and reorganizing each entity in the first question template based on the queried synonyms and / or near synonyms to obtain multiple second question templates.

[0074] Specifically, the first question template may contain multiple entities, some of which have other semantic expressions and can be semantically transformed. These entities are transformable entities. For example, "going to school" can also be expressed as "reading", so "going to school" is a transformable entity; while some entities have no other semantic expressions, or usually only have one form of semantic expression. These entities are non-transformable entities, such as "identity card".

[0075] This application pre-sets a vocabulary library that pre-stores synonyms and near-synonymous expressions for various transformable entities. The vocabulary library can be used to query all synonyms and / or near-synonymous expressions for each transformable entity in the first question template. Then, the queried synonyms and / or near-synonymous words are used to replace the transformable entities in the first question template one by one to obtain multiple second question templates. It can be understood that if there are multiple transformable entities in the first question template, two transformable entities can be replaced simultaneously, and their synonyms and / or near-synonymous words can be arranged to obtain multiple second question templates.

[0076] In one embodiment, the present application is provided with a pre-trained language model, the transformable entity is input into the pre-trained language model, and the pre-trained language model outputs synonyms and / or near synonyms of the transformable entity.

[0077] In one embodiment, the transformable entity is expressed in a first language, and the transformable entity can be translated into a second language, and then back-translated, and the multiple results obtained by the back-translation are used as synonyms and / or near-synonyms of the transformable entity. For example, the question text is Chinese text, and the transformable entity is also Chinese text. The transformable entity is translated into a second language such as Korean / Japanese / English, and then back-translated into Chinese. During the back-translation, multiple different forms of expressions may be obtained as synonyms and / or near-synonyms of the transformable entity. Alternatively, the first question template is directly translated into the second language, and then back-translated, and the multiple results obtained by the back-translation are directly used as the second question template.

[0078] In this embodiment, the transformable entity in the first question template is determined, the synonyms and / or near synonyms of the transformable entity are queried according to a preset vocabulary, and the entities in the first question template are arranged and reorganized based on the queried synonyms and / or near synonyms to obtain multiple second question templates, thereby obtaining other semantic expressions that are the same or similar to the first question template, so that more information can be covered during retrieval, thereby improving the accuracy of information retrieval.

[0079] Furthermore, the step of calculating the similarity between the question template and each inventory question template in the question and answer library may include: selecting an inventory question template that matches the question template in the question and answer library; for each question template, converting the question template into a question template vector, and converting each inventory question template into an inventory template vector; calculating the cosine similarity between the question template vector and each inventory template vector, and using each cosine similarity as the similarity between the question template and each inventory question template.

[0080] Specifically, a question template contains the entities in the question text, their entity types, and the entity relationships between them. Question templates have a specific template format. To ensure accurate information retrieval, it is necessary to select a matching inventory question template from the Q&A database. This ensures that the question text and inventory questions roughly match in format and content. Furthermore, narrowing the scope of inventory question templates can reduce computational complexity.

[0081] For each question template, convert the question template into a question template vector in vector form, and convert each inventory question template into an inventory template vector in vector form. Calculate the cosine similarity between the question template vector and each inventory template vector, and use the cosine similarity as the similarity between the question template and each inventory question template.

[0082] In one embodiment, the similarity between the question template and each inventory question template may also be calculated based on a TF (Term Frequency)-IDF (Inverse Document Frequency) algorithm.

[0083] In this embodiment, an inventory question template that matches the question template is selected from the question-and-answer database, thereby ensuring the accuracy of information retrieval, narrowing the scope of the inventory question template, and reducing the amount of computation. The question template is converted into a question template vector, and the inventory question template is converted into an inventory template vector. The cosine similarity between the question template vector and the inventory template vector is used as the similarity between the question template and the inventory question template, thereby ensuring that the similarity between the question template and the inventory question template can be accurately evaluated.

[0084] Furthermore, the above-mentioned step of selecting an inventory question template that matches the question template in the question and answer library may include: obtaining a template type identifier of the question template, the template type identifier being determined based on the text entity information corresponding to the question template; and selecting an inventory question template that matches the template type identifier in the preset question and answer library.

[0085] Specifically, the text entity information carried by the question template includes entities, entity types of entities, and relationship information between entities. Therefore, the question template has a certain format, which can be represented by a template type identifier.

[0086] In one embodiment, entity types and relationship information between entities can be identified by a unique identification code. For example, "AB" in the above example represents a certain brand of car, and the brand of car can be identified by the identification code 0a1, or the car can be identified by the identification code 0a1. Therefore, the information contained in the text entity information can be represented by a number of identification codes, and different identification codes constitute a specific identification code combination, which can be used as a template type identification of the question template. Similarly, the inventory question template in the question and answer library also has a template type identification. After obtaining the template type identification of the question template, the inventory question template corresponding to the template type identification is queried in the question and answer library, and the similarity of these inventory question templates is calculated.

[0087] It can be understood that after obtaining text entity information from the question text, the identification code combination can be determined based on the text entity information, and the initial template with the same template type identifier and identification code combination can be queried. The initial template is filled in according to the text entity information to obtain the first question template.

[0088] In this embodiment, the template type identifier of the question template is obtained. The template type identifier is determined based on the text entity information corresponding to the question template and can uniquely identify the format of the question template. In the preset question and answer library, the inventory question template that matches the template type identifier is selected. The selected inventory question template is similar to the question template type, ensuring the accuracy of information retrieval.

[0089] Furthermore, the step of determining an inventory problem template that matches the problem template based on the obtained similarities may include: arranging the calculated similarities in descending order to obtain a similarity sequence; selecting a preset number of similarities from the similarity sequence; and when the selected similarities are greater than or equal to a preset similarity threshold, determining that the inventory problem template associated with the selected similarities matches the problem template.

[0090] Specifically, after calculating each similarity, all similarities are sorted in descending order to obtain a similarity sequence. A preset number of similarities are then selected from the similarity sequence. A preset similarity threshold is obtained, which is used to evaluate the inventory question templates associated with the similarities. If any of the selected similarities exceeds the similarity threshold, the inventory question template associated with the similarity matches the question template, and the answer information corresponding to the inventory question template can be used as the answer to the question text.

[0091] In this embodiment, the similarities are arranged in descending order, and a preset number of similarities are selected. The largest number of similarities can be selected from the similarities. If there is a similarity greater than a similarity threshold, it indicates that the inventory problem template associated with the similarity is semantically similar to the problem template, and thus a matching inventory problem template is selected.

[0092] Furthermore, after the above-mentioned step of selecting a preset number of similarities from the similarity sequence, it may also include: when the selected similarities are all less than a preset similarity threshold, obtaining the inventory problem corresponding to the inventory problem template associated with the selected similarities; generating a question confirmation request according to each inventory problem; sending the question confirmation request to the retrieval terminal; when receiving the question confirmation information returned by the retrieval terminal in response to the question confirmation request, extracting the inventory problem in the question confirmation information, and determining the answer information corresponding to the inventory problem as the answer information of the question text.

[0093] Specifically, if the similarities selected from the similarity sequence are all less than a preset similarity threshold, it indicates that no closely matching inventory question template has been found. Since the question-and-answer database stores inventory questions corresponding to inventory question templates, the inventory questions corresponding to the inventory question templates associated with the selected similarities can be extracted, and question confirmation requests can be generated based on these inventory questions.

[0094] Inventory questions are typically phrased in a more formal and rigorous manner. Similarities are often below the preset similarity threshold, likely due to the user's informal question formulation. The server sends a question confirmation request to the search terminal, which displays the inventory question and prompts the user to check whether the question they are searching for is among the displayed inventory questions. If so, the user can select the inventory question. The search terminal generates a question confirmation message based on the selected inventory question and sends it to the server. The server extracts the inventory question from the question confirmation message and determines the answer information corresponding to the inventory question as the answer information for the question text.

[0095] In this embodiment, when the selected similarities are all less than a preset similarity threshold, it indicates that the inventory question template and the question template have a poor match, and the inventory question corresponding to the inventory question template associated with the selected similarity is obtained. A question confirmation request is generated based on each inventory question and sent to the search terminal so that the user can confirm whether there is the question to be retrieved in the inventory question; when the question confirmation information returned in response to the question confirmation request is received, the inventory question in the question confirmation information is extracted, and the answer information corresponding to the inventory question is determined as the answer information of the question text. The generation of the answer information is selected by the user, ensuring the accuracy of the returned answer information.

[0096] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology, for example, by generating text entity information and obtaining synonyms and / or near-synonyms of transformable entities through artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to achieve optimal results.

[0097] Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0098] This application can be applied in the field of smart cities, thereby promoting the construction of smart cities.

[0099] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing related hardware via computer-readable instructions. The computer-readable instructions can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes in the above-described method embodiments. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0100] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0101] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of an information retrieval device, which is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0102] like Figure 3 As shown, the information retrieval device 300 of this embodiment includes: a question acquisition module 301, a question analysis module 302, a template selection module 303, a template transformation module 304, a similarity calculation module 305 and an answer determination module 306, wherein:

[0103] The question acquisition module 301 is used to acquire the input question text.

[0104] The question parsing module 302 is used to parse the question text to obtain text entity information, wherein the text entity information includes each entity in the question text, the entity type of each entity, and the entity relationship between each entity.

[0105] The template selection module 303 is used to select an initial template that matches the text entity information, and fill the initial template according to the text entity information to obtain a first question template.

[0106] The template transformation module 304 is configured to transform the first question template to obtain a plurality of second question templates.

[0107] The similarity calculation module 305 is used to calculate the similarity between the question template and each inventory question template in the question and answer database, wherein the question template includes a first question template and multiple second question templates.

[0108] The answer determination module 306 is configured to determine an inventory question template that matches the question template based on the obtained similarity, and determine the answer information corresponding to the inventory question template as the answer information of the question text.

[0109] In this embodiment, a question text is obtained and parsed to obtain text entity information. The text entity information includes each entity in the question text, the entity type of each entity, and the entity relationship between each entity, which can reflect the structure and semantics of the question text to a certain extent; an initial template matching the text entity information is selected, and the initial template is filled in according to the text entity information to obtain a first question template. The first question template can carry the information in the text entity information and simplify the question text; the first question template is transformed to obtain multiple second question templates. The second question templates are semantically similar to the first question template but have different textual expressions, so as to cover all semantic expressions of the first question template as much as possible; the similarity between the question template and each inventory question template in the question and answer library is calculated. The question template includes the first question template and the multiple second question templates. Template-based retrieval can reduce the amount of calculation and improve the speed of information retrieval; the inventory question template matching the question template is determined based on the similarity, and the answer information corresponding to the inventory question template is determined as the answer information of the question text, thereby completing the information retrieval; the present application uses the template to carry the key information of the question text and obtains all semantic expressions of the key information as much as possible, thereby improving the speed of information retrieval while also improving the accuracy of information retrieval.

[0110] In some optional implementations of this embodiment, the information retrieval device 300 may further include: a search judgment module and a prompt return module, wherein:

[0111] The search judgment module is used to judge whether the question text meets the preset search conditions based on the text entity information.

[0112] The template selection module 303 is further configured to select an initial template that matches the text entity information when the question text meets the search conditions, and fill the initial template according to the text entity information to obtain a first question template.

[0113] The prompt return module is used to return search prompt information to the search terminal when the question text does not meet the search conditions.

[0114] In this embodiment, it is determined whether the question text meets the preset search conditions based on the text entity information; when it meets the conditions, an initial template matching the text entity information is selected, and the initial template is filled in according to the text entity information to obtain a first question template for information retrieval; when the question text does not meet the search conditions, a search prompt message is returned to the search terminal to remind the user to re-enter the question text, thereby achieving the limitation of the search content.

[0115] In some optional implementations of this embodiment, the template transformation module 304 may include: a transformation determination submodule, a query submodule, and an entity reorganization submodule, wherein:

[0116] The transformation determination submodule is used to determine the transformable entities in the first question template.

[0117] The query submodule is used to query synonyms and / or near synonyms of the transformable entity based on a preset vocabulary.

[0118] The entity reorganization submodule is used to arrange and reorganize the entities in the first question template based on the queried synonyms and / or near-synonyms to obtain multiple second question templates.

[0119] In this embodiment, the transformable entity in the first question template is determined, the synonyms and / or near synonyms of the transformable entity are queried according to a preset vocabulary, and the entities in the first question template are arranged and reorganized based on the queried synonyms and / or near synonyms to obtain multiple second question templates, thereby obtaining other semantic expressions that are the same or similar to the first question template, so that more information can be covered during retrieval, thereby improving the accuracy of information retrieval.

[0120] In some optional implementations of this embodiment, the similarity calculation module 305 may include: a template selection submodule, a template conversion submodule, and a similarity calculation submodule, wherein:

[0121] The template selection submodule is used to select an inventory question template that matches the question template in the question and answer library.

[0122] The template conversion submodule is used to convert each question template into a question template vector, and convert each inventory question template into an inventory template vector.

[0123] The similarity calculation submodule is used to calculate the cosine similarity between the question template vector and each inventory template vector, and use each cosine similarity as the similarity between the question template and each inventory question template.

[0124] In this embodiment, an inventory question template that matches the question template is selected from the question-and-answer database, thereby ensuring the accuracy of information retrieval, narrowing the scope of the inventory question template, and reducing the amount of computation. The question template is converted into a question template vector, and the inventory question template is converted into an inventory template vector. The cosine similarity between the question template vector and the inventory template vector is used as the similarity between the question template and the inventory question template, thereby ensuring that the similarity between the question template and the inventory question template can be accurately evaluated.

[0125] In some optional implementations of this embodiment, the template selection submodule may include: a type acquisition unit and a template selection unit, wherein:

[0126] The type acquisition unit is used to acquire a template type identifier of the question template, where the template type identifier is determined based on text entity information corresponding to the question template.

[0127] The template selection unit is used to select an inventory question template that matches the template type identifier in a preset question and answer library.

[0128] In this embodiment, the template type identifier of the question template is obtained. The template type identifier is determined based on the text entity information corresponding to the question template and can uniquely identify the format of the question template. In the preset question and answer library, the inventory question template that matches the template type identifier is selected. The selected inventory question template is similar to the question template type, ensuring the accuracy of information retrieval.

[0129] In some optional implementations of this embodiment, the answer determination module 306 may include: a descending order submodule, a selection submodule, and a template determination submodule, wherein:

[0130] The descending arrangement submodule is used to arrange the calculated similarities in descending order to obtain a similarity sequence.

[0131] The selection submodule is used to select a preset number of similarities from the similarity sequence.

[0132] The template determination submodule is used to determine whether the inventory problem template associated with the selected similarity matches the problem template when the selected similarity is greater than or equal to a preset similarity threshold.

[0133] In this embodiment, the similarities are arranged in descending order, and a preset number of similarities are selected. The largest number of similarities can be selected from the similarities. If there is a similarity greater than a similarity threshold, it indicates that the inventory problem template associated with the similarity is semantically similar to the problem template, and thus a matching inventory problem template is selected.

[0134] In some other optional implementations of this embodiment, the answer determination module 306 may further include: a question acquisition submodule, a request generation submodule, a request sending submodule, and an answer determination submodule, wherein:

[0135] The question acquisition submodule is used to acquire the inventory question corresponding to the inventory question template associated with the selected similarity when all the selected similarities are less than a preset similarity threshold.

[0136] The request generation submodule is used to generate a problem confirmation request based on each inventory problem.

[0137] The request sending submodule is used to send the question confirmation request to the retrieval terminal.

[0138] The answer determination submodule is used to extract the inventory question from the question confirmation information when receiving the question confirmation information returned by the search terminal in response to the question confirmation request, and determine the answer information corresponding to the inventory question as the answer information of the question text.

[0139] In this embodiment, when the selected similarities are all less than a preset similarity threshold, it indicates that the inventory question template and the question template have a poor match, and the inventory question corresponding to the inventory question template associated with the selected similarity is obtained. A question confirmation request is generated based on each inventory question and sent to the search terminal so that the user can confirm whether there is the question to be retrieved in the inventory question; when the question confirmation information returned in response to the question confirmation request is received, the inventory question in the question confirmation information is extracted, and the answer information corresponding to the inventory question is determined as the answer information of the question text. The generation of the answer information is selected by the user, ensuring the accuracy of the returned answer information.

[0140] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.

[0141] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits (ASICs), programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0142] The computer device may be a desktop computer, notebook computer, PDA, cloud server, etc. The computer device may interact with the user via a keyboard, mouse, remote control, touchpad, or voice control device.

[0143] The memory 41 includes at least one type of readable storage medium, including flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic storage, a magnetic disk, an optical disk, etc. In some embodiments, the memory 41 may be an internal storage unit of the computer device 4, such as the hard disk or memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk equipped on the computer device 4, a smart media card (SMC), a secure digital (SD) card, a flash memory card, etc. Of course, the memory 41 may also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of the information retrieval method. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.

[0144] In some embodiments, the processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to execute computer-readable instructions stored in the memory 41 or process data, such as computer-readable instructions for executing the information retrieval method.

[0145] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.

[0146] The computer device provided in this embodiment can execute the above-mentioned information retrieval method, which can be the information retrieval method of each of the above-mentioned embodiments.

[0147] In this embodiment, a question text is obtained and parsed to obtain text entity information. The text entity information includes each entity in the question text, the entity type of each entity, and the entity relationship between each entity, which can reflect the structure and semantics of the question text to a certain extent; an initial template matching the text entity information is selected, and the initial template is filled in according to the text entity information to obtain a first question template. The first question template can carry the information in the text entity information and simplify the question text; the first question template is transformed to obtain multiple second question templates. The second question templates are semantically similar to the first question template but have different textual expressions, so as to cover all semantic expressions of the first question template as much as possible; the similarity between the question template and each inventory question template in the question and answer library is calculated. The question template includes the first question template and the multiple second question templates. Template-based retrieval can reduce the amount of calculation and improve the speed of information retrieval; the inventory question template matching the question template is determined based on the similarity, and the answer information corresponding to the inventory question template is determined as the answer information of the question text, thereby completing the information retrieval; the present application uses the template to carry the key information of the question text and obtains all semantic expressions of the key information as much as possible, thereby improving the speed of information retrieval while also improving the accuracy of information retrieval.

[0148] The present application also provides another embodiment, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the information retrieval method as described above.

[0149] In this embodiment, a question text is obtained and parsed to obtain text entity information. The text entity information includes each entity in the question text, the entity type of each entity, and the entity relationship between each entity, which can reflect the structure and semantics of the question text to a certain extent; an initial template matching the text entity information is selected, and the initial template is filled in according to the text entity information to obtain a first question template. The first question template can carry the information in the text entity information and simplify the question text; the first question template is transformed to obtain multiple second question templates. The second question templates are semantically similar to the first question template but have different textual expressions, so as to cover all semantic expressions of the first question template as much as possible; the similarity between the question template and each inventory question template in the question and answer library is calculated. The question template includes the first question template and the multiple second question templates. Template-based retrieval can reduce the amount of calculation and improve the speed of information retrieval; the inventory question template matching the question template is determined based on the similarity, and the answer information corresponding to the inventory question template is determined as the answer information of the question text, thereby completing the information retrieval; the present application uses the template to carry the key information of the question text and obtains all semantic expressions of the key information as much as possible, thereby improving the speed of information retrieval while also improving the accuracy of information retrieval.

[0150] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0151] Obviously, the embodiments described above are only some of the embodiments of the present application, rather than all of the embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application has been described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions described in the aforementioned specific embodiments, or to make equivalent replacements for some of the technical features therein. Any equivalent structure made using the contents of the present application specification and the accompanying drawings, directly or indirectly used in other related technical fields, is also within the scope of patent protection of the present application.

Claims

1. An information retrieval method, characterized in that: The steps include: Get the input question text; Parsing the question text to obtain text entity information, wherein the text entity information includes entities in the question text, entity types of the entities, and entity relationships between the entities; Selecting an initial template that matches the text entity information, and filling the initial template according to the text entity information to obtain a first question template; transforming the first question template to obtain a plurality of second question templates; Calculating similarity between the question template and each inventory question template in the question-answer database, wherein the question template includes the first question template and the plurality of second question templates; An inventory question template that matches the question template is determined based on the obtained similarity, and answer information corresponding to the inventory question template is determined as answer information of the question text.

2. The information retrieval method according to claim 1, wherein: After the step of parsing the question text to obtain text entity information, the method further includes: Determining whether the question text meets the preset search conditions based on the text entity information; When the question text meets the search condition, performing the step of selecting an initial template that matches the text entity information, and filling the initial template according to the text entity information to obtain a first question template; When the question text does not meet the search condition, search prompt information is returned to the search terminal.

3. The information retrieval method according to claim 1, wherein: The step of transforming the first question template to obtain a plurality of second question templates includes: determining a transformable entity in the first question template; Searching for synonyms and / or near synonyms of the transformable entity according to a preset vocabulary; Based on the retrieved synonyms and / or near-synonyms, the entities in the first question template are arranged and reorganized to obtain a plurality of second question templates.

4. The information retrieval method according to claim 1, wherein: The step of calculating the similarity between the question template and each inventory question template in the question-answer database includes: Select an inventory question template that matches the question template in the question and answer library; For each question template, convert the question template into a question template vector, and convert each inventory question template into an inventory template vector respectively; The cosine similarities between the question template vector and each inventory template vector are calculated respectively, and each cosine similarity is used as the similarity between the question template and each inventory question template.

5. The information retrieval method according to claim 4, characterized in that: The step of selecting an inventory question template that matches the question template from the question-answer database includes: Obtaining a template type identifier of the question template, where the template type identifier is determined based on text entity information corresponding to the question template; In the preset question and answer library, an inventory question template that matches the template type identifier is selected.

6. The information retrieval method according to claim 1, wherein: The step of determining an inventory question template that matches the question template based on the obtained similarity comprises: Arrange the calculated similarities in descending order to obtain a similarity sequence; Selecting a preset number of similarities from the similarity sequence; When the selected similarity is greater than or equal to a preset similarity threshold, it is determined that the inventory problem template associated with the selected similarity matches the problem template.

7. The information retrieval method according to claim 6, characterized in that: After the step of selecting a preset number of similarities from the similarity sequence, the method further includes: When the selected similarities are all less than a preset similarity threshold, the inventory problem corresponding to the inventory problem template associated with the selected similarity is obtained; Generate issue confirmation requests based on each inventory issue; Sending the question confirmation request to the retrieval terminal; When the question confirmation information returned by the search terminal in response to the question confirmation request is received, the inventory question in the question confirmation information is extracted, and the answer information corresponding to the inventory question is determined as the answer information of the question text.

8. An information retrieval device, characterized in that: include: Question acquisition module, used to obtain the input question text; A question parsing module, configured to parse the question text to obtain text entity information, wherein the text entity information includes entities in the question text, entity types of the entities, and entity relationships between the entities; A template selection module, configured to select an initial template that matches the text entity information, and fill the initial template with the text entity information to obtain a first question template; a template transformation module, configured to transform the first question template to obtain a plurality of second question templates; a similarity calculation module, configured to calculate the similarity between the question template and each inventory question template in the question-answer library, wherein the question template includes the first question template and the plurality of second question templates; The answer determination module is used to determine an inventory question template that matches the question template according to the obtained similarity, and determine the answer information corresponding to the inventory question template as the answer information of the question text.

9. A computer device comprising a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the information retrieval method according to any one of claims 1 to 7 when executing the computer-readable instructions.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the information retrieval method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Question and answer method and device based on product use manual and computing equipment

    CN110532362A

  • Methods and systems for natural language processing of graph database queries

    US20220414228A1