Big language model-based medical and invasive service agent construction method and device
By adopting a science and technology innovation service intelligent construction method based on a large language model in the science and technology innovation service industry, combining the science and technology innovation knowledge graph and personal knowledge graph, the problems of intensive knowledge, strong professionalism and low intelligence in the science and technology innovation service industry are solved, and efficient and accurate science and technology innovation services are achieved to meet the diverse and personalized needs of users.
Patent Information
- Application Number
- CN202510015657.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-06
- Publication Date
- 2025-04-18
AI Technical Summary
The science and technology innovation service industry faces problems such as intensive knowledge, strong professionalism, low level of intelligence in information retrieval and consulting services, low service efficiency and high cost, diversified user needs and personalized.
The construction method of science and technology innovation service agents based on large language models is adopted, and by combining science and technology innovation knowledge graph and personal knowledge graph, the accurate identification of user intentions and the correlation of question-asking search results is achieved. This method supports multimodal input, uses a large model to convert user questions into text, and combines knowledge graphs to perform intelligent matching to generate targeted replies.
It significantly improves the accuracy and personalization of the search results, improves service efficiency and quality, meets users' needs for efficient and accurate services, and reduces service costs.
Smart Images

Figure CN119848268A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to a method and device for constructing a scientific and technological innovation service intelligent entity based on large language models (LLM), aiming to improve the online intelligent and professional service level of the scientific and technological innovation service industry. Background Art
[0002] As a knowledge-intensive industry, the science and technology service industry covers multiple fields such as science and technology consulting, technology transfer, intellectual property services, and scientific research cooperation. Its core goal is to provide all-round support and services for scientific and technological innovation. However, with the rapid development of science and technology and the increasing diversification of user needs, traditional service methods have gradually exposed many shortcomings and are difficult to adapt to the requirements of the new era. Specifically, the challenges faced by the science and technology service industry are mainly reflected in the following aspects: 1. Complexity caused by knowledge intensity and specialization The core of the science and technology service industry lies in the in-depth understanding and application of scientific and technological knowledge. Whether it is technical consulting, patent analysis, or scientific research cooperation, practitioners are required to have a high degree of professional knowledge and rich practical experience. However, the knowledge in the field of science and technology is updated very quickly, and emerging technologies emerge in an endless stream. The traditional manual service model is difficult to keep up with the pace of knowledge updating. In addition, the professionalism and complexity of scientific and technological knowledge make it difficult for ordinary users to directly obtain and understand the required information, resulting in a high service threshold.
[0003] 2. Limitations of information retrieval and consulting services Existing information retrieval and online consulting services mainly rely on keyword matching and simple rule engines, which have a low level of intelligence and cannot meet users' high requirements for timeliness and accuracy. For example, in patent retrieval or technical consultation, users often need to filter out content that is highly relevant to their needs from a large amount of literature and data, while traditional search tools often return a large number of irrelevant or low-quality results due to their lack of understanding of semantics and context, causing users to spend a lot of time on secondary screening. In addition, existing consulting services mostly rely on manual customer service or experts, whose response speed and service quality are limited by the availability of human resources, making it difficult to achieve efficient large-scale services.
[0004] 3. Inefficient and costly services Due to the professionalism and complexity of the science and technology service industry, traditional service models usually require a large amount of human resources, resulting in high service costs. For example, in technology transfer or scientific research cooperation, it is often necessary for expert teams to conduct multiple rounds of communication and evaluation, which not only prolongs the service cycle but also increases service costs. In addition, due to information asymmetry and inefficient communication, user needs often cannot be responded to in a timely manner, further reducing service efficiency and user satisfaction.
[0005] 4. Diversity and personalization of user needs With the continuous deepening of scientific and technological innovation, users' demands for scientific and technological innovation services are becoming increasingly diversified and personalized. For example, researchers may need in-depth analysis of specific technical fields, while enterprises may pay more attention to the commercialization prospects and market applications of technologies. However, the existing service models mostly adopt a "one-size-fits-all" approach, which is difficult to meet the personalized needs of different users. In addition, users have higher requirements for the timeliness and accuracy of services, and traditional service means are difficult to provide high-quality customized services in a short period of time.
[0006] In summary, the science and technology service industry is facing the challenge that traditional service means cannot adapt to new demands due to its knowledge-intensive, highly professional, and large consulting and service volume. Existing information retrieval and online consulting services have obvious deficiencies in timeliness, accuracy, efficiency, and cost, and it is difficult to meet the increasingly diversified and personalized needs of users. In order to meet these challenges, it is urgent to introduce advanced technical means (such as artificial intelligence, knowledge graphs, large language models, etc.) to build an intelligent and efficient science and technology service platform to improve service quality and user experience and promote the transformation and upgrading of the science and technology service industry. Summary of the invention
[0007] 1. Purpose of the invention The purpose of the present invention is to provide a method for constructing a scientific and technological innovation service intelligent entity based on a large language model. The present invention provides a method for quickly extracting key information of question content by using a large language model and a knowledge graph, combining a human-computer interaction system, realizing accurate identification of user intentions, and improving the relevance of question retrieval results.
[0008] (II) Technical solution To achieve the above object, the present invention provides the following technical solutions: A method for constructing a scientific and technological innovation service agent based on a large language model, comprising the following steps: Step S1, constructing a scientific and technological innovation knowledge graph based on scientific and technological innovation services, and constructing a personal knowledge graph based on user data, wherein the scientific and technological innovation knowledge graph contains entity-relationship-entity-attribute quadruple information; Step S2, obtaining user questions, the questioning method supports text, voice, text, image multimodal methods, and using the big model to convert the user questions into text; Step S3, inputting the user question text and personal knowledge graph into the big model as prompts of the big model in real time; Step S4: The large model uses the pre-trained knowledge base and the scientific and technological knowledge graph to generate a response based on the input prompt; Step S5, the large model outputs the reply to the user; Step S6, the system determines whether the user continues to ask questions, if so, repeats the above steps; otherwise, ends the conversation.
[0009] Further, step S1 constructs a scientific and technological innovation knowledge graph based on scientific and technological innovation services, and constructs a personal knowledge graph based on user data, including the following steps: Step S11, extracting literature materials from the scientific and technological innovation service database, parsing the text and generating scientific and technological innovation achievement text information; Step S12, entity recognition is performed on the corresponding text to extract the entity-relationship-entity-attribute quadruple and store it in the scientific and technological innovation knowledge graph. Through ontology mapping, the intelligent matching of the attributes of the ontology object and the data set fields is supported, and the value conversion logic from the data set to the graph data is determined in the form of configuration mapping rules; unique identification information is created for the data through the knowledge graph, and the function of rapid positioning is performed to realize that the nodes in the database have sources and basis; Step S13, constructing a personal knowledge graph for the user based on the user's uploaded results, user needs, user tags, user historical questions, and user concerns; the personal knowledge graph can integrate and represent various types of user personalized information, and through the knowledge graph system in the subsequent retrieval generation step, the content that is directly or indirectly related to the current user input content can be quickly obtained.
[0010] Further, in step S2, the user's question is obtained, and the questioning method supports text, voice, text, and image multi-modal methods. The user's question is converted into text using a large model, including the following steps: Step S21, multi-modal question acquisition, providing multiple input methods such as text, voice, image, and video, designing the user interface to support multi-modal input such as voice button and image upload function, identifying the modality type of user input, calling the corresponding processing module according to the modality type, and temporarily storing the original data for subsequent processing; Step S22, multimodal data preprocessing, segmenting the input text, removing stop words, correcting errors, and standardizing the text format; using speech recognition technology to convert speech into text, and cleaning and standardizing the converted text; using image recognition technology such as OCR and target detection to extract text or key information from the image, and cleaning and standardizing the extracted text; extracting key frames or audio streams from the video, and performing image or speech preprocessing on the extracted frames or audio respectively; Step S23, multimodal data fusion, converting speech and image non-text input into text, aligning it with the text directly input by the user, generating a unified context representation based on the multimodal data input by the user, and generating a unified text representation after fusing the multimodal data as the input of the subsequent large language model; Step S24, exception handling and user feedback, detect whether the user input is empty or unrecognizable, such as voice input without sound, image without text or blurred content, prompt abnormal input and guide the user to re-enter; display the converted text to the user for the user to confirm whether it is accurate. If the user is not satisfied with the conversion result, support the user to manually modify or re-enter; Step S25, recording the user's multimodal input and conversion results for subsequent model optimization and data analysis.
[0011] Further, step S3, inputting the user question text and the personal knowledge graph into the big model as the prompt of the big model in real time includes the following steps: Step S31, fusion of user question text and personal knowledge graph, Step S311, extracting the user question text: obtaining the text representation of the user question from step S2, ensuring that the text content is clear and complete, performing semantic analysis on the question text, and extracting key information; Step S312, according to the user identity or session ID, load the user's personal knowledge graph from the database, the personal knowledge graph includes the user's historical interaction data, interest preferences, professional fields, and project experience information; Step S313, matching the key information in the user's question text with the nodes in the personal knowledge graph; For example, if a user asks "Please help me analyze the scientific and technological achievements of this technology", the system extracts the "technical field" and "professional preference" that the user is concerned about from the personal knowledge graph; Step S314, extracting relevant context information from the personal knowledge graph according to the matching results; Step S315, fusing the user question text with the extracted context information to generate a prompt suitable for understanding by the large language model; Step S32, optimization and formatting of prompt, structural processing of prompt according to the input requirements of the large language model, truncation or compression of prompt according to the input length limit of the large language model, semantic optimization of prompt, to ensure that it is clear, concise and easy for the large language model to understand; Step S33, calling the large language model API, inputting the optimized prompt into the large language model in real time through the API interface, ensuring that the format of the input data is consistent with the model requirements. If the prompt length exceeds the input limit of the model, it is processed by block input or summary generation; Step S34, check whether the prompt is empty or in the wrong format, ensure the validity of the input data, prompt abnormal input, and guide the user to ask the question again; record the prompt content, user ID, and timestamp information of each input for subsequent analysis and optimization, and log the model call results for tracking and debugging.
[0012] Further, in step S4, the large model uses the pre-trained knowledge base and the scientific and technological knowledge graph to generate a response according to the input prompt, including the following steps: Step S41, loading the pre-trained knowledge base and the scientific and technological innovation knowledge graph; Further, step S41, loading the pre-trained knowledge base and the scientific and technological innovation knowledge graph includes the following steps: Step S411, pre-training the large language model knowledge base to ensure that the model loads the latest pre-trained weights to obtain the latest knowledge; Step S412, loading the scientific and technological innovation knowledge graph from the graph database, including patents, technical documents, scientific research papers, and scientific and technological innovation achievement data; Step S413, integrating the pre-trained knowledge base with the scientific and technological knowledge graph to build a comprehensive and professional knowledge system; Step S42, semantic analysis is performed on the input prompt to identify the user's intention, natural language processing technology is used to identify the intention, key entities are extracted from the prompt, and a named entity recognition model is used to extract entities, and the user preferences in the personal knowledge graph in the prompt are combined to deeply understand the user's needs; Step S43, based on the identified intent and entity, relevant information is retrieved from the pre-trained knowledge base and the scientific and technological innovation knowledge graph, and the retrieved information is reasoned and analyzed to generate a response that meets the user's needs; Step S44, integrating the information from the pre-trained knowledge base and the scientific and technological knowledge graph to ensure the comprehensiveness and accuracy of the response, and the large language model generates a preliminary response based on the results of retrieval and reasoning; Step S45, detects whether the reply is empty or does not meet user needs, such as irrelevant content or incomplete information, prompts abnormal situations, and regenerates the reply, records the process of each reply generation, including the input prompt, retrieved knowledge, and generated reply, and records user feedback for subsequent model optimization.
[0013] A device for constructing a scientific and technological service intelligent agent based on a large language model, characterized in that it is used to implement the method as described above.
[0014] (III) Technical Effect Compared with the prior art, the present invention has the following beneficial and significant technical effects: (1) In traditional science and technology services, information retrieval and consulting services mostly rely on keyword matching and simple rule engines, which have a low level of intelligence and are difficult to accurately capture the user's true intentions, resulting in insufficient relevance and practicality of search results. The present invention significantly improves the accuracy and personalization of search results by combining the science and technology knowledge graph with the personal knowledge graph and intelligently matching it with the search information.
[0015] The scientific and technological knowledge graph is a structured knowledge base built based on massive scientific and technological literature, patents, papers and other data, covering entities such as technical fields, scientific research teams, innovative achievements and their relationships. The personal knowledge graph is built based on personalized data such as the user's historical behavior, interest tags, and concerns, and can accurately portray the user's needs and preferences. By combining the two, the system can simultaneously understand the professional knowledge in the field of science and technology and the personalized needs of users, providing a solid foundation for subsequent retrieval and services.
[0016] When a user makes a search request, the system will not only analyze the keywords entered by the user, but also combine the scientific and technological knowledge graph and personal knowledge graph to perform contextual understanding and semantic reasoning. For example, when a user searches for "application of artificial intelligence in medicine", the system will not only return relevant technical literature, but also provide more targeted search results based on the user's professional background (such as whether he is a medical practitioner) and interest preferences (such as whether he is concerned about the commercialization of technology). This intelligent matching mechanism significantly improves the accuracy and practicality of the search results.
[0017] (2) Traditional knowledge graphs mostly use a triple (entity-relationship-entity) structure. Although it can represent basic semantic relationships, it has the problem of insufficient information expression in complex scenarios. This invention innovatively introduces a quadruple structure (entity-relationship-entity-attribute) to represent nodes and edges in the scientific and technological knowledge graph, which significantly improves the expressiveness and practicality of the knowledge graph.
[0018] The quadruple structure can not only represent the relationship between entities, but also describe the attribute information of the relationship. For example, when expressing "a certain scientific research team developed a certain technology", the quadruple can further describe the attribute information such as the development time and technology maturity. This structure enables the knowledge graph to express complex scientific and technological knowledge more comprehensively.
[0019] When constructing the scientific and technological knowledge graph, the system extracts entities, relationships, and attributes from data sources such as scientific and technological literature, patents, and papers, and constructs quadruple. By using ontology mapping technology, the quadruple is intelligently matched with the data set fields to ensure data consistency and scalability. For example, when integrating patent data from different sources, the system can automatically identify and unify different expressions of the same entity to avoid data redundancy and conflict.
[0020] By introducing the quadruple structure, the present invention significantly improves the structuring of the knowledge graph, facilitating knowledge management and retrieval. For example, in technical consultation, the system can quickly retrieve technologies, teams, and application cases related to user needs, and provide detailed attribute information. In addition, the quadruple structure also supports complex queries and reasoning, such as predicting the development trend or potential application scenarios of technologies by analyzing the relationship chain between technologies.
[0021] (3) Traditional scientific and technological innovation service platforms mostly rely on manual customer service or simple rule engines, which have a low level of intelligence and are difficult to meet users' needs for efficient and accurate services. This invention combines knowledge graphs with big models to build an intelligent scientific and technological innovation service platform, which significantly improves service efficiency and quality.
[0022] In the intelligent service platform, the scientific and technological knowledge graph and personal knowledge graph serve as inputs to the big model, providing rich contextual information. For example, when answering users' questions about "the commercialization prospects of a certain technology", the system will not only analyze the attributes of the technology itself, but also provide more targeted suggestions based on the user's industry background and interest preferences. This context-aware capability significantly improves the accuracy and practicality of the service.
[0023] The intelligent service platform supports multi-modal input (such as text, voice, and images) and output (such as text, charts, and voice), further enhancing the user's interactive experience. For example, users can ask questions through voice, and the system will generate analysis reports in the form of charts to help users understand complex technical information more intuitively.
[0024] By combining knowledge graphs with big models, the intelligent service platform realizes question-answering, recommendation, and decision-making support functions based on knowledge graphs. For example, in technology transfer, the system can recommend potential technology buyers or partners; in scientific research cooperation, the system can match teams with complementary research directions. This intelligent service not only improves service efficiency, but also expands the application scenarios of scientific and technological innovation services.
[0025] (4) In traditional scientific and technological innovation services, the responses generated by large models often lack pertinence and practicality, and are difficult to meet the real needs of users. This invention significantly improves the matching degree between service results and user intentions by optimizing the training and reasoning process of large models.
[0026] First, based on user feedback and behavior data, the large model is fine-tuned to make it more adaptable to user needs. For example, in technical consultation, the system will adjust the model generation strategy based on the user's historical questions and feedback to provide answers that are more in line with user preferences.
[0027] Secondly, we designed a user intent recognition model to accurately understand the underlying intentions of user questions. For example, when a user asks "how to improve the efficiency of a certain technology", the system can recognize that the user's real intention is to seek a technical optimization solution, rather than a simple explanation of the technical principle. This intent recognition capability significantly improves the accuracy of the service.
[0028] Finally, combined with the knowledge graph, the reasoning ability of the large model is optimized to generate more accurate responses. For example, when answering users' questions about "the future development trend of a certain technology", the system will combine the technical relationship chain and historical data in the knowledge graph to perform in-depth reasoning and prediction, and provide more forward-looking analysis. Through the above optimization measures, the present invention significantly improves the matching degree between scientific and technological innovation service results and user intentions, and improves the practicality of the service and user satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is a schematic diagram of the overall architecture of a specific embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to better understand the present invention, the content of the present invention is further explained in conjunction with the embodiments below. In the accompanying drawings, the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions. The described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be understood as limitations on the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present invention. The structure and technical solution of the present invention are further described in detail below in conjunction with the accompanying drawings, and the following embodiments of the present invention are given. Example
[0031] like Figure 1 As shown, a method for constructing a scientific and technological innovation service agent based on a large language model includes the following steps: Step S1, constructing a scientific and technological innovation knowledge graph based on scientific and technological innovation services, and constructing a personal knowledge graph based on user data, wherein the scientific and technological innovation knowledge graph contains entity-relationship-entity-attribute quadruple information; Step S2, obtaining user questions, the questioning method supports text, voice, text, image multimodal methods, and using the big model to convert the user questions into text; Step S3, inputting the user question text and personal knowledge graph into the big model as prompts of the big model in real time; Step S4: The large model uses the pre-trained knowledge base and the scientific and technological knowledge graph to generate a response based on the input prompt; Step S5, the large model outputs the reply to the user; Step S6, the system determines whether the user continues to ask questions, if so, repeats the above steps; otherwise, ends the conversation.
[0032] Further, step S1 constructs a scientific and technological innovation knowledge graph based on scientific and technological innovation services, and constructs a personal knowledge graph based on user data, including the following steps: Step S11, extracting literature materials from the scientific and technological innovation service database, parsing the text and generating scientific and technological innovation achievement text information; Identify entities in the text (such as technology, institutions, and people), and label entity types, extract relationships between entities (such as "research and development", "cooperation", and "belong to"), extract entity attributes (such as "release time", "technical parameters", and "affiliated institution"), and store the extracted entity-relationship-entity-attribute quadruplets in a structured manner for building a knowledge graph. Through ontology mapping, intelligently match entity attributes with data set fields, determine value conversion logic, and create unique identification information for each node to ensure that nodes in the knowledge graph can be quickly located and have a source basis.
[0033] Analyze the results, needs, tags, historical questions, and attention data uploaded by users, extract user-related entities (such as interest areas, attention technologies, historical behaviors), and mark entity types, extract relationships between entities (such as "attention", "question", "upload"), integrate user data with the scientific and technological knowledge graph, and build a personal knowledge graph to ensure that the personal knowledge graph can represent the user's personalized information and support rapid retrieval of content that is directly or indirectly related to the current user input content.
[0034] Step S12, entity recognition is performed on the corresponding text to extract the entity-relationship-entity-attribute quadruple and store it in the scientific and technological innovation knowledge graph. Through ontology mapping, the intelligent matching of the attributes of the ontology object and the data set fields is supported, and the value conversion logic from the data set to the graph data is determined in the form of configuration mapping rules; unique identification information is created for the data through the knowledge graph, and the function of rapid positioning is performed to realize that the nodes in the database have sources and basis; Step S13, constructing a personal knowledge graph for the user based on the user's uploaded results, user needs, user tags, user historical questions, and user concerns; the personal knowledge graph can integrate and represent various types of user personalized information, and through the knowledge graph system in the subsequent retrieval generation step, the content that is directly or indirectly related to the current user input content can be quickly obtained.
[0035] The above steps innovatively introduce the quadruple structure (entity-relationship-entity-attribute) to represent the nodes and edges in the scientific and technological knowledge graph, which significantly improves the expressiveness and practicality of the knowledge graph. The quadruple structure can not only represent the relationship between entities, but also describe the attribute information of the relationship. For example, when expressing "a scientific research team has developed a certain technology", the quadruple can further describe attribute information such as R&D time and technology maturity. This structure enables the knowledge graph to express complex scientific and technological knowledge more comprehensively. By introducing the quadruple structure, the present invention significantly improves the structuring of the knowledge graph, facilitating the management and retrieval of knowledge.
[0036] Further, in step S2, the user's question is obtained, and the questioning method supports text, voice, text, and image multi-modal methods. The user's question is converted into text using a large model, including the following steps: Step S21, multi-modal question acquisition, providing multiple input methods such as text, voice, image, and video, designing the user interface to support multi-modal input such as voice button and image upload function, identifying the modality type of user input, calling the corresponding processing module according to the modality type, and temporarily storing the original data for subsequent processing; Step S22, multimodal data preprocessing, segmenting the input text, removing stop words, correcting errors, and standardizing the text format; using speech recognition technology to convert speech into text, and cleaning and standardizing the converted text; using image recognition technology such as OCR and target detection to extract text or key information from the image, and cleaning and standardizing the extracted text; extracting key frames or audio streams from the video, and performing image or speech preprocessing on the extracted frames or audio respectively; Step S23, multimodal data fusion, converting speech and image non-text input into text, aligning it with the text directly input by the user, generating a unified context representation based on the multimodal data input by the user, and generating a unified text representation after fusing the multimodal data as the input of the subsequent large language model; Step S24, exception handling and user feedback, detect whether the user input is empty or unrecognizable, such as voice input without sound, image without text or blurred content, prompt abnormal input and guide the user to re-enter; display the converted text to the user for the user to confirm whether it is accurate. If the user is not satisfied with the conversion result, support the user to manually modify or re-enter; Step S25, recording the user's multimodal input and conversion results for subsequent model optimization and data analysis.
[0037] Through the above steps, the system can more comprehensively understand user needs and improve the accuracy of intelligent matching by integrating multimodal data. The unified text representation contains the contextual information of multimodal data, providing richer input for the matching model. Based on the unified text representation, the generation module can also generate smoother and more accurate responses. Users can express their needs through text, voice, images and other methods, which improves the convenience of interaction. At the same time, the system can also process user input in real time and provide feedback, supporting users to confirm or modify conversion results to ensure the accuracy of input.
[0038] Further, step S3, inputting the user question text and the personal knowledge graph into the big model as the prompt of the big model in real time includes the following steps: Step S31, fusion of user question text and personal knowledge graph, Step S311, extracting the user question text: obtaining the text representation of the user question from step S2, ensuring that the text content is clear and complete, performing semantic analysis on the question text, and extracting key information; Step S312, according to the user identity or session ID, load the user's personal knowledge graph from the database, the personal knowledge graph includes the user's historical interaction data, interest preferences, professional fields, and project experience information; Step S313, matching the key information in the user's question text with the nodes in the personal knowledge graph; For example, if a user asks "Please help me analyze the scientific and technological achievements of this technology", the system will extract the "technical fields" and "professional preferences" that the user is concerned about from the personal knowledge graph.
[0039] Step S314, extracting relevant context information from the personal knowledge graph according to the matching results; For example, extract relevant patents that users have previously searched for and the technology trends they are interested in.
[0040] Step S315, fusing the user question text with the extracted context information to generate a prompt suitable for understanding by the large language model; Step S32, optimization and formatting of prompt, structural processing of prompt according to the input requirements of the large language model, truncation or compression of prompt according to the input length limit of the large language model, semantic optimization of prompt, to ensure that it is clear, concise and easy for the large language model to understand; Step S33, calling the large language model API, inputting the optimized prompt into the large language model in real time through the API interface, ensuring that the format of the input data is consistent with the model requirements. If the prompt length exceeds the input limit of the model, it is processed by block input or summary generation; Step S34, check whether the prompt is empty or in the wrong format, ensure the validity of the input data, prompt abnormal input, and guide the user to ask the question again; record the prompt content, user ID, and timestamp information of each input for subsequent analysis and optimization, and log the model call results for tracking and debugging.
[0041] The above steps, by combining personal knowledge graphs, perform contextual understanding and semantic reasoning, so that when users make search requests, the system will not only analyze the keywords entered by users, but also combine the scientific and technological knowledge graphs and personal knowledge graphs to perform contextual understanding and semantic reasoning, thereby providing more targeted search results. This intelligent matching mechanism significantly improves the accuracy and practicality of search results.
[0042] Further, in step S4, the large model uses the pre-trained knowledge base and the scientific and technological knowledge graph to generate a response according to the input prompt, including the following steps: Step S41, loading the pre-trained knowledge base and the scientific and technological innovation knowledge graph; Further, step S41, loading the pre-trained knowledge base and the scientific and technological knowledge graph includes the following steps: Step S411, pre-training the large language model knowledge base to ensure that the model loads the latest pre-trained weights to obtain the latest knowledge; Step S412, loading the scientific and technological innovation knowledge graph from the graph database, including patents, technical documents, scientific research papers, and scientific and technological innovation achievement data; Step S413, integrating the pre-trained knowledge base with the scientific and technological knowledge graph to build a comprehensive and professional knowledge system; For example, the patent information in the scientific and technological innovation knowledge graph is associated with the technical description in the pre-trained knowledge base; Step S42, semantic analysis is performed on the input prompt to identify the user's intention, natural language processing technology is used to identify the intention, key entities are extracted from the prompt, and a named entity recognition model is used to extract entities, and the user preferences in the personal knowledge graph in the prompt are combined to deeply understand the user's needs; Step S43, based on the identified intent and entity, relevant information is retrieved from the pre-trained knowledge base and the scientific and technological innovation knowledge graph, and the retrieved information is reasoned and analyzed to generate a response that meets the user's needs; Step S44, integrating the information from the pre-trained knowledge base and the scientific and technological knowledge graph to ensure the comprehensiveness and accuracy of the response, and the large language model generates a preliminary response based on the results of retrieval and reasoning; Step S45, detects whether the reply is empty or does not meet user needs, such as irrelevant content or incomplete information, prompts abnormal situations, and regenerates the reply, records the process of each reply generation, including the input prompt, retrieved knowledge, and generated reply, and records user feedback for subsequent model optimization.
[0043] Through the above steps, by combining the pre-trained knowledge base and the scientific and technological knowledge graph, an accurate, comprehensive and user-friendly natural language response is generated. Specifically, the present invention integrates the pre-trained knowledge base with the scientific and technological knowledge graph to construct a comprehensive and professional knowledge system, combining general knowledge and domain knowledge. The model can simultaneously utilize general language capabilities and domain expertise. At the same time, the present invention can combine user preferences in personal knowledge graphs to deeply understand user needs, and provide responses that better meet user needs through personalized analysis. And on the basis of providing comprehensive and accurate preliminary responses, the present invention ensures response quality and improves system performance through exception handling and record optimization. Example
[0044] A device for constructing a scientific and technological service intelligent agent based on a large language model, characterized in that it is used to implement the method as described above.
[0045] Through the above embodiments, the purpose of the present invention is fully and effectively achieved. Those skilled in the art can understand that the present invention includes but is not limited to the contents described in the drawings and the above specific embodiments. Although the present invention has been described with respect to the most practical and preferred embodiments currently considered, it should be understood that the present invention is not limited to the disclosed embodiments, and any modification that does not deviate from the functional and structural principles of the present invention will be included in the scope of the claims.
Claims
1. A method for constructing a scientific and technological innovation service agent based on a large language model, characterized in that: The following steps are involved: Step S1, constructing a scientific and technological innovation knowledge graph based on scientific and technological innovation services, and constructing a personal knowledge graph based on user data, wherein the scientific and technological innovation knowledge graph contains entity-relationship-entity-attribute quadruple information; Step S2, obtaining user questions, the questioning method supports text, voice, text, image multimodal methods, and using the big model to convert the user questions into text; Step S3, inputting the user question text and personal knowledge graph into the big model as prompts of the big model in real time; Step S4: The large model uses the pre-trained knowledge base and the scientific and technological knowledge graph to generate a response based on the input prompt; Step S5, the large model outputs the reply to the user; Step S6, the system determines whether the user continues to ask questions, if so, repeats the above steps; otherwise, ends the conversation.
2. The method for constructing a scientific and technological innovation service agent based on a large language model according to claim 1, characterized in that: Step S1 constructs a scientific and technological innovation knowledge graph based on scientific and technological innovation services. Constructing a personal knowledge graph based on user data includes the following steps: Step S11, extracting literature materials from the scientific and technological innovation service database, parsing the text and generating scientific and technological innovation achievement text information; Step S12, entity recognition is performed on the corresponding text to extract the entity-relationship-entity-attribute quadruple and store it in the scientific and technological innovation knowledge graph. Through ontology mapping, the intelligent matching of the attributes of the ontology object and the data set fields is supported, and the value conversion logic from the data set to the graph data is determined in the form of configuration mapping rules; unique identification information is created for the data through the knowledge graph, and the function of rapid positioning is performed to realize that the nodes in the database have sources and basis; Step S13, constructing a personal knowledge graph for the user based on the user's uploaded results, user needs, user tags, user historical questions, and user concerns; the personal knowledge graph can integrate and represent various types of user personalized information, and through the knowledge graph system in the subsequent retrieval generation step, the content that is directly or indirectly related to the current user input content can be quickly obtained.
3. The method for constructing a scientific and technological innovation service agent based on a large language model according to claim 1, characterized in that: Step S2, obtaining user questions, the questioning method supports text, voice, text, image multi-modal methods, and using the big model to convert the user questions into text includes the following steps: Step S21, multi-modal question acquisition, providing multiple input methods such as text, voice, image, and video, designing the user interface to support multi-modal input such as voice button and image upload function, identifying the modality type of user input, calling the corresponding processing module according to the modality type, and temporarily storing the original data for subsequent processing; Step S22, multimodal data preprocessing, segmenting the input text, removing stop words, correcting errors, and standardizing the text format; using speech recognition technology to convert speech into text, and cleaning and standardizing the converted text; using image recognition technology such as OCR and target detection to extract text or key information from the image, and cleaning and standardizing the extracted text; extracting key frames or audio streams from the video, and performing image or speech preprocessing on the extracted frames or audio respectively; Step S23, multimodal data fusion, converting speech and image non-text input into text, aligning it with the text directly input by the user, generating a unified context representation based on the multimodal data input by the user, and generating a unified text representation after fusing the multimodal data as the input of the subsequent large language model; Step S24, exception handling and user feedback, detect whether the user input is empty or unrecognizable, such as voice input without sound, image without text or blurred content, prompt abnormal input and guide the user to re-enter; display the converted text to the user for the user to confirm whether it is accurate. If the user is not satisfied with the conversion result, support the user to manually modify or re-enter; Step S25, recording the user's multimodal input and conversion results for subsequent model optimization and data analysis.
4. The method for constructing a scientific and technological innovation service agent based on a large language model according to claim 1, characterized in that: Step S3, inputting the user question text and personal knowledge graph into the big model as the prompt of the big model in real time includes the following steps: Step S31, merging the user question text with the personal knowledge graph; Step S32, optimization and formatting of prompt, structural processing of prompt according to the input requirements of the large language model, truncation or compression of prompt according to the input length limit of the large language model, semantic optimization of prompt, to ensure that it is clear, concise and easy for the large language model to understand; Step S33, calling the large language model API, inputting the optimized prompt into the large language model in real time through the API interface, ensuring that the format of the input data is consistent with the model requirements. If the prompt length exceeds the input limit of the model, it is processed by block input or summary generation; Step S34, check whether the prompt is empty or in the wrong format, ensure the validity of the input data, prompt abnormal input, and guide the user to ask the question again; record the prompt content, user ID, and timestamp information of each input for subsequent analysis and optimization, and log the model call results for tracking and debugging.
5. The method for constructing a scientific and technological innovation service agent based on a large language model according to claim 4 is characterized in that: Step S31, the fusion of the user question text and the personal knowledge graph includes the following steps: Step S311, extracting the user question text: obtaining the text representation of the user question from step S2, ensuring that the text content is clear and complete, performing semantic analysis on the question text, and extracting key information; Step S312, according to the user identity or session ID, load the user's personal knowledge graph from the database, the personal knowledge graph includes the user's historical interaction data, interest preferences, professional fields, and project experience information; Step S313, matching the key information in the user's question text with the nodes in the personal knowledge graph; For example, if a user asks "Please help me analyze the scientific and technological achievements of this technology", the system extracts the "technical field" and "professional preference" that the user is interested in from the personal knowledge graph; Step S314, extracting relevant context information from the personal knowledge graph according to the matching results; Step S315: fuse the user question text with the extracted context information to generate a prompt suitable for understanding by the large language model.
6. The method for constructing a scientific and technological innovation service agent based on a large language model according to claim 1, characterized in that: Step S4: The large model uses the pre-trained knowledge base and the scientific and technological knowledge graph to generate a response based on the input prompt, including the following steps: Step S41, loading the pre-trained knowledge base and the scientific and technological innovation knowledge graph; Step S42, semantic analysis is performed on the input prompt to identify the user's intention, natural language processing technology is used to identify the intention, key entities are extracted from the prompt, and a named entity recognition model is used to extract entities, and the user preferences in the personal knowledge graph in the prompt are combined to deeply understand the user's needs; Step S43, based on the identified intent and entity, relevant information is retrieved from the pre-trained knowledge base and the scientific and technological innovation knowledge graph, and the retrieved information is reasoned and analyzed to generate a response that meets the user's needs; Step S44, integrating the information from the pre-trained knowledge base and the scientific and technological knowledge graph to ensure the comprehensiveness and accuracy of the response, and the large language model generates a preliminary response based on the results of retrieval and reasoning; Step S45, detects whether the reply is empty or does not meet user needs, such as irrelevant content or incomplete information, prompts abnormal situations, and regenerates the reply, records the process of each reply generation, including the input prompt, retrieved knowledge, and generated reply, and records user feedback for subsequent model optimization.
7. The method for constructing a scientific and technological innovation service agent based on a large language model according to claim 6, characterized in that: Step S41, loading the pre-trained knowledge base and the scientific and technological innovation knowledge graph includes the following steps: Step S411, pre-training the large language model knowledge base to ensure that the model loads the latest pre-trained weights to obtain the latest knowledge; Step S412, loading the scientific and technological innovation knowledge graph from the graph database, including patents, technical documents, scientific research papers, and scientific and technological innovation achievement data; Step S413, integrate the pre-trained knowledge base with the scientific and technological knowledge graph to build a comprehensive and professional knowledge system.
8. A device for constructing a scientific and technological innovation service agent based on a large language model, characterized in that: Used to implement the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Domain entity and event double-center knowledge graph construction method, system and equipment
CN115269877A
Language model graduate employment service system based on knowledge graph retrieval enhancement
CN117371973A
Large language model knowledge question-answering method and system fused with multi-modal knowledge graph
CN118627628A
Composite symbolic and non-symbolic artificial intelligence system for advanced reasoning and semantic search
US20240386015A1
Cited By
Big data matching recommendation system and method based on technology transfer platform
CN120256692A
Interaction method and device based on agent cooperation, agent and storage medium
CN120654731A
Knowledge graph and vector retrieval fused medical and invasive service agent construction method and system
CN121413651A