Intelligent question answering method and system based on keyword dictionary index table and optimal sequence graph method

By adopting the method based on keyword dictionary index table and superior sequence diagram method in the intelligent question and answer system, the problems of irrelevant or inunique answers, low retrieval efficiency and high training cost in the existing intelligent question and answer system are solved, and fast and accurate answer acquisition and low maintenance costs are achieved.

CN119848072AActive Publication Date: 2025-04-18YANGTZE OPTICAL FIBRE & CABLE CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411963476.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-18
Estimated Expiration
2044-12-30

AI Technical Summary

Technical Problem

The existing intelligent question and answer system has problems such as irrelevant or inunique answers, low retrieval efficiency, and high training cost.

Method used

The intelligent question-and-answer method is adopted based on the keyword dictionary index table and the superior order graph method. User questions are formatted through regular expressions, match the keyword dictionary index table, obtain the index ID in the knowledge base reply table, calculate the multi-dimensional index value, and calculate the weight value of each alternative answer using the superior order graph method, and finally output the answer with the largest weight value.

Benefits of technology

It achieves rapid and accurate acquisition of relevant answers, solves the problems of irrelevant or inunique answers, reduces the problems of low retrieval efficiency and high training costs, and has a simple architecture and a low maintenance cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119848072A_ABST
    Figure CN119848072A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of natural language processing, and particularly discloses an intelligent question answering method and system based on a keyword dictionary index table and an optimal sequence graph method. Through the pre-established keyword dictionary index table, whether the keyword matched with the problem character string exists in the pre-established keyword dictionary index table or not is quickly and visually judged, and the technical problems that the efficiency is very low and the retrieval speed is low due to the fact that the keyword cannot be used in fuzzy search are solved; the weights of multiple dimensions are comprehensively calculated by using an optimal sequence diagram calculation method in the weights, and the unique optimal solution of the answer is obtained from the weights, so that the technical problems that the cost is increased due to the fact that a matching mechanism based on a machine learning model needs a large number of parameter adjustment and a training process, and answer results obtained every time are different can be solved; through combination of the two methods, the problem that a plurality of answers irrelevant to expectation appear once content involved in a knowledge base is complex and keywords are repeated in an existing rule-based retrieval mechanism can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of natural language processing technology, and more specifically, to an intelligent question-answering method and system based on a keyword dictionary index table and a priority graph method. Background Art

[0002] How to meet the internal business and production of enterprises for consulting services such as enterprise regulations and processes, product information, and operating specifications has become the focus of the demand for intelligent customer service robots. Enterprises need intelligent customer service robot Q&A solutions with high efficiency, low maintenance costs, and stable responses.

[0003] Existing intelligent customer service robot question-and-answer solutions mainly include the following two types: the first is a rule-based retrieval mechanism (such as keyword fuzzy retrieval, dialogue management, question-and-answer matching technology, etc.), which matches user questions through preset keywords and answer templates and provides corresponding answers; the second is a matching mechanism based on machine learning models (such as recurrent neural networks (RNNs), long short-term memory networks (LSTMs), etc.), that is, through machine learning algorithms, customer service robots can learn from a large amount of dialogue data and continuously optimize their question-and-answer capabilities.

[0004] However, both of the above methods have some defects that cannot be ignored: First, the rule-based retrieval mechanism only queries the knowledge base based on simple retrieval rules. Once the content involved in the knowledge base is complex and the keywords are repeated, multiple answers that are irrelevant to the expectations will appear, and keyword fuzzy search cannot use indexes, resulting in low efficiency and slow retrieval speed; Second, the matching mechanism based on machine learning models seems to be able to give users a more natural human-computer interaction experience, but the model tuning and training process requires graphics card resources, which is very costly, and the answers to the same question are often different, so it cannot meet the company's requirements for standardized and standardized results. Summary of the invention

[0005] In view of the defects of the prior art, the purpose of this application is to provide an intelligent question and answer method and system based on a keyword dictionary index table and a priority graph method, aiming to solve the problems of irrelevant or non-unique answers, low retrieval efficiency and high training cost in the existing intelligent question and answer.

