A text opinion extraction method and system based on multi-agent framework
Through a multi-agent framework method, using large models and external knowledge bases for text semantic analysis and agent collaborative interaction, the problem of difficulty in dealing with complex scenarios in the existing technology is solved, and efficient and accurate extraction and analysis of text views is achieved. .
Patent Information
- Application Number
- CN202411560405.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2044-11-04
AI Technical Summary
The existing text view extraction methods are difficult to adapt to complex scenarios and cannot effectively deal with the problems of multi-view coexistence, opinion conflict and context dependence.
Using a multi-agent framework approach, by creating multiple agents, using large models, external knowledge bases and adaptive information adjustment modules for semantic analysis, identifying key information, and automating step-by-step reasoning and decision-making through collaborative interaction of agents , and finally output structured viewpoint information.
It realizes efficient processing of complex text views, improves the accuracy and rationality of view extraction, can analyze text more comprehensively and in-depth, simulate human thinking process, weigh the priorities of different views, and provide more valuable and reliable analysis result.
Smart Images

Figure CN119066210B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a text opinion extraction method and system based on a multi-agent framework. Background Art
[0002] Early research on opinion extraction from text focused on simple sentence levels or single topics. To this end, researchers collected a large amount of text and developed basic opinion extraction systems. As the field develops, especially as large language models become more capable in text opinion extraction, research has begun to expand from simple opinion identification to more complex scenarios, such as coexistence of multiple opinions, conflicting opinions, and context-dependent opinion extraction. Summary of the invention
[0003] In order to solve the technical problem that existing opinion extraction methods cannot adapt to complex scenarios, an embodiment of the present invention provides a text opinion extraction method and system based on a multi-agent framework.
[0004] The technical solution of the embodiment of the present invention is achieved as follows:
[0005] An embodiment of the present invention provides a method for extracting text opinions based on a multi-agent framework, the method comprising: creating multiple agents, wherein the multiple agents have different roles and functions; wherein the agents are obtained by fusing a large model, an external knowledge base and an adaptive information adjustment module; performing semantic analysis on the input text by the agents, extracting and understanding key information in the text; wherein the key information includes actor information, behavior information and scene background information; obtaining extraction tasks and user extraction requirements, and using knowledge graphs and document data to identify external information related to the text opinions; performing automated step-by-step reasoning by collaborative interaction of the multiple agents, fusing interactive information and providing analysis results; comprehensively considering all generated information, weighing priorities and making a final decision by a decision-making agent among the multiple agents; and designing a specific format to guide output content based on the final decision.
[0006] The embodiment of the present invention also provides a text opinion extraction system based on a multi-agent framework, comprising the following modules: an agent creation module, used to create multiple agents, wherein the multiple agents have different roles and functions; wherein the agents are obtained by integrating a large model, an external knowledge base and an adaptive information adjustment module; a text analysis module, used to perform semantic analysis on the input text through the agent, extract and understand the key information in the text; wherein the key information includes actor information, behavior information and scene background information; an information call module, used to obtain extraction tasks and user extraction requirements, and use knowledge graphs and document data to identify external information related to the text opinion; an agent interaction module, used to perform automated step-by-step reasoning through collaborative interaction of the multiple agents, integrate interactive information and give analysis results; a comprehensive evaluation module, used to comprehensively consider all the generated information, weigh priorities and make a final decision through the decision-making agent among the multiple agents; a decision output module, used to design a specific format to guide the output content based on the final decision.
[0007] An embodiment of the present invention further provides an electronic device, comprising: a processor and a memory for storing a computer program that can be run on the processor; wherein the processor executes the steps of the above-mentioned method when running the computer program.
[0008] An embodiment of the present invention further provides a storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the above method are implemented.
[0009] This embodiment has the following beneficial effects:
[0010] By creating multiple agents with specific functions and the ability to access external knowledge bases, efficient processing of complex text opinion extraction is achieved; the text understanding ability of the large language model is used to perform semantic analysis on the input text; more accurate text understanding is achieved by extracting and understanding key information; extraction principles and tasks are identified, and external explanatory information is obtained; the agent simulates the human thinking process, comprehensively considers all information, weighs the priority of different opinions, and conducts in-depth thinking and evaluation; based on the previous analysis and evaluation, clear opinion information is given. Through this structured approach, the present application can achieve more comprehensive and in-depth analysis in the text opinion extraction task, and improve the accuracy and rationality of opinion extraction. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 A flowchart of a method for extracting text opinions based on a multi-agent framework according to an embodiment of the present invention;
[0012] Figure 2This is a schematic diagram of agent information interaction according to an embodiment of the present invention;
[0013] Figure 3 It is a structural schematic diagram of a text opinion extraction system based on a multi-agent framework according to an embodiment of the present invention;
[0014] Figure 4 1 is a diagram showing the internal structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0015] The present invention will be described in further detail below with reference to the accompanying drawings and embodiments.
[0016] The embodiment of the present invention provides a text opinion extraction method based on a multi-agent framework, such as Figure 1 As shown, the method includes:
[0017] Step 101: creating multiple intelligent agents, each of which has different roles and functions; wherein the intelligent agents are obtained by integrating a large model, an external knowledge base, and an adaptive information adjustment module;
[0018] Step 102: The agent performs semantic analysis on the input text to extract and understand key information in the text; wherein the key information includes actor information, behavior information and scene background information;
[0019] Step 103: Obtaining the extraction task and the user's extraction requirement, and using the knowledge graph and document data to identify external information related to the text viewpoint;
[0020] Step 104: Through the collaborative interaction of the multiple agents, automatic step-by-step reasoning is performed, interaction information is integrated, and analysis results are given;
[0021] Step 105: The decision-making agent among the multiple agents comprehensively considers all the generated information, weighs the priorities, and makes a final decision;
[0022] Step 106: Based on the final decision, a specific format is designed to guide output content.
[0023] This embodiment develops a multi-agent collaborative reasoning framework and simulates the reasoning and decision-making ability of humans in complex thinking processes to more effectively extract multi-level opinions in texts. In this way, the opinions and attitudes expressed in the text can be more accurately captured and understood, thereby optimizing the model's opinion extraction mechanism and ensuring that it can provide more valuable and reliable analysis results to meet the needs of different application scenarios.
[0024] Specifically, see Figure 2,This embodiment subdivides the agents into different roles and functions, including decision making agents, sentiment analysis agents, opinion recognition agents, and information fusion agents;
[0025] Decision-making Agent Receive text for which opinion extraction is required And receive extraction tasks and user extraction requirements , and finally synthesize information, make decisions and output results. These execution process information are written into , the large language model is (For example, GPT-4), then:
[0026] ;
[0027] in, Represents the Langchain framework, which allows developers to combine large language models like GPT-4 with external computation and data sources.
[0028] ;
[0029] in, represents the adaptive information adjustment module, Represents the adjustment items of the adaptive process, based on human feedback, optimizing information , generating a new execution information flow , external knowledge base K Includes: Knowledge Graph , document data ;in and are a set of additional explanatory information, Representing short-term memory, storing important information that is constantly changing, we have:
[0030] ;
[0031] in, Through langchain Module creation, combining the interactive information of the intelligent agent to update the memory content in real time, Indicates all external information called, Represents a collection of command and response information. Indicates the total number of characters to be counted. Differentiate the long-term memory of the large model itself, making the whole operation process more efficient and reducing information redundancy;
[0032] Creating an Agent As a basis for creating the following three agents, this agent Able to understand text content, access and parse knowledge graphs and document knowledge bases when necessary, using execution process information such as , then:
[0033] ;
[0034] in, Representing short-term memory, storing important information that is constantly changing, we have:
[0035] ;
[0036] in, Through langchain Module creation, combining the interactive information of the intelligent agent to update the memory content in real time, Indicates key information; By leveraging the ability of large models to prompt learning, in the adaptive information adjustment module In , and Add 3 role information, including: sentiment analysis agent , opinion recognition agent and information fusion agent , and in , and Add the execution information of the calling tool to the module, or call the corresponding memory module to update the short-term memory, and use the The module calls external open source models corresponding to the fields of sentiment analysis and opinion extraction, such as RoBERTa and OpenIE, and collaborates with intelligent agents to improve accuracy.
[0037] ;
[0038] in, is 2, 3, 4, Represents the adjustment items of the adaptive process, based on human feedback, optimizing information , generating a new execution information flow .
[0039] Through the above settings, each intelligent agent can effectively interact and make decisions in different situations to achieve accurate opinion extraction.
[0040] In addition, the key information in this embodiment includes: actor information, behavior information and scene background information. The text is segmented and overlapped using the segmentation and overlap method. Batch transfer to the agent, using the agent The language understanding ability of medium and large models, combined with specific The format is used as a limit to the recognized content, and the input text is recognized and obtained. Key information , then:
[0041] ;
[0042] Among them, the segmentation and overlapping methods refer to text By specifying the split Length of characters, and the length of characters at the beginning and end of each overlapping text Get batches of text segments, and then pass the text segments as input batches to , The format template includes fixed fields and replaceable fields. Limit the output content to conform to the expected format specification, such as instructing the large model to extract the text According to the key information extracted by the big model, Replaceable fields in templates The corresponding Make a replacement.
[0043] For example, the above key information may specifically be:
[0044] Information about the actor, including name, gender, occupation, age, etc. Analyzing this data will help us understand the specific situation of the actor;
[0045] Behavioral information, including actions, mental activities, etc. These data are the focus of opinion extraction;
[0046] Scenario background information, including geographic location, environment, rules, special circumstances, etc. Analyzing this data helps to understand the external environment and prerequisites for the behavior.
[0047] The external information in this embodiment refers to the additional explanatory information related to the text content accessed by the agent. The additional explanatory information refers to the information to be accessed when the viewpoints identified in the text need to be further explained, so as to make the expression of the viewpoints more specific. The process is as follows:
[0048] ;
[0049] Among them, the large language model in the agent Combining key information and external knowledge bases , including: Knowledge Graph , document data , output the information that needs to be extracted from the external knowledge base , the similarity calculation formula used in document data retrieval is:
[0050] ;
[0051] in, , , is the text in the key information, The threshold value is set to , indicating the degree of text similarity, when the similarity is greater than Access the information that needs to be extracted from the external knowledge base , when the information to be extracted from the external knowledge base When further explanation is needed, the knowledge graph can be called. The knowledge graph retrieval formula is:
[0052] ;
[0053] in, Indicates the information that needs to be extracted from the external knowledge base Combined with pre-set entity field information , and through the large model Extract named entities from text. The purpose of named entity recognition is to extract entities and fill the CQL model. Therefore, the data after the large model is processed is a dictionary data. Therefore, the field information The output format of the large model when extracting named entity information is limited. The template representing the CQL query statement is combined with the identified named entities to accurately identify them in the knowledge graph to obtain the final explanation information. ,in .
[0054] The collaborative interaction of intelligent agents in this embodiment includes emotion recognition, opinion expression, and information analysis;
[0055] Agent Get key information Afterwards, we provide the sentiment analysis agent Issue the corresponding instructions .
[0056] The emotion recognition refers to the emotion analysis agent Based on emotion recognition instructions , call large models and external sentiment analysis models, such as RoBERT, to assist in analysis and receive key text information , call the external knowledge base to obtain the required external information, analyze the sentiment of the text content and comprehensively consider the results to obtain , which includes positive emotions, negative emotions, and neutral emotions, and then feeds the opinion recognition agent Issue Instructions and as input.
[0057] The opinion expression refers to the opinion recognition agent Extract instructions based on viewpoint , call large models and external opinion extraction models, such as OpenIE, to assist in analysis, analyze text content, call external knowledge bases to obtain required external information, and combine sentiment analysis agents The generated information is used as a reference, and the point of view information to be expressed in the natural language interactive text segment is obtained. , and then to the information fusion agent Issue Instructions .
[0058] The information analysis is performed by an information fusion agent Receive instructions for fusion information , synthesize the information generated by the above intelligent agents, think about it, and give the final analysis results .
[0059] The execution process is as follows:
[0060] ;
[0061] Among them, the process of text information, instructions and response information is stored in the short-term memory module of the intelligent agent. The input and output of the previous intelligent agent will also be used as the input of the next intelligent agent and as a reference for the output of the intelligent agent. The short-term memory module is updated in real time, and the instructions and response information of the three are sent in an orderly manner to realize automated interactive reasoning.
[0062] The comprehensive evaluation in this embodiment includes information synthesis and priority weighing;
[0063] Information Fusion Agent Give the final analysis results Afterwards, the decision agent Issue a command that integrates all available information , and the results obtained above are , and As a decision-making agent Input.
[0064] The information synthesis is a decision-making agent Issue instructions that integrate all available information , get the summary information ;
[0065] The priority trade-off is to make the decision-making agent Issue priority instructions that weigh different information , and get the result ;
[0066] ;
[0067] Among them, all information and summary information instructions Input to the decision agent, and get , and and With the next instruction composition , as the next step instruction prompt ,The priority refers to the trade-off between the number of opinions generated by the existing ,analysis information, the clarity of opinions and the interactive information generated by the ,agent.
[0068] This embodiment combines the final information with the decision-making agent Summarize and analyze all generated information, including text in its own memory module As well as extraction tasks and user extraction requirements , and finally output a clear view , then:
[0069] ;
[0070] in, The design principle of the format template is similar , including fixed fields and replaceable fields. Fixed fields limit the output Conforms to the expected format specification, The replaceable fields in the template will be based on the extraction task and user extraction requirements and analysis results to make the output content logical and flexible, and The memory module in the As well as extraction tasks and user extraction requirements .
[0071] Example, extraction tasks and user extraction requirements To extract the second paragraph's opinion, multiple replaceable fields in JSON The replacement display is {the second paragraph of opinion:}, {(specific opinion content)}, {(extracted actors, behaviors and background information)}. The extracted actors, behaviors and background information can be used to intuitively locate the source of opinion extraction, thereby improving the credibility of opinion extraction.
[0072] From the above design, we can see that this model divides the agent into different roles and functions to form an agent sequence with specific tasks. It combines external knowledge base, adaptive information adjustment module and large language model to build a basic agent framework. Through scene recognition and rule analysis, key information is extracted from the input text to obtain the semantic information of the scene. Through agent interactive decision-making, multi-angle text opinion content and corresponding understanding are obtained. Through information synthesis and reflection, the collected information is deeply thought about and evaluated to obtain a comprehensive text opinion. In the instruction process, by sequentially executing instructions and combining the response of the previous step, a continuous reasoning chain is formed, and finally a clear text opinion is output. The use of this multi-agent framework can handle complex situations in the text opinion extraction task and improve the accuracy and reliability of text opinion extraction.
[0073] In order to implement the method of the embodiment of the present invention, the embodiment of the present invention also provides a text opinion extraction system based on a multi-agent framework, such as Figure 3 As shown, the text opinion extraction system 300 based on the multi-agent framework includes: an agent creation module 301, a text analysis module 302, an information call module 303, an agent interaction module 304, a comprehensive evaluation module 305 and a decision output module 306; wherein:
[0074] An agent creation module 301 is used to create multiple agents, each of which has different roles and functions; wherein the agents are obtained by integrating a large model, an external knowledge base and an adaptive information adjustment module;
[0075] A text analysis module 302 is used to perform semantic analysis on the input text through the agent to extract and understand key information in the text; wherein the key information includes actor information, behavior information and scene background information;
[0076] An information calling module 303 is used to obtain extraction tasks and user extraction requirements, and use knowledge graphs and document data to identify external information related to the text viewpoint;
[0077] An agent interaction module 304 is used to perform automated step-by-step reasoning, integrate interaction information and provide analysis results through collaborative interaction of the multiple agents;
[0078] Comprehensive evaluation module 305, used for comprehensively considering all generated information, weighing priorities, and making a final decision through a decision agent among the multiple agents;
[0079] The decision output module 306 is used to design a specific format to guide output content based on the final decision.
[0080] In actual application, the agent creation module 301, the text analysis module 302, the information call module 303, the agent interaction module 304, the comprehensive evaluation module 305 and the decision output module 306 can be implemented by a processor in a text opinion extraction system based on a multi-agent framework.
[0081] It should be noted that: when the above-mentioned device provided in the above-mentioned embodiment is executed, only the division of the above-mentioned program modules is used as an example. In actual application, the above-mentioned processing can be assigned to different program modules as needed, that is, the internal structure of the terminal is divided into different program modules to complete all or part of the above-mentioned processing. In addition, the above-mentioned device provided in the above-mentioned embodiment belongs to the same concept as the above-mentioned method embodiment. The specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0082] In order to implement the method of the embodiment of the present invention, the embodiment of the present invention also provides a computer program product, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of the above method.
[0083] Based on the hardware implementation of the above program modules, and in order to implement the method of the embodiment of the present invention, the embodiment of the present invention further provides an electronic device (computer device). Specifically, in one embodiment, the computer device may be a terminal, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor A01, a network interface A02, a display screen A04, an input device A05 and a memory (not shown in the figure) connected through a system bus. Among them, the processor A01 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes an internal memory A03 and a non-volatile storage medium A06. The non-volatile storage medium A06 stores an operating system B01 and a computer program B02. The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A06. The network interface A02 of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor A01, the method of any one of the above embodiments is implemented. The display screen A04 of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device A05 of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0084] Those skilled in the art will understand that Figure 4The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0085] The device provided by the embodiment of the present invention includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the method of any one of the above embodiments is implemented.
[0086] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0087] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0088] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0089] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1The steps for the functions specified in one or more boxes.
[0090] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0091] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0092] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0093] It can be understood that the memory of the embodiment of the present invention can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAMbus random access memory (DRRAM, Direct Rambus Random Access Memory).The memories described in the embodiments of the present invention are intended to include, but are not limited to, these and any other suitable types of memories.
[0094] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0095] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A text opinion extraction method based on a multi-agent framework, characterized in that: The method comprises: Creating multiple intelligent agents, each of which has different roles and functions; wherein the intelligent agents are obtained by integrating a large model, an external knowledge base, and an adaptive information adjustment module; The agent performs semantic analysis on the input text to extract and understand key information in the text; wherein the key information includes actor information, behavior information and scene background information; Obtaining extraction tasks and user extraction requirements, and using knowledge graphs and document data to identify external information related to the textual viewpoints; Through the collaborative interaction of the multiple intelligent agents, automatic step-by-step reasoning is performed, interaction information is integrated and analysis results are given; The decision-making agent among the multiple agents comprehensively considers all the generated information, weighs the priorities, and makes a final decision; Based on the final decision, design a specific format to guide output content; Wherein, the creating of multiple agents includes: The intelligent agents are subdivided into different roles and functions, including decision-making agents, sentiment analysis agents, opinion recognition agents, and information fusion agents; Decision-making Agent Receive text for which opinion extraction is required And receive extraction tasks and user extraction requirements , synthesize information, make decisions and output results; ; in, For execution process information, For large language models, represents the Langchain framework, which allows large language models to be combined with external computation and data sources; ,in, represents the adaptive information adjustment module, Represents the adjustment items of the adaptive process, based on human feedback, optimizing information , generating a new execution information flow , external knowledge base K Includes: Knowledge Graph , document data ;in and are a set of additional explanatory information, Represents short-term memory, storing important information that is constantly changing, ,in, Through langchain Module creation, combining the interactive information of the intelligent agent to update the memory content in real time, Indicates all external information called, Represents a collection of command and response information. Indicates the total number of characters to be calculated; Creating an Agent To create the basis for sentiment analysis agents, opinion recognition agents and information fusion agents, agents Understand text content, access and parse knowledge graphs and document knowledge bases, and use the execution process information , then: ; in, Representing short-term memory, storing important information that is constantly changing, we have: ; in, Through langchain Module creation, combining the interactive information of the intelligent agent to update the memory content in real time, Indicates key information; By leveraging the ability of large models to prompt learning, in the adaptive information adjustment module In , and Add 3 role information, including: sentiment analysis agent , opinion recognition agent and information fusion agent , and in , and Add the execution information of the calling tool to ,in, is 2, 3, 4, Represents the adjustment items of the adaptive process, based on human feedback, optimizing information , generating a new execution information flow ; The external information refers to the additional explanatory information related to the text content accessed by the agent, and the additional explanatory information refers to the information to be accessed when further explanation is required for the viewpoints identified in the text; ; Among them, the large language model in the agent Combining key information and external knowledge bases , including: Knowledge Graph , document data , output the information that needs to be extracted from the external knowledge base , the similarity calculation formula used in document data retrieval is: ; in, , , is the text in the key information, similarity The threshold value is set to , indicating the degree of text similarity, when the similarity is greater than Access the information that needs to be extracted from the external knowledge base , when the information to be extracted from the external knowledge base When further explanation is needed, the knowledge graph is called, and the knowledge graph retrieval formula is: ; in, Indicates the information that needs to be extracted from the external knowledge base Combined with pre-set entity field information , and through the large model Extract named entities and field information from text Used to limit the output format when extracting named entity information from a large model. A template representing a CQL query statement. For the final interpretation of the information, ; Wherein, the collaborative interaction of the intelligent agents includes emotion recognition, opinion expression and information analysis; Agent Get key information Afterwards, we provide the sentiment analysis agent Issue the corresponding instructions ; The emotion recognition refers to the emotion analysis agent Based on emotion recognition instructions , call the big model and external sentiment analysis model to assist in analysis and receive key text information , call the external knowledge base to obtain the required external information, analyze the sentiment of the text content and comprehensively consider the results to obtain , which includes positive emotions, negative emotions, and neutral emotions, and then feeds the opinion recognition agent Issue Instructions and As input; The opinion expression refers to the opinion recognition agent Extract instructions based on viewpoint , call the big model and external opinion extraction model to assist analysis, analyze the text content, call the external knowledge base to obtain the required external information, and combine the sentiment analysis agent The generated information is used as a reference, and the point of view information to be expressed in the natural language interactive text segment is obtained. , and then to the information fusion agent Issue Instructions ; The information analysis is performed by an information fusion agent Receive instructions for fusion information , synthesize the information generated by the above intelligent agents, think about it, and give the final analysis results ; The execution process is as follows: ; Among them, the process of text information, instructions and response information is stored in the short-term memory module of the intelligent agent. The input and output of the previous intelligent agent will also be used as the input of the next intelligent agent and as a reference for the output of the intelligent agent. The short-term memory module is updated in real time, and the instructions and response information of the three are sent in an orderly manner to realize automated interactive reasoning.
2. The text opinion extraction method based on a multi-agent framework according to claim 1 is characterized in that: The key information includes: actor information, behavior information and scene background information; Use segmentation and overlap to segment text Batch transfer to the agent, using the agent The language understanding ability of the medium and large models, combined with The format template is used as a limit to the recognized content to recognize and obtain the input text Key information , then: ; Among them, the segmentation and overlapping methods refer to text By specifying the split Length of characters, and the length of characters at the beginning and end of each overlapping text Get batches of text segments, and then pass the text segments as input batches to , The format template includes fixed fields and replaceable fields. Limit the output content to the preset format specification; according to the key information extracted from the large model, Replaceable fields in templates The corresponding Make a replacement.
3. The text opinion extraction method based on a multi-agent framework according to claim 2 is characterized in that: Comprehensive consideration of all generated information including information synthesis and priority weighing; Information Fusion Agent Give the final analysis results Afterwards, the decision agent Issue instructions that integrate all available information , and the previous results , and As a decision-making agent Input; The information synthesis is a decision-making agent Issue instructions that integrate all available information , get the summary information ; The priority trade-off is to make the decision-making agent Issue priority instructions that weigh different information , and get the result ; ; Among them, all information and summary information instructions Input to the decision agent, and get , and and With the next instruction composition , as the next step instruction prompt ,The priority refers to the trade-off between the number of opinions generated by the existing ,analysis information, the clarity of opinions and the interactive information generated by the ,agent.
4. The text opinion extraction method based on a multi-agent framework according to claim 3 is characterized in that: Combined with the final information, through the decision-making agent Summarize and analyze all generated information, including the information text in its own memory module As well as extraction tasks and user extraction requirements , and finally output a clear view : ; in, Format template, including fixed fields and replaceable fields, fixed fields limit output Conform to the preset format specifications, The replaceable fields in the template will be based on the extraction task and user extraction requirements and analysis results to make the output content logical and flexible, and The memory module in the As well as extraction tasks and user extraction requirements .
5. A text opinion extraction system based on a multi-agent framework, characterized in that: Includes the following modules: An agent creation module, used to create multiple agents, each of which has different roles and functions; wherein the agents are obtained by integrating a large model, an external knowledge base and an adaptive information adjustment module; A text analysis module, used to perform semantic analysis on the input text through the agent, extract and understand key information in the text; wherein the key information includes actor information, behavior information and scene background information; An information calling module is used to obtain extraction tasks and user extraction requirements, and use knowledge graphs and document data to identify external information related to the text viewpoint; An agent interaction module, used to perform automated step-by-step reasoning through collaborative interaction of the multiple agents, integrate interaction information and provide analysis results; A comprehensive evaluation module, used for comprehensively considering all the generated information, weighing the priorities, and making a final decision through a decision-making agent among the multiple agents; A decision output module, used to design a specific format to guide output content based on the final decision; The agent creation module is further specifically used for: The intelligent agents are subdivided into different roles and functions, including decision-making agents, sentiment analysis agents, opinion recognition agents, and information fusion agents; Decision-making Agent Receive text for which opinion extraction is required And receive extraction tasks and user extraction requirements , synthesize information, make decisions and output results; ; in, For execution process information, For large language models, represents the Langchain framework, which allows large language models to be combined with external computation and data sources; ,in, represents the adaptive information adjustment module, Represents the adjustment items of the adaptive process, based on human feedback, optimizing information , generating a new execution information flow , external knowledge base K Includes: Knowledge Graph , document data ;in and are a set of additional explanatory information, Represents short-term memory, storing important information that is constantly changing, ,in, Through langchain Module creation, combining the interactive information of the intelligent agent to update the memory content in real time, Indicates all external information called, Represents a collection of command and response information. Indicates the total number of characters to be calculated; Creating an Agent To create the basis for sentiment analysis agents, opinion recognition agents and information fusion agents, agents Understand text content, access and parse knowledge graphs and document knowledge bases, and use the execution process information , then: ; in, Representing short-term memory, storing important information that is constantly changing, we have: ; in, Through langchain Module creation, combining the interactive information of the intelligent agent to update the memory content in real time, Indicates key information; By leveraging the ability of large models to prompt learning, in the adaptive information adjustment module In , and Add 3 role information, including: sentiment analysis agent , opinion recognition agent and information fusion agent , and in , and Add the execution information of the calling tool to ,in, is 2, 3, 4, Represents the adjustment items of the adaptive process, based on human feedback, optimizing information , generating a new execution information flow ; The external information refers to the additional explanatory information related to the text content accessed by the agent, and the additional explanatory information refers to the information to be accessed when further explanation is required for the viewpoints identified in the text; ; Among them, the large language model in the agent Combining key information and external knowledge bases , including: Knowledge Graph , document data , output the information that needs to be extracted from the external knowledge base , the similarity calculation formula used in document data retrieval is: ; in, , , is the text in the key information, similarity The threshold value is set to , indicating the degree of text similarity, when the similarity is greater than Access the information that needs to be extracted from the external knowledge base , when the information to be extracted from the external knowledge base When further explanation is needed, the knowledge graph is called, and the knowledge graph retrieval formula is: ; in, Indicates the information that needs to be extracted from the external knowledge base Combined with pre-set entity field information , and through the large model Extract named entities and field information from text Used to limit the output format when extracting named entity information from a large model. A template representing a CQL query statement. For the final interpretation of the information, ; The agent interaction module is also specifically used for emotion recognition, opinion expression and information analysis; Agent Get key information Afterwards, we provide the sentiment analysis agent Issue the corresponding instructions ; The emotion recognition refers to the emotion analysis agent Based on emotion recognition instructions , call the big model and external sentiment analysis model to assist in analysis and receive key text information , call the external knowledge base to obtain the required external information, analyze the sentiment of the text content and comprehensively consider the results to obtain , which includes positive emotions, negative emotions, and neutral emotions, and then feeds the opinion recognition agent Issue Instructions and As input; The opinion expression refers to the opinion recognition agent Extract instructions based on viewpoint , call the big model and external opinion extraction model to assist analysis, analyze the text content, call the external knowledge base to obtain the required external information, and combine the sentiment analysis agent The generated information is used as a reference, and the point of view information to be expressed in the natural language interactive text segment is obtained. , and then to the information fusion agent Issue Instructions ; The information analysis is performed by an information fusion agent Receive instructions for fusion information , synthesize the information generated by the above intelligent agents, think about it, and give the final analysis results ; The execution process is as follows: ; Among them, the process of text information, instructions and response information is stored in the short-term memory module of the intelligent agent. The input and output of the previous intelligent agent will also be used as the input of the next intelligent agent and as a reference for the output of the intelligent agent. The short-term memory module is updated in real time, and the instructions and response information of the three are sent in an orderly manner to realize automated interactive reasoning.
6. An electronic device, characterized in that: include: A processor and a memory for storing a computer program that can be run on the processor; wherein, when the processor is used to run the computer program, the steps of the method according to any one of claims 1 to 4 are performed.
7. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Information processing method and system based on artificial intelligence technology
CN115081457A
Long text generation method based on large language model agent
CN118210873A