Information generation method, device and system, electronic equipment and storage medium
By using the vector search module in the intelligent question-answer system to match the answers to short questions in the FAQ database, the problem of inaccurate answers of short text questions is solved, which improves the accuracy and speed of answer generation and reduces system maintenance costs.
Patent Information
- Application Number
- CN202411299559.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2024-12-31
AI Technical Summary
In the smart question and answer scenario, the short text problem is inaccurate due to the low amount of text content maintained in the document database, and the answers generated based on model reasoning are inaccurate.
Use the vector search module to retrieve candidate problem vectors that match the target problem in the FAQ database. If there is a target problem vector that meets the preset conditions, the target answer information will be determined; if there is no FAQ database or the candidate problem vector does not meet the conditions, the target answer information will be determined. The answer generation link generates the target answer information, and the vector search module is set in the answer generation link to prioritize the matching of the target answer using the FAQ database.
Improves the accuracy and speed of answer generation of short questions, ensures that accurate answers can be generated even when answers cannot be obtained from the FAQ database, and reduces the development, management and maintenance costs of software systems.
Smart Images

Figure CN119226467A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of data processing technology, and in particular, to an information generation method, device, system, electronic device and storage medium. Background Art
[0002] With the development of computer and Internet technology, intelligent question and answer has been widely used in more and more industries. For example, more and more enterprises, institutions or shopping malls have introduced intelligent question and answer systems into their websites or applications to assist or replace manual answering of questions.
[0003] In intelligent question-answering scenarios, most solutions currently adopted are to retrieve relevant fragments in the question from the document database, and then use reasoning capabilities to generate answers to the questions based on the relevant fragments. However, for some question-answering scenarios, such as scenarios where the questions are short texts, the document database may maintain some relatively short texts, resulting in less information in the fragment content for reasoning, and there is a problem of inaccurate answers generated based on model reasoning. Summary of the invention
[0004] To overcome the problems existing in the related art, the embodiments of the present application provide an information generation method, device, system, electronic device and storage medium.
[0005] According to a first aspect of an embodiment of the present application, there is provided an information generation method, the method comprising:
[0006] Receive target question information sent by the client;
[0007] If there is a FAQ database, calling a vector retrieval module to retrieve a candidate question vector matching the target question information in the FAQ database; wherein the vector retrieval module is arranged in the answer generation link;
[0008] If there is a target question vector that meets the preset conditions in the candidate question vectors, determining the target answer information corresponding to the target question information according to the target question vector;
[0009] If the FAQ database does not exist or the target question vector that meets the preset condition does not exist in the candidate question vector, the target answer information corresponding to the target question information is generated through the answer generation link.
[0010] According to a second aspect of an embodiment of the present application, there is provided an information generation method, the method comprising:
[0011] Receive target question information input by the user;
[0012] The target question information is sent to a server, so that after receiving the target question information, if the FAQ database exists, the server calls a vector retrieval module to retrieve a candidate question vector matching the target question information in the FAQ database; if the target question vector that meets the preset conditions exists in the candidate question vectors, the target answer information corresponding to the target question information is determined according to the target question vector; if the FAQ database does not exist or the target question vector that meets the preset conditions does not exist in the candidate question vectors, the target answer information corresponding to the target question information is generated through an answer generation link; wherein the vector retrieval module is arranged in the answer generation link;
[0013] Receive and display the target answer information returned by the server.
[0014] According to a third aspect of an embodiment of the present application, there is provided an information generation method, the method comprising:
[0015] In response to the FAQ creation operation, a FAQ data creation interface is displayed; wherein the FAQ data creation interface includes an interface for uploading information;
[0016] Receive FAQ related information through the interface;
[0017] The FAQ related information is sent to a server so that the server stores the FAQ related information in a FAQ database, and upon receiving the target question information sent by the client, a vector retrieval module is called to retrieve a candidate question vector matching the target question information in the FAQ database.
[0018] According to a fourth aspect of an embodiment of the present application, there is provided an information generation method, the method comprising:
[0019] The client receives the target question information input by the user and sends the target question information to the server;
[0020] The server receives the target question information sent by the client;
[0021] If there is an FAQ database, the server calls a vector retrieval module to retrieve a candidate question vector matching the target question information in the FAQ database; wherein the vector retrieval module is arranged on the answer generation link;
[0022] If there is a target question vector that meets the preset conditions in the candidate question vectors, the server determines the target answer information corresponding to the target question information according to the target question vector;
[0023] If the FAQ database does not exist or the target question vector that meets the preset condition does not exist in the candidate question vector, the server generates the target answer information corresponding to the target question information through the answer generation link;
[0024] The server sends the target answer information to the client;
[0025] The client receives and displays the target answer information.
[0026] According to a fifth aspect of an embodiment of the present application, there is provided an information generation system, the system comprising a client and a server;
[0027] The client is used to receive target question information input by a user and send the target question information to the server;
[0028] The server is used to receive the target question information sent by the client, and if there is an FAQ database, call the vector retrieval module to retrieve the candidate question vector matching the target question information in the FAQ database; if there is a target question vector that meets the preset conditions in the candidate question vectors, determine the target answer information corresponding to the target question information according to the target question vector; if there is no FAQ database or the target question vector that meets the preset conditions does not exist in the candidate question vectors, generate the target answer information corresponding to the target question information through the answer generation link; and send the target answer information to the client; wherein the vector retrieval module is arranged in the answer generation link;
[0029] The client is also used to receive and display the target answer information returned by the server.
[0030] According to a sixth aspect of an embodiment of the present application, there is provided an information generating device, the device comprising:
[0031] A receiving module, used for receiving target question information sent by the client;
[0032] A calling module, configured to call a vector retrieval module to retrieve a candidate question vector matching the target question information from a FAQ database if there is one; wherein the vector retrieval module is arranged in an answer generation link;
[0033] A first determination module, configured to determine target answer information corresponding to the target question information according to the target question vector if there is a target question vector satisfying a preset condition in the candidate question vectors;
[0034] A generating module is used to generate target answer information corresponding to the target question information through the answer generating link if the FAQ database does not exist or the target question vector that meets the preset condition does not exist in the candidate question vector.
[0035] According to a seventh aspect of an embodiment of the present application, there is provided an information generating device, the device comprising:
[0036] A first receiving module is used to receive target question information input by a user;
[0037] A second sending module is used to send the target question information to a server, so that after receiving the target question information, if the FAQ database exists, the server calls the vector retrieval module to retrieve the candidate question vector matching the target question information in the FAQ database; if the target question vector that meets the preset conditions exists in the candidate question vectors, the target answer information corresponding to the target question information is determined according to the target question vector; if the FAQ database does not exist or the target question vector that meets the preset conditions does not exist in the candidate question vectors, the target answer information corresponding to the target question information is generated through an answer generation link; wherein the vector retrieval module is arranged in the answer generation link;
[0038] The first display module is used to receive and display the target answer information returned by the server.
[0039] According to an eighth aspect of an embodiment of the present application, there is provided an information generating device, the device comprising:
[0040] A fourth display module, for displaying a FAQ data creation interface in response to the FAQ creation operation; wherein the FAQ data creation interface includes an interface for uploading information;
[0041] A second receiving module, used for receiving FAQ related information through the interface;
[0042] The fourth sending module is used to send the FAQ related information to the server so that the server stores the FAQ related information in the FAQ database, and upon receiving the target question information sent by the client, call the vector retrieval module to retrieve the candidate question vector matching the target question information in the FAQ database.
[0043] According to the ninth aspect of the embodiments of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in the first aspect; or, the processor executes the program to implement the method described in the second aspect; or, the processor executes the program to implement the method described in the third aspect.
[0044] According to the tenth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and the program is executed by a processor to implement the method described in the first aspect; or, the program is executed by a processor to implement the method described in the second aspect; or, the program is executed by a processor to implement the method described in the third aspect.
[0045] According to the eleventh aspect of the embodiments of the present application, a computer program product is provided, comprising instructions, which, when the instructions are executed on a computer, cause the computer to execute the method described in the first aspect; or, when the instructions are executed on a computer, cause the computer to execute the method described in the second aspect; or, when the instructions are executed on a computer, cause the computer to execute the method described in the third aspect.
[0046] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0047] The method provided in the embodiment of the present application, after receiving the target question information sent by the client, if there is an FAQ database, calls the vector retrieval module in the answer generation link to retrieve the candidate question vector matching the target question information in the FAQ database, and if the candidate question vector has a target question vector that meets the preset conditions, determines the target answer information corresponding to the target question information according to the target question vector; that is, in the embodiment of the present application, if there is an FAQ database, the corresponding target answer information is preferentially searched in the FAQ database, and some common questions and their corresponding answers are stored in the FAQ database. Therefore, by preferentially searching in the FAQ database, on the one hand, the corresponding target answer information can be quickly matched, thereby improving the answer generation speed; on the other hand, for some short questions, the answer information obtained is relatively simple. The accuracy of the information will be higher; if there is no FAQ database or the target question vector that meets the preset conditions does not exist in the candidate question vector, the target answer information corresponding to the target question information is generated through the answer generation link; that is, in the embodiment of the present application, through the setting of the answer generation link, it is guaranteed that for the target question information that cannot be obtained from the FAQ database, the corresponding target answer information can also be generated; therefore, through the present technical solution, it is guaranteed that the target answer information can be obtained, and at the same time, the accuracy of the answers to some short questions is guaranteed; in addition, the vector retrieval module in the embodiment of the present application is set in the answer generation link, and the target answer information matched through the FAQ database and the answer generation link share a vector retrieval module, which can reduce the development, management and maintenance costs of the software system used to implement the method.
[0048] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments of the present application. It should be understood that for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor.
[0050] Figure 1 A schematic diagram of an application scenario of the information generation method provided in an embodiment of the present application;
[0051] Figure 2 One of the method flow diagrams of the information generation method provided in the embodiment of the present application;
[0052] Figure 3 The second method flow diagram of the information generation method provided in the embodiment of the present application;
[0053] Figure 4The third method flow diagram of the information generation method provided in the embodiment of the present application;
[0054] Figure 5 A schematic diagram of a flow chart of an information generation method provided in an embodiment of the present application;
[0055] Figure 6 A schematic diagram of the FAQ database generation process in the information generation method provided in an embodiment of the present application;
[0056] Figure 7 A schematic diagram of a processing flow executed by a vector retrieval module in the information generation method provided in an embodiment of the present application;
[0057] Figure 8 A fourth method flow chart of the information generation method provided in an embodiment of the present application;
[0058] Fig.9A This is one of the interface schematic diagrams of the answer display interface in the information generation method provided in the embodiment of the present application;
[0059] Fig. 9B This is a second schematic diagram of an answer display interface in the information generation method provided in an embodiment of the present application;
[0060] Fig. 9C The third interface diagram of the answer display interface in the information generation method provided in the embodiment of the present application;
[0061] Fig.10 A fifth method flow chart of the information generation method provided in an embodiment of the present application;
[0062] Fig.11A This is one of the interface schematic diagrams of the data configuration interface in the information generation method provided in the embodiment of the present application;
[0063] Fig. 11B This is a second schematic diagram of the data configuration interface in the information generation method provided in an embodiment of the present application;
[0064] Fig. 11C The third interface diagram of the data configuration interface in the information generation method provided in the embodiment of the present application;
[0065] Fig.11D This is a fourth interface diagram of a data configuration interface in the information generation method provided in an embodiment of the present application;
[0066] Fig.11E This is a fifth interface diagram of a data configuration interface in the information generation method provided in an embodiment of the present application;
[0067] Fig.12 This is one of the interactive flow diagrams in the information generation method provided in the embodiment of the present application;
[0068] Fig.13 The second interactive flow diagram of the information generation method provided in the embodiment of the present application;
[0069] Fig.14 One of the structural schematic diagrams of the information generation system provided in the embodiment of the present application;
[0070] Fig.15 The second structural diagram of the information generation system provided in the embodiment of the present application;
[0071] Fig.16 This is one of the schematic diagrams of the module composition of the information generating device provided in the embodiment of the present application;
[0072] Fig.17 The second schematic diagram of the module composition of the information generating device provided in the embodiment of the present application;
[0073] Fig.18 The third schematic diagram of the module composition of the information generating device provided in the embodiment of the present application;
[0074] Fig.19 An exemplary structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0075] The technical solution of the embodiment of the present application is described below in conjunction with the drawings in the embodiment of the present application.
[0076] The terms used in the following embodiments of the present application are for the purpose of describing specific embodiments, and are not intended to be used as limitations on the technical solutions of the present application. As used in the specification and appended claims of the present application, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to include plural expressions as well, unless there is a clear indication to the contrary in the context.
[0077] It should also be understood that although the terms first, second, etc. may be used to describe a certain type of object in the following embodiments, the object should not be limited to these terms. These terms are used to distinguish the specific implementation objects of this type of object.
[0078] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0079] Large models refer to machine learning models with large-scale parameters and complex computing structures. They are usually built by deep neural networks and have billions or even hundreds of billions of parameters. Large models are widely used in various fields, including natural language processing, computer vision, speech recognition, and recommendation systems. Since large language models for natural language processing have many advantages when performing reasoning, they have been widely used in the field of intelligent question answering. In many question-answering scenarios, large language models are usually introduced to assist or replace manual question answering.
[0080] When using a large language model to assist or replace manual answering of questions, it is usually necessary to establish a document database, first retrieve the fragments related to the question in the document database, and then use the reasoning ability of the large language model to generate the answer to the question. However, for some scenarios with relatively short questions, the corresponding text maintained in the document database is usually also some short text, which will result in less fragment content for the large language model to reason, and the reasoning results may be inaccurate.
[0081] Based on this, the embodiment of the present application provides a method for generating information. Figure 1 A schematic diagram of an application scenario of the information generation method provided in the embodiment of the present application, in Figure 1 In the illustrated scenario, a client 110 and a server 120 are included, and two answer generation links are deployed in the server, namely, a frequently asked questions (FAQ) retrieval link 121 and an answer generation link 122. The FAQ retrieval link 121 obtains answer information by searching in the FAQ database, and the answer generation link 122 obtains answer information by model reasoning. In the embodiment of the present application, when the FAQ retrieval link 121 performs answer retrieval in the FAQ database, it is necessary to call a vector retrieval module 123 in the answer generation link 122. Among them, the FAQ database maintains common questions and corresponding answer information.
[0082] In some optional embodiments, the above answer generation link may also be referred to as a retrieval enhanced generation (RAG) link.
[0083] Among them, the hardware entity of the client 110 can be a computing device such as a mobile phone, a tablet computer, a laptop computer, a desktop computer or an all-in-one computer. In an optional embodiment, the user inputs the target question information to be asked through the client 110. After receiving the target question information input by the user, the client 110 sends the target question information to the server 120. After receiving the target question information sent by the client 110, the server 120 determines whether there is a FAQ database. If so, the vector retrieval module 123 is called to perform a vector search in the FAQ database through the vector retrieval module 123, and then the target answer information corresponding to the target question information is obtained, and the target answer information is sent to the client 110; if the target answer information cannot be obtained through the FAQ retrieval link 121 or the FAQ database does not exist, the corresponding target answer information is generated through the answer generation link 122, and the server 120 sends the generated target answer information to the client 110.
[0084] It should be noted that Figure 1 This is just an example of a possible application scenario of the technical solution of the present application, and does not constitute a limitation on the technical solution of the present application. In some other implementations, the application scenario of the information generation method involved in the present application may also include more or fewer components, or include more or fewer steps.
[0085] Figure 2 One of the method flow diagrams of the information generation method provided in the embodiment of the present application is shown, Figure 2 The method shown can be applied to Figure 1 The server in the application scenario shown. Figure 2 As shown, the method includes:
[0086] Step 201: Receive target question information sent by the client.
[0087] If the FAQ database exists, execute step 202; if the FAQ database does not exist, execute step 204.
[0088] Step 202, calling a vector retrieval module to retrieve candidate question vectors matching the target question information in the FAQ database; wherein the vector retrieval module is arranged in the answer generation link.
[0089] If so, there is a target question vector that meets the preset conditions in the candidate question vectors, then step 203 is executed; if there is no target question vector that meets the preset conditions in the candidate question vectors, then step 204 is executed.
[0090] Step 203: Determine target answer information corresponding to the target question information according to the target question vector.
[0091] Step 204: Generate target answer information corresponding to the target question information through the answer generation link.
[0092] In an optional implementation, the user may input target question information to be asked on the question input interface of the client, and after receiving the target question information input by the user, the client sends the target question information to the server.
[0093] Usually, in intelligent question-and-answer scenarios, in order to assist or replace manual generation of corresponding answers, it is necessary to establish a knowledge base associated with the client and store it in the server. The knowledge base may include a document database for generating answer information through reasoning, and may also include a FAQ database. In an embodiment of the present application, in order to improve the accuracy of answers generated for short questions, after receiving the target question information sent by the client, it is first determined whether there is a FAQ data block in the knowledge base associated with the client. If there is a FAQ database, it will first choose to generate the corresponding answer information based on the FAQ data retrieval. Therefore, when the server receives the target question information sent by the client, it first determines whether there is a FAQ database in the database corresponding to the client. If there is a FAQ database, it will be generated through Figure 1 The FAQ retrieval link 121 in the scene graph shown in the figure determines the target answer information corresponding to the target question information. If there is no FAQ database, Figure 1 The answer generation link 122 in the illustrated scenario determines target answer information corresponding to the target question information.
[0094] In an optional implementation, the FAQ database stores question vectors. Therefore, it is necessary to use a vector retrieval module to retrieve candidate question vectors matching the target question information in the FAQ database.
[0095] Exemplarily, a separate vector retrieval module is not provided in the FAQ retrieval link 121, that is, in the embodiment of the present application, the FAQ retrieval link 121 and the answer generation link 122 share a common vector retrieval module. Therefore, when searching for the target answer information corresponding to the target question information through the FAQ retrieval link, it is necessary to call the vector retrieval module in the answer generation link 122, and retrieve the candidate question vector matching the target question information in the FAQ database through the vector retrieval module.
[0096] Among them, when searching for candidate question vectors matching the target question information in the FAQ database through the vector retrieval module, the candidate question vectors that may be retrieved are one or more question vectors that are relatively matched with the target question information in the FAQ database. However, in fact, the similarity between the retrieved candidate question vectors and the target question information may not meet the requirements. Therefore, in the embodiment of the present application, after the candidate question vectors are retrieved through the vector retrieval module, it is necessary to further determine whether the candidate question vectors meet the preset conditions.
[0097] Exemplarily, the above-mentioned preset condition may be that the similarity between the candidate question vector and the vector corresponding to the target question information is higher than a preset threshold, for example, 0.8. Of course, the specific value of the preset threshold may also be other, which is only an exemplary description. The above-mentioned similarity may be represented by Euclidean distance.
[0098] In an optional implementation, for any candidate question vector, the similarity value between the candidate question vector and the vector corresponding to the target question information can be calculated to determine whether each similarity value meets the above-mentioned preset conditions. Among them, a specific expression of the similarity value can be the Euclidean distance. If there is no target question vector that meets the preset conditions in the above-mentioned candidate question vectors, it means that the question vectors stored in the FAQ database have a low similarity with the target question information. At this time, if the corresponding target answer information is still determined based on the FAQ retrieval results, there may be a problem of low similarity between the target answer information and the target question information, that is, low accuracy of the target answer information; therefore, in this case, in order to ensure the accuracy of the generated answer information, it is necessary to use an answer generation link to generate the target answer information corresponding to the target question information.
[0099] In the embodiment of the present application, if there is an FAQ database, the corresponding target answer information is searched in the FAQ database first. The FAQ database stores some common questions and their corresponding answers. Therefore, by searching in the FAQ database first, on the one hand, the corresponding target answer information can be quickly matched to improve the answer generation speed; in addition, for some short questions, the accuracy of the answer information obtained will be higher; if there is no FAQ database or there is no target question vector that meets the preset conditions in the candidate question vector, the target answer information corresponding to the target question information is generated through the answer generation link; that is, in the embodiment of the present application, through the setting of the answer generation link, it is ensured that for the target question information that cannot be obtained from the FAQ database, the corresponding target answer information can also be generated; therefore, through this technical solution, it is ensured that the target answer information can be obtained, and at the same time, the accuracy of the answers to some short questions is guaranteed; in addition, the vector retrieval module in the embodiment of the present application is set in the answer generation link, and the target answer information matched through the FAQ database and the answer generation link share a vector retrieval module, which can reduce the development, management and maintenance costs of the software system used to implement the method.
[0100] Optionally, in some application scenarios, multiple applications may be deployed on the client. For example, the client is the client corresponding to the internal middle platform of the enterprise. In order to meet the internal needs of the enterprise, the middle platform needs to integrate multiple task systems. Accordingly, multiple applications will be deployed on the client, such as onboarding applications, physical examination applications, travel reimbursement applications, etc. For different applications, the data that needs to be maintained in the database used to generate answer information is not the same. Therefore, in order to improve the efficiency of answer generation and reduce the amount of data retrieval, one application can correspond to one knowledge sub-base, and one knowledge sub-base is used to maintain the data of one application. Any knowledge sub-base includes a document sub-database and may also include a FAQ sub-database. Therefore, in an embodiment of the present application, the above-mentioned FAQ database includes multiple FAQ sub-databases, any FAQ sub-database maintains the data of the corresponding application, and any application is pre-deployed on the client. That is, one application corresponds to one FAQ sub-database.
[0101] Optionally, before calling the vector retrieval module to retrieve candidate question vectors matching the target question information in the FAQ database, the method provided in the embodiment of the present application further includes the following steps:
[0102] Determine whether there is a corresponding target FAQ sub-database for the target application to which the target question information belongs;
[0103] If the target FAQ sub-database exists, the calling vector retrieval module retrieves candidate question vectors matching the target question information in the FAQ database, including:
[0104] The vector retrieval module is called to retrieve candidate question vectors matching the target question information in the target FAQ sub-database.
[0105] Optionally, for the FAQ sub-database corresponding to any application, an association relationship between the identification information of each application and the corresponding FAQ sub-database can be established in the server. Exemplarily, the name of each FAQ sub-database can be associated with the identification information of the application, or, an association relationship table between the identification information of the application and each FAQ sub-database can be maintained in the server. Here, two possible implementation methods of the management relationship between the identification information of the application and the FAQ sub-database are listed by way of example only, and are not intended to limit the present application scheme. Any method that can achieve the establishment of an association relationship between the identification information of the application and the FAQ sub-database can be applied to the present application scheme.
[0106] In an optional implementation, in the case where multiple applications are deployed on the client, when the user needs to ask a question, the user opens the corresponding application through the client and enters the target question information in the question input interface of the application. The client receives the target question information entered by the user, and sends the target question information and the identification information of the corresponding target application to the server. After receiving the target question information and the identification information of the target application sent by the client, the server searches for the target FAQ sub-database corresponding to the identification information based on the identification information. If it exists, the call vector retrieval module is executed to retrieve the candidate question vector matching the target question information in the target FAQ sub-database. If it does not exist, the target answer information corresponding to the target question information is generated through the answer generation link.
[0107] In the embodiment of the present application, the data of an application is maintained through an FAQ sub-database, so that each FAQ sub-database only needs to maintain the data of the corresponding application, and the amount of data maintained is relatively small. Accordingly, when the vector retrieval module is called to retrieve the candidate question vector matching the target question information in the FAQ sub-database, the retrieval amount of the vector retrieval module can be reduced, thereby saving computing overhead; in addition, since the retrieval amount of the vector retrieval module is reduced, the retrieval time can be shortened, and then the answer generation time can be shortened, which can increase the speed of returning the answer information to each client and reduce the user's waiting time.
[0108] In an embodiment of the present application, in order to reduce the development, management and maintenance costs of the software system, the answer generation link and the FAQ retrieval link share a vector retrieval module, but when the vector retrieval module performs a vector retrieval task in the answer generation link and the FAQ retrieval link, the specific retrieval logic is not exactly the same. For example, when the vector retrieval module performs a retrieval task in the FAQ retrieval link, it is necessary to match the vector corresponding to the target question information with each question vector stored in the FAQ database, and when the vector retrieval module performs a retrieval task in the answer generation link, it is necessary to match the vector corresponding to the target question information with the document vector in the document database and the document title vector corresponding to the document vector. Therefore, in order to realize that the FAQ retrieval link and the answer generation link share a vector retrieval module, the vector retrieval module needs to determine in which link the vector retrieval is performed before performing the retrieval task.
[0109] Therefore, in an optional implementation, the calling vector retrieval module retrieves candidate question vectors matching the target question information in the target FAQ sub-database, including the following steps:
[0110] The vector retrieval module is called to determine whether the current task to be executed is to perform a vector search in the FAQ sub-database; if so, the target semantic vector corresponding to the above target question information is determined through the vector retrieval module; the question vector in the target FAQ sub-database that matches the target semantic vector is determined as a candidate question vector.
[0111] Illustratively, after receiving the task instruction, the vector search module may determine whether the task currently to be executed is to perform a vector search in the FAQ sub-database based on the identification information of the database carried in the task instruction.
[0112] The above-mentioned determination of the target semantic vector corresponding to the target question information by the vector retrieval module may be to extract features of the target question information to obtain the target semantic vector. The specific process of extracting features of the target question information may refer to the existing feature extraction method, which will not be described in detail here.
[0113] In an optional implementation, after obtaining the target semantic vector corresponding to the target question information, the target semantic vector is matched one by one with each question vector stored in the target FAQ sub-database, and a candidate question vector is determined based on the matching results of each vector. Exemplarily, one or more question vectors with the highest matching degree in the matching results can be used as candidate question vectors. Of course, when determining the candidate question vector based on the matching results, it can also be achieved in other ways, which will not be described one by one here.
[0114] The number of the obtained candidate question vectors may be one or more. Of course, in some implementations, if there is no question vector related to the target semantic vector in the target FAQ sub-database, the number of the candidate question vectors obtained in the above steps may also be 0.
[0115] In an embodiment of the present application, by adding logic in the vector retrieval module to determine whether to execute the vector retrieval service in the FAQ sub-database, the FAQ retrieval link and the answer generation link share a vector retrieval module, which can meet the different requirements of different links for the vector retrieval module, thereby improving the accuracy of the vector retrieval of each link.
[0116] Generally, for any FAQ sub-database, it maintains data corresponding to an application, and the amount of data is still large. Considering that there may be multiple different problems in an application, for example, assuming that a certain FAQ sub-database maintains data corresponding to an onboarding application, for the onboarding application, the problems involved may include problems related to asset requisition, problems related to onboarding process, and problems related to company rules and regulations, etc. Therefore, in order to further improve the efficiency of vector retrieval, the question vectors in each FAQ sub-database can be clustered in advance to obtain multiple FAQ question subsets; that is, in the embodiment of the present application, any FAQ sub-database includes multiple FAQ question subsets, and any FAQ subset maintains a category of question vectors.
[0117] Therefore, in the embodiment of the present application, the target semantic vector also includes the category features of the target question information;
[0118] Accordingly, the above-mentioned determination of the question vector matching the target semantic vector in the target FAQ sub-database as the above-mentioned candidate question vector may include the following process:
[0119] The FAQ question subset corresponding to the target question information in the target FAQ sub-database is determined according to the category features; the question vector in the FAQ question subset that matches the target semantic vector is determined as a candidate question vector.
[0120] In order to implement the above solution, when extracting features of the target question information through the vector retrieval module, it is also necessary to extract the category features of the target question information.
[0121] In an optional embodiment, after the question vectors are clustered in each FAQ sub-database, the correspondence between each FAQ subset and the category to which it belongs can be stored. For example, the FAQ subset can be named based on the category information, or the correspondence table between the FAQ subset and the corresponding category information can be separately maintained. Therefore, when matching the target semantic vector with each question vector stored in the target FAQ sub-database, the category features corresponding to the target question information can be first matched with the category information corresponding to each FAQ subset in the target FAQ sub-database to determine the FAQ subset that matches the category features corresponding to the target question information. Then, the target semantic vector is matched with each question vector in the FAQ subset, so as to obtain a candidate question vector that matches the target semantic vector.
[0122] In an embodiment of the present application, each FAQ sub-database is divided into multiple FAQ question subsets, and one FAQ question subset maintains a category of question vectors. In this way, when the vector retrieval module performs vector retrieval, it can first determine the target FAQ question subset corresponding to the target question information based on the category features corresponding to the target question information, and then only match the target semantic vector with each corresponding question vector in the FAQ question subset, thereby further reducing the retrieval volume of the vector retrieval service module and improving the retrieval speed. In addition, it further reduces the computational overhead caused by vector retrieval.
[0123] The specific representation form of the target question vector is a vector, but the answer information finally returned to the client is text information, so it is necessary to obtain the answer text information corresponding to the target question vector. In an optional implementation, the answer vector corresponding to the target question vector may be first searched, and the corresponding answer text may be generated based on the answer vector. In addition, the corresponding answer text information may be searched based on the target question vector, that is, the answer text information may be pre-stored.
[0124] Therefore, in an optional implementation, the FAQ database includes a FAQ text library and a FAQ vector library, and the target question vector is stored in the FAQ vector library;
[0125] Accordingly, the above-mentioned determination of the target answer information corresponding to the target question information according to the target question vector may include the following process:
[0126] Determine a target question vector with the highest similarity to the target question information from the above target question vectors; obtain the target question identification information corresponding to the target question vector with the highest similarity from the FAQ vector library; and search the FAQ text library for answer information corresponding to the target question identification information as the target answer information.
[0127] In the embodiment of the present application, a FAQ database is composed of two databases, one is a FAQ text library for storing answer text information, and the other is a FAQ vector library for storing question vectors.
[0128] Exemplarily, the FAQ vector library may store each question vector and its corresponding question identification information, that is, the FAQ vector library maintains a one-to-one correspondence between the question vector and the question identification information. The FAQ text library may store each question identification information and its corresponding question answer information, that is, the FAQ text library maintains a one-to-one correspondence between the question identification information and the question answer information.
[0129] Of course, in some other implementations, the mapping relationship between the question vector, the answer vector and the question identifier can also be maintained in the FAQ vector library; the mapping relationship between the question identifier information, the question text information and the answer text information can be maintained in the FAQ text library. Alternatively, the corresponding relationship between the question vector and the question identifier information is maintained in the FAQ vector library, and the corresponding relationship between the question identifier information, the question text information and the answer text is maintained in the FAQ text library. When implementing this solution, the specific data that needs to be maintained in the FAQ vector library and the FAQ text library can be determined according to actual needs.
[0130] Usually, one question generates one answer information. However, in the embodiment of the present application, the number of target question vectors that meet the preset conditions in the above-mentioned candidate question vectors can be one or more. Therefore, if the number of target question vectors is one, the target question identification information corresponding to the target question vector can be directly obtained from the FAQ vector; if the number of target question vectors is multiple, first determine the target question vector with the highest similarity to the target question information from the above-mentioned target question vectors, and obtain the target question identification information corresponding to the target question vector with the highest similarity from the FAQ vector library.
[0131] After obtaining the target question identification information from the FAQ vector library, the question identification information matching the target question identification information is searched in the FAQ text library based on the question identification information, and the answer information corresponding to the matching question identification information is determined as the target answer information.
[0132] In an embodiment of the present application, a FAQ text library is set up, and the answer text information corresponding to each question is stored in the FAQ text library. In this way, after determining a target question vector with the highest similarity with the target question information, the corresponding text answer can be directly searched in the FAQ text library based on the target question identification information corresponding to the target question vector. There is no need to calculate the corresponding text information based on the vector, which can further shorten the time spent on answer generation and thereby improve the speed of answer generation.
[0133] Exemplarily, in the case where the FAQ database includes multiple FAQ sub-databases, one FAQ sub-database may include a FAQ sub-text library and a FAQ sub-vector library. Alternatively, one FAQ sub-database may include a FAQ sub-vector library, and multiple FAQ sub-databases may share one FAQ text library. In specific implementation, it may be set according to actual needs, and the embodiments of the present application are not limited to this.
[0134] In some embodiments, after asking a question, the user may need to ask some related questions around the question, or the question entered by the user may not be very accurate, resulting in the returned answer not being what the user wants to consult. Therefore, while returning the target answer information to the user, the recommended question information can also be returned to the user to facilitate the user to ask again. Therefore, in the embodiment of the present application, if there is a target question vector that meets the preset conditions in the candidate question vector, the method provided in the embodiment of the present application also includes the following process:
[0135] A target number of target question vectors are selected from the target question vectors in order of similarity from high to low as recommended question vectors; recommended question information corresponding to the recommended question vectors is determined; and the recommended question information and target answer information are sent to the client.
[0136] Of course, in some implementations, if the number of target question vectors that meet the preset conditions in the candidate question vectors is one, then only the target answer information may be returned to the client. If the number of target question vectors that meet the preset conditions in the candidate question vectors is multiple, then the recommended question information and the target answer information may be returned to the client together.
[0137] Exemplarily, the value of the above target number can be three or four, etc. The specific number can be set according to actual needs. The embodiment of the present application does not limit the specific value of the above target number.
[0138] After obtaining the candidate question vectors matching the target semantic vector through the vector retrieval module, the similarity values between the candidate question vectors and the target semantic vector can be calculated, and the target question vector can be selected in descending order of similarity. One possible form of the similarity value is the Euclidean distance.
[0139] After obtaining the above-mentioned recommended question vector, the question identification information corresponding to the recommended question vector is determined in the FAQ vector library, and the corresponding question text information is searched in the FAQ text library based on the question identification information as the recommended question information; the above-mentioned recommended question information and the target answer information are returned to the client together.
[0140] Of course, in addition to this, after obtaining the above-mentioned recommended question vector, a corresponding vector-to-text algorithm can also be used to generate corresponding text based on the recommended question vector as recommended question information.
[0141] In addition, it should be noted that in some embodiments, in order to improve the hit rate of questions asked by users, some questions with semantic similarity to the question may be stored in the FAQ database and stored as similar question vectors, but the answer information corresponding to these questions is the same. For example, assuming that a question is "apply for another monitor", the similar questions corresponding to this question may be "I already have a monitor, can I apply for a second display screen", "Change to a 2K monitor", "Can I change to a 27-inch monitor", "The monitor is blurry", etc., but the answer information corresponding to these questions is the same. Therefore, for this example, a possible implementation method may be to store the above-mentioned question vectors and their corresponding question identification information in the FAQ vector library respectively; and store each question identification information and the corresponding answer text information in the FAQ text library.
[0142] Therefore, for this situation, there may be target question vectors with the same answer among the target question vectors that meet the preset conditions in the above candidate question vectors. Therefore, in an optional embodiment, the target question vectors with the same answer in the target question vectors can be eliminated, and then a target number of target question vectors are selected from the target question vectors in order of similarity from high to low as recommended question vectors; or, after selecting the target number of target question vectors, the target question vectors with repeated answers in the selected target question vectors are eliminated, that is, only one target question vector with repeated answers is retained, and after eliminating the target question vectors with repeated answers, the recommended question vector is obtained.
[0143] In an embodiment of the present application, by returning the recommended question information and the target answer information to the client together, when the user asks questions around the question again, he can directly select the questions to be asked from the recommended question information. The operation is simple and convenient, which makes it easy for the user to ask questions again.
[0144] Usually, when data is transmitted between a server and a client, the data needs to be encapsulated before the data is transmitted. Therefore, in an embodiment of the present application, before sending the recommended question information and the target answer information to the client, the recommended question information and the target answer information need to be encapsulated according to the client's requirements. In an optional implementation, the sending of the recommended question information and the target answer information to the client may include the following process:
[0145] The recommended question information and target answer information are encapsulated in a preset encapsulation format to obtain data to be transmitted; a link relationship between the recommended question information and the corresponding answer information in the data to be transmitted is constructed; and the data to be transmitted after the link relationship is constructed is sent to the client.
[0146] The above-mentioned preset encapsulation format is set based on the requirements of the client. For different clients, the specific format of the above-mentioned preset encapsulation format may be different.
[0147] For example, in some optional implementations, the client may be a client of an independent system, and the system may be integrated as a subsystem on a client corresponding to another system. Therefore, even if the same system is used, the corresponding clients may be different. Therefore, when encapsulating the recommended question information and the target answer information, the client that needs to send the target question information needs to encapsulate it using the corresponding preset encapsulation format.
[0148] Among them, different clients are used to send the above-mentioned target question information, and the ports through which the server receives the target question information are different. Therefore, the corresponding client can be determined based on the port through which the target question information is received, and then the above-mentioned recommended question information and target answer information can be encapsulated using the encapsulation format required by the client.
[0149] Of course, in an optional implementation, when encapsulating the above-mentioned recommended question information and target answer information, the storage format corresponding to the target answer information and the recommended question information can also be considered. For example, it can be stored in the FAQ database in Markdown format, of course, it can also be other formats, which will not be described here one by one.
[0150] Usually, before returning the above-mentioned recommended question information to the client, in order to facilitate the user to quickly obtain the answer information corresponding to the recommended question information, and to reduce the search volume corresponding to the recommended question information obtained by the server, in the embodiment of the present application, after obtaining the above-mentioned recommended question information, the corresponding answer information can be searched in the FAQ text library based on the question identification information of the recommended question information, and a link relationship between the recommended question information and the corresponding answer information can be established, and the data to be transmitted with the above-mentioned link relationship can be sent to the client. In this way, when the user chooses to ask the recommended question information, the corresponding answer information can be quickly obtained based on the link relationship.
[0151] For example, when the data to be transmitted after the link relationship is established is sent to the client, the agreed protocol can be transparently transmitted, or the DingTalk message delivery protocol (DTMD) can be used for data transmission. During implementation, the corresponding data transmission protocol can be selected according to actual needs.
[0152] To facilitate understanding of the method provided by the embodiment of the present application, the following will describe it in conjunction with the embodiment. In an optional implementation, multiple applications are pre-deployed on the client, and multiple FAQ sub-databases are stored in the server, one FAQ sub-database maintains data of one application, and one FAQ sub-database includes a FAQ sub-vector library and a FAQ sub-text library, one FAQ sub-vector library contains multiple FAQ question subsets, and one FAQ question subset corresponds to a category of question vectors. For this application scenario, Figure 3 The second method flow chart of the information generation method provided in the embodiment of the present application is as follows: Figure 3 As shown, the method includes:
[0153] Step 301: Receive target problem information and target application information to which the target problem belongs, sent by a client.
[0154] Step 302 , determine whether there is a target FAQ sub-database corresponding to the target application; if so, execute step 303 ; otherwise, execute step 315 .
[0155] Step 303: call the vector retrieval module in the answer generation link.
[0156] Step 304 , determining through the vector search module whether the task currently to be executed is to perform a vector search in the FAQ sub-database; if so, executing step 305 ; otherwise, executing step 315 .
[0157] Step 305: determine the target semantic vector corresponding to the target question information through a vector retrieval module; wherein the target semantic vector includes the category feature of the target question information.
[0158] Step 306: Determine the target FAQ question subset corresponding to the target question information in the FAQ sub-vector library according to the above category features.
[0159] Step 307: determine the question vectors in the target FAQ question subset that match the target semantic vector as candidate question vectors.
[0160] Step 308 , determining whether there is a target question vector that meets preset conditions in the candidate question vectors; if so, executing step 309 ; otherwise, executing step 315 .
[0161] Step 309 , determining a target question vector with the highest similarity among the target question vectors, and selecting a target number of target question vectors from the target question vectors in descending order of similarity as recommended question vectors.
[0162] Step 310: Obtain target question identification information corresponding to a target question vector with the highest similarity and recommended question identification information corresponding to the recommended question vector in the FAQ sub-vector library.
[0163] Step 311: Search the FAQ subtext library for target answer information corresponding to the target question identification information, and search for recommended question information corresponding to the recommended question identification information.
[0164] Step 312: encapsulate the recommended question information and target answer information according to a preset data format to obtain data to be transmitted.
[0165] Step 313: construct a link relationship between the recommended question information and the corresponding answer information in the data to be transmitted.
[0166] Step 314, sending the data to be transmitted after the link relationship is established to the client.
[0167] Step 315: Generate target answer information corresponding to the target question information through the answer generation link.
[0168] certainly, Figure 3 It only shows a possible implementation scheme of the above application scenario. In some other implementations, the information generation method provided in the embodiment of the present application may also include more or fewer steps.
[0169] In the embodiment of the present application, if there is no FAQ database, or if there is no target question vector satisfying the preset condition among the candidate question vectors retrieved from the FAQ database, then Figure 1The answer generation link 122 in the application scenario shown generates the target answer information corresponding to the target question information. Exemplarily, multiple applications can be deployed on the client, and one application corresponds to one document sub-database, that is, the document sub-database maintains knowledge documents related to the application. Therefore, in an optional implementation, the above-mentioned generation of the target answer information corresponding to the target question information through the answer generation link may include the following process:
[0170] A target document vector matching the target question information is retrieved in a target document sub-database through a vector retrieval module; target document information corresponding to the target document vector is determined; target prompt words are constructed according to a preset prompt word template based on the target question information and the target document information; the prompt words are input into an answer reasoning model, and target answer information is generated based on the target prompt words through the answer reasoning model; wherein the target document sub-database maintains data of a target application corresponding to the target question information, and the target application is pre-deployed on the client.
[0171] Usually, knowledge documents are stored in each document sub-database, and usually the knowledge documents stored are longer. Therefore, in order to facilitate the vector retrieval module to match the target question information with the knowledge document, when storing the knowledge document, any knowledge document can be divided into multiple document fragments, and each document fragment is converted into a document vector, and each document vector and its corresponding document title vector are stored.
[0172] In an optional implementation, the vector corresponding to the target question information may be matched with each document vector and corresponding document title stored in the target document sub-database by a vector retrieval module to obtain a target document vector that matches the target question vector.
[0173] The number of target document vectors matching the target question may be one or more.
[0174] For example, in the embodiment of the present application, the target document vector can be converted into target document information based on a corresponding vector-to-document algorithm. For example, an autoregressive model, a natural language generation method, a transformer model, etc. can be used. When implementing the solution, a corresponding algorithm can be selected according to actual needs to convert the vector into text information.
[0175] Usually, when using the inference model to generate the target answer information, it is necessary to first construct a prompt word (prompt), and input the prompt word into the inference model so that the inference model can infer the corresponding answer information according to the prompt word. Therefore, in the embodiment of the present application, it is necessary to construct the target prompt word according to the preset prompt word template based on the above-mentioned target question information and target document information.
[0176] For example, in an optional implementation, the constructed target prompt word is as follows:
[0177] rag_prompt="""#Role
[0178] You are a strict and polite customer service representative who needs to answer questions based on the user's questions and reference documents:
[0179] ${REFERENCE_DOC}, provide a detailed and accurate response.
[0180] #Skill
[0181] - Question understanding: You need to understand the questions raised by users and analyze and summarize them based on the content of the questions.
[0182] -Document retrieval: You need to search for relevant content in reference documents based on the user's question and find information that can answer the question.
[0183] -Information organization: You need to organize the information retrieved from the reference documents, associate the relevant information with the question, and form the answer content.
[0184] -Answer generation: You need to generate detailed and accurate answers based on the collated information, including detailed answers to the questions, analysis, processes, and precautions.
[0185] #limit
[0186] -You can only answer users' questions based on the reference documentation and cannot provide information that is not in the reference documentation.
[0187] -You need to ensure the accuracy of your answers and not fabricate or create answers.
[0188] -You need to indicate the source of the reference document in your answer so that users can further view related materials.
[0189] -If there is no reference document that can answer the question, you should simply answer "cannot answer based on the information available".
[0190] #question
[0191] """
[0192] Among them, ${REFERENCE_DOC} is the reference document, that is, the target document information in the embodiment of the present application.
[0193] Exemplarily, the answer reasoning model may be a large model, for example, the large model may be a natural language model (Large Language Model 1, LLM).
[0194] In an optional implementation, target answer information output by the answer reasoning model is obtained, and the target answer information is packaged according to a preset format, and the packaged answer information is returned to the client.
[0195] Generally, in addition to outputting the target answer information, the answer reasoning model also outputs the target document information referenced when generating the target answer information. For example, it can be the title information and source information of the target document. After obtaining the target answer information and target document information output by the answer reasoning model, the target answer information and target document information are packaged according to a preset format and returned to the client.
[0196] In some application scenarios, users may need to view the content of the reference document. Therefore, in order to facilitate users to view the target document information, before returning the encapsulated target answer information and target document information to the client, a link relationship between the target document information and the target document content can be established, and then the encapsulated data with the link relationship established can be returned to the client. In this way, when the user clicks on the target document information, it will jump to the content page of the corresponding target document, which is convenient for the user to view.
[0197] In an embodiment of the present application, when the target answer information is generated through the answer generation link, the document vector is matched in the document sub-database corresponding to the target application to which the target question information belongs through the vector retrieval module. Since only the data corresponding to the target application needs to be maintained in the document sub-database, the amount of stored data is relatively small, which can reduce the amount of calculation of the vector retrieval module for vector matching, reduce calculation overhead, and improve the retrieval speed.
[0198] In the embodiment of the present application, the above-mentioned searching of the target document vector matching the target question information in the target document sub-database by the vector retrieval module may include the following process:
[0199] When it is determined through the vector retrieval module that the current task to be performed is to perform vector retrieval in the document sub-database, the target semantic vector corresponding to the target question information is determined; the target semantic vector is matched with each document vector stored in the target document sub-database and the document title vector corresponding to the document vector to obtain a target document vector that matches the target question information.
[0200] In the embodiment of the present application, the FAQ search link and the answer generation link share a vector search module, but when the vector search module performs a vector search task in the answer generation link and the FAQ search link, the specific search logic is not exactly the same. Therefore, in order to achieve that the FAQ search link and the answer generation link share a vector search module, the vector search module needs to determine in which link the vector search is performed before performing the search task.
[0201] In an optional implementation, after receiving the task instruction, the vector retrieval module may determine whether the task currently to be executed is to perform a vector retrieval in the document sub-database based on the database identification information carried in the task instruction.
[0202] If the vector retrieval module determines that the current task to be performed is to perform vector retrieval in the document sub-database, the target semantic vector corresponding to the target question information is determined by the vector retrieval module. Optionally, feature information corresponding to the target question information can be extracted by the vector retrieval module as the target semantic vector.
[0203] Exemplarily, in an optional implementation, the target semantic vector can be matched with each document vector stored in the target document sub-database and the document title vector corresponding to each document vector to obtain each matching result. A preset number of document vectors with the highest matching degree can be selected as the target document vector, or a document vector with a matching degree higher than a target threshold can be selected as the target document vector. When implementing this solution, the selection can be made according to actual needs.
[0204] In an embodiment of the present application, before executing a retrieval task, the vector retrieval module first determines in which link the vector retrieval is to be executed, and then uses the corresponding retrieval logic to perform the vector retrieval. On the basis of realizing that two links share one vector retrieval module, the retrieval requirements of each link are also taken into account; in addition, for the answer generation link, when the vector retrieval module performs a vector search in the document sub-database, it simultaneously matches the document vector and its corresponding document title vector, thereby further improving the accuracy of the vector matching, thereby improving the accuracy of the generated answer.
[0205] Usually, a target document sub-database will maintain a large number of knowledge documents. If the target semantic vector is used to match all document vectors stored in the target document sub-database and their corresponding document title vectors each time during matching, the matching workload is large, which not only wastes computing resources but also takes a long time. Therefore, in an optional implementation, the document vectors stored in the target document sub-database can be clustered to obtain document subsets of each category, so that when matching the target semantic vector with the target document sub-database, it is only necessary to match the target semantic vector with the document vectors and their document title vectors in the document subset of the corresponding category.
[0206] Therefore, in the embodiment of the present application, any document sub-database includes multiple document subsets, and any document subset maintains a category of document vectors and its corresponding document title vector; accordingly, the target semantic vector includes the category feature of the target question information, and accordingly, the target semantic vector is matched with each document vector stored in the target sub-document database and the document title vector corresponding to the document vector to obtain the target document vector matching the target question information, which may include the following process:
[0207] The target document subset corresponding to the target question information in the target document sub-database is determined according to the category features; the target semantic vector is matched with each document vector in the target document subset and the document title vector corresponding to the document vector to obtain a target document vector matching the target question information.
[0208] That is, in the embodiment of the present application, when the target question information is subjected to feature extraction by the vector retrieval module, the category feature corresponding to the target question information can also be extracted. In this way, when matching the target document vector in the target document sub-database, the target document subset corresponding to the target question information can be first determined in the target document sub-database based on the category feature in the target semantic vector.
[0209] In an optional implementation, each document subset and its corresponding category information may be maintained in each document sub-database. For example, a mapping relationship table between document subsets and category information may be created, or the document subsets may be named using the category information, etc. Thus, during implementation, the category features in the target semantic vector may be matched with the mapping relationship table or the name of the document subset, thereby determining the target document subset corresponding to the target question information in the target document sub-database.
[0210] After obtaining the above target document subset, it is only necessary to match the target semantic vector with each document vector corresponding to the target document subset and the document title vector corresponding to each document vector to obtain the above target document vector.
[0211] In an embodiment of the present application, by dividing the document sub-database into multiple document subsets, one document subset maintains a document vector of a category and its corresponding document title vector. In this way, when the target document vector is retrieved through the vector retrieval module, the retrieval workload of the vector retrieval module can be further reduced, the retrieval efficiency can be improved, and the computational overhead caused by the retrieval can be saved.
[0212] To facilitate understanding of the method provided by the embodiment of the present application, the following will be described in conjunction with a specific embodiment. For example, in an optional application scenario, multiple applications are deployed on the client, a document sub-database maintains data corresponding to an application, a document sub-database includes multiple document subsets, and a document subset corresponds to a category of knowledge; for this application scenario, Figure 4 The third method flow diagram of the information generation method provided in the embodiment of the present application is shown as follows: Figure 4 As shown, the method comprises the following steps:
[0213] Step 401: receiving target problem information and target application information to which the target problem information belongs, sent by a client.
[0214] Step 402 , determine whether there is a target FAQ sub-database corresponding to the target application; if so, execute step 403 ; otherwise, execute step 406 .
[0215] Step 403, calling a vector retrieval module to retrieve candidate question vectors matching the target question information in the target FAQ sub-database; wherein the vector retrieval module is arranged in the answer generation link.
[0216] Step 404 , determining whether there is a target question vector that meets a preset condition among the candidate question vectors; if so, executing step 405 ; otherwise, executing step 406 .
[0217] Step 405: Determine target answer information corresponding to the target question information according to the target question vector.
[0218] Step 406 , determining through the vector search module whether the task currently to be executed is to perform vector search in the document sub-database; if so, executing step 407 .
[0219] Step 407, determining a target semantic vector corresponding to the target question information; wherein the target semantic vector includes a category feature.
[0220] Step 408: Determine the document subset corresponding to the target question information in the target document sub-database according to the category feature.
[0221] Step 409 , matching the target semantic vector with each document vector in the document subset and the document title vector corresponding to the document vector, to obtain a target document vector that matches the target question information.
[0222] Step 410: Determine the target document information corresponding to the target document vector.
[0223] Step 411 , constructing a target prompt word according to the target question information and the target document information according to a preset prompt word template.
[0224] Step 412, input the above prompt words into the answer reasoning model, and generate target answer information based on the target prompt words through the answer reasoning model.
[0225] To facilitate understanding of the information generation method provided in the embodiment of the present application, the following will be introduced in conjunction with a specific flowchart. Figure 5 A flow chart of the information generation method provided in the embodiment of the present application is as follows: Figure 5 As shown. The server receives the target question information sent by the client and the identification information of the target application to which the target question information belongs. The server determines whether there is a FAQ sub-database corresponding to the identification information. If so, the vector generation module in the answer generation link is called to search the FAQ sub-database for candidate question vectors that match the target question information, and determines whether there is a target question vector that meets the preset conditions in the candidate question vectors; if so, a target number of target question vectors are screened as recommended question vectors, and the recommended question information corresponding to the recommended question vector is obtained, as well as the target answer information corresponding to the target question vector with the highest similarity. The recommended question information and the target answer information are encapsulated and sent to the client.
[0226] If there is no FAQ sub-database corresponding to the identification information or there is no target question vector that meets the preset conditions in the candidate question vector, the target document matching the target question information is retrieved in the document sub-database corresponding to the identification information through the vector retrieval module, and a prompt word is constructed according to the target document and the target question information according to a preset prompt word template, and the prompt word is input into the large language model, and the target answer information is generated based on the prompt word through the large language model, and the target answer information and the target document information are encapsulated and returned to the client.
[0227] In an optional implementation, a user (such as an administrator) can upload FAQ-related information through a data maintenance terminal to create or expand a FAQ data set. The hardware entity of the data maintenance terminal can be a computing device such as a desktop computer, a laptop computer, a tablet computer, a mobile phone, etc. For example, a user can upload FAQ-related information documents on the data maintenance terminal, such as the FAQ-related information can be in Excel table format. Figure 6As shown, after the data maintenance end receives the FAQ-related information uploaded by the user, the FAQ-related information is sent to the server. The server receives the FAQ-related information sent by the data maintenance end through ili nk, and parses the FAQ-related information to obtain each question information and its corresponding answer information, and then generates a question vector corresponding to the question information and an answer vector corresponding to the answer information through a vector retrieval module, and generates identification information corresponding to the question vector, and stores the question vector, answer vector and corresponding identification information in a FAQ vector library, and stores the question identification information and its corresponding question text information and answer text information in a FAQ text library.
[0228] In one optional implementation, the FAQ text library may be an ili nk database, and the FAQ vector library may be an open search database.
[0229] Of course, in some optional implementations, the FAQ-related information may also include format information corresponding to the question information and the answer information, such as the format may be Markdown format or the like.
[0230] In addition, it should be noted that, in some embodiments, the above FAQ-related information may also include similar question information corresponding to each question information. These similar question information are the same as the answer information corresponding to the question information. When uploading, the user may upload it in the format of standard question-similar question-answer information, but when storing it in the FAQ database, it is necessary to store answer pairs such as a question and its corresponding answer information. Therefore, when parsing the FAQ-related information, it is necessary to parse out question-answer pairs one by one, that is, parse out question-answer pairs such as standard question-answer information and similar question-answer information from the FAQ-related information.
[0231] From the above description, it can be seen that in the embodiment of the present application, the vector retrieval module is used in both the FAQ database generation stage and the answer generation stage. The structure of the vector retrieval module will be described below. Figure 7 FIG. 1 is a schematic diagram of the module composition of the vector search module in the embodiment of the present application. Figure 7As shown, the vector retrieval module includes an online feature processing submodule, a search engine, and an offline feature processing submodule, wherein the online feature processing submodule and the search engine are used to execute the generation process of the target answer information, and the offline feature processing submodule is used to execute the construction process of the FAQ database or the document database. Among them, the online feature processing submodule may include an algorithm scheduling unit, an online feature extraction unit, and a category prediction unit; the search engine includes a search unit, a merge sorting unit, and an execution engine; the offline feature processing submodule includes a distributed computing framework, a clustering unit, and an index construction unit.
[0232] In an optional embodiment, for the generation process of the target answer information, after receiving the task instruction sent by the service front end, the algorithm scheduling unit is first used to schedule the various computing units required to execute the task. Exemplarily, the algorithm scheduling unit can call the corresponding computing unit according to the specific task that needs to be executed. After scheduling the corresponding computing unit, the target question information is input into the called online feature extraction unit, and the target semantic vector of the target question information is extracted by the online feature extraction unit. The target semantic vector includes category features. The category prediction unit predicts the question category to which the target question information belongs based on the category features, thereby determining the corresponding data subset (FAQ question subset or document subset). The search unit performs data search in the corresponding data subset based on the target semantic vector, and the merge sorting unit merges and sorts the search results. Finally, the execution unit performs the corresponding answer generation operation based on the merged and sorted results.
[0233] Regarding the construction process of FAQ database or document database, after receiving the data used to build the database, the feature vector of the data is calculated through the distributed computing framework, and it is clustered through the clustering unit. The general index construction unit generates its corresponding identification information, and finally the identification information and the corresponding clustering data are stored in the corresponding database through the execution engine.
[0234] Corresponds to Figures 2 to 7 The method provided in the embodiment shown is based on the same idea. The embodiment of the present application also provides an information generation method, which can be applied to Figure 1 The client 110 in the illustrated application scenario. Figure 8 The fourth method flow chart of the information generation method provided in the embodiment of the present application is as follows: Figure 8 As shown, the method comprises the following steps:
[0235] Step 501: receiving target question information input by a user.
[0236] Step 502, the target question information is sent to the server, so that after receiving the target question information, if the FAQ database exists, the server calls the vector retrieval module to retrieve the candidate question vector matching the target question information in the FAQ database; if the target question vector that meets the preset conditions exists in the candidate question vectors, the target answer information corresponding to the target question information is determined according to the target question vector; if the FAQ database does not exist or the target question vector that meets the preset conditions does not exist in the candidate question vectors, the target answer information corresponding to the target question information is generated through the answer generation link; wherein the vector retrieval module is arranged in the answer generation link.
[0237] Step 503: Receive and display the target answer information returned by the server.
[0238] Wherein, in an optional implementation, the hardware entity corresponding to the client is integrated with a display screen, and the display screen is configured as a user interface (UI) of the hardware entity, providing an interface for interaction and information exchange between the hardware entity and the user. The common form of UI can be a graphical user interface (GUI), which refers to a user interface related to computer operation displayed in a graphical manner. It can be an interface element such as an icon, window, control (control) displayed in the display screen of the hardware entity, wherein the control can include visual interface elements such as icons, buttons, menus, tabs, text boxes, etc. The control can be implemented as a visual functional interface of the client, and when the control receives a corresponding trigger operation from the user, the corresponding functional interface of the client receives a corresponding processing instruction, thereby responding to the processing instruction to perform functional processing.
[0239] In the embodiment of the present application, the user enters the target question information in the text data box of the GUI, and clicks the "Submit" or "Send" control on the GUI, or an interface element that expresses the same meaning as "Submit" or "Send", to send a corresponding instruction to the client. After receiving the target question information and the corresponding instruction, the client sends the target question information to the server.
[0240] Correspondingly, after the client receives the target answer information returned by the server, the target answer information is displayed in the text box of the GUI.
[0241] In an optional implementation, in addition to generating the target answer information, the server also generates recommended question information related to the target question information, and returns the target answer information and the recommended question information together to the client.
[0242] Therefore, the method provided in the embodiment of the present application also includes:
[0243] Receive and display recommended question information corresponding to the target question information returned by the server; wherein, along the screen display direction, the recommended question information is displayed below the target answer information.
[0244] Considering the actual needs of users, the target answer information is the information that users currently need to view. For the recommended question information, users may or may not need to view it. Therefore, when displaying, the target answer information is displayed above the text box of the GUI, and the recommended question information is displayed below the target answer information, such as Fig.9A As shown. Among them, Fig.9A An interface schematic diagram of an answer display interface is shown.
[0245] In an optional implementation, for each recommended question information, the server constructs a link relationship between each recommended question information and the corresponding answer information before returning the recommended question information. Therefore, the method provided in the embodiment of the present application further includes the following steps:
[0246] In response to a click operation on the recommended question information, a request is sent to the server to obtain the answer information corresponding to the recommended question information, so that the server obtains the corresponding answer information based on the link relationship between the recommended question information and the corresponding answer information; the answer information corresponding to the recommended question information returned by the server is received and displayed.
[0247] In an optional implementation, the recommended question information is displayed in a text box of the GUI. Since the recommended question information carries link information, on the GUI interface, the display color of the recommended question information can be distinguished from that of ordinary information. Alternatively, the recommended question information can be displayed in a normal color but the color or cursor style can be changed when the mouse hovers over the information. Alternatively, the recommended question information can be displayed with an underline, etc.
[0248] When a user clicks on the recommended question information on the GUI interface, he actually clicks on the hyperlink control corresponding to the recommended question information on the GUI interface. The corresponding interface on the GUI interface captures the click event and determines whether the hyperlink text is clicked based on the location of the user's click. If it is determined that the hyperlink text is clicked, the client is triggered to obtain the answer information pointed to by the hyperlink from the server. After the client receives the corresponding answer information returned by the server, it displays the corresponding answer information in the text box on the GUI interface. For example, for Fig.9A In the interface shown, if the user clicks on the recommended question information of "children's hospitalization reimbursement" in the interface, the question information of "children's hospitalization reimbursement" will be displayed in the input box on the GUI interface, and the client will send the question information to the server to obtain the corresponding answer information.
[0249] In an optional implementation, if the target answer information corresponding to the target question information is generated through the answer generation link, the server will return the target document information in addition to the target answer information. Therefore, for this scenario, a possible interface diagram of the answer display interface is as follows: Fig. 9C shown.
[0250] Similarly, in order to facilitate users to view the content information of the target document, the server can build a link relationship between the target document information and the web page corresponding to the target document content before returning the target document information. Fig. 9B When you click on the target document information on the interface shown, you will be redirected to the web page corresponding to the target document content.
[0251] The information generation method provided in the embodiment of the present application is Figures 2 to 7 The information generation method provided by the corresponding embodiment is based on the same inventive concept and has the same beneficial effects as the method adopted, operated or implemented. Therefore, the specific implementation process of some steps in the scheme provided by the embodiment of the present application can refer to the aforementioned method embodiment, which will not be repeated here.
[0252] Corresponds to Figures 2 to 7 The method provided in the illustrated embodiment is based on the same idea. The embodiment of the present application also provides an information generation method, which can be applied to the data maintenance end. Fig.10 The fifth method flow chart of the information generation method provided in the embodiment of the present application is as follows: Fig.10 As shown, the method comprises the following steps:
[0253] Step 601, in response to the FAQ creation operation, displaying a FAQ data creation interface; wherein the FAQ data creation interface includes an interface for uploading information.
[0254] Step 602: Receive FAQ related information through the above interface.
[0255] Step 603: Send the FAQ related information to the server so that the server stores the FAQ related information in the FAQ database, and upon receiving the target question information sent by the client, call the vector retrieval module to retrieve the candidate question vector matching the target question information in the FAQ database.
[0256] In an optional implementation, an interface element such as "Create" or a corresponding graphic button is displayed on the GUI interface. The user clicks the interface element, and after receiving the user's click operation, the client obtains the interface data of the FAQ data creation interface and displays the FAQ creation interface.
[0257] Exemplarily, in an optional embodiment, in Fig.11AIn the interface shown in the figure, the user clicks the "New" button on the interface to enter the knowledge base creation interface. When the client deploys multiple applications, there may be multiple knowledge bases. One knowledge base is used to maintain the data corresponding to one application, such as Fig.11A In any knowledge base, there is a document database and a FAQ database. On the interface corresponding to any knowledge base, users can create a database, which can be a FAQ database or a document database, such as Fig. 11B As shown, the user selects "Database" on the interface and clicks the "New" button. If the user creates an FAQ database, it triggers the input of the FAQ creation operation to the client. The client receives the FAQ creation operation triggered by the user and displays the FAQ data creation interface.
[0258] In the embodiment of the present application, the FAQ data creation interface includes an information upload interface, through which the user uploads FAQ related information. Fig. 11C In the interface shown, users can upload FAQ related information documents in the input box corresponding to "Knowledge File" in the interface; Fig.11D In the interface shown, the user can directly enter the question and answer information in the input boxes corresponding to the "standard question" and "answer" of the interface as the FAQ related information document.
[0259] After receiving the FAQ related information, the data maintenance terminal sends the FAQ related information to the server.
[0260] In an optional implementation, receiving FAQ related information through an interface may include:
[0261] Receive FAQ related information documents imported by users through the interface;
[0262] or,
[0263] Receive FAQ related information input by the user through the interface.
[0264] In the embodiment of the present application, Fig. 11C In the interface shown, the user can input FAQ related information by importing FAQ related information documents in the interface, and the data maintenance end receives the FAQ related information documents imported by the user through the above interface; Fig.11D In the interface shown, the user can enter FAQ related information by entering questions and answers in the interface, and the data maintenance end receives the FAQ related information input by the user through the above interface.
[0265] In an optional implementation, the user can also configure the knowledge base corresponding to each application program, wherein the interface for configuring the knowledge base is as follows: Fig.11E As shown, in Fig.11E In the interface shown, the user can configure the knowledge base corresponding to an application, for example, the application identifier and the application name can be associated with the knowledge base identifier; and related information such as the usage permissions of the knowledge base corresponding to the application can also be set.
[0266] The information generation method provided in the embodiment of the present application is Figures 2 to 7 The information generation method provided by the corresponding embodiment is based on the same inventive concept and has the same beneficial effects as the method adopted, operated or implemented. Therefore, the specific implementation process of some steps in the scheme provided by the embodiment of the present application can refer to the aforementioned method embodiment, which will not be repeated here.
[0267] Corresponding to the method provided in the aforementioned method embodiment, based on the same idea, the embodiment of the present application also provides an information generation method, such as Fig.12 As shown, the method comprises the following steps:
[0268] Step 701: The client receives target question information input by the user.
[0269] Step 702: The client sends the target question information to the server.
[0270] Step 703, the server receives the target question information sent by the client, and if the target question information exists in the FAQ database, execute step 704; otherwise, execute step 706.
[0271] In step 704, the server calls the vector retrieval module to retrieve candidate question vectors matching the target question information in the FAQ database; wherein the vector retrieval module is arranged on the answer generation link; if there is a target question vector satisfying a preset condition in the candidate question vectors, step 705 is executed; otherwise, step 706 is executed.
[0272] Step 705: The server determines target answer information corresponding to the target question information according to the target question vector.
[0273] Step 706: The server generates target answer information corresponding to the target question information through the answer generation link.
[0274] Step 707: The server sends the target answer information to the client.
[0275] Step 708: The client receives and displays the target answer information.
[0276] In a feasible implementation manner, if there is a target question vector that meets the preset conditions in the candidate question vectors, the method provided in the embodiment of the present application further includes:
[0277] The server selects a target number of target question vectors from the target question vectors in order of similarity from high to low as recommended question vectors, and determines the recommended question information corresponding to the recommended question vector; the server sends the recommended question information to the client; the client receives and displays the recommended question information sent by the server; wherein, along the screen display direction, the recommended question information is displayed below the target answer information.
[0278] In a feasible implementation manner, the method provided in the embodiment of the present application further includes:
[0279] In response to a click operation on the recommended question information, the client sends a request to the server to obtain the answer information corresponding to the recommended question information; the server obtains the corresponding answer information based on the link relationship between the recommended question information and the response answer information, and sends the answer information corresponding to the recommended question information to the client; the client receives and displays the answer information corresponding to the recommended question information.
[0280] In a possible implementation, Fig.13 As shown, the method provided in the embodiment of the present application also includes the following steps:
[0281] Step 709: The data maintenance terminal displays a FAQ data creation interface in response to the FAQ creation operation; wherein the FAQ data creation interface includes an interface for uploading information.
[0282] Step 710: The data maintenance terminal receives FAQ related information through the above interface.
[0283] Step 711: The data maintenance terminal sends the FAQ related information to the server.
[0284] Step 712: The server stores the FAQ related information in the FAQ database.
[0285] It should be noted that in Fig.13 In the illustrated embodiment, steps 709 to 712 may be performed before step 701, or may be performed during the execution of steps 701 to 708. Fig.13 This is only an exemplary description and does not limit the order in which the above steps are performed.
[0286] The information generation method provided in the embodiment of the present application is Figures 2 to 11E The information generation method provided by the corresponding embodiment is based on the same inventive concept and has the same beneficial effects as the method adopted, operated or implemented. Therefore, the specific implementation process of some steps in the scheme provided by the embodiment of the present application can refer to the aforementioned method embodiment, which will not be repeated here.
[0287] Corresponding to the method provided in the above method embodiment, based on the same idea, the embodiment of the present application also provides an information generation system, which includes a client 110 and a server 120, such as Fig.14 As shown; among them,
[0288] The client 110 is used to receive target question information input by a user and send the target question information to the server;
[0289] The server 120 is used to receive the target question information sent by the client, and if there is an FAQ database, call the vector retrieval module to retrieve the candidate question vector matching the target question information in the FAQ database; if there is a target question vector that meets the preset conditions in the candidate question vectors, determine the target answer information corresponding to the target question information according to the target question vector; if there is no FAQ database or the target question vector that meets the preset conditions does not exist in the candidate question vectors, generate the target answer information corresponding to the target question information through the answer generation link; and send the target answer information to the client; wherein the vector retrieval module is set in the answer generation link;
[0290] The client 110 is also used to receive and display the target answer information returned by the server 120 .
[0291] In an optional implementation, the system provided in the embodiment of the present application further includes a data maintenance terminal 130, such as Fig.15 As shown; among them,
[0292] The data maintenance terminal 130 is used to display a FAQ data creation interface in response to the FAQ creation operation; wherein the FAQ data creation interface includes an interface for uploading information; receive FAQ related information through the interface, and send the FAQ related information to the server 120;
[0293] The server 120 is further configured to store the above FAQ related information in a FAQ database.
[0294] The information generation system provided in the embodiment of the present application and the information generation method provided in the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, operated or implemented by them. Therefore, the specific implementation process of the system provided in the embodiment of the present application can refer to the aforementioned method embodiment, which will not be repeated here.
[0295] Corresponds to Figures 2 to 7 The information generating method shown is based on the same idea, and the embodiment of the present application also provides an information generating device. Fig.16 This is one of the schematic diagrams of the module composition of the information generating device provided in the embodiment of the present application. The device can be configured as follows: Figure 1 In the server 120 in the application scenario shown. The device can be used to execute Figures 2 to 7 Any of the embodiments shown in the figure provides an information generation method. Fig.16 As shown, the information generating device includes:
[0296] Receiving module 801, used to receive target question information sent by the client;
[0297] A calling module 802 is used to call a vector retrieval module to retrieve a candidate question vector matching the target question information in the FAQ database if there is a FAQ database of frequently asked questions; wherein the vector retrieval module is arranged in the answer generation link;
[0298] A first determination module 803 is used to determine target answer information corresponding to the target question information according to the target question vector if there is a target question vector that meets the preset conditions in the candidate question vectors;
[0299] The generating module 804 is used to generate target answer information corresponding to the target question information through an answer generating link if there is no FAQ database or the target question vector that meets the preset conditions does not exist in the candidate question vector.
[0300] In an optional implementation, the FAQ database includes a plurality of FAQ sub-databases, any FAQ sub-database maintains data of a corresponding application, and any application is pre-deployed on the client;
[0301] The device also includes:
[0302] A judgment module, used to judge whether there is a corresponding target FAQ sub-database for the target application to which the target question information belongs;
[0303] If the target FAQ sub-database exists, call module 802, which is specifically used to:
[0304] The vector retrieval module is called to retrieve candidate question vectors matching the target question information in the target FAQ sub-database.
[0305] In an optional implementation, the calling module 802 is further specifically configured to:
[0306] The vector retrieval module is called to determine whether the current task to be executed is to perform vector retrieval in the FAQ sub-database; if so, the target semantic vector corresponding to the target question information is determined through the vector retrieval module; the question vector matching the target semantic vector in the target FAQ sub-database is determined as a candidate question vector.
[0307] In an optional implementation, any FAQ sub-database includes multiple FAQ question subsets, and any FAQ question subset maintains a category of question vectors; the target semantic vector includes category features of target question information, and the calling module 802 is further specifically used to:
[0308] Determine the target FAQ question subset corresponding to the target question information in the target FAQ sub-database according to the category feature;
[0309] The question vectors matching the target semantic vector in the target FAQ question subset are determined as candidate question vectors.
[0310] In an optional implementation, the FAQ database includes a FAQ text library and a FAQ vector library, and the target question vector is stored in the FAQ vector library;
[0311] The first determining module 803 is specifically configured to:
[0312] Determine a target question vector with the highest similarity to the target question information from the target question vector; obtain the target question identification information corresponding to the target question vector with the highest similarity from the FAQ vector library; and search for the answer information corresponding to the target question identification information in the FAQ text library as the target answer information.
[0313] In an optional implementation, if there is a target question vector that meets a preset condition in the candidate question vectors, the device further includes:
[0314] A selection module is used to select a target number of target question vectors from the target question vectors in descending order of similarity as recommended question vectors;
[0315] A second determination module is used to determine the recommended question information corresponding to the recommended question vector;
[0316] The first sending module is used to send the recommended question information and the target answer information to the client.
[0317] In an optional implementation manner, the first sending module is specifically configured to:
[0318] The recommended question information and the target answer information are encapsulated in a preset data format to obtain the data to be transmitted; a link relationship between the recommended question information and the corresponding answer information in the data to be transmitted is constructed; and the data to be transmitted after the link relationship is constructed is sent to the client.
[0319] In an optional implementation, the generating module 804 is specifically configured to:
[0320] A target document vector matching the target question information is retrieved in a target document sub-database through a vector retrieval module; target document information corresponding to the target document vector is determined; target prompt words are constructed according to a preset prompt word template based on the target question information and the target document information; the prompt words are input into an answer reasoning model, and target answer information is generated based on the target prompt words through the answer reasoning model; wherein the target document sub-database maintains data of a target application corresponding to the target question information, and the target application is pre-deployed on the client.
[0321] In an optional implementation, the generating module 804 is further specifically configured to:
[0322] When it is determined through the vector retrieval module that the current task to be performed is to perform vector retrieval in the document sub-database, the target semantic vector corresponding to the target question information is determined; the target semantic vector is matched with each document vector stored in the target document sub-database and the document title vector corresponding to the document vector to obtain a target document vector that matches the target question information.
[0323] In an optional implementation, any document sub-database includes multiple document subsets, and any document subset maintains a document vector of a category and its corresponding document title vector; the target semantic vector includes the category features of the target question information, and the generation module 804 is further specifically used for:
[0324] The target document subset corresponding to the target question information in the target document sub-database is determined according to the category features; the target semantic vector is matched with each document vector in the target document subset and the document title vector corresponding to the document vector to obtain a target document vector matching the target question information.
[0325] The information generation device provided in the embodiment of the present application is Figures 2 to 7 The information generation method provided by the illustrated embodiment is based on the same inventive concept and has the same beneficial effects as the method adopted, operated or implemented therein.
[0326] The implementation process of the functions and effects of each module in the information generating device provided in the embodiment of the present application is specifically described in the implementation process of the corresponding steps in the above method embodiment, which will not be repeated here.
[0327] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are merely illustrative, wherein the modules described as separate components may or may not be physically separated, and the components illustrated as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application. A person of ordinary skill in the art may understand and implement it without creative work.
[0328] Understandably, Fig.16 The division of the various modules is only a division of logical functions. In actual implementation, the functions of the above modules can be integrated into the hardware entity implementation of the server. For example, the function of the receiving module 801 can be integrated into the communication device of the server, and the functions of the calling module 802, the first determination module 803 and the generation module 804 can be integrated into the processor implementation of the server, etc.
[0329] Corresponds to Figures 8 to 9C The information generating method shown is based on the same idea, and the embodiment of the present application also provides an information generating device. Fig.17 The second schematic diagram of the module composition of the information generating device provided in the embodiment of the present application, the device can be configured as follows Figure 1 In the client 110 in the application scenario shown. The device can be used to execute Figures 8 to 9C Any of the embodiments shown provides an information generation method.
[0330] like Fig.17 As shown, the information generating device includes:
[0331] The first receiving module 901 is used to receive target question information input by a user;
[0332] The second sending module 902 is used to send the target question information to the server, so that after receiving the target question information, if there is a FAQ database, the server calls the vector retrieval module to retrieve the candidate question vector matching the target question information in the FAQ database; if there is a target question vector that meets the preset conditions in the candidate question vectors, the target answer information corresponding to the target question information is determined according to the target question vector; if there is no FAQ database or the target question vector that meets the preset conditions does not exist in the candidate question vectors, the target answer information corresponding to the target question information is generated through the answer generation link; wherein the vector retrieval module is provided in the answer generation link;
[0333] The first display module 903 is used to receive and display the target answer information returned by the server.
[0334] In an optional implementation, the device provided in the embodiment of the present application further includes:
[0335] The second display module is used to receive and display the recommended question information corresponding to the target question information returned by the server; wherein, along the screen display direction, the recommended question information is displayed below the target answer information.
[0336] In an optional implementation, the device provided in the embodiment of the present application further includes:
[0337] A third sending module is used to send a request for obtaining answer information corresponding to the recommended question information to the server in response to a click operation on the recommended question information, so that the server obtains the corresponding answer information based on the link relationship between the recommended question information and the corresponding answer information;
[0338] The third display module is used to receive and display the answer information corresponding to the recommended question information returned by the server.
[0339] The information generation device provided in the embodiment of the present application is Figures 8 to 9C The information generation method provided by the illustrated embodiment is based on the same inventive concept and has the same beneficial effects as the method adopted, operated or implemented therein.
[0340] The implementation process of the functions and effects of each module in the information generating device provided in the embodiment of the present application is specifically described in the implementation process of the corresponding steps in the above method embodiment, which will not be repeated here.
[0341] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are merely illustrative, wherein the modules described as separate components may or may not be physically separated, and the components illustrated as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application. A person of ordinary skill in the art may understand and implement it without creative work.
[0342] Understandably, Fig.17 The division of the modules is only a division of logical functions. In actual implementation, the functions of the above modules can be integrated into the hardware entity implementation of the client. For example, the functions of the first receiving module 901 and the second sending module 902 can be integrated into the communication device of the client, and the function of the first display module 903 can be integrated into the GUI implementation of the client, etc.
[0343] Corresponds to Figures 10 to 11EThe information generating method shown is based on the same idea, and the embodiment of the present application also provides an information generating device. Fig.18 The second schematic diagram of the module composition of the information generation device provided in the embodiment of the present application, the device can be configured in the data maintenance client. Among them, the device can be used to execute Figures 10 to 11E Any of the embodiments shown in the figure provides an information generation method. Fig.18 As shown, the information generating device includes:
[0344] The fourth display module 1001 is used to display a FAQ data creation interface in response to the FAQ creation operation; wherein the FAQ data creation interface includes an interface for uploading information;
[0345] The second receiving module 1002 is used to receive FAQ related information through an interface;
[0346] The fourth sending module 1003 is used to send FAQ related information to the server so that the server stores the FAQ related information in the FAQ database, and upon receiving the target question information sent by the client, call the vector retrieval module to retrieve the candidate question vector matching the target question information in the FAQ database.
[0347] In an optional implementation manner, the second receiving module 1002 is specifically configured to:
[0348] Receive FAQ related information documents imported by users through the interface;
[0349] or,
[0350] Receive FAQ related information input by the user through the interface.
[0351] The information generation device provided in the embodiment of the present application is Figures 10 to 11E The information generation method provided by the illustrated embodiment is based on the same inventive concept and has the same beneficial effects as the method adopted, operated or implemented therein.
[0352] The implementation process of the functions and effects of each module in the information generating device provided in the embodiment of the present application is specifically described in the implementation process of the corresponding steps in the above method embodiment, which will not be repeated here.
[0353] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are merely illustrative, wherein the modules described as separate components may or may not be physically separated, and the components illustrated as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application. A person of ordinary skill in the art may understand and implement it without creative work.
[0354] Understandably, Fig.18 The division of each module is only a division of logical functions. In actual implementation, the functions of the above modules can be integrated into the hardware entity implementation of the data maintenance end. For example, the function of the fourth display module 1001 can be integrated into the GUI implementation of the data maintenance end, and the functions of the second receiving module 1002 and the fourth sending module 1003 can be integrated into the communication device of the data maintenance end.
[0355] Some embodiments of the present application also provide an electronic device corresponding to the information generation method provided in the aforementioned embodiment, the electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executes the program to implement the above Figures 2 to 7 The information generation method provided in the embodiment shown; or, the processor executes the above program to implement the above Figures 8 to 9C The information generation method provided in the embodiment shown; or, the processor executes the above program to implement the above Figures 10 to 11E The illustrated embodiment provides a method for generating information.
[0356] Fig.19 The hardware structure diagram of an electronic device provided in an embodiment of the present application includes: a processor 1101, a transceiver 1103 and a memory 1102, and these components are connected and communicated through a communication bus 1104. When the electronic device is configured as Figure 1 When the server shown in FIG. 1 is used, the transceiver 1103 can be used to receive the target question information sent by the client, and send the target answer information to the client. The memory 1102 is used to store a computer program, which can be executed by the processor. When the processor executes the computer program, the aforementioned Figures 2 to 7 The information generation method provided by any implementation method in the illustrated embodiments. Figure 1When the client is shown in FIG. 1 , the transceiver 1103 can be used to send the target question information to the server and receive the target answer information returned by the server. The memory 1102 is used to store a computer program that can be executed by the processor. When the processor executes the computer program, the aforementioned Figures 8 to 9C The information generation method provided by any implementation in the illustrated embodiments. When the electronic device is configured as a data maintenance terminal, the transceiver 1103 can be used to send FAQ related information to the server. The memory 1102 is used to store a computer program, which can be executed by a processor. When the processor executes the computer program, the aforementioned Figures 10 to 11E The information generation method provided by any implementation method in the illustrated embodiments.
[0357] The electronic device provided in the embodiment of the present application and the information generation method provided in the embodiment of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, operated or implemented therein.
[0358] The present application also provides a computer-readable storage medium corresponding to the information generation method provided in the above embodiment, on which a computer program is stored. When the computer program is executed by a processor, the above Figures 2 to 7 The information generation method provided in any implementation manner of the corresponding embodiment; or, when the computer program is executed by the processor, the aforementioned Figures 8 to 9C The information generation method provided in any implementation manner of the corresponding embodiment; or, when the computer program is executed by the processor, the aforementioned Figures 10 to 11E The information generation method provided in any implementation manner in the corresponding embodiment.
[0359] The computer-readable storage medium provided in the above-mentioned embodiments of the present application and the information generation method provided in the embodiments of the present application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the application programs stored therein.
[0360] The present application also provides a computer program product corresponding to the information generation method provided in the above embodiment. The computer program product includes a computer program. The computer program is executed by a processor to implement the above Figures 2 to 7 The information generation method provided in any implementation manner of the corresponding embodiment; or, the computer program is executed by the processor to implement the aforementioned Figures 8 to 9C The information generation method provided in any implementation manner of the corresponding embodiment; the computer program is executed by the processor to implement the aforementioned Figures 10 to 11E The information generation method provided in any implementation manner in the corresponding embodiment.
[0361] The computer program product provided by the above-mentioned embodiments of the present application and the information generation method provided by the embodiments of the present application are based on the same inventive concept and have the same beneficial effects as the method adopted, run or implemented by the application program stored therein.
[0362] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0363] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, 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, such as 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 an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0364] 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.
[0365] In addition, each functional unit in each embodiment of the present application 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0366] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a smart phone or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0367] Although the optional embodiments of the present application have been described, those skilled in the art, once informed of the basic creative concept, may make additional changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiment and all changes and modifications falling within the scope of the present application.
[0368] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only the specific implementation methods of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present application should be included in the scope of protection of the present application.
Claims
1. A method for generating information, characterized in that: The method comprises: Receive target question information sent by the client; If there is a FAQ database of frequently asked questions, calling a vector retrieval module to retrieve a candidate question vector matching the target question information in the FAQ database; wherein the vector retrieval module is arranged in an answer generation link; If there is a target question vector that meets the preset conditions in the candidate question vectors, determining the target answer information corresponding to the target question information according to the target question vector; If the FAQ database does not exist or the target question vector that meets the preset condition does not exist in the candidate question vector, the target answer information corresponding to the target question information is generated through the answer generation link.
2. The method according to claim 1, characterized in that The FAQ database includes a plurality of FAQ sub-databases, any FAQ sub-database maintains data of a corresponding application, and any application is pre-deployed on the client; Before the calling vector retrieval module retrieves a candidate question vector matching the target question information in the FAQ database, the method further includes: Determine whether there is a corresponding target FAQ sub-database for the target application to which the target question information belongs; If the target FAQ sub-database exists, the calling vector retrieval module retrieves a candidate question vector matching the target question information in the FAQ database, including: The vector retrieval module is called to retrieve candidate question vectors matching the target question information in the target FAQ sub-database.
3. The method according to claim 2, characterized in that The calling of the vector retrieval module to retrieve a candidate question vector matching the target question information in the target FAQ sub-database includes: Calling the vector search module to determine whether the task currently to be executed is to perform a vector search in the FAQ sub-database; If so, determining the target semantic vector corresponding to the target question information through the vector retrieval module; A question vector in the target FAQ sub-database that matches the target semantic vector is determined as the candidate question vector.
4. The method according to claim 1, characterized in that: The FAQ database includes a FAQ text library and a FAQ vector library, and the target question vector is stored in the FAQ vector library; The step of determining target answer information corresponding to the target question information according to the target question vector includes: Determine a target question vector having the highest similarity to the target question information from the target question vectors; Acquire target question identification information corresponding to the target question vector with the highest similarity from the FAQ vector library; The answer information corresponding to the target question identification information is searched in the FAQ text library as the target answer information.
5. The method according to any one of claims 1 to 4, characterized in that: If there is a target question vector that meets a preset condition in the candidate question vectors, the method further includes: Selecting a target number of target question vectors from the target question vectors in descending order of similarity as recommended question vectors; Determining the recommended question information corresponding to the recommended question vector; The recommended question information and the target answer information are sent to the client.
6. The method according to claim 1, characterized in that The step of generating target answer information corresponding to the target question information through the answer generation link includes: Retrieving a target document vector matching the target question information in a target document sub-database through the vector retrieval module; wherein the target document sub-database maintains data of a target application corresponding to the target question information, and the target application is pre-deployed on the client; Determining target document information corresponding to the target document vector; Constructing a target prompt word according to the target question information and the target document information according to a preset prompt word template; The prompt word is input into an answer reasoning model, and the target answer information is generated based on the target prompt word by the answer reasoning model.
7. The method according to claim 6, characterized in that The step of retrieving a target document vector matching the target question information in the target document sub-database by the vector retrieval module includes: When it is determined by the vector retrieval module that the task currently to be performed is to perform vector retrieval in the document sub-database, determining a target semantic vector corresponding to the target question information; The target semantic vector is matched with each document vector stored in the target document sub-database and the document title vector corresponding to the document vector to obtain a target document vector that matches the target question information.
8. A method for generating information, characterized in that: The method comprises: Receive target question information input by the user; The target question information is sent to a server, so that after receiving the target question information, if the FAQ database exists, the server calls a vector retrieval module to retrieve a candidate question vector matching the target question information in the FAQ database; if the target question vector that meets the preset conditions exists in the candidate question vectors, the target answer information corresponding to the target question information is determined according to the target question vector; if the FAQ database does not exist or the target question vector that meets the preset conditions does not exist in the candidate question vectors, the target answer information corresponding to the target question information is generated through an answer generation link; wherein the vector retrieval module is arranged in the answer generation link; Receive and display the target answer information returned by the server.
9. A method for generating information, characterized in that: The method comprises: In response to the FAQ creation operation, a FAQ data creation interface is displayed; wherein the FAQ data creation interface includes an interface for uploading information; Receive FAQ related information through the interface; The FAQ related information is sent to a server so that the server stores the FAQ related information in a FAQ database, and upon receiving the target question information sent by the client, a vector retrieval module is called to retrieve a candidate question vector matching the target question information in the FAQ database.
10. An information generation system, characterized in that: The system includes a client and a server; The client is used to receive target question information input by a user and send the target question information to the server; The server is configured to receive the target question information sent by the client, and if there is an FAQ database, call a vector retrieval module to retrieve a candidate question vector matching the target question information in the FAQ database; if there is a target question vector that meets a preset condition in the candidate question vectors, determine the target answer information corresponding to the target question information according to the target question vector; If the FAQ database does not exist or the target question vector that meets the preset condition does not exist in the candidate question vector, then generating target answer information corresponding to the target question information through an answer generation link; and sending the target answer information to the client; wherein the vector retrieval module is arranged in the answer generation link; The client is also used to receive and display the target answer information returned by the server.
Citation Information
Cited By
Question and answer information processing method and device based on intelligent knowledge base and electronic equipment
CN120123484A
Question and answer information processing method and device based on intelligent knowledge base and electronic equipment
CN120123484B
