Question and answer method and device, equipment, storage medium and computer program product
By extracting the file contents that users have permission to access in the Q&A system and returning it to the large language model, the problem of the large language model lacking user permission isolation when answering user questions is solved, and the effect of improving the security of Q&A is achieved.
Patent Information
- Application Number
- CN202411606886.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-11-11
AI Technical Summary
The existing large language model of question-and-answer methods does not perform effective user permission isolation when answering user questions, resulting in users being able to obtain confidential information from the company by asking questions, resulting in leaking confidential information.
Provide a question-and-answer method, in response to a user's question, input the question into the large language model, and obtain the file contents of the large language model to answer the question. Extract the target file content that the user has permission to access from the file content, and return the target file content to the large language model, obtain the answers generated by the large language model based on the question and the target file content, and display the answers.
By only passing the file contents that the user has permission to access to when the user asks questions, the large language model is avoided and the security of the model question and answer is improved.
Smart Images

Figure CN119598482A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information security technology, and in particular to a question-answering method, apparatus, device, storage medium, and computer program product. Background Art
[0002] Currently, when large language models answer users' questions, there is no effective user permission isolation. Users can obtain confidential information of the company by asking questions, which may lead to confidential information leakage. Summary of the invention
[0003] The main purpose of this application is to provide a question-answering method, apparatus, device, storage medium and computer program product, which aims to solve the technical problem that when answering users' questions, the large language model of the existing question-answering method does not perform effective user authority isolation, and users can obtain confidential information of the enterprise by asking questions, thereby causing confidential information leakage.
[0004] To achieve the above purpose, the present application provides a question-answering method, which includes:
[0005] In response to a question raised by a user, the question is input into a large language model, and the content of a file referenced by the large language model in answering the question is obtained;
[0006] Extracting target file content that the user has permission to access from the file content, and returning the target file content to the large language model;
[0007] An answer generated by the large language model according to the question and the target file content is obtained, and the answer is displayed.
[0008] Optionally, extracting target file content that the user has permission to access from the file content, and returning the target file content to the large language model, includes:
[0009] Obtaining the source file corresponding to the file content, and obtaining the file access permission of the user;
[0010] Acquire a target source file that the user has permission to access from the source file according to the file access permission;
[0011] The target file content corresponding to the target source file is obtained, and the target file content is returned to the large language model.
[0012] Optionally, obtaining the file access permission of the user includes:
[0013] Monitoring the user's historical question and answer information and current access environment;
[0014] Obtaining initial access rights pre-assigned to the user;
[0015] The initial access permission of the user is adjusted according to the historical question and answer information and the current access environment to obtain the file access permission of the user.
[0016] Optionally, the adjusting the initial access rights of the user according to the historical question and answer information and the current access environment to obtain the file access rights of the user includes:
[0017] Performing semantic analysis, sentiment analysis, and behavior pattern recognition on the historical question and answer information to obtain a multi-dimensional analysis result of the historical question and answer information;
[0018] Obtaining the user's geographic location, device type, and status identification from the current access environment;
[0019] Analyze the security of the user according to the geographic location, the device type, and the state identification to obtain a security score of the user;
[0020] The initial access rights of the user are adjusted according to the multi-dimensional analysis results of the historical question and answer information and the security score of the user to obtain the file access rights of the user.
[0021] Optionally, in response to a question raised by a user, inputting the question into a large language model, and obtaining the file content referenced by the large language model in answering the question, comprises:
[0022] In response to a question raised by a user, inputting the question into a large language model;
[0023] Vectorize the question using the large language model to obtain a question vector;
[0024] The question vector is matched with the file content in a preset vector library, and the file content referenced by the large language model to answer the question is obtained according to the matching result.
[0025] Optionally, before the step of responding to a question raised by a user, inputting the question into a large language model, and obtaining the file content referenced by the large language model in answering the question, the step further includes:
[0026] Receive files added by management users, and perform retrieval enhancement training on the large language model based on the files;
[0027] Slice the file to obtain the file content;
[0028] Storing the file content in the preset vector library, and creating a question-and-answer application according to the large language model and the preset vector library;
[0029] Accordingly, in response to the question raised by the user, the question is input into the large language model, and the file content referenced by the large language model in answering the question is obtained, including:
[0030] In response to a question raised by a user through the question-answering application, the question is input into a large language model, and the document content referenced by the large language model in answering the question is obtained.
[0031] Optionally, slicing the file to obtain the file content includes:
[0032] Obtaining a file type and a file source of the file, and analyzing an encryption level of the file according to the file type and the file source;
[0033] Acquire the model characteristics of the large language model and the user needs of the user, and analyze the answer generation method of the large language model according to the model characteristics and the user needs;
[0034] The file is sliced according to the encryption level and the answer generation method to obtain file content, wherein the file content includes multiple knowledge fragments.
[0035] Optionally, storing the file content into the preset vector library includes:
[0036] Encrypting the file content and storing the encrypted file content in the preset vector library;
[0037] The matching of the problem vector with the file content in the preset vector library includes:
[0038] The file content in the preset vector library is decrypted, and the question vector is matched with the decrypted file content.
[0039] Optionally, obtaining an answer generated by the large language model according to the question and the target file content, and displaying the answer, includes:
[0040] Obtaining an answer generated by the large language model according to the question and the content of the target file;
[0041] Obtain the target source file corresponding to the target file content, and display the answer and the target source file.
[0042] Optionally, after obtaining the target source file corresponding to the target file content and displaying the answer and the target source file, the method further includes:
[0043] Receiving a permission application request from the user based on the answer and the target source file;
[0044] Sending the answer, the target source file and the permission application request to the management user;
[0045] Receiving permission allocation information fed back by the management user according to the answer, the target source file and the permission application request;
[0046] re-extracting the custom file content from the file content according to the permission allocation information, and returning the answer and the custom file content to the large language model;
[0047] Obtain a custom answer regenerated by the large language model according to the question, the answer and the custom file content, and display the custom answer.
[0048] Optionally, after obtaining the target source file corresponding to the target file content and displaying the answer and the target source file, the method further includes:
[0049] Receiving a file selection instruction fed back by the user according to the answer and the target source file;
[0050] Returning the question, the answer, and the file selection instruction to the large language model;
[0051] An answer regenerated by the large language model according to the question, the answer and the file selection instruction is obtained, and the regenerated answer is displayed.
[0052] In addition, to achieve the above purpose, the present application also proposes a question-answering device, which includes:
[0053] A question input module, used to respond to a question raised by a user, input the question into a large language model, and obtain the file content referenced by the large language model in answering the question;
[0054] A permission verification module, used for extracting target file content that the user has permission to access from the file content, and returning the target file content to the large language model;
[0055] The answer generation module is used to obtain the answer generated by the large language model according to the question and the content of the target file, and display the answer.
[0056] Optionally, the permission verification module is also used to obtain the source file corresponding to the file content and obtain the file access permissions of the user; obtain the target source file that the user has permission to access from the source file according to the file access permissions; obtain the target file content corresponding to the target source file, and return the target file content to the large language model.
[0057] Optionally, the permission verification module is also used to monitor the user's historical question and answer information and current access environment; obtain the initial access rights pre-assigned to the user; adjust the user's initial access rights according to the historical question and answer information and the current access environment to obtain the user's file access rights.
[0058] Optionally, the permission verification module is further used to perform semantic analysis, sentiment analysis and behavioral pattern recognition on the historical question and answer information to obtain a multi-dimensional analysis result of the historical question and answer information; obtain the user's geographic location, device type and status identification from the current access environment; analyze the user's security based on the geographic location, the device type and the status identification to obtain the user's security score; adjust the user's initial access rights based on the multi-dimensional analysis result of the historical question and answer information and the user's security score to obtain the user's file access rights.
[0059] Optionally, the question input module is also used to respond to a question raised by a user and input the question into a large language model; vectorize the question through the large language model to obtain a question vector; match the question vector with the file content in a preset vector library, and obtain the file content referenced by the large language model to answer the question based on the matching result.
[0060] Optionally, the question-answering device further includes:
[0061] The application creation module is used to receive files added by management users, and perform retrieval enhancement training on the large language model according to the files; slice the files to obtain file contents; store the file contents into the preset vector library, and create a question-and-answer application according to the large language model and the preset vector library;
[0062] Correspondingly, the question input module is also used to respond to questions raised by the user through the question-answering application, input the questions into the large language model, and obtain the file content referenced by the large language model to answer the questions.
[0063] In addition, to achieve the above-mentioned purpose, the present application also proposes a question-and-answer device, which includes a memory, a processor, and a question-and-answer program stored in the memory and executable on the processor, wherein the question-and-answer program is configured to implement the question-and-answer method described above.
[0064] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, on which a question-and-answer program is stored, and when the question-and-answer program is executed by a processor, the question-and-answer method as described above is implemented.
[0065] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a question-and-answer program, and when the question-and-answer program is executed by a processor, it implements the question-and-answer method described above.
[0066] One or more technical solutions proposed in this application have at least the following technical effects:
[0067] In the present application, a method of responding to a question raised by a user is disclosed, wherein the question is input into a large language model, and the file content referenced by the large language model in answering the question is obtained, the target file content that the user has permission to access is extracted from the file content, and the target file content is returned to the large language model, and the answer generated by the large language model according to the question and the target file content is obtained, and the answer is displayed; because when a user asks a question, the present application only passes the file content that the user has permission to access to the large language model for answering, thereby avoiding the leakage of confidential information, thereby improving the security of the model question and answer. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0069] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0070] Figure 1 This is a flowchart of the first embodiment of the question-and-answer method of this application;
[0071] Figure 2 This is a flow chart of the second embodiment of the question-and-answer method of this application;
[0072] Figure 3 This is a flowchart of the third embodiment of the question-and-answer method of this application;
[0073] Figure 4This is a scenario flow chart of an embodiment of the question-and-answer method of this application;
[0074] Figure 5 This is a schematic diagram of an interface of an embodiment of the question-answering method of this application;
[0075] Figure 6 This is a schematic diagram of the module structure of the question-answering device according to an embodiment of the present application;
[0076] Figure 7 A schematic diagram of the device structure of the hardware operating environment involved in the question-and-answer method in the embodiment of the present application.
[0077] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0078] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0079] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0080] At present, in the process of using large language models, in order to ensure that the content corresponding to the large language model is credible, the provided file content is usually sliced to form a data set through RAG (Retrieval-augmented Generation). When a user asks a question, the corresponding data segment is obtained based on the vector retrieval or keyword retrieval mode, and then passed to the large language model, which generates the corresponding answer to the question.
[0081] However, since the relevant technology does not perform effective user permission isolation when obtaining the corresponding data fragments, users can obtain the company's confidential information by asking questions, resulting in the leakage of the company's confidential information and causing significant losses to the company.
[0082] Therefore, in order to overcome the above-mentioned defects, the present application provides a solution, which includes: in response to a question raised by a user, inputting the question into a large language model, and obtaining the file content referenced by the large language model to answer the question, extracting the target file content that the user has the authority to access from the file content, and returning the target file content to the large language model, obtaining the answer generated by the large language model based on the question and the target file content, and displaying the answer; because when a user asks a question, the present application only passes the file content that the user has the authority to access to the large language model for answering, thereby avoiding the leakage of confidential information, thereby improving the security of the model question and answer.
[0083] It should be noted that the executor of this embodiment can be a question-and-answer device with data processing, network communication and program running functions, such as a cloud disk or file management system, or other electronic devices that can achieve the same or similar functions. This embodiment does not impose any restrictions on this.
[0084] Based on this, the embodiment of the present application provides a question-answering method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the question-and-answer method of this application.
[0085] In a first embodiment, the question-answering method includes:
[0086] Step S10: In response to a question raised by a user, the question is input into a large language model, and the file content referenced by the large language model in answering the question is obtained.
[0087] It should be understood that users can ask questions through preset applications, which can be pre-set. In a specific implementation, the preset application can be a document assistant corresponding to the file management system. Of course, in order to meet the personalized needs of users, in this embodiment, users can also ask questions by managing question-and-answer applications pre-built by users (such as RAG applications), and this embodiment does not limit this.
[0088] It should be noted that the big language model may refer to a natural language processing model based on artificial intelligence technology, which can understand, analyze and generate human language text, and is used to answer various questions, provide information, generate text, etc. The questions raised by the user may refer to specific questions or requests sent by the user to the file management system that need to be answered or information. The referenced file content may refer to the content of specific files, documents or materials that the big language model refers to or quotes when answering user questions. These files can be stored in the enterprise's file management system.
[0089] It is understandable that after the question is input into the large language model, the large language model will answer the question and input the file content referenced by the answer question, wherein the file content may be multiple knowledge fragments, which is not limited in this embodiment.
[0090] Step S20: extracting the target file content that the user has the authority to access from the file content, and returning the target file content to the large language model.
[0091] It should be understood that the target file content that the user has the right to access may refer to the part of the file content that the user is authorized to access and view according to the enterprise's rights management mechanism. In a specific implementation, the file management system filters out the part of the content that the user has the right to access from the referenced file content according to the enterprise's rights management mechanism and the file access rights pre-assigned to the user, so as to ensure that the user can only see the information they are authorized to view, thereby protecting the enterprise's information security.
[0092] Step S30: Obtain the answer generated by the large language model according to the question and the target file content, and display the answer.
[0093] It should be noted that the generated answer may refer to a specific response or answer to a user's question generated by a large language model through natural language processing technology based on the user's question and the filtered target file content.
[0094] It should be understood that the large language model can generate a specific answer based on the user's question and the filtered target file content. The file management system receives and displays the answer to the user, and the user can see the information related to their question and that they have the right to access.
[0095] In this embodiment, when a user asks a question, only the file content that the user has permission to access is passed to the large language model for answering, thereby avoiding the leakage of confidential information and further improving the security of the model question and answer.
[0096] Reference Figure 2 , Figure 2 This is a flow chart of the second embodiment of the question-and-answer method of this application, based on the above Figure 1 The first embodiment shown proposes a second embodiment of the question-and-answer method of the present application.
[0097] In the second embodiment, the step S10 includes:
[0098] Step S101: In response to a question raised by a user, the question is input into a large language model.
[0099] It should be understood that in order to improve the accuracy of the file content, in this embodiment, the question is first vectorized to obtain a question vector, and then the question vector is matched with the file content in a preset vector library, and the file content referenced by the large language model to answer the question is obtained based on the matching result.
[0100] Step S102: vectorizing the question using the large language model to obtain a question vector.
[0101] It is understandable that in this embodiment, the large language model converts the question raised by the user into a mathematical representation, namely a vector. A vector is a data structure containing multiple numerical values, which is used to represent the position of a text in a specific space. Through vectorization, the large language model can convert the text into a format that can be processed by a computer while retaining its semantic information.
[0102] Step S103: Match the question vector with the file content in the preset vector library, and obtain the file content referenced by the large language model to answer the question according to the matching result.
[0103] It should be understood that the preset vector library can be a database containing a large amount of file content (such as multiple knowledge fragments, etc.), and the file content in the preset vector library has been converted into vector form. By calculating the similarity (such as cosine similarity) between the question vector and the file content vector in the preset vector library, the file content vector most similar to the question vector can be found. After finding the file content vector that best matches the question vector, the corresponding file content can be retrieved from the preset vector library. These file contents will serve as the basis for the large language model to answer user questions. The large language model can directly quote these file contents, or it can generate a more specific answer based on these contents, which is not limited in this embodiment.
[0104] This embodiment first vectorizes the question to obtain a question vector, then matches the question vector with the file content in a preset vector library, and obtains the file content referenced by the large language model to answer the question based on the matching result, thereby improving the accuracy of the file content and further improving the user's question-answering experience.
[0105] In the second embodiment, the step S20 includes:
[0106] Step S201: Obtain the source file corresponding to the file content, and obtain the file access permission of the user.
[0107] It should be understood that in order to avoid leakage of confidential information at the file level, in this embodiment, the source file corresponding to the file content and the user's file access permissions are first obtained, and then the target source file that the user has access rights to is obtained from the source file based on the file access permissions, and then the target file content corresponding to the target source file is obtained, and the target file content is returned to the large language model.
[0108] It is understandable that in this embodiment, it is necessary to determine the source of the file content, that is, to find the original file that generates or contains the file content. In a specific implementation, it can be to parse the metadata, reference information or links in the file content, or query the database to find the source file associated with the file content. It is also necessary to query the user account or access control list to determine the user's current file access rights. Among them, the file access rights may include access rights to different file types, file locations or file attributes, which are not limited in this embodiment.
[0109] Furthermore, in order to meet the actual needs of users, in this embodiment, the user's access rights can also be adjusted, and the obtaining of the user's file access rights includes: monitoring the user's historical question and answer information and the current access environment; obtaining the initial access rights pre-assigned to the user; adjusting the user's initial access rights according to the historical question and answer information and the current access environment to obtain the user's file access rights.
[0110] It should be noted that historical question and answer information may refer to the data generated by users when they interacted with the large language model in the past, including questions raised by users, answers given by the large language model, user feedback, etc. Historical question and answer information can reflect the user's knowledge level, interest preferences, and possible access needs, etc. The current access environment may refer to the user's current network environment, device information, geographical location and other external conditions. The current access environment may affect the user's access rights. For example, some sensitive information may only be accessible in the company's internal network environment. Initial access rights may refer to file access rights pre-assigned to users based on their roles, positions or organizational policies. The initial access rights define which files the user can view, edit or delete. File access rights may refer to dynamically adjusted access rights when a user actually accesses a file based on their historical question and answer information, current access environment and possible other factors.
[0111] It should be understood that the user's historical question and answer information and current access environment are continuously monitored to collect relevant data. Based on the user's role, position and other static information, a set of initial access rights are pre-assigned to the user. Based on the collected historical question and answer information and the current access environment, the user's initial access rights are dynamically adjusted. This adjustment can be based on multiple factors such as the user's behavior pattern, access requirements, security policies, etc. The adjusted file access rights will be applied to the user's actual file access request to ensure that the user can only access the content for which he is authorized.
[0112] Furthermore, in order to improve the accuracy of access permission adjustment, the initial access permissions of the user are adjusted according to the historical question and answer information and the current access environment to obtain the file access permissions of the user, including: performing semantic analysis, sentiment analysis, and behavioral pattern recognition on the historical question and answer information to obtain multi-dimensional analysis results of the historical question and answer information; obtaining the user's geographic location, device type, and status identification from the current access environment; analyzing the user's security according to the geographic location, the device type, and the status identification to obtain the user's security score; adjusting the user's initial access permissions according to the multi-dimensional analysis results of the historical question and answer information and the user's security score to obtain the user's file access permissions.
[0113] It is understood that semantic analysis can refer to the process of understanding and interpreting text content, aiming to extract semantic information such as themes, concepts, and relationships in the text. Sentiment analysis can refer to the process of judging the sentiment tendency of text content, used to identify whether the sentiment expressed in the text is positive, negative, or neutral. Behavioral pattern recognition can refer to the process of identifying the behavioral characteristics, habits, or regularities of users by analyzing their behavioral data. Geographic location positioning can refer to the technology of determining the current geographic location of the user, which can be achieved through GPS, network positioning, etc. Device type can refer to the type of device used by the user to access the system, such as mobile phones, computers, tablets, etc. State recognition can refer to identifying the current state of the user's device, such as whether it is connected to the company network, whether security software is turned on, etc. The security score can refer to the security score of the user's access to the system obtained by comprehensive evaluation based on factors such as the user's geographic location, device type, and state.
[0114] For ease of understanding, the following examples are given, but this application is not limited. As an example, suppose an employee of a company wants to understand the company's reimbursement process and plans to access relevant files stored in the company's file management system. The specific steps are as follows: 1. Multidimensional analysis: Semantic analysis: The system analyzes the questions asked by the employee in the past and finds that he has mentioned keywords such as "reimbursement" and "invoice" many times, indicating that he has a strong interest in the reimbursement process. Sentiment analysis: The system finds that the employee usually shows a positive and patient attitude when asking questions, and does not show obvious negative emotions. Behavioral pattern recognition: The system analyzes the employee's access records and finds that he usually accesses the system during working hours, and the access frequency is relatively stable. 2. Environmental information collection: Geographic location positioning: The system uses GPS to locate that the employee is currently in the company building. Device type: The employee is using a company-issued laptop. Status identification: The system detects that the employee's laptop is connected to the company's internal network and has the latest security software installed. 3. Security assessment: Based on the employee's geographic location (within the company), device type (company-issued laptop), and status identification (connected to the company's internal network, with security software installed), the system comprehensively assesses the employee's security score to be high. 4. Permission adjustment: Based on the employee's historical Q&A information (strong interest in the reimbursement process) and security score (high), the system adjusts his initial access rights, allowing him to access more detailed reimbursement process guides and more relevant financial documents.
[0115] Step S202: Obtaining a target source file that the user has permission to access from the source file according to the file access permission.
[0116] It is understood that file access permissions may refer to the permission level of a user in a file management system to access a specific file or set of files. File access permissions determine which files a user can view, edit, download, or delete. Therefore, in this embodiment, the target source file that a user has permission to access may be obtained from the source file based on the file access permissions.
[0117] Step S203: obtaining the target file content corresponding to the target source file, and returning the target file content to the large language model.
[0118] For ease of understanding, the following examples are provided, but are not intended to limit this application. As an example, assume that the large language model vectorizes the questions raised by the user and performs a unified search in the vector library to retrieve 10 blocks (multiple knowledge fragments, i.e., file contents) with high matching degrees, and the 10 blocks come from 4 files (i.e., source files). Of the 4 files recalled by the large language model, only 3 have access rights to which the current user has access rights (i.e., target source files), and the corresponding 3 files are associated with 8 blocks (i.e., the target file contents corresponding to the target source files). The corresponding 8 block contents and the user's questions are transmitted to the large language model, and the large language model generates answers within the corresponding authority range for the user based on the transmitted content.
[0119] This embodiment first obtains the source file corresponding to the file content and the user's file access permissions, then obtains the target source file that the user has access permissions to from the source file based on the file access permissions, then obtains the target file content corresponding to the target source file, and returns the target file content to the large language model, thereby avoiding the leakage of confidential information at the file level and improving the security of model question answering.
[0120] In the second embodiment, the step S30 includes:
[0121] Step S301: Obtain an answer generated by the large language model according to the question and the target file content.
[0122] It should be understood that in order to reduce the illusion of a large language model and to make the answer traceable and the content credible, in this embodiment, while displaying the answer, the target source file corresponding to the target file content is also displayed.
[0123] It is understandable that after returning the target file content to the large language model, the large language model generates a specific answer to the user's question based on the user's question and the filtered target file content.
[0124] Step S302: Obtain the target source file corresponding to the target file content, and display the answer and the target source file.
[0125] It should be understood that the original file or document containing the target file content is identified and obtained, that is, the target source file. The generated answer and the target source file are displayed to the user together so that the user can understand the specific source and basis of the answer.
[0126] In this embodiment, while displaying the answer, the target source file corresponding to the target file content is also displayed, thereby reducing the illusion of a large language model and achieving traceability of the answer and credibility of the content.
[0127] Furthermore, in order to obtain an answer containing more information, in this embodiment, after obtaining the answer, the user can also apply to the management user for permission to regenerate the answer. After step S302, it also includes: receiving the permission application request fed back by the user based on the answer and the target source file; sending the answer, the target source file and the permission application request to the management user; receiving permission allocation information fed back by the management user based on the answer, the target source file and the permission application request; re-extracting the custom file content from the file content according to the permission allocation information, and returning the answer and the custom file content to the large language model; obtaining the custom answer regenerated by the large language model based on the question, the answer and the custom file content, and displaying the custom answer.
[0128] It should be noted that a permission application request may refer to a request made by a user to the system to adjust or increase access permissions based on the answer and the target source file. An administrative user may refer to a user with permission to assign permissions, specifically a system administrator or a person with corresponding responsibilities. Permission allocation information may refer to specific information about user permission adjustments fed back by an administrative user based on the user's permission application request. Custom file content may refer to content that the file management system re-extracts from the file content and to which the user has newly gained access permissions based on the permission allocation information. A custom answer may refer to a more detailed or more informative answer regenerated by a large language model based on the user's question, original answer, and custom file content.
[0129] It should be understood that the user submits a permission application request to the file management system based on the answer and the target source file. The file management system sends the answer, the target source file, and the permission application request to the management user. The management user decides whether to adjust the user's permissions based on this information and feedbacks the permission allocation information. The file management system re-extracts the content of the user's newly obtained access rights from the file content based on the permission allocation information, that is, the custom file content. The file management system returns the answer and the custom file content to the large language model. The large language model regenerates a custom answer containing more information based on the user's question, the original answer, and the custom file content. The file management system displays the custom answer to the user so that the user can understand more detailed information.
[0130] Furthermore, in order to obtain a more detailed answer, in this embodiment, after obtaining the answer, the user can also select part of the file from the target source file to regenerate the answer. After step S302, it also includes: receiving the file selection instruction fed back by the user based on the answer and the target source file; returning the question, the answer and the file selection instruction to the large language model; obtaining the answer regenerated by the large language model based on the question, the answer and the file selection instruction, and displaying the regenerated answer.
[0131] It should be noted that the file selection instruction may refer to an instruction issued by the user to the system to select a specific file or file content based on the answer and the target source file, so as to further refine or supplement the answer. The regenerated answer may refer to a more detailed or more informative answer regenerated by the large language model based on the user's question, the original answer, and the file selection instruction.
[0132] It is understandable that the user issues a file selection instruction to the file management system based on the answer and the target source file, and selects a specific file or file content to further refine or supplement the answer. The file management system returns the user's question, the answer generated by the large language model, and the file selection instruction issued by the user to the large language model. The large language model regenerates a more detailed or more informative answer based on the user's question, the original answer, and the file selection instruction. The file management system displays the regenerated answer to the user.
[0133] Reference Figure 3 , Figure 3 This is a flow chart of the third embodiment of the question-and-answer method of this application, based on the above Figure 2 The second embodiment shown proposes the third embodiment of the question-and-answer method of the present application.
[0134] In the third embodiment, before step S101, the method further includes:
[0135] Step S01: receiving files added by management users, and performing retrieval enhancement training on a large language model according to the files.
[0136] It should be understood that in order to improve the retrieval and answering capabilities of the large language model in specific fields or topics, in this embodiment, the management user can also add files to perform retrieval enhancement training on the large language model, and store the added files in the form of file content.
[0137] It is understandable that the management user may refer to a user who has the authority to add and manage files in the file management system, for example, a system administrator or an individual with specific authority, and this embodiment does not limit this. In a specific implementation, receiving files added by the management user may be that the file management system provides an interface or interface that allows the management user to add files in batches in the background. In this embodiment, the large language model is trained using the added file content to improve the model's retrieval and answering capabilities in specific fields or topics. In a specific implementation, the added files may be converted into training data, and the large language model is trained with RAG using the training data.
[0138] Step S02: Slice the file to obtain the file content.
[0139] It should be understood that in order to more efficiently process and store file content, in this embodiment, the file is divided into smaller fragments or slices. In the specific implementation, different files are sliced according to different slicing strategies to obtain multiple knowledge fragments, where the slicing strategy can be set in advance.
[0140] Furthermore, in order to meet actual slicing requirements, the step S02 includes: obtaining the file type and file source of the file, and analyzing the encryption level of the file according to the file type and the file source; obtaining the model characteristics of the large language model and the user needs of the user, and analyzing the answer generation method of the large language model according to the model characteristics and the user needs; slicing the file according to the encryption level and the answer generation method to obtain file content, wherein the file content includes multiple knowledge fragments.
[0141] It should be noted that the file type may refer to the format or type of the file, such as text files, image files, audio files, video files, etc. Each type has its own specific storage and representation methods. The file source may refer to the origin or generation method of the file, such as internal generation, external reception, network download, etc. Files from different sources may have different security and credibility. The encryption level may refer to the degree or level of encryption of the file, which is used to protect the confidentiality and integrity of the file. The higher the encryption level, the higher the security of the file. Model characteristics may refer to the characteristics exhibited by the large language model when processing natural language tasks, such as language understanding ability, generation ability, context perception ability, etc. User needs may refer to the goals or needs that users expect to achieve when using the large language model, such as obtaining specific information, generating text, and conducting conversations. The answer generation method may refer to the strategy or method adopted by the large language model when answering user questions, such as template-based generation, retrieval-based generation, generation-based generation, etc. Knowledge fragments may refer to information units with specific meanings or values extracted from files, which may be concepts, facts, opinions, etc.
[0142] It should be understood that the document management system first identifies the type (e.g., PDF, DOCX, TXT, etc.) and source (e.g., internal system, external mailbox, network link, etc.) of the uploaded file. Based on the type and source of the file, the document management system evaluates the encryption requirements of the file. For example, sensitive data (e.g., financial statements, customer information) may require a higher level of encryption, while public information (e.g., press releases, product manuals) may not require encryption. The document management system analyzes the characteristics of the currently used large language model (e.g., what type of text it is good at processing, the speed and quality of answer generation, etc.) and the specific needs of users (e.g., the need to get answers quickly, the need for detailed explanations, etc.). Based on the model characteristics and user needs, the document management system determines the best answer generation method that the large language model should use when answering user questions. For example, for questions that require quick answers, a retrieval-based generation method can be used; for questions that require detailed explanations, a generation-based generation method can be used. After determining the encryption level of the file and the answer generation method of the large language model, the document management system slices the file. The size and number of slices depend on the encryption level of the file (the higher the encryption level, the finer the slices may be) and the answer generation method (the more knowledge fragments need to be extracted, the more slices may be). The sliced file content is extracted and stored as multiple knowledge fragments, which can be used for subsequent question-answering, retrieval and other tasks.
[0143] For ease of understanding, the following examples are provided, but this application is not limited. As an example, assume that there is an enterprise document management system, which contains files of various types and sources, such as internally generated financial statements, externally received customer information, and competitor analysis reports downloaded from the network. The user uploaded a financial statement in PDF format, which comes from the internal financial department. Because the financial statement contains sensitive data, the enterprise document management system sets its encryption level to the highest level. The large language model used by the enterprise document management system is good at processing text data, and users need to quickly obtain key data in the report. Based on the characteristics of the model and user needs, the enterprise document management system decides to use a retrieval-based generation method to answer user questions. Due to the high encryption level, the enterprise document management system finely slices the financial statements to ensure that each slice contains an independent and complete knowledge fragment (such as income, expenditure, profit, etc.). The sliced financial statements are extracted into multiple knowledge fragments and stored in the enterprise document management system. When the user asks "What is the revenue this quarter?", the enterprise document management system can quickly retrieve the relevant knowledge fragments and return them to the user.
[0144] Step S03: storing the file content into the preset vector library, and creating a question-and-answer application based on the large language model and the preset vector library.
[0145] For ease of understanding, the following examples are provided, but the present application is not limited. As an example, suppose there is an enterprise document management system, which contains a large number of technical documents, policy documents, user manuals, etc. The system administrator uploads a new technical document to the enterprise document management system. The enterprise document management system uses the content of this new document to train the large language model so that it can better understand and answer technology-related questions. The enterprise document management system divides the document into multiple paragraphs or chapters, and each paragraph or chapter is a slice. The enterprise document management system converts the contents of these slices into vector representations and stores them in a preset vector library. The enterprise document management system has built a question-and-answer application through which users can ask questions related to technical documents. For example, a user may ask how to use a specific function or the details of a policy.
[0146] Furthermore, in order to improve the security of the document content, storing the file content in the preset vector library includes: encrypting the file content and storing the encrypted file content in the preset vector library; matching the question vector with the file content in the preset vector library includes: decrypting the file content in the preset vector library and matching the question vector with the decrypted file content.
[0147] It is understandable that before storing the file content in the preset vector library, the file content is first encrypted using a preset encryption algorithm to ensure that even if the preset vector library is accessed without authorization, the file content therein will not be easily understood or abused. The encrypted file content is converted into a vector form and stored in the preset vector library, which contains multiple encrypted file content vectors. When it is necessary to match the question vector with the file content in the preset vector library, it is first necessary to decrypt the encrypted file content vector in the preset vector library. This is because in the matching process, it is necessary to access the original form of the file content in order to compare with the question vector. Specifically, it can be determined which file content in the preset vector library is most relevant to the user's question by calculating the similarity or distance between the decrypted file content vector and the question vector. Among them, the preset encryption algorithm can be preset, and this embodiment does not limit this.
[0148] Accordingly, the step S101 includes:
[0149] Step S101 ′: in response to a question raised by a user through the question-answering application, the question is input into a large language model, and the file content referenced by the large language model in answering the question is obtained.
[0150] In this embodiment, the management user can also add files to perform retrieval enhancement training on the large language model, and store the added files as file content, thereby improving the retrieval and answering capabilities of the large language model in specific fields or topics and enhancing the user experience.
[0151] For ease of understanding, refer to Figure 4 and Figure 5 This invention is provided for illustration, but is not intended to limit the present application. Figure 4 This is a scenario flow chart of an embodiment of the question-answering method of this application. Figure 5 This is a schematic diagram of the interface of an embodiment of the question-answering method of this application. In order to solve the problem of content leakage in the current large language model during the user question-answering process, this application adopts a file permission allocation technology based on a cloud disk or file management system. When a user asks a question, only the file content (multiple knowledge fragments) that the current user has permission to access is retrieved, and the corresponding fragment content is returned to the large language model, allowing the large language model to generate the answer and give the final reference file. The specific control steps are as follows:
[0152] Step 1: The administrator assigns different file access permissions to different types of users.
[0153] Step 2: The administrator adds files in batches in the background, trains the RAG, slices the files according to different slicing strategies, and creates RAG-based applications.
[0154] Step 3: The user asks questions on the RAG application created by the administrator (such as Figure 5 In the question “What is the reimbursement process of the Hangzhou branch?”), the large language model vectorizes the question raised by the user and performs a unified search in the vector library to retrieve the 10 blocks with high matching degree (such as Figure 4 , and the 10 blocks come from 4 files (such as Figure 4 File 1, File 2, File 3, and File 4).
[0155] Step 4: The current user has access rights to only three of the four files recalled by the large language model (such as Figure 4 File 1, file 2, file 3), and the corresponding three files are associated with 8 blocks (such as Figure 4 block1, block2, block3, block4, block5, block6, block7, block8).
[0156] Step 5: The corresponding 8 block contents and the user's question are transmitted to the large language model. The large language model generates the corresponding answer within the scope of the user's authority based on the transmitted content (such as Figure 5 The answer given by the document assistant in the document assistant) and display the files from which the corresponding user's answer comes (such as Figure 5 File 1, File 2, File 3) shown in the "Learn more" section in the
[0157] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the question-and-answer method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0158] This application also provides a question-and-answer device, please refer to Figure 6 , the question-answering device comprises:
[0159] A question input module 10 is used to respond to a question raised by a user, input the question into a large language model, and obtain the file content referenced by the large language model in answering the question;
[0160] The permission verification module 20 is used to extract the target file content that the user has permission to access from the file content, and return the target file content to the large language model;
[0161] The answer generation module 30 is used to obtain the answer generated by the large language model according to the question and the target file content, and display the answer.
[0162] The question-and-answer device provided by the present application adopts the question-and-answer method in the above embodiment, which can solve the technical problem that the large language model of the existing question-and-answer method does not perform effective user permission isolation when answering the user's questions, and the user can obtain the company's confidential information by asking questions, thereby causing the leakage of confidential information. Compared with the prior art, the beneficial effects of the question-and-answer device provided by the present application are the same as the beneficial effects of the question-and-answer method provided by the above embodiment, and the other technical features in the question-and-answer device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0163] The present application provides a question-and-answer device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the question-and-answer method in the above-mentioned embodiment 1.
[0164] Reference below Figure 7, which shows a schematic diagram of the structure of a question-answering device suitable for implementing the embodiment of the present application. The question-answering device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The question-and-answer device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0165] like Figure 7 As shown, the question-answering device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a ROM (Read Only Memory) 1002 or a program loaded from a storage device 1003 to a RAM (Random Access Memory) 1004. In the RAM 1004, various programs and data required for the operation of the question-answering device are also stored. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, an LCD (Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the question-answering device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a question-answering device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0166] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0167] The question-and-answer device provided by the present application adopts the question-and-answer method in the above embodiment, which can solve the technical problem that the existing question-and-answer method large language model does not perform effective user permission isolation when answering the user's questions, and the user can obtain the company's confidential information by asking questions, thereby causing the leakage of confidential information. Compared with the prior art, the beneficial effects of the question-and-answer device provided by the present application are the same as the beneficial effects of the question-and-answer method provided by the above embodiment, and the other technical features in the question-and-answer device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0168] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0169] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0170] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the question-answering method in the above-mentioned embodiment.
[0171] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, RAM (Random Access Memory), ROM (Read Only Memory), EPROM (Erasable Programmable Read Only Memory) or flash memory, optical fiber, CD-ROM (CD-Read Only Memory, portable compact disk read-only memory), optical storage device, magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0172] The computer-readable storage medium may be included in the question-answering device; or may exist independently without being assembled into the question-answering device.
[0173] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the question-and-answer device, the question-and-answer device executes the question-and-answer method.
[0174] The computer program code for performing the operation of the present application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a LAN (Local Area Network) or a WAN (Wide Area Network), or it can be connected to an external computer (e.g., using an Internet service provider to connect through the Internet).
[0175] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0176] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0177] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned question-and-answer method, and can solve the technical problem that the existing question-and-answer method large language model does not perform effective user authority isolation when answering user questions, and users can obtain confidential information of the enterprise by asking questions, thereby causing confidential information leakage. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the question-and-answer method provided by the above-mentioned embodiment, which will not be repeated here.
[0178] The present application also provides a computer program product, including a computer program, which implements the question-and-answer method as described above when executed by a processor.
[0179] The computer program product provided by this application can solve the technical problem that when answering user questions, the large language model of the existing question-and-answer method does not perform effective user permission isolation, and users can obtain confidential information of the company by asking questions, thereby causing confidential information leakage. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the question-and-answer method provided by the above embodiment, and will not be repeated here.
[0180] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
[0181] The present application discloses A1, a question-answering method, the question-answering method comprising:
[0182] In response to a question raised by a user, the question is input into a large language model, and the content of a file referenced by the large language model in answering the question is obtained;
[0183] Extracting target file content that the user has permission to access from the file content, and returning the target file content to the large language model;
[0184] An answer generated by the large language model according to the question and the target file content is obtained, and the answer is displayed.
[0185] A2. The question-answering method as described in A1, wherein the step of extracting target file content that the user has the authority to access from the file content and returning the target file content to the large language model comprises:
[0186] Obtaining the source file corresponding to the file content, and obtaining the file access permission of the user;
[0187] Acquire a target source file that the user has permission to access from the source file according to the file access permission;
[0188] The target file content corresponding to the target source file is obtained, and the target file content is returned to the large language model.
[0189] A3. The question-and-answer method as described in A2, wherein obtaining the file access rights of the user comprises:
[0190] Monitoring the user's historical question and answer information and current access environment;
[0191] Obtaining initial access rights pre-assigned to the user;
[0192] The initial access permission of the user is adjusted according to the historical question and answer information and the current access environment to obtain the file access permission of the user.
[0193] A4. The question-and-answer method as described in A3, wherein the initial access rights of the user are adjusted according to the historical question-and-answer information and the current access environment to obtain the file access rights of the user, including:
[0194] Performing semantic analysis, sentiment analysis, and behavior pattern recognition on the historical question and answer information to obtain a multi-dimensional analysis result of the historical question and answer information;
[0195] Obtaining the user's geographic location, device type, and status identification from the current access environment;
[0196] Analyze the security of the user according to the geographic location, the device type, and the state identification to obtain a security score of the user;
[0197] The initial access rights of the user are adjusted according to the multi-dimensional analysis results of the historical question and answer information and the security score of the user to obtain the file access rights of the user.
[0198] A5. The question-answering method according to any one of A1 to A4, wherein in response to a question raised by a user, inputting the question into a large language model, and obtaining the file content referenced by the large language model in answering the question comprises:
[0199] In response to a question raised by a user, inputting the question into a large language model;
[0200] Vectorize the question using the large language model to obtain a question vector;
[0201] The question vector is matched with the file content in a preset vector library, and the file content referenced by the large language model to answer the question is obtained according to the matching result.
[0202] A6. The question-answering method as described in A5, wherein before inputting the question into the large language model in response to the question raised by the user and obtaining the file content referenced by the large language model in answering the question, the method further comprises:
[0203] Receive files added by management users, and perform retrieval enhancement training on the large language model based on the files;
[0204] Slice the file to obtain the file content;
[0205] Storing the file content in the preset vector library, and creating a question-and-answer application according to the large language model and the preset vector library;
[0206] Accordingly, in response to the question raised by the user, the question is input into the large language model, and the file content referenced by the large language model in answering the question is obtained, including:
[0207] In response to a question raised by a user through the question-answering application, the question is input into a large language model, and the document content referenced by the large language model in answering the question is obtained.
[0208] A7. The question-answering method as described in A6, wherein slicing the file to obtain the file content comprises:
[0209] Obtaining a file type and a file source of the file, and analyzing an encryption level of the file according to the file type and the file source;
[0210] Acquire the model characteristics of the large language model and the user needs of the user, and analyze the answer generation method of the large language model according to the model characteristics and the user needs;
[0211] The file is sliced according to the encryption level and the answer generation method to obtain file content, wherein the file content includes multiple knowledge fragments.
[0212] A8. The question-answering method as described in A6, wherein storing the file content into the preset vector library comprises:
[0213] Encrypting the file content and storing the encrypted file content in the preset vector library;
[0214] The matching of the problem vector with the file content in the preset vector library includes:
[0215] The file content in the preset vector library is decrypted, and the question vector is matched with the decrypted file content.
[0216] A9. The question-answering method as described in any one of A1 to A4, wherein obtaining the answer generated by the large language model according to the question and the target file content, and displaying the answer, comprises:
[0217] Obtaining an answer generated by the large language model according to the question and the content of the target file;
[0218] Obtain the target source file corresponding to the target file content, and display the answer and the target source file.
[0219] A10. The question-answering method as described in A9, after obtaining the target source file corresponding to the content of the target file and displaying the answer and the target source file, further comprising:
[0220] Receiving a permission application request from the user based on the answer and the target source file;
[0221] Sending the answer, the target source file and the permission application request to the management user;
[0222] Receiving permission allocation information fed back by the management user according to the answer, the target source file and the permission application request;
[0223] re-extracting the custom file content from the file content according to the permission allocation information, and returning the answer and the custom file content to the large language model;
[0224] Obtain a custom answer regenerated by the large language model according to the question, the answer and the custom file content, and display the custom answer.
[0225] A11. The question-answering method as described in A9, after obtaining the target source file corresponding to the content of the target file and displaying the answer and the target source file, further comprises:
[0226] Receiving a file selection instruction fed back by the user according to the answer and the target source file;
[0227] Returning the question, the answer, and the file selection instruction to the large language model;
[0228] An answer regenerated by the large language model according to the question, the answer and the file selection instruction is obtained, and the regenerated answer is displayed.
[0229] The present application also discloses B12, a question-answering device, the question-answering device comprising:
[0230] A question input module, used to respond to a question raised by a user, input the question into a large language model, and obtain the file content referenced by the large language model in answering the question;
[0231] A permission verification module, used for extracting target file content that the user has permission to access from the file content, and returning the target file content to the large language model;
[0232] The answer generation module is used to obtain the answer generated by the large language model according to the question and the content of the target file, and display the answer.
[0233] B13. In the question-and-answer device as described in B12, the permission verification module is further used to obtain the source file corresponding to the file content and obtain the file access rights of the user; obtain the target source file that the user has the right to access from the source file according to the file access rights; obtain the target file content corresponding to the target source file, and return the target file content to the large language model.
[0234] B14. In the question-and-answer device as described in B13, the permission verification module is further used to monitor the user's historical question-and-answer information and current access environment; obtain the initial access rights pre-assigned to the user; adjust the user's initial access rights according to the historical question-and-answer information and the current access environment, and obtain the user's file access rights.
[0235] B15. In the question-and-answer device as described in B14, the permission verification module is further used to perform semantic analysis, sentiment analysis and behavioral pattern recognition on the historical question-and-answer information to obtain a multi-dimensional analysis result of the historical question-and-answer information; obtain the user's geographic location, device type and status identification from the current access environment; analyze the user's security based on the geographic location, the device type and the status identification to obtain the user's security score; adjust the user's initial access rights based on the multi-dimensional analysis result of the historical question-and-answer information and the user's security score to obtain the user's file access rights.
[0236] B16. In the question-answering device as described in any one of B12 to B15, the question input module is further used to input the question into a large language model in response to a question raised by a user; vectorize the question through the large language model to obtain a question vector; match the question vector with the file content in a preset vector library, and obtain the file content referenced by the large language model to answer the question based on the matching result.
[0237] B17. The question-answering device as described in B16, further comprising:
[0238] The application creation module is used to receive files added by management users, and perform retrieval enhancement training on the large language model according to the files; slice the files to obtain file contents; store the file contents into the preset vector library, and create a question-and-answer application according to the large language model and the preset vector library;
[0239] Correspondingly, the question input module is also used to respond to questions raised by the user through the question-answering application, input the questions into the large language model, and obtain the file content referenced by the large language model to answer the questions.
[0240] The present application also discloses C18, a question-and-answer device, which includes: a memory, a processor, and a question-and-answer program stored in the memory and executable on the processor, wherein the question-and-answer program implements the question-and-answer method described above when executed by the processor.
[0241] The present application also discloses D19, a storage medium, on which a question-and-answer program is stored, and when the question-and-answer program is executed by a processor, the question-and-answer method as described above is implemented.
[0242] The present application also discloses E20, a computer program product, which includes a question-answering program, and when the question-answering program is executed by a processor, the question-answering method as described above is implemented.
Claims
1. A question-answering method, characterized in that: The question-answering method comprises: In response to a question raised by a user, the question is input into a large language model, and the content of a file referenced by the large language model in answering the question is obtained; Extracting target file content that the user has permission to access from the file content, and returning the target file content to the large language model; An answer generated by the large language model according to the question and the target file content is obtained, and the answer is displayed.
2. The question-answering method according to claim 1, wherein: The step of extracting target file content that the user has permission to access from the file content and returning the target file content to the large language model includes: Obtaining the source file corresponding to the file content, and obtaining the file access permission of the user; Acquire a target source file that the user has permission to access from the source file according to the file access permission; The target file content corresponding to the target source file is obtained, and the target file content is returned to the large language model.
3. The question-answering method according to claim 2, wherein: The obtaining the file access permission of the user includes: Monitoring the user's historical question and answer information and current access environment; Obtaining initial access rights pre-assigned to the user; The initial access permission of the user is adjusted according to the historical question and answer information and the current access environment to obtain the file access permission of the user.
4. The question-answering method according to claim 3, wherein: The adjusting the initial access rights of the user according to the historical question-and-answer information and the current access environment to obtain the file access rights of the user includes: Performing semantic analysis, sentiment analysis, and behavior pattern recognition on the historical question and answer information to obtain a multi-dimensional analysis result of the historical question and answer information; Obtaining the user's geographic location, device type, and status identification from the current access environment; Analyze the security of the user according to the geographic location, the device type, and the state identification to obtain a security score of the user; The initial access rights of the user are adjusted according to the multi-dimensional analysis results of the historical question and answer information and the security score of the user to obtain the file access rights of the user.
5. The question-answering method according to any one of claims 1 to 4, characterized in that: In response to the question raised by the user, inputting the question into the large language model, and obtaining the file content referenced by the large language model in answering the question, including: In response to a question raised by a user, inputting the question into a large language model; Vectorize the question using the large language model to obtain a question vector; The question vector is matched with the file content in a preset vector library, and the file content referenced by the large language model to answer the question is obtained according to the matching result.
6. The question-answering method according to claim 5, wherein: Before the step of responding to the question raised by the user, inputting the question into the large language model, and obtaining the file content referenced by the large language model in answering the question, the step further includes: Receive files added by management users, and perform retrieval enhancement training on the large language model based on the files; Slice the file to obtain the file content; Storing the file content in the preset vector library, and creating a question-and-answer application according to the large language model and the preset vector library; Accordingly, in response to the question raised by the user, the question is input into the large language model, and the file content referenced by the large language model in answering the question is obtained, including: In response to a question raised by a user through the question-answering application, the question is input into a large language model, and the document content referenced by the large language model in answering the question is obtained.
7. A question-answering device, characterized in that: The question-answering device comprises: A question input module, used to respond to a question raised by a user, input the question into a large language model, and obtain the file content referenced by the large language model in answering the question; A permission verification module, used for extracting target file content that the user has permission to access from the file content, and returning the target file content to the large language model; The answer generation module is used to obtain the answer generated by the large language model according to the question and the content of the target file, and display the answer.
8. A question-answering device, characterized in that: The question-answering device comprises: a memory, a processor, and a question-answering program stored in the memory and executable on the processor. When the question-answering program is executed by the processor, the question-answering method according to any one of claims 1 to 6 is implemented.
9. A storage medium, characterized in that: The storage medium stores a question-and-answer program, which, when executed by a processor, implements the question-and-answer method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The computer program product comprises a question-answering program, and when the question-answering program is executed by a processor, the question-answering method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Question and answer model construction method, knowledge base creation method, question and answer search method and electronic equipment
CN116842151A
Training method of question-answering system, question-answering method and control device
CN117633161A
Question and answer method, device and equipment based on large language model and storage medium
CN118133948A
Privacy protection method and device for knowledge retrieval enhancement, system, equipment and medium
CN118296654A
Database-based retrieval enhancement and question and answer method and system
CN118364087A