[0006] The first aspect of the present application relates to an intelligent question-answering method based on a keyword dictionary index table and a priority diagram method, the intelligent question-answering method comprising: Step 1: Use regular expressions to format the character string in the question input by the user to obtain several formatted character strings; Step 2: Match all formatted strings with the keyword dictionary index table. If there are matching keywords, get all matching keywords and go to step 3. Otherwise, inform the user that there is no corresponding answer or ask the user to ask again, and end this question and answer session. Step 3: According to the index ID in the knowledge base reply table corresponding to the matched keyword, obtain the corresponding knowledge information in the knowledge base reply table as an alternative answer; Step 4: If the user's security level reaches the security level of the acquired knowledge information, proceed to step 5; otherwise, inform the user that the level is not high enough and the corresponding answer cannot be obtained, or ask the user to ask the question again, and end the Q&A session; Step 5: Calculate the index values ​​of different dimensions of knowledge information corresponding to each knowledge base index ID; Step 6: Using the indicator values ​​of each dimension of knowledge information, the priority diagram method is used to calculate the weight value of each alternative answer; Step 7: Output the alternative answer with the largest weight value as the final answer.

[0007] In some implementations, the keyword dictionary index table is a full keyword dictionary, including: a keyword, an index ID of the keyword in the knowledge base reply table, and a creation time of the keyword.

[0008] In some implementations, the keyword matching adopts a direct comparison method.

[0009] In some implementations, the different dimensional indicators include time distance, importance, user relevance, and question-answer relevance.

[0010] In some implementations, the time distance index value is calculated as follows: For each piece of knowledge information obtained in step 3, obtain the corresponding creation time from the knowledge base reply table and calculate the number of days from the creation time to the current time. As the number of days for this knowledge information; Sum the days corresponding to all the knowledge information obtained in step 3 to get the total number of days ; Calculate the time distance index value corresponding to each piece of knowledge information .

[0011] In some implementations, the importance index value is calculated as follows: For each piece of knowledge information obtained in step 3, obtain the corresponding importance value from the knowledge base response table ; Sum the importance values ​​corresponding to all the knowledge information obtained in step 3 to get the total importance value ; Calculate the importance index value corresponding to each piece of knowledge information .

[0012] In some implementations, the calculation process of the user relevance index value is as follows: For each piece of knowledge information obtained in step 3, obtain the corresponding department type from the knowledge base reply table; determine whether the user's department matches the department type, and if so, set the user relevance index value corresponding to the knowledge information is 1, otherwise, set the user relevance index value corresponding to the knowledge information is 0.

[0013] In some implementations, the question-answer relevance index value is calculated as follows: For each piece of knowledge information obtained in step 3, count the number of occurrences of the knowledge information ; Calculate the question response relevance index value corresponding to each knowledge information ,in, Represents the total number of occurrences of all knowledge information corresponding to all knowledge base index IDs.

[0014] The second aspect of the present application relates to an intelligent question and answer system based on a keyword dictionary index table and a priority diagram method, comprising: at least one memory for storing programs; at least one processor for entering the program stored in the memory, and when the program stored in the memory is entered, the processor is used to enter the intelligent question and answer method as described in any embodiment of the present application.

[0015] A third aspect of the present application relates to a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor enters the intelligent question-answering method as described in any embodiment of the present application.

[0016] It can be understood that the beneficial effects of the second to third aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.

[0017] In general, the above technical solutions conceived by this application have the following beneficial effects compared with the prior art: The present application proposes an intelligent question-answering method based on a keyword dictionary index table and a priority graph method. Through a pre-established keyword dictionary index table, it is quickly and intuitively determined whether there are keywords matching the question string in the pre-established keyword dictionary index table, which solves the technical problem that fuzzy search cannot use keywords, resulting in low efficiency and slow retrieval speed; the priority graph calculation method in the weight is used to comprehensively calculate the weights of multiple dimensions, and the only optimal solution for the answer is obtained from it, so that the matching mechanism based on the machine learning model requires a large amount of parameter adjustment and training process to increase the cost, and the technical problem that the answer results obtained each time are different; the combination of the two can solve the problem that once the content involved in the knowledge base is complex and the keywords are repeated, multiple answers that are not related to expectations will appear in the existing rule-based retrieval mechanism. The architecture of the present application adopts a relational database combined with natural language recognition, and the implementation method is simple, easy to maintain, and has low maintenance cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 It is a flow chart of an intelligent question-answering method based on a keyword dictionary index table and a priority diagram method provided in an embodiment of the present application.

