Question and answer method and device based on large model and knowledge base
Through the question and answer method based on large models and knowledge bases, the problem of insufficient efficiency and professionalism of grid workers in answering questions in the smart city grassroots governance scenario is solved, the efficient operation of the intelligent question and answer system is realized, and residents' service satisfaction is improved.
Patent Information
- Application Number
- CN202410792667.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-09-24
AI Technical Summary
In the grassroots governance scenario of smart cities, due to limited energy and high job mobility, it is difficult for grid operators or government staff to answer the masses' questions in a timely and professional manner. Traditional artificial intelligence cannot understand natural language, resulting in 'unanswered questions' and 'poor answers'. Understanding people's problem.
Using a question and answer method based on large models and knowledge bases, through the knowledge base building module and intelligent question and answer module, knowledge documents are collected and configured, semantic word segmentation and feature word extraction are performed, and target answers are provided based on the user location and feature word matching rule files, combined with Deep learning and vector library construction realize intelligent question and answer.
It improves the accuracy and efficiency of question and answer, reduces the workload of grid operators, saves costs, improves resident service satisfaction, and ensures timely and professional answers to questions.
Smart Images

Figure CN118689984A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine learning, and specifically provides a question-answering method and device based on a large model and a knowledge base. Background Art
[0002] In the grassroots governance scenario of smart cities, when grassroots people consult grid workers or staff about issues, due to the large number of questions from the masses and the limited energy of grid workers or government staff, they will not be able to answer the masses' questions in a timely manner.
[0003] Due to the high job mobility of grid workers, some grid workers are not familiar with the rules and are unprofessional or unable to answer questions from the public. In the process of solving such problems, traditional artificial intelligence cannot understand natural language, so it may give irrelevant answers or be unsympathetic. Summary of the invention
[0004] The present invention aims at solving the above-mentioned deficiencies of the prior art and provides a highly practical question-answering method based on a large model and a knowledge base.
[0005] A further technical task of the present invention is to provide a question-answering device based on a large model and a knowledge base that is reasonably designed, safe and applicable.
[0006] The technical solution adopted by the present invention to solve its technical problem is:
[0007] A question-answering method based on a large model and a knowledge base, comprising a knowledge base building module and an intelligent question-answering module;
[0008] The knowledge base construction module has the following operation steps:
[0009] (1-1) Collect knowledge documents;
[0010] (1-2) Upload the knowledge file, complete the knowledge file configuration, and match the knowledge file to the file type and business type according to the actual situation;
[0011] (1-3) Configure the knowledge base according to actual conditions;
[0012] (1-4) Complete the construction of vector library based on knowledge base;
[0013] The intelligent question-answering module has the following operating steps:
[0014] (2-1) Obtain question text;
[0015] (2-2) Obtain user location;
[0016] (2-3) Perform semantic segmentation on the question text to obtain characteristic words of the question text;
[0017] (2-4) Determine the administrative region to which the user belongs based on the user's location;
[0018] (2-5) According to the feature words, the matching rule file in the knowledge base;
[0019] (2-6) Provide the user with the target answer corresponding to the target question.
[0020] Furthermore, in step (1-1), before collecting knowledge documents, it is necessary to analyze the business according to the city where the project is located, determine the document type and business type of the specific policy, and analyze the dictionary value according to the specific business.
[0021] Furthermore, in step (1-3), if there is a one-region-one-government rule, the special rule is configured to the one-region-one-government administrative division and configured as a high priority;
[0022] When it does not belong to the general rule of one place, one government, it is configured to the highest-level node of the administrative division and configured as a general rule. The high priority is higher than the general priority.
[0023] Furthermore, in step (1-4), based on the self-developed vector cutting algorithm, the knowledge base file is vector segmented to complete the construction of the vector library based on the knowledge base.
[0024] Furthermore, in step (2-1), before obtaining the question text, it also includes: obtaining question voice and converting the question voice into question text, obtaining question pictures and converting the question pictures into question text, obtaining question videos and converting the question videos into question text.
[0025] Furthermore, in step (2-2), before obtaining the administrative region to which the user belongs, the following is further included:
[0026] Get the user's address location, get the user's grid through the geographic location, get the user's administrative area through the grid, and determine whether the administrative area has a special situation of "one place, one policy". If it is determined that there is a special rule of "one place, one policy", retrieve the knowledge files of all special rules in the knowledge base as the target file. If there is no special situation of "one place, one policy", jump directly to step (2-4).
[0027] Furthermore, in step (2-3), historical vocabulary text is trained by deep learning methods to obtain a language statistical model for determining the probability of word-to-word combination; semantic word segmentation is performed on the question text according to the language statistical model and the domain dictionary to obtain characteristic words in the question text, and the domain dictionary includes a general dictionary and a professional dictionary, and the professional dictionary includes domain professional words.
[0028] Furthermore, in step (2-4), the administrative division to which the user belongs is determined based on the user's location, and based on the administrative division, it is determined whether there is a special rule of "one place, one policy" in the knowledge base.
[0029] Furthermore, in step (2-5), based on the feature words and the matching rule file in the knowledge base, the question with the highest similarity to the feature words is retrieved in the question-answering knowledge base as the target question, and the stored questions and the answers corresponding to the questions are retrieved in the question-answering knowledge base.
[0030] Furthermore, in step (2-5), specifically: the feature words are compared with questions in the question-answering knowledge base, and the question with the highest overlap with the feature words is determined according to the comparison result as the target question with the highest similarity to the feature words.
[0031] A question-answering device based on a large model and a knowledge base, comprising: at least one memory and at least one processor;
[0032] The at least one memory is used to store a machine-readable program;
[0033] The at least one processor is used to call the machine-readable program to execute a question-answering method based on a large model and a knowledge base.
[0034] Compared with the prior art, the question-answering method and device based on a large model and a knowledge base of the present invention have the following outstanding beneficial effects:
[0035] The present invention first obtains question text, then performs semantic segmentation on the question text to obtain feature words in the question text, and then searches for the target question with the highest similarity to the feature words in a preset question-and-answer knowledge base based on the feature words, and finally feeds back the target answer corresponding to the target question to the user. In this way, the question-and-answer knowledge is associated with the question and answer and stored in the question-and-answer knowledge base, and artificial intelligence technology is used to replace or assist customer service in solving problems raised by users, reducing grids and investments in grassroots governance application scenarios, releasing the workload of grid workers, saving costs and improving residents' service satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] Attached Figure 1 It is a flowchart of a question-answering method based on a large model and knowledge base. DETAILED DESCRIPTION
[0038] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0039] A best embodiment is given below:
[0040] like Figure 1 As shown, a question-answering method based on a large model and a knowledge base in this embodiment includes a knowledge base construction module and an intelligent question-answering module;
[0041] The knowledge base construction module has the following steps:
[0042] (1-1) Collect knowledge documents;
[0043] Document types include: laws and regulations, rule documents, administrative documents, service guides, question and answer sessions, meeting documents, statistical data, research reports, and historical archives; business types include: education services, medical care, social security, elderly care services, employment services, housing-related, transportation, urban management, and environmental protection, etc.
[0044] Before collecting knowledge files, you need to analyze the business according to the city where the project is located. Determine the file type and business type of the specific rules, and analyze the dictionary value according to the specific business.
[0045] (1-2) Upload the knowledge file, complete the knowledge file configuration, and match the knowledge file to the file type and business type according to the actual situation;
[0046] (1-3) Configure the knowledge base according to actual conditions;
[0047] The knowledge base configuration of "one place, one policy" is based on the actual situation. If there is a "one place, one policy" rule, the special rule will be configured to the administrative division to which it belongs, and configured as a high priority; the general policy that does not belong to "one place, one policy" will be configured to the highest-level node of the administrative division and configured as a general priority. The high priority is higher than the general priority.
[0048] In order to improve the accuracy of the model in answering the public's questions under the special circumstances of "one place, one policy", it is necessary to identify the special rules of "one place, one policy", and associate the special rules with the administrative divisions to which they belong. For residents in the administrative divisions with special rules of "one place, one policy", the question retrieval and answer generation should be completed based on the special rules first. For residents in the administrative divisions without special rules, the question retrieval and answer generation should be completed based on the general rules.
[0049] (1-4) Complete the construction of vector library based on knowledge base;
[0050] Based on the self-developed vector cutting algorithm, the knowledge base files are vector segmented to complete the construction of the vector library based on the knowledge base.
[0051] The intelligent question-answering module has the following steps:
[0052] (2-1) Obtain question text;
[0053] Before obtaining the question text, it also includes: obtaining the question voice and converting the question voice into question text, obtaining the question picture and converting the question picture into question text, obtaining the question video and converting the question video into question text.
[0054] (2-2) Obtain user location;
[0055] Before obtaining the administrative area to which the user belongs, it also includes:
[0056] Get the user's address location, get the user's grid through the geographic location, get the user's administrative area through the grid, and determine whether the administrative area has a special rule of one place, one policy. If it is determined that there is a special rule of one place, one policy, retrieve the knowledge files of all special rules in the knowledge base as the target file. If there is no special rule of one place, one policy, jump directly to step (2-5).
[0057] (2-3) Perform semantic segmentation on the question text to obtain characteristic words of the question text;
[0058] Through deep learning methods, historical vocabulary texts are trained to obtain a language statistical model for determining the probability of word-to-word combination. The question text is semantically segmented based on the language statistical model and the domain dictionary to obtain the characteristic words in the question text. The domain dictionary includes general dictionaries and professional dictionaries, and the professional dictionary includes domain professional words.
[0059] (2-4) Determine the administrative region to which the user belongs based on the user's location;
[0060] According to the user's location, determine the administrative division to which it belongs, and according to the administrative division, determine whether there is a special rule of "one place, one policy" in the knowledge base;
[0061] If there is a special rule of one place, one policy under the administrative region to which the user belongs, all knowledge files in the knowledge base that meet the special rule of the administrative region are matched as target files for question retrieval. If not, jump directly to step (2-5).
[0062] (2-5) According to the feature words, the matching rule file in the knowledge base;
[0063] According to the feature words and the matching policy documents in the knowledge base, the question with the highest similarity to the feature words is retrieved in the question-answering knowledge base as the target question, and the stored questions and the answers corresponding to the questions are retrieved in the question-answering knowledge base.
[0064] Specifically, the feature words are compared with the questions in the question-answering knowledge base, and the question with the highest overlap with the feature words is determined according to the comparison results as the target question with the highest similarity to the feature words.
[0065] (2-6) Provide the user with the target answer corresponding to the target question.
[0066] Based on the above method, a question-answering device based on a large model and a knowledge base in this embodiment includes: at least one memory and at least one processor;
[0067] The at least one memory is used to store a machine-readable program;
[0068] The at least one processor is used to call the machine-readable program to execute a question-answering method based on a large model and a knowledge base.
[0069] The above-mentioned specific implementations are only specific cases of the present invention. The patent protection scope of the present invention includes but is not limited to the above-mentioned specific implementations. Any technical solutions that comply with the claims of the present invention and any appropriate changes or substitutions made by ordinary technicians in the relevant technical field shall fall within the patent protection scope of the present invention.
[0070] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A question-answering method based on a large model and a knowledge base, characterized in that: Includes knowledge base building module and intelligent question-answering module; The knowledge base construction module has the following operation steps: (1-1) Collect knowledge documents; (1-2) Upload the knowledge file, complete the knowledge file configuration, and match the knowledge file to the file type and business type according to the actual situation; (1-3) Configure the knowledge base according to actual conditions; (1-4) Complete the construction of vector library based on knowledge base; The intelligent question-answering module has the following operating steps: (2-1) Obtain question text; (2-2) Obtain user location; (2-3) Perform semantic segmentation on the question text to obtain characteristic words of the question text; (2-4) Determine the administrative region to which the user belongs based on the user's location; (2-5) According to the feature words, the matching rule file in the knowledge base; (2-6) Provide the user with the target answer corresponding to the target question.
2. A question-answering method based on a large model and a knowledge base according to claim 1, characterized in that: In step (1-1), before collecting knowledge files, it is necessary to analyze the business according to the city where the project is located, determine the file type and business type of the specific policy, and analyze the dictionary value according to the specific business.
3. A question-answering method based on a large model and a knowledge base according to claim 2, characterized in that: In step (1-3), if there is a one-region-one-government rule, configure the special rule to the one-region-one-government administrative division and configure it as a high priority; When it does not belong to the general rule of one place, one government, it is configured to the highest-level node of the administrative division and configured as a general rule. The high priority is higher than the general priority.
4. A question-answering method based on a large model and a knowledge base according to claim 3, characterized in that: In step (1-4), based on the self-developed vector cutting algorithm, the knowledge base file is vector segmented to complete the construction of the vector library based on the knowledge base.
5. A question-answering method based on a large model and a knowledge base according to claim 4, characterized in that: In step (2-1), before obtaining the question text, it also includes: obtaining the question voice and converting the question voice into question text, obtaining the question picture and converting the question picture into question text, obtaining the question video and converting the question video into question text.
6. A question-answering method based on a large model and a knowledge base according to claim 5, characterized in that: In step (2-2), before obtaining the administrative region to which the user belongs, it also includes: Get the user's address location, get the user's grid through the geographic location, get the user's administrative area through the grid, and determine whether the administrative area has a special situation of "one place, one policy". If it is determined that there is a special rule of "one place, one policy", retrieve the knowledge files of all special rules in the knowledge base as the target file. If there is no special situation of "one place, one policy", jump directly to step (2-4).
7. A question-answering method based on a large model and a knowledge base according to claim 6, characterized in that: In step (2-3), historical vocabulary text is trained by deep learning method to obtain a language statistical model for determining the probability of word-to-word combination; semantic word segmentation is performed on the question text according to the language statistical model and the domain dictionary to obtain characteristic words in the question text, and the domain dictionary includes a general dictionary and a professional dictionary, and the professional dictionary includes domain professional words.
8. A question-answering method based on a large model and a knowledge base according to claim 7, characterized in that: In step (2-4), the administrative division to which the user belongs is determined based on the user's location, and based on the administrative division, it is determined whether there is a special rule of "one place, one policy" in the knowledge base.
9. A question-answering method based on a large model and a knowledge base according to claim 8, characterized in that: In step (2-5), based on the feature words and the matching rule file in the knowledge base, the question with the highest similarity to the feature words is retrieved in the question-answering knowledge base as the target question, and the stored question and the answer corresponding to the question are retrieved in the question-answering knowledge base; Specifically, the feature words are compared with the questions in the question-answering knowledge base, and the question with the highest overlap with the feature words is determined according to the comparison results as the target question with the highest similarity to the feature words.
10. A question-answering device based on a large model and a knowledge base, characterized in that: include: at least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is configured to call the machine-readable program to execute the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Intelligent question and answer system and method based on knowledge base
CN109977204A
Travel guidance generation method and device, equipment and storage medium
CN115238945A
Government affair question and answer service-based atlas construction method
CN117807250A
Knowledge base question and answer construction method and device based on large model
CN118035405A
Chat response method, electronic device and storage medium
WO2019153613A1
