Policy question and answer method, device and equipment based on large model and medium
Through the policy question-and-answer method based on big model, the policy problems of users are rewritten and vectorized, and combined with preset search algorithms and policy knowledge bases, the problem of inefficient handling of complex policy problems in traditional systems is solved, achieving more efficient and high-quality policy information processing.
Patent Information
- Application Number
- CN202411722410.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-11-28
AI Technical Summary
Traditional policy Q&A systems cannot effectively deal with complex and changeable policy problems, and are difficult to deal with the update and maintenance of massive policy documents, resulting in low processing efficiency and poor user experience.
The policy question-and-answer method based on the big model is adopted to obtain the user's initial policy questions, use the pre-trained big model to rewrite and vectorize the transformation, and combine the preset search algorithm and policy knowledge base to generate target policy answers.
It improves the efficiency of handling policy issues, provides more accurate and high-quality policy answers, and improves the robustness and generalization capabilities of the user experience and system.
Smart Images

Figure CN119513331A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of policy question answering technology, and in particular to a policy question answering method, device, equipment and medium based on a large model. Background Art
[0002] In recent years, the public's demand for timely and accurate policy information has been growing. Traditional policy question-and-answer systems usually rely on manually written FAQ (Frequently Asked Questions) lists or simple keyword matching algorithms. This approach has obvious limitations, such as being unable to handle complex and changing policy issues and having difficulty in updating and maintaining massive policy documents. Therefore, how to improve the efficiency of handling policy issues and enhance user experience is an urgent problem to be solved. Summary of the invention
[0003] In view of this, the purpose of the present invention is to provide a policy question-answering method, device, equipment and medium based on a large model, which can improve the processing efficiency of policy issues and enhance the user experience. The specific scheme is as follows:
[0004] First, this application provides a policy question-answering method based on a large model, including:
[0005] Acquire an initial policy question sent by a user terminal, and rewrite the format and content of the initial policy question using a first pre-trained large model to obtain a rewritten policy question;
[0006] Performing vectorization conversion on the rewritten policy problem based on semantic features and problem scenario features to obtain a vectorized policy problem;
[0007] Using a preset search algorithm to screen the policy information stored in a preset question matching database to determine whether there is a target policy answer corresponding to the vectorized policy question in the preset question matching database;
[0008] If the target policy answer corresponding to the vectorized policy question does not exist in the preset question matching database, then the associated documents corresponding to the vectorized policy question are screened from the preset policy knowledge base, and the prompt word corresponding to the vectorized policy question is determined from the preset policy prompt word library;
[0009] The associated document and the prompt word are input into a second pre-trained large model to obtain a target policy answer corresponding to the vectorized policy question.
[0010] Optionally, rewriting the format and content of the initial policy question using the first pre-trained large model to obtain a rewritten policy question includes:
[0011] Performing data preprocessing on the initial policy question based on a preset language processing technology to obtain a structured policy question;
[0012] Identifying and extracting policy information in the structured policy question by using a preset semantic parsing technology, and inputting the extracted policy information into the first pre-trained large model;
[0013] The content of the initial policy question is converted using a preset rewriting rule and the first pre-trained large model to obtain a rewritten policy question.
[0014] Optionally, the using a preset search algorithm to screen the policy information stored in the preset question matching database includes:
[0015] Using a preset search algorithm and a preset question matching database, the policy information stored in the preset question matching database is screened to obtain screened policy information;
[0016] A similarity analysis is performed between the filtered policy information and the vectorized policy question through a preset deep learning model, and a determination is made based on the corresponding similarity analysis result whether there is a target policy answer corresponding to the vectorized policy question in the preset question matching database.
[0017] Optionally, the using a preset search algorithm and a preset question matching database to screen the policy information stored in the preset question matching database to obtain screened policy information includes:
[0018] Using a preset search algorithm and a frequently asked questions and answers library, the policy question answer pairs in the frequently asked questions and answers library are screened to obtain screened policy information;
[0019] And / or, using a preset search algorithm and a class graph library, the policy features in the class graph library are screened to obtain screened policy information.
[0020] Optionally, inputting the associated document and the prompt word into a second pre-trained large model to obtain a target policy answer corresponding to the vectorized policy question includes:
[0021] Inputting the associated document and the prompt word into a second pre-trained large model to obtain an initial policy answer, and analyzing the policy type corresponding to the policy answer to obtain a document display type corresponding to the initial policy answer;
[0022] The document structure of the initial policy answer is adjusted based on the document presentation type to obtain a target policy answer corresponding to the vectorized policy question.
[0023] Optionally, inputting the associated document and the prompt word into a second pre-trained large model to obtain a target policy answer corresponding to the vectorized policy question includes:
[0024] Input the associated document and the prompt word into the second pre-trained large model to obtain an initial policy answer, and use the pre-trained security detection model or the preset rule library to check the initial policy answer to determine whether there is a preset risk word in the initial policy answer;
[0025] If there are risk words in the initial policy answer, the initial policy answer is modified based on a preset answer standard to obtain a target policy answer, and the target policy answer is sent to the user end.
[0026] Optionally, the large model-based policy question-answering method further includes:
[0027] Monitoring a preset policy information source based on a preset machine learning model to determine whether there is new policy data in the preset policy information source;
[0028] If there is new policy data, the new policy data is crawled from the preset policy information source through the preset crawler mechanism, and the policy features of the new policy data are extracted based on the preset keyword extraction technology, so as to update the preset question matching database using the policy features.
[0029] In the second aspect, the present application provides a policy question-answering device based on a large model, comprising:
[0030] A question rewriting module, used for obtaining an initial policy question sent by a user terminal, and rewriting the format and content of the initial policy question using a first pre-trained large model to obtain a rewritten policy question;
[0031] A problem conversion module, used for performing vectorization conversion on the rewritten policy problem based on semantic features and problem scenario features to obtain a vectorized policy problem;
[0032] An answer judgment module is used to screen the policy information stored in the preset question matching database using a preset search algorithm to determine whether there is a target policy answer corresponding to the vectorized policy question in the preset question matching database;
[0033] An information determination module, configured to screen the associated documents corresponding to the vectorized policy question from a preset policy knowledge base, and determine the prompt word corresponding to the vectorized policy question from a preset policy prompt word library, if the target policy answer corresponding to the vectorized policy question does not exist in the preset question matching database;
[0034] An answer generation module is used to input the associated document and the prompt word into a second pre-trained large model to obtain a target policy answer corresponding to the vectorized policy question.
[0035] In a third aspect, the present application provides an electronic device, including:
[0036] Memory, used to store computer programs;
[0037] A processor is used to execute the computer program to implement the aforementioned large model-based policy question-answering method.
[0038] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned large-model-based policy question-answering method is implemented.
[0039] In the present application, an initial policy question sent by a user terminal is first obtained, and the format and content of the initial policy question are rewritten using a first pre-trained large model to obtain a rewritten policy question; the rewritten policy question is vectorized based on semantic features and problem scenario features to obtain a vectorized policy question; the policy information stored in a preset question matching database is screened using a preset retrieval algorithm to determine whether a target policy answer corresponding to the vectorized policy question exists in the preset question matching database; if the target policy answer corresponding to the vectorized policy question does not exist in the preset question matching database, the associated documents corresponding to the vectorized policy question are screened from a preset policy knowledge base, and the prompt words corresponding to the vectorized policy question are determined from a preset policy prompt word library; the associated documents and the prompt words are input into a second pre-trained large model to obtain the target policy answer corresponding to the vectorized policy question. As can be seen from the above, this application uses a pre-trained large model to rewrite the policy questions sent by users, which can initially improve the accuracy of policy questions; by vectorizing the rewritten policy questions, the intention and background of the policy questions can be better understood, and feature information can be provided for subsequent question matching; by screening the policy information stored in the preset question matching database, it is determined whether there is a target policy answer corresponding to the vectorized policy question in the preset question matching database, and the corresponding target policy answer generation method is determined based on the judgment result to ensure the accuracy of the target policy answer. In this way, this application improves the processing efficiency of policy questions based on large models and provides better user experience and services. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] 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 only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0041] Figure 1 A flow chart of a policy question-answering method based on a large model disclosed in this application;
[0042] Figure 2 A system architecture diagram of a policy question-answering method based on a large model disclosed in this application;
[0043] Figure 3 A schematic diagram of the structure of a policy question-answering device based on a large model disclosed in this application;
[0044] Figure 4 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not 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.
[0046] In recent years, the public's demand for timely and accurate policy information has been growing. Traditional policy question-answering systems usually rely on manually written FAQ lists or simple keyword matching algorithms. This approach has obvious limitations, such as being unable to handle complex and changing policy issues and having difficulty in updating and maintaining massive policy documents. Therefore, this application will specifically introduce a large-model-based policy question-answering method that can solve the above problems.
[0047] See also Figure 1 As shown, the embodiment of the present invention discloses a policy question answering method based on a large model, which may include:
[0048] Step S11: Acquire the initial policy question sent by the user terminal, and use the first pre-trained large model to rewrite the format and content of the initial policy question to obtain a rewritten policy question.
[0049] In this embodiment, the initial policy question sent by the user end is first obtained through multiple channels. It should be noted that in order to improve the user experience, this embodiment not only supports the traditional text input box input, but also integrates the voice recognition interface, natural language processing technology, and OCR (Optical Character Recognition) technology to support users to ask policy questions through voice, pictures and other methods.
[0050] In this embodiment, the data of the initial policy question is preprocessed based on the preset language processing technology to obtain a structured policy question; the policy information in the structured policy question is identified and extracted by the preset semantic parsing technology, and the extracted policy information is input into the first pre-trained large model; the content of the initial policy question is converted using the preset rewriting rules and the first pre-trained large model to obtain a rewritten policy question. Specifically, this embodiment first preprocesses the data of the initial policy question based on the preset language processing technology, including data processing operations such as removing irrelevant symbols, word segmentation, and part-of-speech tagging. In this way, by removing irrelevant data, a clear and structured policy question can be provided for subsequent processing. It should be pointed out that the preset language processing technology includes but is not limited to natural language processing technology, machine translation, and information retrieval. Next, the policy information such as policy fields, specific matters, time range, etc. in the structured policy question is identified and extracted through the preset semantic parsing technology, and the policy information is input into the first training large model, and then the content of the initial policy question is converted through the preset rewriting rules and the generation capability of the first pre-trained large model to obtain a more standardized and structured rewritten policy question; it should be noted that the first training large model can be BERT (Bidirectional Encoder Representations from Transformers, i.e., a bidirectional transformer model) or GPT (Generative Pre-trained Transformer, i.e., a generative pre-trained model). In this way, by rewriting the initial policy question, the accuracy of subsequent question matching is improved, and the robustness and generalization ability of the system are enhanced.
[0051] Step S12: vectorize the rewritten policy problem based on semantic features and problem scenario features to obtain a vectorized policy problem.
[0052] In this embodiment, a combination of scenario vectorization and general vectorization is used to represent the rewritten policy issues in multiple dimensions. The scenario vectorization is to obtain the problem scenario features of the rewritten policy issues by constructing word vector spaces for specific scenarios such as policy fields and topics; the general vectorization is to obtain the semantic features of the rewritten policy issues by using general word vectors obtained through training with a large-scale corpus. By vectorizing the rewritten policy issues through the semantic features and the problem scenario features to obtain vectorized policy issues, the intent and background of the initial policy issues can be more fully understood.
[0053] Step S13: Filter the policy information stored in the preset question matching database using a preset search algorithm to determine whether there is a target policy answer corresponding to the vectorized policy question in the preset question matching database.
[0054] In this embodiment, the policy information stored in the preset question matching database is screened by using a preset retrieval algorithm and a preset question matching database to obtain screened policy information; the screened policy information and the vectorized policy question are analyzed for similarity by using a preset deep learning model, and the preset question matching database is judged whether there is a target policy answer corresponding to the vectorized policy question in the preset question matching database according to the corresponding similarity analysis result. Specifically, firstly, the policy information stored in the preset question matching database is roughly screened by using a preset retrieval algorithm, such as the BM25 algorithm (Best Matching 25, i.e., the best matching algorithm of the 25th iteration), and the preset question matching database to obtain a plurality of screened policy information, and then the semantics, context and other factors of the vectorized policy question are analyzed by using a preset deep learning model to obtain a question analysis result, and the question analysis result is analyzed for similarity with the plurality of screened policy information one by one to obtain the most accurate screened policy information among the plurality of screened policy information, and based on the screened policy information, it is judged whether there is a target policy answer corresponding to the vectorized policy question in the preset question matching database. It should be noted that this embodiment uses a preset retrieval algorithm and FAQ library to filter the policy question answer pairs in the FAQ library to obtain filtered policy information, and / or uses a preset retrieval algorithm and class graph library to filter the policy features in the class graph library to obtain filtered policy information. That is, the preset retrieval algorithm is used to search for policy question answer pairs matching the vectorized policy question in the FAQ library, and when the policy question answer pair matching the vectorized policy question is found, the preset retrieval algorithm is used to extract the policy question answer pair matching the vectorized policy question as the filtered policy information; and / or, the preset retrieval algorithm is used to traverse the feature nodes related to the vectorized policy question in the class graph library, and the relationship between the feature nodes is analyzed to determine the feature information that meets the filtering conditions. For example, if the vectorized policy question is a policy question related to environmental protection, the preset retrieval algorithm will search for feature nodes associated with the environmental label, and determine the feature node as feature information that meets the filtering conditions, and then extract the feature information that meets the filtering conditions to obtain the filtered policy information.
[0055] In this embodiment, the preset policy information source is monitored based on the preset machine learning model to determine whether there is new policy data in the preset policy information source; if there is new policy data, the new policy data is crawled from the preset policy information source through the preset crawler mechanism, and the policy features of the new policy data are extracted based on the preset keyword extraction technology, so as to update the preset question matching database using the policy features. Specifically, in order to improve the automation of the system, the preset machine learning model is used to learn historical data to more accurately predict and identify new policy information, that is, the preset policy information source is monitored based on the preset machine learning model to determine whether there is new policy data in the preset policy information source, wherein the new policy data is data obtained by updating the policy information source; if there is new policy data, the new policy data is crawled from the policy information source released by government departments, authoritative media, etc. through the preset crawler mechanism. It should be noted that in the crawling process, named entity recognition and keyword extraction technology can be used to extract key information such as policy name, release date, main content, etc. in the new policy data file, and the key information is structured and stored in the preset question matching database. At the same time, this embodiment provides a flexible rule configuration interface, allowing the user to adjust the update strategy and rules of the preset question matching database according to actual needs to adapt to the special requirements of different policy areas.
[0056] In this embodiment, a version control mechanism and a permission management mechanism are introduced to ensure the security and consistency of policy documents in the preset problem matching database. The version control mechanism records multiple version information of each policy document, such as modification time, modification content, etc., and allows users to view and compare the differences between different versions of the policy document as needed. This mechanism helps users track the change history of the policy. The permission management mechanism is used to control the access and modification rights of different users to policy documents. Different permission levels are set according to the user's role and responsibilities, and identity authentication and access control policies are used to ensure that only authorized users can access or modify policy documents. At the same time, a log recording function is set to record the user's operating behavior and system operation status, so as to track and trace the source when problems occur.
[0057] Step S14: If the target policy answer corresponding to the vectorized policy question does not exist in the preset question matching database, the associated documents corresponding to the vectorized policy question are screened from the preset policy knowledge base, and the prompt word corresponding to the vectorized policy question is determined from the preset policy prompt word library.
[0058] In this embodiment, if the target policy answer corresponding to the vectorized policy question exists in the FAQ library or the class graph library, the target policy answer is directly extracted and sent to the user end; if the target policy answer corresponding to the vectorized policy question does not exist in the preset question matching database, it means that the vectorized policy question needs to be further processed using a preset enhancement model or knowledge retrieval, that is, the associated documents corresponding to the vectorized policy question are screened from the preset policy knowledge base, and the prompt words corresponding to the vectorized policy question are determined from the preset policy prompt word library.
[0059] Step S15: input the associated document and the prompt word into a second pre-trained large model to obtain a target policy answer corresponding to the vectorized policy question.
[0060] In this embodiment, the associated document and the prompt word are input into the second pre-trained large model to obtain an initial policy answer, and the policy type corresponding to the policy answer is analyzed to obtain the document display type corresponding to the initial policy answer; based on the document display type, the document structure of the initial policy answer is adjusted to obtain the target policy answer corresponding to the vectorized policy question. It can be understood that in this embodiment, the associated document and the prompt word are input into the second pre-trained large model, and based on the language generation ability and domain knowledge of the large model, an initial policy answer that meets policy requirements and is easy to understand is generated, and then the policy type corresponding to the policy answer is analyzed to obtain the document display type corresponding to the initial policy answer, and the document display type includes but is not limited to charts, tables, PDF (Portable Document Format Generator), etc., and the document structure of the initial policy answer is adjusted based on the document display type to obtain the target policy answer corresponding to the vectorized policy question. For example, when explaining complex policy clauses or analyzing policy impacts, a bar chart or pie chart containing data comparison is generated to help users understand the policy content more intuitively; for policy documents that need to be elaborated in detail, a structured PDF document is generated, containing detailed information such as policy background, main content, and implementation points, so that users can read and save it. In addition, this embodiment sets up multi-round dialogue and context understanding functions, which can dynamically adjust the answer content based on user feedback and dialogue history.
[0061] In addition, in order to ensure the security and compliance of the answer content, this embodiment uses a pre-trained security detection model or a preset rule library to check the initial policy answer to determine whether there are preset risk words in the initial policy answer; if there are risk words in the initial policy answer, the initial policy answer is modified based on the preset answer standard to obtain the target policy answer, and the target policy answer is sent to the user end. Specifically, the initial policy answer is comprehensively risk assessed and filtered, and the process includes sensitive word detection, inappropriate speech recognition, privacy information protection and other aspects. In other words, the initial policy answer is checked using a pre-trained security detection model or rule library to ensure that the content of the initial policy answer complies with laws, regulations and ethical standards. For answer content that may be risky, the initial policy answer is modified based on the preset answer standard before being sent to the user end; for content that seriously violates regulations, it is directly refused to be sent.
[0062] In this embodiment, in order to subsequently optimize the above-mentioned large model, a statistical module is set up to record information such as questions sent by the user end, answers returned by the system, matching efficiency, and user satisfaction. The statistical module not only helps to evaluate the performance and effectiveness of the system, but also provides strong support for subsequent optimization and improvement. At the same time, users can also express their satisfaction and suggestions for the answers to the target policies through scoring, comments, etc. The system performs data analysis and mining based on user feedback information, identifies problems and shortcomings in the large model, and performs targeted optimization and improvement based on the problems and shortcomings, such as adjusting question rewriting strategies, optimizing vectorization methods, and expanding question libraries and knowledge bases. Through continuous optimization and improvement, the quality of answers and user experience are continuously improved.
[0063] As can be seen from the above, this embodiment first obtains the initial policy question sent by the user terminal, and uses the first pre-trained large model to rewrite the format and content of the initial policy question to obtain the rewritten policy question; based on semantic features and problem scenario features, the rewritten policy question is vectorized to obtain a vectorized policy question; the policy information stored in the preset question matching database is screened using a preset retrieval algorithm to determine whether there is a target policy answer corresponding to the vectorized policy question in the preset question matching database; if the target policy answer corresponding to the vectorized policy question does not exist in the preset question matching database, the associated documents corresponding to the vectorized policy question are screened from the preset policy knowledge base, and the prompt words corresponding to the vectorized policy question are determined from the preset policy prompt word library; the associated documents and the prompt words are input into the second pre-trained large model to obtain the target policy answer corresponding to the vectorized policy question. As can be seen from the above, this application uses a pre-trained large model to rewrite the policy questions sent by users, which can initially improve the accuracy of policy questions; by vectorizing the rewritten policy questions, the intention and background of the policy questions can be better understood, and feature information can be provided for subsequent question matching; by screening the policy information stored in the preset question matching database, it is determined whether there is a target policy answer corresponding to the vectorized policy question in the preset question matching database, and the corresponding target policy answer generation method is determined based on the judgment result to ensure the accuracy of the target policy answer. In this way, this application improves the processing efficiency of policy questions based on large models and provides better user experience and services.
[0064] In summary, the system architecture diagram of this application is as follows Figure 2 As shown. The question input by the user is obtained, and the question is rewritten. Then, the rewritten question is vectorized into a multi-dimensional representation through scene vectorization and general vectorization to obtain a vectorized question. Then, the vectorized question is matched, and the vectorized question is located based on the matching result. If the vectorized question exists in the FAQ library or NL2SQL (Natural Language to SQL), the answer corresponding to the vectorized question is directly generated and returned to the user; otherwise, the associated documents and prompt words associated with the vectorized question are extracted from the relevant knowledge base by using an enhanced model or knowledge retrieval, and then the answer corresponding to the vectorized question is generated based on the pre-trained LLM (Large Language Model) and returned to the user.
[0065] Accordingly, see Figure 3 As shown, the embodiment of the present application also provides a policy question-answering device based on a large model, which may include:
[0066] The question rewriting module 11 is used to obtain the initial policy question sent by the user terminal, and rewrite the format and content of the initial policy question using the first pre-trained large model to obtain a rewritten policy question;
[0067] A problem conversion module 12, configured to perform vectorization conversion on the rewritten policy problem based on semantic features and problem scenario features to obtain a vectorized policy problem;
[0068] The answer judgment module 13 is used to screen the policy information stored in the preset question matching database using a preset search algorithm to determine whether there is a target policy answer corresponding to the vectorized policy question in the preset question matching database;
[0069] The information determination module 14 is used to select the associated documents corresponding to the vectorized policy question from the preset policy knowledge base and determine the prompt word corresponding to the vectorized policy question from the preset policy prompt word library if the target policy answer corresponding to the vectorized policy question does not exist in the preset question matching database;
[0070] The answer generation module 15 is used to input the associated document and the prompt word into the second pre-trained large model to obtain a target policy answer corresponding to the vectorized policy question.
[0071] As can be seen from the above, this application uses a pre-trained large model to rewrite the policy questions sent by users, which can initially improve the accuracy of policy questions; by vectorizing the rewritten policy questions, the intention and background of the policy questions can be better understood, and feature information can be provided for subsequent question matching; by screening the policy information stored in the preset question matching database, it is determined whether there is a target policy answer corresponding to the vectorized policy question in the preset question matching database, and the corresponding target policy answer generation method is determined based on the judgment result to ensure the accuracy of the target policy answer. In this way, this application improves the processing efficiency of policy questions based on large models and provides better user experience and services.
[0072] In some specific implementations, the question rewriting module 11 includes:
[0073] A data preprocessing unit, configured to perform data preprocessing on the initial policy question based on a preset language processing technology to obtain a structured policy question;
[0074] An information extraction unit, configured to identify and extract policy information from the structured policy question by using a preset semantic parsing technology, and input the extracted policy information into the first pre-trained large model;
[0075] A question rewriting unit is used to transform the content of the initial policy question by using a preset rewriting rule and the first pre-trained large model to obtain a rewritten policy question.
[0076] In some specific implementations, the answer determination module 13 includes:
[0077] An information screening submodule, for screening the policy information stored in the preset question matching database by using a preset search algorithm and a preset question matching database to obtain screened policy information;
[0078] An answer judgment unit is used to perform a similarity analysis on the filtered policy information and the vectorized policy question through a preset deep learning model, and to judge whether there is a target policy answer corresponding to the vectorized policy question in the preset question matching database according to the corresponding similarity analysis result.
[0079] In some specific implementations, the information screening submodule includes:
[0080] A question-answer pair screening unit, used to screen the policy question-answer pairs in the FAQ library using a preset search algorithm and the FAQ library to obtain screened policy information;
[0081] The policy feature screening unit is used to screen the policy features in the class graph library using a preset retrieval algorithm and the class graph library to obtain screened policy information.
[0082] In some specific implementations, the answer generation module 15 includes:
[0083] A display type determination unit, configured to input the associated document and the prompt word into a second pre-trained large model to obtain an initial policy answer, and analyze the policy type corresponding to the policy answer to obtain a document display type corresponding to the initial policy answer;
[0084] An answer generation unit is used to adjust the document structure of the initial policy answer based on the document presentation type to obtain a target policy answer corresponding to the vectorized policy question.
[0085] In some specific implementations, the answer generation module 15 includes:
[0086] A risk vocabulary judgment unit, used for inputting the associated document and the prompt word into a second pre-trained large model to obtain an initial policy answer, and using a pre-trained security detection model or a preset rule library to check the initial policy answer to determine whether there is a preset risk vocabulary in the initial policy answer;
[0087] The answer sending unit is used to modify the initial policy answer based on a preset answer standard to obtain a target policy answer if there are risk words in the initial policy answer, and send the target policy answer to the user end.
[0088] In some specific implementations, the policy question-answering device further includes:
[0089] A new policy data determination module, configured to monitor a preset policy information source based on a preset machine learning model to determine whether there is new policy data in the preset policy information source;
[0090] The database update module is used to crawl the new policy data from the preset policy information source through a preset crawler mechanism if there is new policy data, and extract the policy features of the new policy data based on a preset keyword extraction technology, so as to update the preset question matching database using the policy features.
[0091] Furthermore, the present application also discloses an electronic device. Figure 4 It is a structural diagram of an electronic device 20 shown according to an exemplary embodiment, and the content in the figure cannot be regarded as any limitation on the scope of use of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input and output interface 25 and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the large model-based policy question-answering method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment can specifically be an electronic computer.
[0092] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0093] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0094] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including computer programs that can be used to complete the large model-based policy question-answering method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include computer programs that can be used to complete other specific tasks.
[0095] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned large-model-based policy question-answering method disclosed above is implemented. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the aforementioned embodiments, and no further description will be given here.
[0096] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0097] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0098] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0099] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0100] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A policy question-answering method based on a large model, characterized in that: include: Acquire an initial policy question sent by a user terminal, and rewrite the format and content of the initial policy question using a first pre-trained large model to obtain a rewritten policy question; Performing vectorization conversion on the rewritten policy problem based on semantic features and problem scenario features to obtain a vectorized policy problem; Using a preset search algorithm to screen the policy information stored in a preset question matching database to determine whether there is a target policy answer corresponding to the vectorized policy question in the preset question matching database; If the target policy answer corresponding to the vectorized policy question does not exist in the preset question matching database, then selecting the associated documents corresponding to the vectorized policy question from the preset policy knowledge base, and determining the prompt word corresponding to the vectorized policy question from the preset policy prompt word library; The associated document and the prompt word are input into a second pre-trained large model to obtain a target policy answer corresponding to the vectorized policy question.
2. The policy question answering method based on a large model according to claim 1 is characterized in that: The method of rewriting the format and content of the initial policy question by using the first pre-trained large model to obtain a rewritten policy question includes: Performing data preprocessing on the initial policy question based on a preset language processing technology to obtain a structured policy question; Identifying and extracting policy information in the structured policy question by using a preset semantic parsing technology, and inputting the extracted policy information into the first pre-trained large model; The content of the initial policy question is converted using a preset rewriting rule and the first pre-trained large model to obtain a rewritten policy question.
3. The policy question answering method based on a large model according to claim 1 is characterized in that: The method of using a preset search algorithm to screen the policy information stored in the preset question matching database includes: Using a preset search algorithm and a preset question matching database, the policy information stored in the preset question matching database is screened to obtain screened policy information; A similarity analysis is performed between the filtered policy information and the vectorized policy question through a preset deep learning model, and a determination is made based on the corresponding similarity analysis result whether there is a target policy answer corresponding to the vectorized policy question in the preset question matching database.
4. The policy question answering method based on a large model according to claim 3 is characterized in that: The method of using a preset search algorithm and a preset question matching database to screen the policy information stored in the preset question matching database to obtain screened policy information includes: Using a preset search algorithm and a frequently asked questions and answers library, the policy question answer pairs in the frequently asked questions and answers library are screened to obtain screened policy information; And / or, using a preset search algorithm and a class graph library, the policy features in the class graph library are screened to obtain screened policy information.
5. The policy question answering method based on a large model according to claim 1 is characterized in that: The step of inputting the associated document and the prompt word into the second pre-trained large model to obtain a target policy answer corresponding to the vectorized policy question includes: Inputting the associated document and the prompt word into a second pre-trained large model to obtain an initial policy answer, and analyzing the policy type corresponding to the policy answer to obtain a document display type corresponding to the initial policy answer; The document structure of the initial policy answer is adjusted based on the document presentation type to obtain a target policy answer corresponding to the vectorized policy question.
6. The policy question answering method based on a large model according to claim 1 is characterized in that: The step of inputting the associated document and the prompt word into the second pre-trained large model to obtain a target policy answer corresponding to the vectorized policy question includes: Input the associated document and the prompt word into the second pre-trained large model to obtain an initial policy answer, and use the pre-trained security detection model or the preset rule library to check the initial policy answer to determine whether there is a preset risk word in the initial policy answer; If there are risk words in the initial policy answer, the initial policy answer is modified based on a preset answer standard to obtain a target policy answer, and the target policy answer is sent to the user end.
7. The large model-based policy question answering method according to any one of claims 1 to 6, characterized in that: Also includes: Monitoring a preset policy information source based on a preset machine learning model to determine whether there is new policy data in the preset policy information source; If there is new policy data, the new policy data is crawled from the preset policy information source through the preset crawler mechanism, and the policy features of the new policy data are extracted based on the preset keyword extraction technology, so as to update the preset question matching database using the policy features.
8. A policy question-answering device based on a large model, characterized in that: include A question rewriting module, used for obtaining an initial policy question sent by a user terminal, and rewriting the format and content of the initial policy question using a first pre-trained large model to obtain a rewritten policy question; A problem conversion module, used for performing vectorization conversion on the rewritten policy problem based on semantic features and problem scenario features to obtain a vectorized policy problem; An answer judgment module is used to screen the policy information stored in the preset question matching database using a preset search algorithm to determine whether there is a target policy answer corresponding to the vectorized policy question in the preset question matching database; An information determination module, configured to screen the associated documents corresponding to the vectorized policy question from a preset policy knowledge base, and determine the prompt word corresponding to the vectorized policy question from a preset policy prompt word library, if the target policy answer corresponding to the vectorized policy question does not exist in the preset question matching database; An answer generation module is used to input the associated document and the prompt word into a second pre-trained large model to obtain a target policy answer corresponding to the vectorized policy question.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the large model-based policy question-answering method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program; wherein, when the computer program is executed by a processor, the large model-based policy question-answering method as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Policy question and answer method and system based on large language model and knowledge graph technology
CN117725170A
Government service question and answer method based on knowledge graph enhanced large language model
CN117851577A
Knowledge graph type question and answer method, system and device for land use batch report and medium
CN118035461A
Knowledge graph-based content retrieval generation method and device and storage medium
CN118133972A
Intelligent question and answer implementation method and device, equipment and storage medium
CN118626604A
Cited By
Smart city platform question and answer method, device and equipment based on large model and medium
CN122334517A
Intelligent city platform question and answer method and device based on large model, equipment and medium
CN122334517B