Knowledge answering method, system, electronic device and storage medium based on large model
By obtaining user trace information in the government affairs system and expanding the question collection, finding the answers to the Q&A on the database, and only generating answers when not found, it solves the problem that traditional Q&A systems cannot understand user intentions and high computing power consumption, and improves response Speed and computing power utilization efficiency.
Patent Information
- Application Number
- CN202411097900.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-08-12
AI Technical Summary
Traditional Q&A systems cannot effectively understand user intentions, resulting in inaccurate answers, and each call to the artificial intelligence model generates answers greatly increases the server's computing power and slow response speed.
By obtaining the trace information of users in the government system, expanding the question collection based on the big model, and finding answer information in the preset question-and-answer database, answers can only be generated through the big model when they are not found, reducing computer computing power consumption.
It saves computer computing power in government Q&A scenarios, improves Q&A response speed, and reduces the computing power cost of large models to generate answers.
Smart Images

Figure CN118606574B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a knowledge answering method, system, electronic device and storage medium based on a large model. Background Art
[0002] Traditional question-answering systems generally use a fixed set of questions and answers to respond to questions, which results in a poor understanding of user intent and an inability to give accurate answers.
[0003] In the prior art, an artificial intelligence model is used to generate corresponding answers based on user questions. However, this method requires calling the artificial intelligence model once to generate an answer each time, which greatly increases the computing power of the server and results in a slow response speed. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a knowledge answering method, system, electronic device and storage medium based on a large model to reduce the server computing power in the question and answer calculation process and improve the question and answer response speed.
[0005] In the first aspect, a knowledge answering method based on a large model is provided, which is applied to government affairs question answering scenarios. The method includes:
[0006] Obtaining the original question information entered by the user in the government affairs system and the trace information left in the government affairs system within a preset period of time before the original question information was entered; the trace information includes trace information of browsing other business units and user location information;
[0007] Based on the original question information and trace information, the original question information is expanded through the pre-trained large model to obtain a preset number of expanded question sets;
[0008] Searching for answer information of the original question information in a preset question-answer pair database based on the extended question set and the original question information;
[0009] If not found, the answer information for the original question information is generated through the large model.
[0010] Optionally, obtaining includes:
[0011] Obtain the user's IP address through the network interface;
[0012] Based on the IP address, query the geographic location information in the geographic database;
[0013] Obtain the browsing information of the user in the government affairs system within a preset time before the user inputs the original question information through the API interface;
[0014] Trace information is composed based on geographic location information and browsing information.
[0015] Optionally, based on the original question information and the trace information, the original question information is expanded by a pre-trained large model to obtain a preset number of expanded question sets including:
[0016] Extract the first keyword of the original question information and the second keyword of the browsing information;
[0017] The first keyword, the second keyword and the geographic location information are input into the pre-trained large model to obtain a preset number of extended question sets, each extended question in the extended question set includes the first keyword, the second keyword and the geographic location information.
[0018] Optionally, before obtaining the trace information, the method further includes:
[0019] Extract the third keyword of the original question information;
[0020] Determining whether the third keyword matches the preset intercept keyword;
[0021] If they match, the preset fixed answer is output and the question and answer session ends;
[0022] If there is no match, get the number of questions asked by the current user;
[0023] Compare the number of questions asked with the preset number of questions asked;
[0024] If the number of questions is greater than the preset number, the preset fixed answer will be output and the question-and-answer session ends;
[0025] If it is less than the preset number of questions, the step of obtaining trace information is executed.
[0026] Optionally, searching for answer information of the original question information in a preset question-answer pair database based on the extended question set and the original question information includes:
[0027] Calculate the similarity between the extended question set and the original question information and the question information in the preset question-answer pair database;
[0028] comparing the similarity with a preset similarity threshold;
[0029] If the similarity between any question information in the extended question set or the original question information and the question information in the preset question and answer pair database is greater than the preset similarity threshold, the answer information of the question information in the preset question and answer pair database that is greater than the preset similarity threshold is determined as the answer information of the original question information.
[0030] Optionally, the method further comprises:
[0031] The original question information and the answer information generated by the large model are used to generate question-answer pairs, which are then stored in the question-answer pair database.
[0032] In the second aspect, a knowledge answering system based on a large model is provided, which is applied to government question-answering scenarios. The system includes: a perception module, an intention recognition module, a question matching module and an answer generation module, wherein:
[0033] The perception module is used to obtain trace information left by the user in the government affairs system within a preset time period before the user inputs the original question information; the trace information includes trace information of browsing other business units and user location information;
[0034] The intention recognition module is used to expand the original question information based on the original question information and trace information through a pre-trained large model to obtain a preset number of expanded question sets;
[0035] The question matching module is used to search for answer information of the original question information in a preset question-answer pair database based on the extended question set and the original question information;
[0036] The answer generation module is used to generate answer information for the original question information through the large model when the answer information is not found.
[0037] Optionally, the system also includes an intelligent interception module, which is used to: extract the third keyword of the original question information; determine whether the third keyword matches the preset interception keyword; if so, output a preset fixed answer and end the question and answer session; if not, obtain the number of questions asked by the current user; compare the number of questions asked with the preset number of questions; if greater than the preset number of questions asked, output a preset fixed answer and end the question and answer session, otherwise obtain trace information through the perception module.
[0038] In a third aspect, an electronic device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0039] Memory, used to store computer programs;
[0040] The processor is used to implement any method step described in the first aspect when executing a program stored in the memory.
[0041] According to a fourth aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any method step described in the first aspect is implemented.
[0042] The [invention name] provided by the embodiment of the present invention, when obtaining the original question information, first obtains trace information with a certain degree of correlation with the original question information, expands the original question based on the trace information, generates an extended question set, and searches for the answer information of the extended question set and the original question information in a preset question and answer database. Only when the answer information cannot be found, will the answer information be generated through a large model. Since the computing power required to expand the question is much smaller than the computing power required to generate the answer, the computer computing power is greatly saved when processing problems in government question and answer scenarios, and the response speed is improved.
[0043] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0045] Figure 1 A flow chart of knowledge response based on a large model provided by an embodiment of the present invention is shown;
[0046] Figure 2 A flow chart showing a knowledge response provided by another embodiment of the present invention;
[0047] Figure 3 A schematic diagram of the structure of a knowledge response system based on a large model provided by an embodiment of the present invention is shown;
[0048] Figure 4 A schematic diagram of the structure of a knowledge response system based on a large model provided by another embodiment of the present invention is shown;
[0049] Figure 5 A schematic structural diagram of an electronic device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.
[0051] Considering that the current technology calls artificial intelligence models to generate answers for each question, and since a large number of questions are processed every day in the government system, if the artificial intelligence model is called every time, the computing power of the computer will be greatly increased, and the server resources will be consumed and occupied. Based on this, the embodiment of the present invention provides a knowledge question answering method and system based on a large model, which is described below through an embodiment.
[0052] Before starting the embodiment of the present invention, the concept of the large model is first introduced:
[0053] Large models refer to machine learning models with large-scale parameters and complex computational structures. These models are usually built with deep neural networks and have billions or even hundreds of billions of parameters. Large models are designed to improve the expressiveness and predictive performance of the model and to handle more complex tasks and data. Large models are widely used in various fields, including natural language processing, computer vision, speech recognition, and recommendation systems. Large models learn complex patterns and features by training massive amounts of data, have stronger generalization capabilities, and can make accurate predictions on unseen data.
[0054] Large models usually learn multiple different NLP (Natural Language Processing) tasks together, such as machine translation, text summarization, question-answering systems, etc. This allows the model to learn a broader and more generalized language understanding ability. Large models can improve the performance of the model on new tasks by pre-training on large-scale data and then fine-tuning on specific tasks.
[0055] The large models are mainly divided into three categories according to the type of input data:
[0056] Language big models: refers to a type of big models in the field of natural language processing, which are usually used to process text data and understand natural language. The main feature of this type of big models is that they are trained on large-scale corpora to learn various grammatical, semantic and contextual rules of natural language. For example: GPT series (OpenAI), Bard (Google), Wenxinyiyan (Baidu).
[0057] Visual large models: refers to large models used in the field of Computer Vision (CV), usually for image processing and analysis. This type of model can achieve various visual tasks such as image classification, object detection, image segmentation, pose estimation, face recognition, etc. by training on large-scale image data. For example: VIT series (Google), Wenxin UFO, Huawei Pangu CV, INTERN (SenseTime).
[0058] Multimodal large models: refers to large models that can process multiple different types of data, such as text, image, audio and other multimodal data. This type of model combines the capabilities of NLP and CV to achieve comprehensive understanding and analysis of multimodal information, so as to more comprehensively understand and process complex data. For example: DingoDB multimodal vector database, DALL-E (OpenAI), Wukong painting, etc.
[0059] The embodiment of the present invention provides a knowledge answering method based on a large model, which is applied to government affairs question answering scenarios, such as Figure 1 As shown, the method comprises the following steps:
[0060] Step S101: obtaining the original question information input by the user in the government affairs system and the trace information left in the government affairs system within a preset period of time before the original question information is input; the trace information includes the trace information of browsing other business units and the user location information.
[0061] In the embodiment of the present application, the government affairs system refers to a system used by residents to handle and query administrative affairs, such as social security, provident fund, entry and exit, transportation and other business handling units. Users can enter the original question information in the front-end page of the mini program, client or web page of the developed government affairs system.
[0062] In one example, the original question information may be obtained by actively inputting questions by the user in the front-end question-and-answer interface, or by passively selecting questions from questions recommended by the system background.
[0063] In the embodiment of the present application, the trace information may be trace information of some dynamic operation types, such as browsing trace information of other business units, etc., or trace information of some static types, such as user identity information, user location information, etc. Among them, the preset time length may be, for example, ten minutes. For example, if the time when the user inputs the original question information is 2024.07.18.12:00, then the trace information within ten minutes before that, that is, the trace information between 2024.07.18.11:50-2024.07.18.12:00, can be obtained.
[0064] By setting a preset time length, the correlation between the obtained trace information and the original problem information is improved. Once the preset time length is exceeded, the correlation between the obtained trace information and the original problem information is reduced, resulting in a reduced reference significance.
[0065] Step S102: Based on the original question information and the trace information, the original question information is expanded through a pre-trained large model to obtain a preset number of expanded question sets.
[0066] In an embodiment of the present application, the big model mainly adopts a language big model, such as the GPT series. The data of the government question and answer scenario can be input into a general language big model for pre-training, and the trained big model can be fine-tuned for the question expansion task, thereby achieving the purpose of generating an expanded question set.
[0067] The embodiment of the present application expands the question set, generates multiple questioning methods, and then matches question and answer pairs, which can increase the success rate of subsequent matching in the question and answer database.
[0068] Step S103: searching for answer information of the original question information in a preset question-answer pair database based on the expanded question set and the original question information.
[0069] In an embodiment of the present application, the preset question-answer database may be question-answer pairs accumulated by the original customer service system or manual customer service, or may include some autonomously configured question-answer pairs.
[0070] If the answer information can be found in the preset question-answer database, it can be output to the front-end interface to end the question-answer process.
[0071] Since generating an extended question set only requires generating it based on the existing original question information and trace information, less computing power is required. However, the computing power required to generate answer information through a large model is much greater than the computing power required for the extended question. Therefore, this application can effectively reduce the computing power cost of generating answer information from a large model by generating an extended question set and reusing the question and answer pairs in a preset question and answer database. At the same time, since the computing power is reduced, the calculation time is also reduced, and the response speed to the original question information is correspondingly improved.
[0072] In this step, the higher the matching success rate, the lower the frequency of subsequent calls to the large model to generate answer information, and the more computing power is saved.
[0073] Step S104: If the answer is not found, generate answer information for the original question information through the large model.
[0074] In an embodiment of the present application, if no corresponding question-answer pair is matched in the preset question-answer pair database, the answer information for the original question can be generated through the large model and output to the front-end page, and the question-answer session ends.
[0075] In a feasible implementation, relevant data in the field of government affairs question and answer can be obtained first, and these data can be cleaned and preprocessed to remove noise, erroneous or duplicate data, and the data can be converted into a format suitable for model input; the preprocessed data can be input into a large model architecture, such as a GPT architecture, and the large model can be trained. During the training process, the model's hyperparameters, such as the learning rate, number of layers, number of neurons, etc., can be adjusted to optimize the performance of the model and obtain a trained large model. The original question information raised by the user is input into the trained large model in text form to extract the key information of the question. The large model generates the corresponding answer information based on the original question information and the key information of the understanding of the question, using the knowledge and language patterns it has learned.
[0076] Based on the above embodiment, the generated answer information may be further post-processed, such as removing redundant spaces, punctuation errors, etc., to make the answer more standardized and easier to understand.
[0077] When the original question information is obtained, the present application does not directly call the big model to generate an answer. Instead, it obtains trace information that has a certain correlation with the original question information, expands the question based on the trace information, generates an extended question set, and matches and searches for the answer information of the extended question set and the original question information in the preset question and answer database. Only when the answer information cannot be found, the big model will be used to generate the answer information. Since the computing power required to expand the question is much less than the computing power required to generate the answer, it greatly saves computer computing power when processing problems in government question and answer scenarios and improves the response speed.
[0078] Based on the above embodiment, obtaining the trace information left in the government affairs system within a preset time period before the original question information is input includes:
[0079] Get the user's IP address through the network interface.
[0080] Based on the IP address, query the geographic location information in the geographic database.
[0081] In the embodiment of the present application, the geographic location information can be accurate to the city level.
[0082] The API interface is used to obtain the browsing information of the user in the government affairs system within a preset time period before the user inputs the original question information.
[0083] For example, if the user previously browsed the ID card application module, then the browsing information is the ID card application information.
[0084] Trace information is composed based on geographic location information and browsing information.
[0085] On the basis of the above embodiment, based on the original question information and trace information, the original question information is expanded through the pre-trained large model to obtain a preset number of expanded question sets including:
[0086] Extract the first keyword of the original question information and the second keyword of the browsing information.
[0087] In the embodiment of the present application, the number of the first keyword and the second keyword may be one or more.
[0088] In one example, keyword extraction may be implemented through a natural language processing method, for example, word segmentation may be performed on the title text of the browsing record, and keywords may be determined based on the part of speech of the segmented words.
[0089] The first keyword, the second keyword and the geographic location information are input into the pre-trained large model to obtain a preset number of extended question sets, each extended question in the extended question set includes the first keyword, the second keyword and the geographic location information.
[0090] In an example, for example, the original question entered by the user is "How to apply for household registration", the first keyword extracted is "household registration", and it is found in the browsing history that the user has browsed the "house purchase deed tax" related business module, so the second keyword obtained is "house purchase", and the geographical location information obtained is, for example, City A. Then the big model will expand different questioning methods based on this information and generate the following extended question set:
[0091] How to go about completing procedures for purchasing a home and obtaining household registration in District B, City A?
[0092] How to go about the procedures for purchasing a house and obtaining household registration in District B of City A?
[0093] How to obtain household registration after purchasing a house in District B, City A?
[0094] How to register for household registration in District B, City A after purchasing a house?
[0095] What steps are required to apply for household registration for purchasing a house in District B of City A?
[0096] What is the procedure for purchasing a house and obtaining household registration in District B of City A?
[0097] How do I apply for household registration for purchasing a house in District B, City A?
[0098] How can I purchase a house and obtain household registration in District B of City A?
[0099] Based on the above embodiment, before obtaining the trace information, the method further includes:
[0100] Extract the third keyword of the original question information.
[0101] It should be noted that, if not blocked, the third keyword may be the same as the first keyword.
[0102] Determine whether the third keyword matches the preset intercept keyword.
[0103] In the embodiment of the present application, the preset interception keyword includes, for example, "manual".
[0104] Among them, the method for determining whether the third keyword matches the preset intercept keyword is to determine the matching degree of the two keywords, compare the matching degree with the preset matching degree, and if it is greater than the preset matching degree, the match is successful. In an example, the matching degree of the two keywords can be expressed by calculating the cosine similarity of the word vectors of the two keywords.
[0105] If there is a match, the preset fixed answer is output and the question and answer session ends.
[0106] In one example, the preset fixed answer includes an apology and a manual prompt.
[0107] Through keyword matching, situations that require manual processing enter the manual consultation channel, ending the machine question and answer mode.
[0108] In the embodiment of the present application, the answer information generated by the preset question-answer database or large model is not necessarily the answer information that the user wants, so the question will be asked again. However, if the question is asked repeatedly, it will not only waste server resources, but also get incorrect answers. Therefore, in the case where the preset interception keywords do not match, it is also necessary to limit the number of questions. The specific method is as follows:
[0109] If there is no match, get the number of questions asked by the current user.
[0110] In one example, a user's question record may be obtained, and the number of times the user asks questions in the question record is counted according to the question time. For example, each question time corresponds to a number of questions.
[0111] Compare the number of questions asked with the preset number of questions asked;
[0112] If the number of questions is greater than the preset number, the preset fixed answer will be output and the question and answer session will end.
[0113] The preset fixed answer is the same as the fixed answer above, and also includes an apology and a prompt to transfer to a human operator. If the number of questions exceeds a certain number, it means that the desired answer has not been obtained. In this case, the user can be provided with a channel to transfer to a human operator. On the one hand, it protects the server, and on the other hand, it helps users solve the problem.
[0114] If it is less than the preset number of questions, the step of obtaining trace information is executed.
[0115] Based on the above embodiment, searching for answer information of the original question information in a preset question-answer pair database based on the extended question set and the original question information includes the following steps:
[0116] Step S1031: Calculate the similarity between the expanded question set and the original question information and the question information in the preset question-answer pair database.
[0117] In a feasible implementation, the bag-of-words model can be used to calculate the similarity between the expanded question set and the original question information and the question information in the preset question-answer pair database. The specific principle is to represent the text of each question as a set of words, ignore the word order and grammar, and construct a text vector by counting the frequency of word occurrence. The similarity between two text vectors is calculated by cosine similarity, Euclidean distance, etc.
[0118] In another feasible implementation, the similarity can also be calculated using a semantic similarity model based on deep learning, such as using deep learning models such as convolutional neural networks (CNN), recurrent neural networks (RNN), long short-term memory networks (LSTM), gated recurrent units (GRU), and Transformer architectures to encode text pairs, learn the semantic representation of the text, and then measure the semantic similarity by calculating the distance or similarity between the two text representations.
[0119] Step S1032: Compare the similarity with a preset similarity threshold.
[0120] Step S1033: If the similarity between any question information in the extended question set or the original question information and the question information in the preset question and answer pair database is greater than the preset similarity threshold, the answer information of the question information in the preset question and answer pair database that is greater than the preset similarity threshold is determined as the answer information of the original question information.
[0121] Based on the above embodiment, the method further includes:
[0122] The original question information and the answer information generated by the large model are used to generate question-answer pairs, which are then stored in the question-answer pair database.
[0123] In an embodiment of the present application, the answer information generated by the large model can be converted into fixed question-and-answer pairs after review, and added to the question-and-answer pair database for subsequent questions and answers.
[0124] A specific knowledge response process example is given below: Figure 2 As shown, the roles involved include users, front-end interfaces, knowledge response systems, and large models, including the following steps:
[0125] Step S201: Intelligent recommendation. This step generates recommended questions based on the context of the user's operation in the front-end interface and displays them.
[0126] Step S202: receiving a user's question;
[0127] Step S203: Intelligent interception: Through intelligent interception, it is determined whether the intelligent interception condition is triggered; if triggered, the process proceeds to step S204, otherwise, the process proceeds to step S205.
[0128] Step S204: Return to the fixed answer and proceed to step S209.
[0129] Step S205: Intent recognition: Generate an extended question set through intent recognition.
[0130] Step S206: Question matching: Matching is performed in the preset question-answer pair database, and if the match is successful, the process proceeds to step S207, otherwise, the process proceeds to step S208.
[0131] Step S207: Find a fixed answer and adopt it directly.
[0132] Step S208: Generate answer information in real time. In this step, answer information is generated by a large model.
[0133] Step S209: Display the answer. Display the answer through the front-end interface.
[0134] Based on the same technical concept, a knowledge answering system based on a large model is provided, which is applied to government question-answering scenarios, such as Figure 3 As shown, the system includes: a perception module 301, an intention recognition module 302, a question matching module 303 and an answer generation module 304, wherein:
[0135] The perception module 301 is used to obtain trace information left in the government affairs system within a preset time period before the user inputs the original question information.
[0136] The trace information includes at least geographic location information and browsing information.
[0137] The intention recognition module 302 is used to expand the original question information based on the original question information and trace information through a pre-trained large model to obtain a preset number of expanded question sets.
[0138] The intention recognition module 302 is specifically used to extract the first keyword of the original question information and the second keyword of the browsing information; input the first keyword, the second keyword and the geographic location information into the pre-trained large model to obtain a preset number of extended question sets, and each extended question in the extended question set includes the first keyword, the second keyword and the geographic location information.
[0139] The question matching module 303 is used to search for answer information of the original question information in a preset question-answer pair database based on the extended question set and the original question information.
[0140] It is specifically used to calculate the similarity between the extended question set and the original question information and the question information in the preset question and answer pair database; compare the similarity with the preset similarity threshold; if the similarity between any question information in the extended question set or the original question information and the question information in the preset question and answer pair database is greater than the preset similarity threshold, then the answer information of the question information in the preset question and answer pair database that is greater than the preset similarity threshold is determined as the answer information of the original question information.
[0141] The answer generation module 304 is used to generate answer information for the original question information through the large model when the answer information is not found.
[0142] Alternatively, if Figure 4 As shown, the system also includes an intelligent interception module 305, which is used to: extract the third keyword of the original question information; determine whether the third keyword matches the preset interception keyword; if so, output a preset fixed answer and end the question and answer session; if not, obtain the number of questions asked by the current user; compare the number of questions asked with the preset number of questions; if greater than the preset number of questions asked, output a preset fixed answer and end the question and answer session, otherwise obtain trace information through the perception module.
[0143] Based on the same technical concept, an embodiment of the present invention further provides an electronic device, such as Figure 5 As shown, it includes a processor 501 , a communication interface 502 , a memory 503 and a communication bus 504 , wherein the processor 501 , the communication interface 502 , and the memory 503 communicate with each other via the communication bus 504 .
[0144] Memory 503, used for storing computer programs;
[0145] The processor 501 is used to implement the steps of the knowledge response method when executing the program stored in the memory 503.
[0146] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0147] The communication interface is used for communication between the above electronic device and other devices.
[0148] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0149] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0150] The computer program product for the knowledge answering method provided in the embodiment of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method described in the previous method embodiment. The specific implementation can be found in the method embodiment and will not be repeated here.
[0151] The knowledge response device provided in the embodiment of the present invention can be specific hardware on the device or software or firmware installed on the device. The implementation principle and technical effects of the device provided in the embodiment of the present invention are the same as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference can be made to the corresponding contents in the aforementioned method embodiment. Technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can all refer to the corresponding processes in the aforementioned method embodiment, and will not be repeated here.
[0152] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0153] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0154] In addition, each functional unit in the embodiment provided by the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0155] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0156] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.
[0157] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can still modify the technical solutions described in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or perform equivalent replacements on some of the technical features thereof; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. They should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A knowledge answering method based on a large model, characterized in that: Applied to the government affairs question and answer scenario, the method includes: Obtaining the original question information entered by the user in the government affairs system and the trace information left in the government affairs system within a preset period of time before the original question information was entered; the trace information includes trace information of browsing other business units and user location information; Before obtaining the trace information, the method further includes: Extracting the third keyword of the original question information; Determining whether the third keyword matches a preset intercept keyword; If they match, the preset fixed answer is output and the question and answer session ends; If there is no match, get the number of questions asked by the current user; Comparing the number of questions asked with a preset number of questions asked; If the number of questions is greater than the preset number, a preset fixed answer is output and the question-and-answer session ends; If the number of questions is less than the preset number, the step of obtaining trace information is executed; Based on the original question information and the trace information, the original question information is expanded by a pre-trained large model to obtain a preset number of expanded question sets; Searching for answer information of the original question information in a preset question-answer pair database based on the extended question set and the original question information; If not found, answer information for the original question information is generated through the large model.
2. The method according to claim 1, characterized in that The trace information left in the government affairs system within a preset time period before the original question information is input includes: Obtain the user's IP address through the network interface; Based on the IP address, query the geographic location information in a geographic database; Obtain the browsing information of the user in the government affairs system within a preset time before the user inputs the original question information through the API interface; Trace information is formed based on the geographic location information and the browsing information.
3. The method according to claim 2, characterized in that The method of expanding the original question information based on the original question information and the trace information through a pre-trained large model to obtain a preset number of expanded question sets includes: Extracting the first keyword of the original question information and the second keyword of the browsing information; The first keyword, the second keyword and the geographic location information are input into a pre-trained large model to obtain a preset number of extended question sets, each extended question in the extended question set includes the first keyword, the second keyword and the geographic location information.
4. The method according to claim 1, characterized in that: The searching for answer information of the original question information in a preset question-answer pair database based on the extended question set and the original question information includes: Calculating the similarity between the extended question set and the original question information and the question information in a preset question-answer pair database; comparing the similarity with a preset similarity threshold; If the similarity between any question information or the original question information in the extended question set and the question information in the preset question and answer pair database is greater than the preset similarity threshold, the answer information of the question information in the preset question and answer pair database that is greater than the preset similarity threshold is determined as the answer information of the original question information.
5. The method according to claim 1, characterized in that: The method further comprises: The original question information and the answer information generated by the large model are used to generate question-answer pairs, which are then stored in the question-answer pair database.
6. A knowledge response system based on a large model, characterized in that: Applied to government affairs question-and-answer scenarios, the system includes: an intelligent interception module, a perception module, an intention recognition module, a question matching module, and an answer generation module, wherein: The intelligent interception module is used to: extract the third keyword of the original question information; determine whether the third keyword matches the preset interception keyword; if they match, output a preset fixed answer and end the question-answering session; if they do not match, obtain the number of questions asked by the current user; compare the number of questions asked with the preset number of questions; if it is greater than the preset number of questions asked, output a preset fixed answer and end the question-answering session, otherwise obtain trace information through the perception module; The perception module is used to obtain trace information left by the user in the government affairs system within a preset time period before the user inputs the original question information; the trace information includes trace information of browsing other business units and user location information; The intention recognition module is used to expand the original question information through a pre-trained large model based on the original question information and the trace information to obtain a preset number of expanded question sets; The question matching module is used to search for answer information of the original question information in a preset question-answer pair database based on the extended question set and the original question information; The answer generation module is used to generate answer information for the original question information through the large model when the answer information is not found.
7. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 5 when executing a program stored in a memory.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 5 are implemented.
