CN-121997900-A - Method for writing generated financial report based on role division
Abstract
The invention discloses a role division based generation type financial report writing method, and relates to the technical field of report writing. By constructing a semantic anchor point set and carrying out structural compression processing, key semantic information for context transfer can be extracted efficiently under the condition of not depending on the lengthy content of an original text, the problem of information interception caused by limited input length in a traditional chain type Prompt mode is fundamentally avoided, the phenomena of information dislocation, semantic drift, key loss and the like in the context compression process are effectively prevented by taking a structural semantic abstract as a unique context source for next character generation and introducing an anchor point binding and semantic coverage checking mechanism, the accurate inheritance and closed-loop control of content semantics are formed between characters through anchor point consistency comparison, and the problem of gradual failure of context states in the Prompt chain transfer is comprehensively solved.
Inventors
- ZHANG WENYING
- LI ZETAO
- Li tianjiao
- YUAN FANG
- SUN QIAOLI
- Guo Jiahang
Assignees
- 联合资信评估股份有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260130
Claims (7)
- 1. The method for writing the generated financial report based on the role division is characterized by comprising the following steps of: s1, acquiring report text content generated by a previous character, carrying out semantic analysis on the text content, and extracting a semantic anchor point set for context transfer from the text content; s2, carrying out structural arrangement and compression treatment on the semantic anchor point set to generate a structural semantic abstract for context injection; S3, injecting the structured semantic abstract as unique and effective context information into a generation prompt of a next role, and generating a core semantic range which must be referred when the content is generated; S4, after the next character finishes the content generation, consistency comparison is carried out on the generated content and the semantic anchor point set, and whether the generated content completely covers the semantic anchor point or not is judged, and the original semantic direction is kept consistent; And S5, outputting the generated content as the input content of the subsequent role or as a component part of the financial report under the condition that the consistency comparison is passed, and regenerating or supplementing and correcting the generated content based on the semantic anchor point set under the condition that the consistency comparison is not passed.
- 2. The role division based generated financial report writing method of claim 1, wherein the step of extracting the set of semantic anchors therefrom for context transfer is: Paragraph level segmentation is carried out on report text content generated by the previous role to obtain a plurality of text segments, semantic role labeling is respectively carried out on each text segment based on a preset financial semantic recognition rule, and the semantic roles at least comprise fact description sentences, trend judgment sentences and conclusion inference sentences; After the semantic role is marked, entity-attribute alignment processing is carried out on the text segment marked as the fact description statement, and numerical value information, time information and index name information which directly correspond to the financial object are extracted from the text segment to form a fact-type semantic gist; Identifying the change direction words and the amplitude limiting words in the text segments marked as the trend judging sentences based on the syntactic dependency relationship, and combining the corresponding fact-type semantic points to construct trend-type semantic points representing the change relationship; identifying causal trigger words or logic connecting words in text segments marked as conclusion inference sentences, and backtracking the quoted fact-type semantic points and trend-type semantic points to generate conclusion-type semantic points with clear reasoning sources; Sorting the fact type semantic points, the trend type semantic points and the conclusion type semantic points according to the appearance sequence of the fact type semantic points, the trend type semantic points and the conclusion type semantic points in the original report text, and recording the reference relation among the semantic points in the sorting process to form a semantic anchor point set containing semantic content and logic association information.
- 3. The method for composing a generated financial report based on role division according to claim 1, wherein the steps of performing structural arrangement and compression processing on the semantic anchor point set and generating a structured semantic abstract for context injection are as follows: Performing type grouping processing on the semantic anchor point set, respectively classifying the semantic anchor points into corresponding semantic levels according to the fact type semantic points, the trend type semantic points and the conclusion type semantic points, and reserving the appearance sequence of the semantic anchor points in the original report text in each semantic level; After the semantic hierarchy division is completed, performing minimum semantic unit compression processing on the fact-type semantic points, wherein the compression processing comprises deleting modifier adjectives and non-core qualifiers, and only reserving financial entity names, corresponding index names, numerical value information and time information so as to form foundation fact semantic fragments which can not be split; based on the basic fact semantic segments, executing trend mapping compression processing on trend type semantic points, binding the change direction and change amplitude related in the trend type semantic points with the basic fact semantic segments corresponding to the trend type semantic points, and recording the logic positions of the trend type semantic points relative to the basic fact semantic segments in a sequential identification mode; After the trend mapping compression is completed, causal reference compression processing is carried out on the conclusion type semantic points, natural language description used for expressing the inferred result in the conclusion type semantic points is replaced by logic reference marks of the fact type semantic points and the trend type semantic points which are referenced by the natural language description, and therefore a complete inference path is reserved under the condition that original content is not repeatedly expressed; Rearranging the fact-type semantic points, the trend-type semantic points and the conclusion-type semantic points after compression processing according to the sequence that the facts precede the trends and the trends precede the conclusions, and explicitly recording the quotation relations among the semantic points in the arranging process to form a structured semantic abstract with a hierarchical structure and a logic dependency relation; And packaging the structured semantic abstract into an independent context injection unit, and limiting that the context injection unit only contains the structured semantic abstract content.
- 4. The character division based generation type financial report writing method according to claim 1, wherein the step of injecting the structured semantic abstract as the only valid context information into the generation prompt of the next character, and the core semantic scope that must be referred to when generating the content is: Before the next role starts to generate content, a generation prompt template corresponding to the role is constructed, a special semantic slot for context injection is divided in the generation prompt template in advance, and the definition of the semantic slot only allows receiving the structured semantic abstract; Injecting the whole structured semantic abstract into the semantic slot, and prohibiting the original report text content or other unstructured text content from being written into the semantic slot in the injection process; after the injection of the structured semantic abstract is completed, role binding processing is carried out on each semantic point in the structured semantic abstract, the semantic points related to the next role responsibility are marked as forced reference semantic points, and the rest semantic points are marked as auxiliary reference semantic points; Based on the role binding processing result, displaying and adding a semantic reference constraint instruction in a generation prompt template, limiting that all forced reference semantic points must be covered when the next role generates the content, and prohibiting the generation of the content which conflicts with the semantic direction of the forced reference semantic points; In the process of generating the content by the next role, the semantic association condition between the generated text and the structured semantic abstract is monitored in real time, when the fact that the generated content deviates from the semantic range of the forced reference semantic gist is detected, the current generation process is automatically interrupted, and the generation is triggered again based on the structured semantic abstract; After the generation is completed, the generated content and the structured semantic abstract are subjected to once complete semantic alignment verification, and the generated content is used as an effective output result of cross-role transfer only when the verification result shows that the generated content accords with the core semantic scope defined by the structured semantic abstract.
- 5. The method for composing a generated financial report based on role division according to claim 1, wherein after the next role completes the content generation, the step of comparing the generated content with the set of semantic anchors to determine whether the generated content completely covers the semantic anchors and keeps the original semantic directions consistent is as follows: After the next character finishes the content generation, executing semantic unit segmentation processing on the generated content, splitting the generated content into a plurality of semantic segments which can be independently judged, and labeling each semantic segment with the semantic function type which the semantic segment belongs to, wherein the semantic function type comprises a fact statement segment, a trend judgment segment and a conclusive expression segment; Based on the semantic anchor point set, an anchor point-semantic segment mapping relation table is established, each semantic anchor point is matched with semantic segments which can express the same or similar semantic meaning in the generated content one by one, and the matching result is recorded as a covered, partially covered or uncovered state; After the semantic coverage matching is completed, further executing semantic direction consistency check on the semantic anchor points judged to be covered or partially covered, wherein the check is completed by comparing whether the change direction, causal direction or conclusion trend expressed by the corresponding semantic segments in the generated content is consistent with the original semantic direction recorded in the semantic anchor points; When detecting that the generated content has the semantic fragments with the opposite semantic direction to any semantic anchor point, weakening or negating the original semantic direction, marking the corresponding semantic anchor point as a direction conflict anchor point, and recording the specific position of the direction conflict anchor point in the generated content; generating a consistency comparison result based on the coverage state of the semantic anchor points and the semantic direction consistency check result, wherein when all the semantic anchor points are judged to be covered or partially covered and no direction conflict anchor points exist, the generated content is determined to pass the consistency comparison; When the consistency comparison result does not pass, outputting check result information containing uncovered semantic anchor points and direction conflict anchor points, and transmitting the check result information as constraint conditions to the subsequent content regeneration or supplementary correction step.
- 6. The character division based generated financial report writing method according to claim 1, wherein in the case that the consistency comparison is passed, the step of outputting the generated content as the input content of the subsequent character or as a constituent part of the financial report is: When the consistency comparison result shows that the generated content passes the consistency comparison, marking the generated content as qualified generated content, and selectively taking the qualified generated content as the input content of the next role directly or writing the qualified generated content into a preset financial report structure to be stored as the composition content of the corresponding chapter according to the position of the current role in the whole report flow.
- 7. The method for composing a generated financial report based on role division according to claim 1, wherein in the case that the consistency comparison fails, the step of regenerating or complementarily correcting the generated content based on the set of semantic anchors is: when the consistency comparison result shows that the generated content fails consistency comparison, reading output verification result information, wherein the verification result information at least comprises an uncovered semantic anchor point set and a direction conflict anchor point set; Screening target semantic anchor points needing to be corrected from the semantic anchor point set based on the uncovered semantic anchor point set and the direction conflict anchor point set, and taking the target semantic anchor points as unique semantic basis for regenerating or supplementing correction; Constructing a limiting type generation prompt aiming at a target semantic anchor point, wherein the content which explicitly limits regeneration or supplement correction only allows expansion around the target semantic anchor point, and forbids the rewriting of the content corresponding to the semantic anchor point which is compared through consistency; triggering content regeneration or supplementary correction operation based on the limited generation prompt, and after the generation is completed, replacing the local fragments corresponding to the target semantic anchor points in the original generated content with the newly generated content, wherein the rest content which is compared by consistency is kept unchanged; and after the partial replacement is completed, re-sending the corrected generated content to the step S4 to execute consistency comparison, and executing output or transmission operation according to the step S1 until the consistency comparison is passed.
Description
Method for writing generated financial report based on role division Technical Field The invention relates to the technical field of report writing, in particular to a role division-based generation type financial report writing method. Background With the development of large language models and generative artificial intelligence technologies, a 'role division' based generative financial report writing method is gradually developed in the financial industry. The method divides a plurality of tasks of data interpretation, trend analysis, investment advice, risk prompt, language color rendering and the like which are originally completed manually into a plurality of AI modules with specific responsibilities, each module plays a role of a virtual expert, corresponding content is generated respectively, and then integrated output is carried out. The method uses a chain prompt (PromptChaining) mechanism to inject the content generated by the previous role into the next role as the context input to form a serial semantic relay chain, so that the context consistency and semantic consistency of the content generation are realized while the cooperation of the modules is maintained. However, a key technical problem is gradually exposed in actual deployment, namely, as the report structure increases and the number of roles increases, a significant context state failure phenomenon exists in chain type promt transmission. The method is characterized in that when the content generated by the previous role is compressed and then injected into the promt, key information is often cut off due to length limitation, misplaced due to sequence adjustment, even the original logic key is lost due to semantic dilution, so that problems such as judgment deviation, expression conflict or semantic drift occur in the understanding and generating process of the downstream role, and the reliability and the professional degree of the whole report in terms of structural continuity and content accuracy are affected. Disclosure of Invention The present invention is directed to solving the above-mentioned problems in the background art, and provides a method for composing a generated financial report based on character division. The invention provides a method for composing a generated financial report based on role division, which comprises the following steps: s1, acquiring report text content generated by a previous character, carrying out semantic analysis on the text content, and extracting a semantic anchor point set for context transfer from the text content; s2, carrying out structural arrangement and compression treatment on the semantic anchor point set to generate a structural semantic abstract for context injection; S3, injecting the structured semantic abstract as unique and effective context information into a generation prompt of a next role, and generating a core semantic range which must be referred when the content is generated; S4, after the next character finishes the content generation, consistency comparison is carried out on the generated content and the semantic anchor point set, and whether the generated content completely covers the semantic anchor point or not is judged, and the original semantic direction is kept consistent; And S5, outputting the generated content as the input content of the subsequent role or as a component part of the financial report under the condition that the consistency comparison is passed, and regenerating or supplementing and correcting the generated content based on the semantic anchor point set under the condition that the consistency comparison is not passed. Optionally, the step of extracting therefrom the set of semantic anchors for context transfer is: Paragraph level segmentation is carried out on report text content generated by the previous role to obtain a plurality of text segments, semantic role labeling is respectively carried out on each text segment based on a preset financial semantic recognition rule, and the semantic roles at least comprise fact description sentences, trend judgment sentences and conclusion inference sentences; After the semantic role is marked, entity-attribute alignment processing is carried out on the text segment marked as the fact description statement, and numerical value information, time information and index name information which directly correspond to the financial object are extracted from the text segment to form a fact-type semantic gist; Identifying the change direction words and the amplitude limiting words in the text segments marked as the trend judging sentences based on the syntactic dependency relationship, and combining the corresponding fact-type semantic points to construct trend-type semantic points representing the change relationship; identifying causal trigger words or logic connecting words in text segments marked as conclusion inference sentences, and backtracking the quoted fact-type semantic points and trend-type semanti