[0019] Figure 2 It is a schematic diagram of a keyword dictionary index table provided in an embodiment of the present application.

[0020] Figure 3 It is a schematic diagram of the knowledge base information table provided in the embodiment of the present application.

[0021] Figure 4 It is a schematic diagram of the sorted priority chart provided in the embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0023] The term "and / or" in this article is a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The symbol " / " in this article indicates that the associated objects are in an or relationship, for example, A / B means A or B.

[0024] The terms "first" and "second" in the specification and claims herein are used to distinguish different objects rather than to describe a specific order of the objects. For example, a first response message and a second response message are used to distinguish different response messages rather than to describe a specific order of the response messages.

[0025] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0026] In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more than two. For example, multiple processing units refer to two or more processing units, etc.; multiple elements refer to two or more elements, etc.

[0027] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application.

[0028] like Figure 1 As shown, the present application discloses an intelligent question-answering method based on a keyword dictionary index table and a priority graph method, and the intelligent question-answering method includes: Step 1: Use regular expressions to format the character string in the question input by the user to obtain several formatted character strings.

[0029] The user may input the question in the form of text or voice, and the character string in the question input by the user is such as "Which optical fiber has ultra-low scattering and low nonlinear coefficient?".

[0030] At the same time, the user's identity information is obtained, including: user ID, name, position, department, employee status (such as employed, resigned) and security level. For guest users, the system generates default identity information for them and controls the security level to the lowest.

[0031] The present application uses regular expressions to format a string, and the formatting includes: 1) unifying the case of Latin in the string; 2) preparing a stop word list in advance, and then removing the stop words in the list when processing the text. The stop word list may include stop words and punctuation marks. For example, the stop words are "hello", "yes", etc., and the punctuation marks are "!", "¥", etc.; 3) combining multiple words involving professional terms in the string into professional terms, such as combining "dispersion" and "optical fiber" into "dispersion optical fiber", thereby obtaining a preprocessed string.

[0032] Step 2: Match all formatted strings with the keyword dictionary index table. If there are matching keywords, get all matching keywords and go to step 3. Otherwise, inform the user that there is no corresponding answer or ask the user to ask the question again, and end this question and answer session.

[0033] In some implementations, the keyword dictionary index table is a full keyword dictionary. The keyword dictionary index table is pre-established, such as Figure 2 As shown, it includes: keywords, the index ID of the keyword in the knowledge base reply table and the creation time of the keyword.

[0034] In some implementations, the keyword matching adopts a direct comparison method.

[0035] For example, the formatted string is "bend-resistant optical fiber". Since the present application uses a keyword dictionary established by a full search method, which stores the keywords "bend-resistant", "optical fiber", and "bend-resistant optical fiber", a direct comparison is used to directly match the last keyword "bend-resistant optical fiber".

[0036] Step 3: According to the index ID in the knowledge base response table corresponding to the matched keyword, obtain the corresponding knowledge information in the knowledge base response table as an alternative answer.

[0037] The knowledge base reply table is pre-established, such as Figure 3 As shown, it includes the knowledge base index ID, the corresponding knowledge information, the security level of the knowledge information (for example, from 1 to 5, where 5 has the highest security level), the importance value of the knowledge information, the department type involved in the knowledge information (such as production, sales, human resources, etc.), and the creation time of the knowledge information.

[0038] According to each knowledge base index ID, the corresponding knowledge information is obtained in the knowledge base reply table, and the number of occurrences of each repeated reply data in the retrieved knowledge base reply table is counted.

[0039] Step 4: If the user's security level reaches the acquired knowledge information security level, proceed to step 5. Otherwise, inform the user that the level is not high enough and the corresponding answer cannot be obtained, or ask the user to ask the question again, thus ending the Q&A session.

[0040] This application pre-sets the user security level and knowledge information security level, and improves the safety factor of intelligent question and answering by matching the security levels.

