A dual-prevention intelligent interactive system based on a large language model
The dual-prevention intelligent interactive system built through a large language model solves the shortcomings of traditional systems in safety training and risk identification, realizes personalized services and efficient safety management, and improves the effectiveness of risk identification and training.
Patent Information
- Application Number
- CN202411507084.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-10-28
AI Technical Summary
Traditional dual-prevention systems lack targeted and personalized safety training, have limited employee expertise, fail to adequately identify risks, and fail to implement safe operating procedures, resulting in training and control measures that are neither targeted nor timely.
A dual-prevention intelligent interactive system is constructed using a large language model, including a large language model base, a knowledge base management module, an intelligent agent module, a multimodal large model module, and an evaluation module. Through natural language processing and multimodal interaction, it provides personalized security management services and improves risk identification and training effectiveness.
It enables personalized security management services, improves risk identification and control capabilities, enhances security management efficiency and knowledge management level, strengthens data confidentiality and professionalism, and provides more comprehensive and accurate risk assessment results.
Smart Images

Figure CN119579365B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence technology, specifically relating to a dual-prevention intelligent interaction system based on a large language model. Background Art
[0002] The dual prevention system, namely the risk classification and control and hidden danger investigation and management mechanism, has achieved certain results in its current promotion and implementation, but it still faces some problems and challenges:
[0003] Firstly, regarding safety training, the training lacks specificity and personalization. A sound safety education and training system should respect and acknowledge individual differences among employees, enhance the safety awareness and specialized skills of all staff, and ensure that all employees implement safety concepts through training. Secondly, in the process of risk identification and hazard investigation, some employees have limited professional expertise and have failed to fully utilize expert resources, resulting in insufficient and incomplete identification and assessment, and the proposed control measures lack specificity and timeliness. Finally, the implementation of safe production is inadequate. Although safe operating procedures are comprehensive, work instruction manuals are complete, and risk source identification and control measures are detailed, there is a significant gap in implementation at the last mile, and unsafe behaviors still occur frequently.
[0004] With the continuous expansion of artificial intelligence applications, how safety managers can effectively utilize Large Language Models (LLMs) to assist in safety production work has become an important issue. In the digital transformation of safety production, establishing a digital platform that supports AI applications is a core task. In risk identification and assessment, using LLM technology, the system can automatically extract features from massive amounts of data to intelligently identify and assess risks. As the amount of data increases, the system can continuously optimize the risk identification model, improving the accuracy and comprehensiveness of identification. In employee training, LLMs can simulate safety experts to develop personalized training programs based on employees' positions, skill levels, and training needs. Training content will cover safety production knowledge, risk identification methods, and hazard identification techniques, helping employees improve their safety awareness and capabilities. In risk identification and prevention, LLMs can deeply analyze historical risk data and real-time monitoring data to identify the causes of risks, their potential consequences, and countermeasures, making risk reports more forward-looking and instructive. Enterprises can develop response strategies in advance based on these analysis results to reduce the likelihood of risks occurring. Therefore, LLM technology has a wide range of applications in the field of safety production. Summary of the Invention
[0005] To address the problems of traditional dual prevention systems in areas such as risk identification and hazard investigation, employee training, and knowledge management, this invention proposes a dual prevention intelligent interactive system based on a large language model.
[0006] To achieve the above-mentioned objectives, the present invention provides the following technical solution.
[0007] A dual-prevention intelligent interaction system based on a large language model includes:
[0008] A large language model base is used to understand user intent and process natural language tasks, and provides token processing capabilities for other modules, including the use of combinations of large language models of different sizes to process different types of data.
[0009] The knowledge base management module is used to classify, store, and manage professional knowledge, including converting user-uploaded documents of different formats into vectors, then building an index based on semantics, and finally storing them locally.
[0010] The agent module is used to analyze user input. Different agents encapsulate different workflows to provide personalized services to users.
[0011] The multimodal large model module receives the user's voice input, converts the voice into text, then sends the description of the information to the Agent. The Agent generates an answer by analyzing the semantics, and finally converts the text back into voice and sends it to the user.
[0012] The evaluation module is designed to evaluate the results of knowledge base question answering, including establishing an evaluation index system from four perspectives: accuracy, answer relevance, context relevance, and context recall.
[0013] The system includes the following interactive process:
[0014] S1. Obtain information including user name, department, and position through the system account;
[0015] S2. The system performs natural language operations, including word segmentation, keyword extraction, and named entity recognition, based on the user's input. It uses the base model to encode the question text, capture its semantic information, and identify the user's intention or topic in asking the question.
[0016] S3. Based on the user's intent or topic, the system routes the request to the corresponding Agent processing module. The workflow encapsulated within the Agent includes knowledge base retrieval, report writing, knowledge Q&A, and real-time system data acquisition.
[0017] S4. Based on the user's question, RAG retrieves relevant documents or information from the knowledge base. The retrieved information is used as the context of the LLM, and the LLM generates an answer based on this context.
[0018] S5. The system performs post-processing on the generated answers, including syntax checking and semantic verification. If the system obtains answers from multiple knowledge bases, it performs operations such as merging, deduplication, and sorting of the answers.
[0019] S6. The system converts the prepared answers into speech by calling a multimodal large model and outputs them to the user in the form of natural language and voice broadcast. At the same time as outputting the answers, the system also includes explanations of the answers or reference indexes.
[0020] Furthermore, the large language model base includes a combination of 2B large models, 7B large models, and 72B large models. The 2B large model is used to extract specific parameters from user questions; the 7B large model is used to analyze and understand user intent and route questions to different agents; and the 72B large model is used to summarize and organize retrieved knowledge and generate answers.
[0021] Furthermore, the knowledge base management module includes constructing different knowledge bases based on the different domains of different knowledge, segmenting documents according to semantics and length, with a maximum segment length of 'a' and a segment overlap length of 'b', and deleting consecutive spaces or tabs in the document; processing the segmented documents into vectors using an embedding model, constructing an index for each vector to improve retrieval efficiency, and finally storing the vectors and indexes in a local vector database.
[0022] The knowledge base management module segments the uploaded documents according to their length, obtaining a text segment set K = {k1,k2,k3,……kn}. Then, it uses an embedding model to encode the segmented set into vectors, obtaining a vector set V, V = Embed(K). Finally, the encoded vector set is stored in the FAISS database, completing the construction of the knowledge base.
[0023] Furthermore, the intelligent agent module includes a memory component, a planning component, and an execution component;
[0024] The memory component is used to store the historical interaction records between the agent and the environment, and to review and use the stored information when needed. When faced with different types of needs, the agent can flexibly call long short-term memory to support its complex reasoning process.
[0025] The planning component breaks down complex tasks into a series of simple subtasks, which are then solved one by one.
[0026] The execution component is used to generate specific actions and behaviors, thereby interacting with the user and obtaining actual feedback on the execution effect;
[0027] The execution component requires the collaboration of the memory component and the planning component to operate.
[0028] The execution component enhances its execution capabilities based on a knowledge base, including the following steps:
[0029] The embedding model is used to vectorize the user's query Q, Vq = Embed(Q);
[0030] Using RAG, we compare question Q with vectors in the knowledge base to obtain m best-matching answers to the question:
[0031]
[0032] The candidate set is further filtered using the Re-Rank model. These documents are re-ranked according to their matching degree with the question, and finally a refined document set is obtained.
[0033] Furthermore, the multimodal large model includes a speech recognition large model and a text-to-speech large model, and the inference process of the multimodal large model is described as follows:
[0034] A = MLLM(I,M)
[0035] Where I and M represent instructions and multimodal inputs, respectively, and A represents the output of the large mode.
[0036] Furthermore, the evaluation index system established by the aforementioned evaluation module includes:
[0037] Accuracy P is defined as the total number of documents retrieved (TD) divided by the total number of relevant documents retrieved (RD).
[0038]
[0039] Answer relevance is defined as the correlation between the answer and the user's question and the system prompts. Incomplete or redundant answers receive lower scores. The score is calculated using cosine similarity (sim()) after converting the word embedding model into vectors, and ranges from 0 to 1.
[0040]
[0041] Where n represents the first n answers returned by the large model, q represents the user's question, and qi represents the answer returned by the system;
[0042] Contextual recall R is defined as the total number of relevant documents in the knowledge base (TRD) divided by the total number of relevant documents retrieved (RD).
[0043]
[0044] Contextual relevance (CR) is defined as the relevance between the answer and its context. Irrelevant answers receive a lower score. The score is calculated by a large model analysis and ranges from 0 to 1.
[0045]
[0046] Here, ES represents the question-related sentences extracted from the context by the large model, and TS represents all sentences in the context.
[0047] Furthermore, the implementation steps of RAG in step S4 include:
[0048] First, a knowledge base is constructed by segmenting documents according to their length. An embedding model is used to vectorize the text and construct a set K to form the knowledge base: K = {k1, k2, k3, ..., kn}, where ki represents the i-th knowledge text. The RAG includes two modules: a retrieval module and a generation module. The retrieval module calculates and returns the m most similar document sequences given input q. To calculate similarity, the user input is vectorized into q using the same method. The approximation between ki and q is expressed as:
[0049]
[0050] The approximation calculation retrieves the top m knowledge vectors that are closest to the user's question; the generation module generates the answer y based on the original input q and the retrieved m knowledge vectors k.
[0051] Furthermore, the system deeply integrates the dual prevention business system and large-scale model technology, including functions for risk and hazard identification, safety training and education, safety knowledge Q&A, proactive safety situation awareness, and intelligent report generation.
[0052] Beneficial effects: Compared with the prior art, the significant effects of this invention include:
[0053] (1) This invention provides personalized services to users. Based on user account information, the big model can provide personalized security management services for different roles, based on actual needs and usage habits, to meet the differentiated needs of different users.
[0054] (2) This invention can enhance risk identification and control capabilities. The large model is based on a knowledge base in the security field. It uses natural language processing technology to understand and analyze risk information, providing more comprehensive and accurate risk assessment results and avoiding the problems of inconsistent human assessment levels and standards.
[0055] (3) This invention can improve the efficiency of safety management. The large model automatically analyzes the safety situation based on the frequency and level of monthly risk and hidden danger events, and generates safety production assessment reports, training programs and other documents in a timely manner, thereby improving the timeliness of safety management.
[0056] (4) This invention is based on a local large model and an enterprise private domain knowledge base, which has strong targeting and confidentiality. It can provide private customized services for enterprises with high data confidentiality requirements and strong professionalism.
[0057] (5) This invention can integrate a large amount of diverse information such as safety production knowledge, accident cases, expert experience and real-time data, improve the level of knowledge management in the field of safety production, and promote the accumulation and inheritance of knowledge. Attached Figure Description
[0058] Figure 1 This is a functional architecture diagram of the system described in this invention;
[0059] Figure 2 This is a flowchart illustrating the implementation of the intent analysis module in the system described in this invention.
[0060] Figure 3 This is a schematic diagram of the intelligent agent execution process in the system described in this invention;
[0061] Figure 4 This is a flowchart of the knowledge base retrieval process in the system described in this invention. Detailed Implementation
[0062] To make the features, uses and effects of the present invention clearer, the embodiments of the present invention will now be further described with reference to the accompanying drawings.
[0063] Based on the relevant applications introduced in the background technology, the current dual prevention system has a wide range of applications in the field of safe production, which can improve the safety management mechanism and achieve risk prevention.
[0064] Large Language Models (LLMs) are deep learning models trained on large amounts of text data that can generate natural language text or understand the meaning of language text. LLMs can handle various natural language tasks, such as text classification, question answering, and dialogue, and are an important pathway to artificial intelligence. Currently, LLMs employ a Transformer architecture and pre-training objectives (such as Language Modeling) similar to small models, differing only in increased model size, training data, and computational resources.
[0065] This invention provides a dual-prevention intelligent interactive system based on a large language model, belonging to the field of artificial intelligence technology. This invention deeply integrates a dual-prevention business system with large model technology to achieve functions such as risk and hazard identification, safety training and education, safety knowledge Q&A, proactive safety situation awareness, and intelligent report generation, possessing high practical value.
[0066] Overall, the system of this invention includes a large language foundation model, which serves as the foundation of the entire system, possessing the ability to understand user intent, handle complex natural language tasks, and provide powerful token processing capabilities for other modules; a knowledge base management module for storing and managing rich professional knowledge, vectorizing user-uploaded documents, ensuring the system can provide accurate and professional answers to questions in specific domains; an intelligent agent module, the core of the system's intelligent interaction, possessing multiple capabilities, able to understand and analyze user input, providing personalized services to meet diverse user needs; a multimodal large model module capable of recognizing user voice input and broadcasting system outputs in voice form, providing the system with more comprehensive and richer interaction methods; and an evaluation module capable of evaluating the results of knowledge base question-and-answer sessions, improving the knowledge base content based on the evaluation results, and enhancing question-and-answer accuracy.
[0067] like Figure 1-4 As shown, this invention provides a dual-prevention intelligent interaction system based on a large language model, comprising a large language foundation model module, a knowledge base management module, an agent module, a multimodal large model module, and an evaluation module. When a user poses a question to the system, the system first obtains the user's role based on their account information, including three types: principal responsible person, security administrator, and operational personnel. The system understands and analyzes the user's question, routes it to a specific resource, and then, upon receiving the question, the agent searches and organizes the answer using the knowledge base before finally sending it to the user.
[0068] Further integration Figures 2-4 As shown, the large language foundation model is the basis of the entire system. Trained on massive corpora and dialogue data, it possesses user intent understanding capabilities, can handle complex natural language tasks, and provides powerful token processing capabilities for other modules. This invention uses large models of different sizes, such as 2B, 7B, and 72B, each playing a different role in the data processing flow. The 2B model is used to extract specific parameters from user questions; the 7B model is used to analyze and understand user intent and route questions to different agents; and the 72B model is used to summarize and organize retrieved knowledge and generate high-quality answers.
[0069] The knowledge base management module is built based on data related to the field of safety management, such as: production safety law, safety standards, safety regulations, operating procedures, accident cases, rules and regulations, risk and hazard lists, etc. It uses the FAISS database for vectorized storage, supports GPU computing, and has extremely high query efficiency.
[0070] Furthermore, the construction of the knowledge base management module includes the following steps:
[0071] Collect and organize security management documents in different formats and types, including TXT, MARKDOWN, PDF, HTML, XLSX, XLS, DOCX, CSV, etc.
[0072] The knowledge is categorized into five types: training tutorials, rules and regulations, laws and regulations, accident cases, and risk and hazard lists. The advantage of this categorized database is that it reduces the size of the database, improves retrieval speed, and ensures that the knowledge types within the database are relatively uniform, thereby improving retrieval accuracy.
[0073] For the uploaded document, the text is segmented according to its length to obtain a set of text segments K = {k1,k2,k3,……kn};
[0074] The segmented set is vectorized using an embedding model to obtain a vector set V, where V = Embed(K). The encoded vector set is then stored in the FAISS database, completing the construction of the knowledge base.
[0075] The intelligent agent module is the core of the system's intelligent interaction. It can understand and analyze user input. Different intelligent agents encapsulate different workflows to provide users with personalized services. It consists of three components: memory component, planning component, and execution component.
[0076] The memory component can store new knowledge, mainly used to store historical interaction records between the agent and the environment, and to review and use the stored information when needed. When faced with different types of needs, the agent can flexibly call upon long short-term memory to support its complex reasoning process.
[0077] The planning component introduces a human-like problem-solving approach to the agent, breaking down complex tasks into a series of simpler subtasks, which are then solved one by one. This method reduces the difficulty of solving the task at once, helps improve the efficiency and effectiveness of problem-solving, and enhances the agent's adaptability to complex environments and the reliability of its operations.
[0078] The execution component plays a crucial role in the intelligent agent system. Workflows are encapsulated within the execution component, defining solutions for specific tasks, including knowledge base retrieval, real-time data acquisition, document writing, and personalized training. By configuring the execution component, the intelligent agent can generate specific actions, interact with the user, and obtain feedback on the actual execution results. The operation of the execution component requires the collaboration of the memory and planning components.
[0079] Execution components can enhance their execution capabilities by leveraging a knowledge base, including the following steps:
[0080] First, the user's question Q is vectorized using an embedding model, Vq = Embed(Q). Then, RAG (Retrieval Augmentation) technology is used to compare question Q with vectors in the knowledge base, obtaining m best-matching answers. The output expression for the answers is:
[0081]
[0082] The system will further utilize the Re-Rank model to filter the candidate set, re-rank these documents according to the degree of matching between the retrieved documents and the question, and finally obtain a refined document set;
[0083] Multimodal large model (MLM) comprises two types of large models: a speech recognition large model and a text-to-speech large model. The inference process of a multimodal large model can be described as follows:
[0084] A = MLLM(I,M)
[0085] Where I and M represent instruction and multimodal input, respectively, and A represents large-mode output;
[0086] The multimodal large model module can recognize the user's voice input, convert the voice into text information, and then pass the description of the question information to the Agent. After analyzing the user's question, the Agent converts the question answer, knowledge base index and other information into voice broadcast and sends it to the user.
[0087] The evaluation module assesses the quality of the generated answers. This invention constructs a four-dimensional indicator system, including: accuracy, answer relevance, contextual relevance, and contextual recall. The evaluation module can identify missing content in the knowledge base, notifying users to update and supplement relevant knowledge in a timely manner. Simultaneously, the evaluation module can filter out high-scoring answers, allowing the system to directly reference high-scoring answers when receiving similar questions in the future, avoiding redundant calculations on large models, reducing computational resource consumption, and improving service quality.
[0088] Example 1: Risk and Hazard Identification
[0089] Taking the process of safety management personnel identifying potential hazards as an example, a user asks the system:
[0090] Question: What are the potential hazards of a single switch in a power distribution cabinet being connected to multiple devices, and what is the basis for this claim?
[0091] System execution process: First, the user's account information is obtained, and the user's job information is analyzed to determine that the user belongs to a security management personnel;
[0092] Then, user information is incorporated into the question to form a new question. The large model classifies the question type according to semantics, identifies the question as a potential hazard identification question, and then directs the question and request to the most appropriate Agent.
[0093] Furthermore, the Agent invokes the hazard identification workflow, first analyzing and understanding the current problem. During this process, it first retrieves relevant context from the memory component to gain a more comprehensive understanding and analysis of the current state. The Agent's retrieval of historical dialogue data and contextual information did not yield any problem-related content. Next, the planning component generates an action plan by comprehensively considering the information stored in the long and short-term memory components and referencing historical response strategies for similar questions. Subsequently, the execution component is responsible for executing the workflow based on the task solution generated by the planning component, using the retrieval module to search for corresponding content in the hazard identification knowledge base.
[0094] Furthermore, the knowledge base retrieval process is as follows: Figure 4 As shown, after the retrieval module obtains the question, it first extracts the keywords in the question: power distribution cabinet, multiple connections to one switch, hidden danger, and basis.
[0095] To improve the probability of retrieval, the system optimizes and expands the question. The large language model expands the question into 5 different questions based on keywords:
[0096] (1) What are the hidden dangers of a single switch in a power distribution cabinet being connected to multiple devices, and what is the basis for this?
[0097] (2) In the power system, what are the potential risks of using a single switch with multiple connections in the distribution cabinet? Please explain the theoretical or regulatory basis for these risks.
[0098] (3) Why is the configuration of one switch with multiple connections in the distribution cabinet considered an unsafe factor? What are the safety regulations or theoretical basis behind it?
[0099] (4) Explain in detail the specific problems that may arise from the use of a single switch for multiple connections in the distribution cabinet, and point out which industry standards or regulations define these problems.
[0100] (5) Why is the application of one switch for multiple connections in power distribution cabinets not recommended in power safety management? Please list the specific hidden dangers and the criteria and basis for judging these hidden dangers.
[0101] Furthermore, the system uses an embedding model to encode the above 5 questions, resulting in a question vector set Q, where Q = {q1, q2, q3, q4, q5}.
[0102] The system compares each of the five question vectors with the information in the knowledge base and returns n most similar search results. The approximation calculation method is as follows:
[0103]
[0104] The returned n search results are sorted and optimized a second time. By re-evaluating the relevance between the initially retrieved documents and the query, more relevant documents are placed first, and documents that are irrelevant or have low relevance to the query are excluded to reduce noise and obtain the optimal top k results.
[0105] Topk=ReRank(A1,A2,A3……An)
[0106] The large language model summarizes and organizes the question and k results, outputting the final answer: "Multiple connections of a single switch in a distribution cabinet refers to a single main switch or branch switch controlling multiple electrical devices simultaneously. This may lead to unstable operation of the electrical devices and increase the risk of failure. The basis is Article 8.1.16 of the 'Technical Specification for Temporary Power Supply Safety at Construction Sites' (JGJ 46-2015), which stipulates that fixed line clamps should be installed at the inlet and outlet ports of distribution boxes and switch boxes, and inlet and outlet lines should be fitted with insulating sheaths."
[0107] Furthermore, the multimodal large model converts the above output into voice broadcast and sends it to the user.
[0108] The evaluation model assesses the output answer and yields the following results:
[0109] Accuracy: 1.0
[0110] Answer relevance: 0.94
[0111] Contextual relevance: 0.75
[0112] Contextual call: 1.0
[0113] Example 2: Personalized Training
[0114] Taking the workflow of personalized user training agent as an example, the memory component contains storage nodes that store nearly 50 dialogue messages from the user; the planning component contains input nodes, intent analysis nodes, API call nodes, and output nodes; and the execution component contains input nodes, knowledge retrieval nodes, long text writing nodes, and output nodes.
[0115] The memory component records the history of user and system conversations. First, the planning component analyzes the user's historical conversations and finds that the user recently asked questions related to fire emergency response. Second, the planning component analyzes the user's role and finds that the user is the workshop director. Finally, by calling the dual-prevention system interface and analyzing the data, the planning component discovers that the workshop contains flammable materials, posing a fire risk. The planning component summarizes the above information and outputs:
[0116] (1) The user is the workshop director, and the questions need to be answered from the perspective of production management;
[0117] (2) Analyze the risk level of this risk;
[0118] (3) Provide users with corresponding training content based on the risk level and risk content;
[0119] After receiving the output from the planning component and the relevant context, the execution component performs the following steps:
[0120] 1) Use the LEC method to analyze the level of this risk;
[0121] Risk Level: Significant Risk (L 3.0, E 6.0, C 30.0, D 540)
[0122] 2) Develop a training content outline based on risks:
[0123] a. Storage location and characteristics of flammable materials;
[0124] b. Layout and usage of fire protection facilities;
[0125] c. Safety inspection of electrical wiring and equipment;
[0126] d. Development and drills of emergency response plans.
[0127] (4) Based on the outline, retrieve relevant content from the knowledge base, compile detailed training content, and provide users with a complete solution.
[0128] The above description discloses only preferred embodiments of the present invention and should not be construed as limiting the scope of the present invention. Therefore, equivalent variations made in accordance with the claims of the present invention are still within the scope of the present invention.
Claims
1. A dual-prevention intelligent interactive system based on a large language model, characterized in that, include: A large language model base is used to understand user intent and process natural language tasks, and provides token processing capabilities for other modules, including the use of combinations of large language models of different sizes to process different types of data. The knowledge base management module is used to classify, store, and manage professional knowledge, including converting user-uploaded documents of different formats into vectors, then creating an index based on semantics, and implementing localized storage. The agent module analyzes user input, and different agents encapsulate different workflows to provide personalized services to users. The agent module includes a memory component, a planning component, and an execution component. The memory component is used to store the historical interaction records between the agent and the environment, and to review and use the stored information when needed. When faced with different types of needs, the agent can flexibly call long short-term memory to support its complex reasoning process. The planning component breaks down complex tasks into a series of simple subtasks, which are then solved one by one. The execution component is used to generate specific actions and behaviors, thereby interacting with the user and obtaining actual feedback on the execution effect; The execution component requires the collaboration of the memory component and the planning component to operate; The execution component enhances its execution capabilities based on a knowledge base, including the following steps: The user's query Q is vector-encoded using the embedding model, Vq = Embed(Q); Using RAG, we compare question Q with vectors in the knowledge base to obtain m best-matching answers to the question: , The candidate set is further filtered using the Re-Rank model. These documents are then re-ranked based on their matching degree with the question, and a refined document set is finally obtained. The multimodal large model module receives the user's voice input, converts the voice into text, then sends the description of the information to the Agent. The Agent generates an answer by analyzing the semantics, and finally converts the text back into voice and sends it to the user. The evaluation module is used to evaluate the results of knowledge base question answering, including establishing an evaluation index system from four perspectives: accuracy, answer relevance, context relevance, and context recall. The system includes the following interactive process: S1. Obtain information including user name, department and position through system account to determine the user's identity and the field of expertise; S2. The system performs natural language operations, including word segmentation, keyword extraction, and named entity recognition, based on the user's input. It uses a large-scale base model to encode the question text, capture its semantic information, and identify the user's intent or topic in asking the question. S3. Based on the user's intent or topic, the system routes the request to the corresponding Agent processing module. The workflow encapsulated within the Agent includes knowledge base retrieval, report writing, knowledge Q&A, and real-time system data acquisition. S4. Based on the user's question, RAG retrieves relevant documents or information from the knowledge base. The retrieved information is used as the context of the LLM, and the LLM generates an answer based on this context. S5. The system performs post-processing on the generated answers, including syntax checking and semantic verification. If the system obtains answers from multiple knowledge bases, it performs operations such as merging, deduplication, and sorting of the answers. S6. The system converts the prepared answers into speech by calling a multimodal large model and outputs them to the user in the form of natural language and voice broadcast. At the same time as outputting the answers, the system also includes explanations of the answers or reference indexes.
2. The dual-prevention intelligent interactive system based on a large language model according to claim 1, characterized in that, The large language model base includes a combination of 2B, 7B, and 72B large models. The 2B large model is used to extract specific parameters from user questions; the 7B large model is used to analyze and understand user intent and route questions to different agents; and the 72B large model is used to summarize and organize retrieved knowledge and generate answers.
3. The dual-prevention intelligent interactive system based on a large language model according to claim 1, characterized in that, The knowledge base management module includes constructing different knowledge bases based on the different knowledge domains, segmenting documents according to semantics and length, with a maximum segment length of 'a' and a segment overlap length of 'b', and deleting consecutive spaces or tabs in the document; processing the segmented documents into vectors using an embedding model, constructing an index for each vector to improve retrieval efficiency, and finally storing the vectors and indexes in a local vector database.
4. The dual-prevention intelligent interactive system based on a large language model according to claim 3, characterized in that, The knowledge base management module segments the uploaded documents according to their length, obtaining a text segment set K={k1,k2,k3,……kn}; then it uses an embedding model to encode the segmented set into vectors, obtaining a vector set V, V=Embed(K); finally, the encoded vector set is stored in the FAISS database, completing the construction of the knowledge base.
5. The dual-prevention intelligent interactive system based on a large language model according to claim 1, characterized in that, The multimodal large model includes a speech recognition large model and a text-to-speech large model. The inference process of the multimodal large model is described as follows: , Where I and M represent instructions and multimodal inputs, respectively, and A represents the output of the large mode.
6. The dual-prevention intelligent interactive system based on a large language model according to claim 1, characterized in that, The evaluation index system established by the aforementioned evaluation module includes: Accuracy P is defined as the total number of documents retrieved (TD) divided by the total number of relevant documents retrieved (RD). , Answer relevance is defined as the correlation between the answer and the user's question and the system prompts. Incomplete or redundant answers receive lower scores. The score is calculated using cosine similarity (sim()) after converting the word embedding model into vectors, and ranges from 0 to 1. , Where n represents the first n answers returned by the large model, q represents the user's question, and qi represents the answer returned by the system; Contextual recall R is defined as the total number of relevant documents in the knowledge base (TRD) divided by the total number of relevant documents retrieved (RD). , Contextual relevance (CR) is defined as the relevance between the answer and its context. Irrelevant answers receive a lower score. The score is calculated by a large model analysis and ranges from 0 to 1. , Here, ES represents the question-related sentences extracted from the context by the large model, and TS represents all sentences in the context.
7. The dual-prevention intelligent interactive system based on a large language model according to claim 1, characterized in that, The implementation steps of RAG in step S4 include: First, a knowledge base is constructed by segmenting documents according to their length. An embedding model is used to vectorize the text and construct a set K to form the knowledge base: K = {k1, k2, k3, ..., kn}, where ki represents the i-th knowledge text. The RAG includes two modules: a retrieval module and a generation module. The retrieval module calculates and returns the m most similar document sequences given an input q. To calculate similarity, the user input is vectorized into q using the same method. The approximation between ki and q is then expressed as: , The approximation calculation retrieves the top m knowledge vectors that are closest to the user's question; the generation module generates the answer y based on the original input q and the retrieved m knowledge vectors k.
8. The dual-prevention intelligent interactive system based on a large language model according to claim 1, characterized in that, This system deeply integrates the dual prevention business system and large model technology, including functions for risk and hazard identification, safety training and education, safety knowledge Q&A, proactive safety situation perception, and intelligent report generation.
Citation Information
Patent Citations
Method for improving answer accuracy for generative ai-based multiple questions
KR102711560B1
Method and system for data conversations
US20210390096A1