Futures content generation method and system based on large language model
Through the combination of a large language model and thinking chain CoT prompt words, the futures index data is processed, and the problem of low quality content generation in the financial futures field is solved, achieving high-quality and relevant content generation.
Patent Information
- Application Number
- CN202411765035.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-12-04
AI Technical Summary
The existing content generation technology has problems such as illusion of content generated, unclear structure, lack of highlights, insufficient length, rigid expressions, and repeated nonsense in the financial futures field, and it is difficult to achieve high-quality content generation.
Using a futures content generation method based on a large language model, pre-processing by obtaining futures index data, event information data and macro-industry chain supply and demand data, use the thinking chain CoT prompt word to guide the large language model to generate high-quality futures content to ensure the content Accuracy and relevance.
It improves the quality and accuracy of content generation in the futures field, meets user needs, and solves the problem of low content generation quality.
Smart Images

Figure CN119248909A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of content generation, and in particular to a method and system for generating futures content based on a large language model. Background Art
[0002] Content generation technology refers to the use of artificial intelligence algorithms to convert data and information into various forms of content, including text, images, audio and video. The core of this technology is to simulate human creativity and expression ability to automatically generate content with a certain quality and relevance. With the rapid development of generative big models, traditional content generation has made great improvements, but it still faces problems such as generated content illusions, unclear content context structure, lack of emphasis on key content, insufficient length, rigid text expression, and repetitive nonsense. Especially in the field of financial futures with strict supervision and lack of data, the existing content generation solutions are still a long way from real implementation.
[0003] Currently, no effective solution has been proposed for the problem of how to improve the quality of content generation in the futures field in related technologies. Summary of the invention
[0004] The embodiments of the present application provide a method and system for generating futures content based on a large language model, so as to at least solve the problem of how to improve the quality of content generation in the futures field in the related art.
[0005] In a first aspect, an embodiment of the present application provides a method for generating futures content based on a large language model, the method comprising: Obtaining basic data for futures content generation, wherein the basic data includes futures index data and futures event information data, and the futures index data also includes real-time market data and macro-industry chain supply and demand data; Performing a first preprocessing on the real-time market data, performing a second preprocessing on the macro-industry chain supply and demand data, and performing a third preprocessing on the futures event information data, thereby obtaining basic indicator data for futures content generation; Based on the user statement, the basic indicator data is retrieved to obtain the target indicator data corresponding to the user statement; The target indicator data is processed by a large language model using CoT prompt words based on the thinking chain CoT to generate futures content corresponding to the user sentence.
[0006] In some embodiments, performing a first preprocessing on the real-time market data includes: The real-time market data is normalized to obtain market index data for futures content generation, wherein the normalization includes Z-score normalization and MinMaxScaler normalization, and the market index data is structured data.
[0007] In some embodiments, performing a second preprocessing on the macro-industry chain supply and demand data includes: The tuple information in the macro-industry chain supply and demand data is identified and extracted to standardize the original indicators and obtain the industrial chain indicator data for futures content generation, wherein the industrial chain indicator data is structured data.
[0008] In some embodiments, performing a third preprocessing on the futures event information data includes: Identify and segment the long text paragraphs of the futures event information data according to the text topics to obtain a number of short text paragraphs; Perform summary analysis on the short text paragraphs respectively to obtain event labels corresponding to the short text paragraphs; Based on the short text paragraphs and the corresponding event tags, information indicator data for futures content generation is obtained, wherein the information indicator data is unstructured data.
[0009] In some embodiments, based on the user statement, by searching the basic indicator data, obtaining the target indicator data corresponding to the user statement includes: Acquire a user sentence input by a user, perform intent recognition on the user sentence, and obtain the basic writing intent of the user; Based on the basic writing intention of the user, the market indicator data and the industrial chain indicator data of the structured data are retrieved through SQL query statements to obtain the target indicator data corresponding to the basic writing intention; Based on the user's basic writing intention, the information indicator data of the unstructured data is searched through the ES keyword inverted index and Faiss vectorized search tool to obtain the target indicator data corresponding to the basic writing intention.
[0010] In some embodiments, obtaining a user sentence input by a user, performing intent recognition on the user sentence, and obtaining the basic writing intent of the user includes: Get the user statement entered by the user; Based on the first preset prompt word, the user sentence is completed and rewritten by a large language model to obtain a user sentence with complete semantic elements; Through keyword matching and UIE model, the intention of the user's sentence with complete semantic elements is identified to obtain the basic writing intention of the user.
[0011] In some embodiments, the target indicator data is processed by a large language model using CoT prompt words based on the thought chain CoT to generate futures content corresponding to the user sentence, including: Based on the second preset prompt word, the user sentence input by the user is recognized by the large language model to obtain the user's deep writing intention, wherein the deep writing intention includes writing focus, writing word limit, writing graphical description and writing disclaimer; Based on the user's deep writing intention, CoT prompt words are constructed through entity relationship analysis and thought chain ERA-CoT; Based on the CoT prompt words, the target indicator data is processed through a large language model to generate futures content corresponding to the user sentence.
[0012] In some embodiments, generating futures content corresponding to the user statement further includes: Different functional definitions are made for the large language model to obtain a writing generator and a writing verifier based on the large language model; The writing generator generates futures content corresponding to the user sentence according to the user sentence input by the user and the feedback information of the writing verifier; The writing verifier checks the futures content generated by the writing generator to generate feedback information to assist in the generation of the futures content.
[0013] In some embodiments, after obtaining basic data for futures content generation, the method includes: The basic data is initially preprocessed, wherein the initial preprocessing includes data cleaning, outlier removal and missing value completion.
[0014] In a second aspect, an embodiment of the present application provides a futures content generation system based on a large language model, the system is used to execute the method described in the first aspect above, the system includes a data acquisition module, a data preprocessing module, a data retrieval module and a content generation module; The data acquisition module is used to acquire basic data for futures content generation, wherein the basic data includes futures index data and futures event information data, and the futures index data also includes real-time market data and macro-industry chain supply and demand data; The data preprocessing module is used to perform a first preprocessing on the real-time market data, a second preprocessing on the macro-industry chain supply and demand data, and a third preprocessing on the futures event information data, thereby obtaining basic indicator data for futures content generation; The data retrieval module is used to retrieve the basic indicator data according to the user statement to obtain the target indicator data corresponding to the user statement; The content generation module is used to use the CoT prompt words based on the thinking chain CoT to process the target indicator data through a large language model to generate futures content corresponding to the user sentence.
[0015] Compared with the related art, the embodiment of the present application provides a method and system for generating futures content based on a large language model, wherein the method obtains basic data for generating futures content, wherein the basic data includes futures index data and futures event information data, and the futures index data also includes real-time market data and macro-industry chain supply and demand data; performs a first preprocessing on the real-time market data, performs a second preprocessing on the macro-industry chain supply and demand data, and performs a third preprocessing on the futures event information data, thereby obtaining basic index data for generating futures content; based on user sentences, retrieves the basic index data to obtain target index data corresponding to the user sentence; uses the CoT prompt words based on the thinking chain CoT to process the target index data through the large language model to generate futures content corresponding to the user sentence, thereby realizing classification processing of different futures basic data to improve data quality, and on the basis of improving data quality, embeds the large language model technology into the generation of futures content, uses the thinking chain CoT prompt words to guide the large language model to convert high-quality futures basic data into futures content that meets the requirements of user sentences, and solves the problem of how to improve the quality of content generation in the futures field. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1 is a flowchart of the steps of a method for generating futures content based on a large language model according to an embodiment of the present application; Figure 2 It is a structural block diagram of a futures content generation system based on a large language model according to an embodiment of the present application; Figure 3 It is a schematic diagram of the internal structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0018] Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, the present application can also be applied to other similar scenarios based on these drawings without creative work. In addition, it can also be understood that although the efforts made in this development process may be complicated and lengthy, for ordinary technicians in this field related to the content disclosed in this application, some changes in design, manufacturing or production based on the technical content disclosed in this application are just conventional technical means, and should not be understood as insufficient content disclosed in this application.
[0019] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0020] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantity limitation, and may indicate the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects before and after are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0021] The present application embodiment provides a method for generating futures content based on a large language model. Figure 1 is a flowchart of the steps of the method for generating futures content based on a large language model according to an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps: Step S102, obtaining basic data for futures content generation, wherein the basic data includes futures index data and futures event information data, and the futures index data also includes real-time market data and macro-industry chain supply and demand data; It should be noted that: ① real-time market data is mainly based on the latest price, highest price, lowest price, closing price, opening price, position, transaction volume and other related data of futures and spot related contracts, and various technical pattern indicator data are obtained by derivative calculation on this basis; ② the macro industrial chain supply and demand data mainly reflects the industrial chain data such as production, import volume, export volume, demand volume, inventory, etc. of futures and spot in various countries and regions, and also includes macro-level data such as freight, tax rate, GDP, PMI, etc. The amount of such data is huge and the text expression varies greatly.
[0022] Step S104, performing a first preprocessing on the real-time market data, performing a second preprocessing on the macro-industry chain supply and demand data, and performing a third preprocessing on the futures event information data, thereby obtaining basic indicator data for futures content generation; Before step S104, the method includes step S103, performing initial preprocessing on the basic data, wherein the initial preprocessing includes data cleaning, outlier removal and missing value filling. In other words, before executing the data preparation processing of step S104, it is necessary to first perform data cleaning, outlier removal and duplicate records, missing value filling, format conversion, etc. on the original basic data.
[0023] Step S104 specifically includes the following steps: Step S1041, normalize the real-time market data to obtain market index data for futures content generation, wherein the normalization includes Z-score normalization and MinMaxScaler normalization, and the market index data is structured data.
[0024] It should be noted that since real-time market data is structured data, when standardizing real-time market data, Z-score or MinMaxScaler is mainly used for normalization processing to scale the value range to a specified interval (such as [0,1] or [-1,1] or [-10,10]).
[0025] Optionally, after the normalization process is completed, derivative calculations of characteristic indicators of futures market conditions (such as moving average MA, relative strength index RSI, Bollinger Bands, MACD) can also be performed based on real-time market data to measure the price of real-time futures market conditions, as well as the speed and amplitude of changes, quantity, price and other indicator information. Preferably, the derivative calculation uses Python's TA-Lib library, which provides a large number of technical indicator calculation functions, thereby providing comprehensive market indicator data for futures content generation and solving the problem of timeliness of content generation.
[0026] Step S1042, identifying and extracting tuple information in the macro-industry chain supply and demand data to standardize the original indicators and obtain industrial chain indicator data for futures content generation, wherein the industrial chain indicator data is structured data.
[0027] It should be noted that since the supply and demand data of the macro-industry chain is structured data, and the supply and demand data of the macro-industry chain is much larger than the real-time market data in terms of the scale of indicators, the disclosure or acquisition channels of the supply and demand data of the macro-industry chain are diverse, and the indicators involved have no unified standardized standards in the form of expression, such as "cotton storage daily trading volume", "ICE cotton No. 2 non-commercial short positions" and other indicators, the expression forms vary greatly. Therefore, in the processing of the supply and demand data of the macro-industry chain in step S1042, it is preferred to use a large language model to identify the tuple information (variety / spot, contract, country / region / city, institution, cycle, unit, etc.) in the original indicators, so as to standardize the original indicators.
[0028] Optionally, after completing the unified standardization of the original indicators, derivative indicators can also be derived based on the macro-industry chain supply and demand data (such as original indicators such as output, inventory, price, profit, etc., to calculate derivative indicators such as historical highs, historical lows, and highs in the last N months), and these derivative indicator data can be stored continuously like the above market indicator data, and updated daily using stream batch processing.
[0029] Step S1043, identifying and segmenting the long text paragraphs of the futures event information data according to the text themes to obtain a number of short text paragraphs; performing summary analysis on the short text paragraphs respectively to obtain event tags corresponding to each short text paragraph; based on the short text paragraphs and the corresponding event tags, obtaining information indicator data for futures content generation, wherein the information indicator data is unstructured data.
[0030] It should be noted that since futures event information data is unstructured data, it is necessary to collect futures event information data from data sources such as historical transactions, news information, policy changes, industry reports, etc., that is, first use web crawler technology to capture data from financial news websites, exchange announcements, social media and other platforms, and then perform unified text conversion on the collected information data, clean and format the text information to obtain pure text content.
[0031] Preferably, in step S1043, a BiLSTM-TWAM+CRF model is used to segment long text paragraphs according to topics. Among them, TWAM (Two Way Attention Module) is a two-way attention module, which describes text features from both local and global perspectives to achieve in-depth understanding of the text, and uses the attention mechanism to allow the model to pay attention to relevant vocabulary information when processing each character, thereby improving the model's accurate grasp of the relationship between topic paragraphs, thereby achieving accurate topic division and recognition.
[0032] Preferably, in step S1043, the UIE (Universal Information Extraction) model is used to perform summary analysis on the several short text paragraphs obtained by segmentation. First, the UIE model is used to parse the short text paragraphs to identify the key information of futures events (such as futures varieties, commodities, time, location, department / institution, event); secondly, the short text paragraphs are summarized and analyzed based on the event information to obtain event labels; Preferably, in step S1043, the Bert model and clustering algorithm are used to obtain information indicator data for futures content generation. First, the short text paragraphs are spliced with the corresponding event tags, the spliced text is vectorized using the Bert model, and the vectorized text is clustered based on the cosine similarity algorithm to obtain information indicator data for indicators such as event popularity, event impact, and event novelty. This provides more detailed basic information for content generation.
[0033] Step S106, based on the user statement, the basic indicator data is searched to obtain the target indicator data corresponding to the user statement; Step S106 specifically includes the following steps: Step S1061, obtaining a user sentence input by the user, performing intent recognition on the user sentence, and obtaining the user's basic writing intent; Specifically, step S1061 obtains a user sentence input by the user; based on the first preset prompt word, the user sentence is completed and rewritten through the large language model to obtain a user sentence with complete semantic elements; through keyword matching and UIE model, the user sentence with complete semantic elements is identified with intent to obtain the user's basic writing intention.
[0034] It should be noted that the user sentence input by the user mainly includes the main information such as the product, sector or event that the user needs to write, and also includes the indicator data to be found, the graphical style display requirements, the writing focus, the number of words, and other demand information, and involves some contextual dialogue information. Therefore, in step S1061, firstly, it is necessary to use the first preset prompt word of the specification (including the specification task role description, basic futures knowledge and recognition output examples) to let the large language model (preferably the fine-tuned ChatGLM4 model) complete and rewrite the user sentence to generate a user sentence with complete semantic elements; secondly, use keyword matching and UIE model to identify the intention of the user sentence with complete semantic elements to obtain the user's basic writing intention, which specifically includes futures varieties (gold, crude oil, soybeans, etc.), entities (companies, individuals, organizations, countries, etc.), time (date, time point, time period, etc.), transactions (price, trading volume, open interest, price fluctuation, output, import volume, inventory, rate, etc.), events, etc., which are mainly used to retrieve the target indicator data corresponding to the basic writing intention in the subsequent steps S1062 and S1063. Keyword matching can ensure the accuracy of recognition results, while the UIE model can ensure the recall rate.
[0035] Step S1062, based on the user's basic writing intention, the market index data and the industrial chain index data which are structured data are searched through SQL query statements to obtain target index data corresponding to the basic writing intention; It should be noted that since the market index data and industrial chain index data are structured data, structured SQL queries are mainly performed based on the identified basic writing intentions of users. In addition, in addition to the indicators clearly mentioned in the basic writing intentions, the latest abnormal indicator data of the varieties / sectors will also be output (such as abnormal indicator data such as new highs and new lows in N days), so as to provide detailed target indicator data for the generation of subsequent futures content.
[0036] Step S1063, based on the user's basic writing intention, the information index data which is unstructured data is searched through the ES keyword inverted index and the Faiss vectorized search tool to obtain the target index data corresponding to the basic writing intention.
[0037] It should be noted that since the information indicator data is structured data, the ES keyword inverted index and the Faiss vectorized search tool are used for retrieval. The two tools are first separately searched to obtain the TOP-N target indicator data corresponding to the basic writing intention, and then the results retrieved by ES and the results retrieved by Faiss are combined to obtain the final target indicator data, thereby improving the richness and completeness of subsequent futures content generation. In addition, for information indicator data other than TOP-N, the cosine similarity algorithm can be used to calculate the similarity between it and the basic writing intention, and those with a similarity score of 0.5 or above are added to the target indicator data.
[0038] Step S108, using the CoT prompt words based on the thinking chain CoT, the target indicator data is processed through the large language model to generate futures content corresponding to the user sentence.
[0039] Step S108 specifically includes the following steps: Step S1081, based on the second preset prompt word, the user sentence input by the user is recognized by the large language model to obtain the user's deep writing intention, wherein the deep writing intention includes writing focus, writing word limit, writing diagram description and writing disclaimer; It should be noted that the basic writing intention identified in the above step S106 is used to retrieve the target indicator data, while the deep writing intention identified in step S108 is used to construct the subsequent CoT prompt words, which include: writing focus - whether it is long-term analysis of market supply and demand, short-term technical operation analysis, or capital analysis or both; writing word limit - the overall length has a specific character limit, or a specific word limit is proposed for certain chapters; writing graphical description - whether the writing needs to display certain indicators graphically, etc.; writing disclaimer - that is, the AI generation description and disclaimer that need to be clarified for the content generation of financial futures. By constructing special prompt words, defining the role functions and input and output of the large language model, and using some system default writing parameters to supplement the writing requirements that the user does not explicitly mention (for example, the default number of words for generated content is more than 2,000, etc.), the conversion processing of the user's deep writing intention is improved.
[0040] Step S1082, based on the user's deep writing intention, construct CoT prompt words through entity relationship analysis and thought chain ERA-CoT; It should be noted that Chain-of-Thought Prompting (CoT) is a new prompt word method. Its main idea is to show a small number of examples to the large language model and explain the reasoning process in the examples, so that the large language model will also display the reasoning process when answering the prompt. This reasoning explanation process can make the LLM processing process more precise, thereby generating more accurate results.
[0041] It should be further explained that the Entity Relationship Analysis and Chain of Thought (ERA-CoT) aims to help large language models (preferably the ChatGLM4 model) understand the context by capturing the relationship between entities, thereby achieving planning reasoning for the overall writing content.
[0042] Step S1083, based on the CoT prompt words, the target indicator data is processed through a large language model to generate futures content corresponding to the user sentence.
[0043] It should be noted that in step S1083, first, entity extraction is performed on the input information, and all entities and their types are extracted from the text using the information extraction capability of LLM. For futures writing, the focus is mainly on input data entity recognition (mainly futures varieties, indicators, events, writing requirements, etc.) through the attention mechanism of Transformer. Then, the explicit entity relationship in the input data is extracted, and the relationship between entity pairs is directly extracted from the text through the context understanding capability of LLM, and the explicit relationship between the basic data and the user's writing needs is detected and discovered. The corresponding relationship between the writing-related indicators or the indicators that need to be graphically represented and the basic data indicators is determined, and the internal relationship triples are generated. Secondly, mainly based on the entities and entity relationships that have been analyzed by the machine, by analyzing the implicit context information in the input text, the entity relationships that are not explicitly mentioned but may exist are inferred, so as to discover the deep correspondence between the basic data and content generation, such as discovering the relationship between events and indicators in the information, and the relationship between events and medium- and long-term analysis views. This step can deeply discover the relationship between the data and provide a detailed foundation for the subsequent planning of writing. Thirdly, the reliability of the extracted implicit relationships is scored using the LLM model, and a threshold is set to filter out implicit relationships below the threshold. After these steps, high-quality corresponding relationships between indicators and data, events and indicators, writing focus and data indicators, etc. are obtained.
[0044] Through the above steps in the embodiment of the present application, different basic futures data are classified and processed to improve data quality. On the basis of improving data quality, the big language model technology is embedded in the generation of futures content. The thinking chain CoT prompt words are used to guide the big language model to convert high-quality basic futures data into futures content that meets the user's sentence requirements, thereby solving the problem of how to improve the quality of content generation in the futures field.
[0045] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0046] In some embodiments, for generating futures content corresponding to the user sentence in step S108, the method for generating futures content based on the large language model further includes: Different functional definitions are made for the large language model to obtain a writing generator and a writing verifier based on the large language model; The writing generator generates the futures content corresponding to the user sentence according to the user sentence input by the user and the feedback information of the writing verifier; The writing verifier proofreads the futures content generated by the writing generator to generate feedback information to assist in the generation of the futures content.
[0047] It should be noted that the embodiment of the present application adopts Agent technology to realize the generation of specific futures content. Agent technology (based on AutoGen multi-agent technology open source architecture) can fully tap the generation and understanding capabilities of the LLM large model, and can achieve high-quality large model output based on relatively poor LLM large models. And it provides a variety of graphical components such as list charts, line charts, pie charts, bar charts, and screenshots, which are registered as tools in the Agent agent, so as to meet user needs and realize rich graphical presentation.
[0048] It should be further explained that the embodiment of the present application specifically adopts the "generate-verify" mode for writing specific chapters. The so-called "generate-verify" mode mainly defines the Agent agent robot of the two roles of the LLM large model through the prompt word technology, namely: the writing generator - mainly responsible for generating the futures content corresponding to the user sentence according to the user sentence input by the user and the feedback information of the writing verifier, and can also focus on enriching and improving the futures content generated in the above step S108; the writing verifier - proofreads the futures content generated by the writing generator, or the chapter content after the enriched writing of the content generated in step S108, determines which content has errors and which content does not meet the requirements, and returns feedback information to assist in the generation of futures content.
[0049] In addition, since the two agents "Generate-Verify" can only enrich and improve a specific chapter, the enrichment of writing between multiple chapters requires the introduction of a "task manager" to take overall control. The task manager is also a large language model function role defined by the prompt word project. It mainly divides the overall framework into chapters and paragraphs, and then the enrichment of writing for each chapter is specifically implemented and improved by the two agents "Generate-Verify" until the writing of the last chapter is completed.
[0050] The present application embodiment provides a futures content generation system based on a large language model. Figure 2 is a structural block diagram of a futures content generation system based on a large language model according to an embodiment of the present application, such as Figure 2 As shown, the system includes a data acquisition module, a data preprocessing module, a data retrieval module and a content generation module; The data acquisition module is used to acquire basic data for futures content generation, wherein the basic data includes futures index data and futures event information data, and the futures index data also includes real-time market data and macro-industry chain supply and demand data; The data preprocessing module is used to perform a first preprocessing on real-time market data, a second preprocessing on macro-industry chain supply and demand data, and a third preprocessing on futures event information data, thereby obtaining basic indicator data for futures content generation; A data retrieval module is used to retrieve the basic indicator data according to the user statement to obtain the target indicator data corresponding to the user statement; The content generation module is used to use the CoT prompt words based on the thinking chain CoT to process the target indicator data through the large language model to generate futures content corresponding to the user sentence.
[0051] Through the data acquisition module, data preprocessing module, data retrieval module and content generation module in the embodiments of the present application, classification processing of different futures basic data is achieved to improve data quality. On the basis of improving data quality, the large language model technology is embedded in the generation of futures content. The thinking chain CoT prompt words are used to guide the large language model to convert high-quality futures basic data into futures content that meets the user's sentence requirements, thereby solving the problem of how to improve the quality of content generation in the futures field.
[0052] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0053] This embodiment further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0054] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0055] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0056] In addition, in combination with the method for generating futures content based on a large language model in the above embodiments, the present application embodiment may provide a storage medium for implementation. The storage medium stores a computer program; when the computer program is executed by a processor, any one of the methods for generating futures content based on a large language model in the above embodiments is implemented.
[0057] In one embodiment, a computer device is provided, which may be a terminal. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for generating futures content based on a large language model is implemented. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a key, trackball, or touchpad provided on the housing of the computer device, or an external keyboard, touchpad, or mouse, etc.
[0058] In one embodiment, Figure 3 is a schematic diagram of the internal structure of an electronic device according to an embodiment of the present application, such as Figure 3 As shown, an electronic device is provided, which may be a server, and its internal structure diagram may be as shown in Figure 3 As shown. The electronic device includes a processor, a network interface, an internal memory and a non-volatile memory connected through an internal bus, wherein the non-volatile memory stores an operating system, a computer program and a database. The processor is used to provide computing and control capabilities, the network interface is used to communicate with an external terminal through a network connection, the internal memory is used to provide an environment for the operation of the operating system and the computer program, the computer program is executed by the processor to implement a futures content generation method based on a large language model, and the database is used to store data.
[0059] Those skilled in the art will understand that Figure 3 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0060] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0061] Those skilled in the art should understand that the technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0062] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for generating futures content based on a large language model, characterized in that: The method comprises: Obtaining basic data for futures content generation, wherein the basic data includes futures index data and futures event information data, and the futures index data also includes real-time market data and macro-industry chain supply and demand data; Performing a first preprocessing on the real-time market data, performing a second preprocessing on the macro-industry chain supply and demand data, and performing a third preprocessing on the futures event information data, thereby obtaining basic indicator data for futures content generation; Based on the user statement, the basic indicator data is retrieved to obtain the target indicator data corresponding to the user statement; The target indicator data is processed by a large language model using CoT prompt words based on the thinking chain CoT to generate futures content corresponding to the user sentence.
2. The method according to claim 1, characterized in that The first preprocessing of the real-time market data includes: The real-time market data is normalized to obtain market index data for futures content generation, wherein the normalization includes Z-score normalization and MinMaxScaler normalization, and the market index data is structured data.
3. The method according to claim 2, characterized in that The second preprocessing of the macro industrial chain supply and demand data includes: The tuple information in the macro-industry chain supply and demand data is identified and extracted to standardize the original indicators and obtain the industrial chain indicator data for futures content generation, wherein the industrial chain indicator data is structured data.
4. The method according to claim 3, characterized in that: The third preprocessing of the futures event information data includes: Identify and segment the long text paragraphs of the futures event information data according to the text topics to obtain a number of short text paragraphs; Perform summary analysis on the short text paragraphs respectively to obtain event labels corresponding to the short text paragraphs; Based on the short text paragraphs and the corresponding event tags, information indicator data for futures content generation is obtained, wherein the information indicator data is unstructured data.
5. The method according to claim 4, characterized in that Based on the user statement, by searching the basic indicator data, the target indicator data corresponding to the user statement is obtained, including: Acquire a user sentence input by a user, perform intent recognition on the user sentence, and obtain the basic writing intent of the user; Based on the basic writing intention of the user, the market indicator data and the industrial chain indicator data of the structured data are retrieved through SQL query statements to obtain the target indicator data corresponding to the basic writing intention; Based on the user's basic writing intention, the information indicator data of the unstructured data is searched through the ES keyword inverted index and Faiss vectorized search tool to obtain the target indicator data corresponding to the basic writing intention.
6. The method according to claim 5, characterized in that Obtaining a user sentence input by a user, performing intent recognition on the user sentence, and obtaining the user's basic writing intent includes: Get the user sentence input by the user; Based on the first preset prompt word, the user sentence is completed and rewritten by a large language model to obtain a user sentence with complete semantic elements; Through keyword matching and UIE model, the intention of the user's sentence with complete semantic elements is identified to obtain the basic writing intention of the user.
7. The method according to claim 1, characterized in that Using the CoT prompt words based on the thinking chain CoT, the target indicator data is processed through a large language model to generate the futures content corresponding to the user sentence, including: Based on the second preset prompt word, the user sentence input by the user is recognized by the large language model to obtain the user's deep writing intention, wherein the deep writing intention includes writing focus, writing word limit, writing graphical description and writing disclaimer; Based on the user's deep writing intention, CoT prompt words are constructed through entity relationship analysis and thought chain ERA-CoT; Based on the CoT prompt words, the target indicator data is processed through a large language model to generate futures content corresponding to the user sentence.
8. The method according to claim 1, characterized in that The futures content corresponding to the user statement is also generated: Different functional definitions are made for the large language model to obtain a writing generator and a writing verifier based on the large language model; The writing generator generates futures content corresponding to the user sentence according to the user sentence input by the user and the feedback information of the writing verifier; The writing verifier checks the futures content generated by the writing generator to generate feedback information to assist in the generation of the futures content.
9. The method according to claim 1, characterized in that: After obtaining basic data for futures content generation, the method includes: The basic data is initially preprocessed, wherein the initial preprocessing includes data cleaning, outlier removal and missing value completion.
10. A futures content generation system based on a large language model, characterized in that: The system is used to execute the method described in any one of claims 1 to 9, and the system includes a data acquisition module, a data preprocessing module, a data retrieval module and a content generation module; The data acquisition module is used to acquire basic data for futures content generation, wherein the basic data includes futures index data and futures event information data, and the futures index data also includes real-time market data and macro-industry chain supply and demand data; The data preprocessing module is used to perform a first preprocessing on the real-time market data, a second preprocessing on the macro-industry chain supply and demand data, and a third preprocessing on the futures event information data, thereby obtaining basic indicator data for futures content generation; The data retrieval module is used to retrieve the basic indicator data according to the user statement to obtain the target indicator data corresponding to the user statement; The content generation module is used to use the CoT prompt words based on the thinking chain CoT to process the target indicator data through a large language model to generate futures content corresponding to the user sentence.
Citation Information
Patent Citations
Method and system for processing investment and research report in futures field
CN115358201A
Knowledge graph automatic construction query method and system based on large language model
CN117273136A
Generative automatic question answering method and system in futures field
CN117573851A
AI service system and device based on large language model
CN118260458A
Human movement behavior generation method and system based on large language model
CN118673102A
Cited By
Data processing method and device, electronic equipment, storage medium and program product
CN120492507A
Futures content generation method and system based on large language model
CN122390782A
A futures content generation method and system based on a large language model
CN122390782B