[0041] Step 5: Calculate the index values ​​of different dimensions of knowledge information corresponding to each knowledge base index ID.

[0042] In some implementations, the different dimensional indicators include time distance, importance, user relevance, and question-answer relevance.

[0043] This application prefers the four dimensions of time distance, importance, user relevance, and question-answer relevance. Among them, the time distance dimension corresponds to the timeliness of the queried knowledge information; user relevance and importance jointly correspond to the practicality of the queried knowledge information; question-answer relevance corresponds to the consistency and accuracy of the queried knowledge information. This application expands the relevant weight parameters, so that more accurate answers can be obtained by adding weight dimensions, and the scalability is strong.

[0044] In some implementations, the time distance index value is calculated as follows: For each piece of knowledge information obtained in step 3, obtain the corresponding creation time from the knowledge base reply table and calculate the number of days from the creation time to the current time. As the number of days for this knowledge information; Sum the days corresponding to all the knowledge information obtained in step 3 to get the total number of days ; Calculate the time distance index value corresponding to each piece of knowledge information .

[0045] In some implementations, the importance index value is calculated as follows: For each piece of knowledge information obtained in step 3, obtain the corresponding importance value from the knowledge base response table ; Sum the importance values ​​corresponding to all the knowledge information obtained in step 3 to get the total importance value ; Calculate the importance index value corresponding to each piece of knowledge information .

[0046] In some implementations, the calculation process of the user relevance index value is as follows: For each piece of knowledge information obtained in step 3, obtain the corresponding department type from the knowledge base reply table; determine whether the user's department matches the department type, and if so, set the user relevance index value corresponding to the knowledge information is 1, otherwise, set the user relevance index value corresponding to the knowledge information is 0.

[0047] In some implementations, the question-answer relevance index value is calculated as follows: For each piece of knowledge information obtained in step 3, count the number of occurrences of the knowledge information ; Calculate the question response relevance index value corresponding to each knowledge information ,in, Represents the total number of occurrences of all knowledge information corresponding to all knowledge base index IDs.

[0048] Step 6: Use the indicator values ​​of each dimension of knowledge information and the priority diagram method to calculate the weight value of each alternative answer.

[0049] For the For each knowledge base index ID, the time distance weight value, importance weight value, relevance weight value, and frequency weight value corresponding to the keyword are summed up and the average value is taken as the value of the first knowledge base index ID. The average value corresponding to the knowledge base index ID.

[0050] Initialize an empty weight matrix whose number of rows and columns are equal to the total number of knowledge base index IDs obtained in step 3 .

[0051] The weight matrix is ​​filled according to the average value corresponding to the knowledge base index ID to obtain the final weight matrix.

[0052] Specifically, the weight matrix Line The value of the column is the first index ID of all knowledge bases in step 3. The knowledge base index ID and The correlation between the knowledge base index IDs is The average value of the knowledge base index ID is If the difference between the average values ​​of the knowledge base index IDs is greater than 0, the association degree is set to 1; if it is equal to 0, the association degree is set to 0.5; if it is less than 0, the association degree is set to 0, where: and All belong to ,like Figure 4 shown.

[0053] Sum the values ​​of each row in the final weight matrix to obtain the summation result corresponding to the row as the weight value of the alternative answer.

[0054] Step 7: Output the alternative answer with the largest weight value as the final answer.

[0055] Get the row corresponding to the maximum value of the sum result, and determine whether the number of rows obtained is greater than 1. If so, randomly select a row from the multiple rows obtained, and obtain the knowledge base answer corresponding to the knowledge base index ID corresponding to the row as the final answer, and the process ends. Otherwise, the knowledge base answer corresponding to the knowledge base index ID corresponding to the row is taken as the final answer, and the process ends.

[0056] It can be understood that the detailed functional implementation of each of the above-mentioned units / modules can be found in the introduction of the aforementioned method embodiment, and will not be repeated here.

[0057] It should be understood that the above-mentioned device is used to execute the method in the above-mentioned embodiment. The implementation principle and technical effect of the corresponding program module in the device are similar to those described in the above-mentioned method. The working process of the device can refer to the corresponding process in the above-mentioned method, which will not be repeated here.

[0058] Based on the method in the above embodiment, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method in the above embodiment.

[0059] Based on the method in the above embodiment, an embodiment of the present application provides a computer program product. When the computer program product runs on a processor, the processor executes the method in the above embodiment.

[0060] It is understandable that the processor in the embodiment of the present application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.

[0061] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.

[0062] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

[0063] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.

[0064] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. An intelligent question-answering method based on a keyword dictionary index table and a priority diagram method, characterized in that: include: Step 1: Use regular expressions to format the character string in the question input by the user to obtain several formatted character strings; Step 2: Match all formatted strings with the keyword dictionary index table. If there are matching keywords, get all matching keywords and go to step 3. Otherwise, inform the user that there is no corresponding answer or ask the user to ask again, and end this question and answer session. Step 3: According to the index ID in the knowledge base reply table corresponding to the matched keyword, obtain the corresponding knowledge information in the knowledge base reply table as an alternative answer; Step 4: If the user's security level reaches the security level of the acquired knowledge information, proceed to step 5; otherwise, inform the user that the level is not high enough and the corresponding answer cannot be obtained, or ask the user to ask the question again, and end the Q&A session; Step 5: Calculate the index values ​​of different dimensions of knowledge information corresponding to each knowledge base index ID; Step 6: Using the indicator values ​​of each dimension of knowledge information, the priority diagram method is used to calculate the weight value of each alternative answer; Step 7: Output the alternative answer with the largest weight value as the final answer.

2. The intelligent question-answering method according to claim 1, characterized in that: The keyword dictionary index table is a full keyword dictionary, including: a keyword, an index ID of the keyword in the knowledge base reply table, and a creation time of the keyword.

3. The intelligent question-answering method according to claim 2, characterized in that: The keyword matching adopts a direct comparison method.

4. The intelligent question-answering method according to claim 1, wherein: The different dimensional indicators include time distance, importance, user relevance and question response relevance.

5. The intelligent question-answering method according to claim 4, characterized in that: The calculation process of the time distance index value is as follows: For each piece of knowledge information obtained in step 3, obtain the corresponding creation time from the knowledge base reply table and calculate the number of days from the creation time to the current time. As the number of days for this knowledge information; Sum the days corresponding to all the knowledge information obtained in step 3 to get the total number of days ; Calculate the time distance index value corresponding to each piece of knowledge information .

6. The intelligent question-answering method according to claim 4, characterized in that: The calculation process of the importance index value is as follows: For each piece of knowledge information obtained in step 3, obtain the corresponding importance value from the knowledge base response table ; Sum the importance values ​​corresponding to all the knowledge information obtained in step 3 to get the total importance value ; Calculate the importance index value corresponding to each piece of knowledge information .

7. The intelligent question-answering method according to claim 4, characterized in that: The calculation process of the user relevance index value is as follows: For each piece of knowledge information obtained in step 3, obtain the corresponding department type from the knowledge base reply table; determine whether the user's department matches the department type, and if so, set the user relevance index value corresponding to the knowledge information is 1, otherwise, set the user relevance index value corresponding to the knowledge information is 0.

8. The intelligent question-answering method according to claim 4, characterized in that: The calculation process of the question-answer relevance index value is as follows: For each piece of knowledge information obtained in step 3, count the number of occurrences of the knowledge information ; Calculate the question response relevance index value corresponding to each knowledge information ,in, Represents the total number of occurrences of all knowledge information corresponding to all knowledge base index IDs.

9. An intelligent question-answering system based on a keyword dictionary index table and a priority diagram method, characterized in that: include: at least one memory for storing a program; At least one processor is used to enter the program stored in the memory. When the program stored in the memory is entered, the processor is used to enter the intelligent question-answering method as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program runs on a processor, the processor enters the intelligent question-answering method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Vertical domain-oriented intelligent question and answer system

    CN105843897A

  • Intelligent question answering method and system based on domain knowledge graph

    CN117648984A

  • Keyword management method and system, electronic equipment and storage medium

    CN118035378A

  • Intelligent question and answer method and device, equipment and medium

    CN118364068A

  • Quasi-semantic question answering

    US10489393B1