A futures content generation method and system based on a large language model
By preprocessing futures indicator data and event information data and applying large language models, and utilizing Thinking Chain CoT prompt words, the problem of insufficient content generation quality in the financial futures field was solved, and high-quality futures content generation was achieved.
Patent Information
- Application Number
- CN202411765035.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2044-12-04
AI Technical Summary
The existing technology in the field of financial futures has insufficient content generation quality. There are problems such as content illusion, unclear structure, lack of emphasis, insufficient length, rigid text expression and repetitive nonsense, making it difficult to achieve effective content generation.
By obtaining futures indicator data and event information data for preprocessing, and using large language models and thinking chain CoT prompt words, futures content that meets user needs is generated.
Improve the quality and accuracy of futures content generation, meet users' writing intentions and needs, and generate high-quality futures content.
Smart Images

Figure CN119248909B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of content generation, in particular to a futures content generation method and system based on a large language model. BACKGROUND
[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 lies in simulating human creativity and expression ability to generate content with certain quality and relevance in an automated manner. With the rapid development of large language models, traditional content generation has been greatly improved, but it still faces problems such as content hallucination, unclear content context structure, unemphasized key content, insufficient length, rigid text expression, and repetition. In the financial futures field, which is strictly regulated and lacks data, the existing content generation solutions still have a long way to go before they can be truly implemented.
[0003] Currently, there is no effective solution to the problem of improving content generation quality in the futures field in related technologies. SUMMARY
[0004] The embodiments of the present application provide a futures content generation method and system based on a large language model to at least solve the problem of how to improve the content generation quality in the futures field in related technologies.
[0005] In a first aspect, the embodiments of the present application provide a futures content generation method based on a large language model, which includes:
[0006] 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 further includes real-time market data and macro-industrial chain supply and demand data;
[0007] Firstly, the real-time market data is pre-processed, the macro-industrial chain supply and demand data is secondly pre-processed, and the futures event information data is thirdly pre-processed, thereby obtaining basic index data for futures content generation;
[0008] Based on a user statement, target index data corresponding to the user statement is obtained by searching the basic index data;
[0009] Using CoT prompt words based on a CoT, the target index data is processed by a large language model to generate futures content corresponding to the user statement.
[0010] In some embodiments, the first pre-processing of the real-time market data includes:
[0011] 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.
[0012] In some embodiments, the second preprocessing of the macro-industrial chain supply and demand data includes:
[0013] Tuple information in the macro-industrial chain supply and demand data is recognized and extracted to unify and standardize the original indicators, thereby obtaining industrial chain index data for futures content generation, wherein the industrial chain index data is structured data.
[0014] In some embodiments, the third preprocessing of the futures event information data includes:
[0015] The long text paragraphs of the futures event information data are identified and divided according to text topics to obtain a plurality of short text paragraphs.
[0016] The short text paragraphs are respectively subjected to summary analysis to obtain event labels corresponding to each short text paragraph.
[0017] Based on the short text paragraphs and the corresponding event labels, information index data for futures content generation is obtained, wherein the information index data is unstructured data.
[0018] In some embodiments, based on a user statement, target index data corresponding to the user statement is obtained by retrieving the basic index data, including:
[0019] A user statement input by a user is obtained, and the user statement is subjected to intent recognition to obtain a basic writing intent of the user.
[0020] Based on the basic writing intent of the user, the market index data and the industrial chain index data as structured data are retrieved by a SQL query statement to obtain target index data corresponding to the basic writing intent.
[0021] Based on the basic writing intent of the user, the information index data as unstructured data is retrieved by an ES keyword inverted index and a Faiss vectorization retrieval tool to obtain target index data corresponding to the basic writing intent.
[0022] In some embodiments, a user statement input by a user is obtained, and the user statement is subjected to intent recognition to obtain a basic writing intent of the user, including:
[0023] A user statement input by a user is obtained.
[0024] Based on the first preset prompt word, the user sentence is rewritten by a large language model to obtain a user sentence with complete semantic elements;
[0025] Through keyword matching and a UIE model, the user sentence with complete semantic elements is subjected to intent recognition to obtain the user's basic writing intent.
[0026] In some embodiments, the target indicator data is processed by a large language model to generate the future content corresponding to the user sentence, using a CoT prompt word based on a CoT.
[0027] Based on a second preset prompt word, the user sentence input by the user is subjected to intent recognition by a large language model to obtain the user's deep writing intent, wherein the deep writing intent includes writing emphasis, writing word limit, writing charting instruction, and writing disclaimer;
[0028] Based on the user's deep writing intent, a CoT prompt word is constructed through entity relationship analysis and ERA-CoT.
[0029] Based on the CoT prompt word, the target indicator data is processed by a large language model to generate the future content corresponding to the user sentence.
[0030] In some embodiments, generating the future content corresponding to the user sentence further includes:
[0031] Different functional definitions are respectively made to a large language model to obtain a writing generator and a writing verifier based on the large language model;
[0032] The writing generator generates the future content corresponding to the user sentence according to the user input user sentence and the feedback information of the writing verifier;
[0033] The writing verifier proofreads and checks the future content generated by the writing generator to generate feedback information for assisting future content generation.
[0034] In some embodiments, after obtaining the basic data for future content generation, the method includes:
[0035] The basic data is subjected to initial preprocessing, wherein the initial preprocessing includes data cleaning, outlier removal, and missing value completion.
[0036] In a second aspect, the embodiments of the present application provide a futures content generation system based on a large language model, which is used to execute the method of the first aspect, and includes a data acquisition module, a data preprocessing module, a data retrieval module, and a content generation module.
[0037] The data acquisition module is configured 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 further includes real-time market data and macro-industrial chain supply and demand data.
[0038] The data preprocessing module is configured to perform first preprocessing on the real-time market data, second preprocessing on the macro-industrial chain supply and demand data, and third preprocessing on the futures event information data, thereby obtaining basic index data for futures content generation.
[0039] The data retrieval module is configured to retrieve the basic index data according to a user statement, and obtain target index data corresponding to the user statement.
[0040] The content generation module is configured to use a CoT prompt word based on a CoT, and process the target index data by using a large language model, to generate futures content corresponding to the user statement.
[0041] Compared with the related art, the futures content generation method and system based on a large language model provided by the embodiments of the present application, wherein the method acquires basic data for futures content generation, wherein the basic data includes futures index data and futures event information data, and the futures index data further includes real-time market data and macro-industrial chain supply and demand data; performs first preprocessing on the real-time market data, second preprocessing on the macro-industrial chain supply and demand data, and third preprocessing on the futures event information data, thereby obtaining basic index data for futures content generation; retrieves the basic index data based on a user statement, and obtains target index data corresponding to the user statement; uses a CoT prompt word based on a CoT, and processes the target index data by using a large language model, to generate futures content corresponding to the user statement, which realizes classified 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 CoT prompt word based on the CoT to guide the large language model to convert high-quality futures basic data into futures content meeting the requirements of the user statement, and solves the problem of how to improve the content generation quality in the futures field. BRIEF DESCRIPTION OF DRAWINGS
[0042] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the present application and together with the description serve to explain the present application. In the drawings:
[0043] Figure 1 is a step flow chart of a futures content generation method based on a large language model according to an embodiment of the present application;
[0044] 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;
[0045] Figure 3 is a schematic diagram of the internal structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0046] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application is described and explained below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of the present application.
[0047] Obviously, the drawings in the following description are only some examples or embodiments of the present application, and for those of ordinary skill in the art, the present application can be applied to other similar scenarios without creative labor on the basis of these drawings. In addition, it can be understood that although the efforts made in this development process can be complex and lengthy, for those of ordinary skill in the art related to the content disclosed in the present application, some design, manufacture or production changes based on the technical content disclosed in the present application are only routine technical means and should not be understood as insufficient disclosure of the present application.
[0048] In the present application, "embodiment" means that the specific features, structures or characteristics described in combination with the embodiment can be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily mean the same embodiment, nor is it an independent or alternative embodiment to other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in the present application can be combined with other embodiments without conflict.
[0049] Unless otherwise defined, technical terms and scientific terms used in the present application shall have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terms "a", "an", "one", "this", and similar referents in the context of describing the application are to be construed to be open-ended, referring to one or more than one, unless otherwise noted. The terms "comprising", "comprises", "including", "includes" and "containing", "contains" shall be construed as containing the stated steps, modules (units) or elements but not excluding others. The terms "connected", "coupled", and "coupling" are not restricted to direct or physical connections, but can include indirect and wireless connections. The term "plurality" means two or more. The term "and / or" describes associated objects in association relationships, which means that there can be three relationships, for example, "A and / or B" can mean that A exists alone, A and B exist together, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects. The terms "first", "second", "third", and the like are only to distinguish similar objects, and do not represent a specific order of the objects.
[0050] The embodiment of the present application provides a futures content generation method based on a large language model, Figure 1 The embodiment of the present application provides a futures content generation method based on a large language model, Figure 1 The embodiment of the present application provides a futures content generation method based on a large language model,
[0051] In step S102, the basic data for generating futures content is obtained, wherein the basic data includes futures index data and futures event information data, and the futures index data further includes real-time market data and macro-industrial chain supply and demand data.
[0052] It should be noted that: ① The real-time market data is mainly based on the latest price, highest price, lowest price, closing price, opening price, position volume, transaction amount and other related data of futures and spot related varieties contracts, and various technical pattern index data obtained by derivative calculation based on the above data; ② The macro-industrial chain supply and demand data mainly reflects the industrial chain data such as production, import volume, export volume, demand, inventory of futures and spot of various countries and regions, and also includes freight, tax rate, GDP, PMI and other macro-level data. Such data has a huge amount and a huge difference in text expression.
[0053] Step S104, first preprocessing is performed on the real-time market data, second preprocessing is performed on the macro-industrial chain supply and demand data, and third preprocessing is performed on the futures event information data, and then the basic index data for futures content generation is obtained.
[0054] Before step S104, the method includes step S103 of performing initial preprocessing on the basic data, wherein the initial preprocessing includes data cleaning, abnormal value elimination, and missing value completion. In other words, before performing the data preparation processing of step S104, the original basic data needs to be cleaned, the abnormal values and duplicate records are eliminated, the missing values are completed, the format is converted, and the like.
[0055] Step S104 specifically includes the following steps:
[0056] Step S1041, normalization processing is performed on the real-time market data to obtain market data indicators for futures content generation, wherein the normalization includes Z-score normalization and MinMaxScaler normalization, and the market data indicators are structured data.
[0057] It should be noted that, since the real-time market data is structured data, when performing normalization on the real-time market data, Z-score or MinMaxScaler is mainly used for normalization processing to scale the numerical range to a specified interval (such as [0, 1] or [-1, 1] or [-10, 10]).
[0058] Optionally, after completing the normalization processing, the derivation calculation of the feature indicators of the futures market (such as the moving average line MA, the relative strength index RSI, the Bollinger band, and the MACD) can also be performed based on the real-time market data, which is used to measure the price level of the futures real-time market, as well as the speed and amplitude of the change, and the quantity and price indicators. Preferably, the derivation calculation uses the TA-Lib library of Python, which provides a large number of technical indicator calculation functions, thereby providing comprehensive market data indicators for futures content generation, and solving the timeliness problem of content generation.
[0059] Step S1042, tuple information in the macro-industrial chain supply and demand data is recognized and extracted to perform uniform standardization of the original indicators, and industrial chain indicators for futures content generation are obtained, wherein the industrial chain indicators are structured data.
[0060] It should be noted that, since the macro industrial chain supply and demand data is structured data, and the macro industrial chain supply and demand data is far greater than the real-time market data in the scale of index quantity, the disclosure or acquisition channel of the macro industrial chain supply and demand data is various, and the indexes involved do not have a unified standardized standard in the form of expression, for example, "cotton storage daily transaction volume", "ICE cotton 2 non-commercial short position number" and the like. Therefore, in the processing of the macro industrial chain supply and demand data in step S1042, the original index tuple information (variety / futures, contract, country / region / city, institution, period, unit, etc.) in the large language model is preferably adopted to perform uniform standardization of the original index.
[0061] Optionally, after the uniform standardization of the original index is completed, the derived index (such as the historical high, historical low, and recent N months high derived index based on yield, inventory, price, and profit original indexes) can also be calculated based on the macro industrial chain supply and demand data, and these derived index data are stored in the same way as the above market index data, and are updated daily by using stream batch processing.
[0062] In step S1043, the long text paragraph of the futures event information data is identified and divided according to the text theme, to obtain a plurality of short text paragraphs; the short text paragraphs are respectively subjected to abstract analysis to obtain event labels corresponding to the short text paragraphs; based on the short text paragraphs and the corresponding event labels, information index data for futures content generation is obtained, wherein the information index data is unstructured data.
[0063] It should be noted that, since the futures event information data is unstructured data, the futures event information data needs to be collected from historical transaction, news information, policy changes, industry reports and the like data sources, that is, firstly, the network crawler technology is used to collect data from financial news websites, exchange announcements, social media platforms and the like, and then the collected information data is subjected to unified text conversion, text information cleaning and formatting, to obtain pure text content.
[0064] Preferably, in step S1043, the BiLSTM-TWAM+CRF model is adopted to divide the long text paragraph according to the theme. Wherein, TWAM (Two Way Attention Module) is a double-way attention module, which describes the text features from the local and global angles, realizes the in-depth understanding of the text, uses the attention mechanism to enable the model to pay attention to the relevant word information when processing each character, improves the accurate understanding of the theme paragraph relationship of the model, and thus realizes the accurate theme division and identification.
[0065] Preferably, in step S1043, the UIE (Universal Information Extraction) model is used to perform summary analysis on the segmented short text paragraphs. First, the UIE model is used to analyze the short text paragraphs to identify key information of futures events (such as futures varieties, commodities, time, place, department / agency, events); second, based on the event information, the summary analysis of the short text paragraphs is performed to obtain event labels;
[0066] Preferably, in step S1043, the Bert model and the clustering algorithm are used to obtain information-based index data for futures content generation. First, the short text paragraphs are spliced with the corresponding event labels, the spliced text is vectorized using the Bert model, and the vectorized text is clustered based on the cosine similarity algorithm to obtain information-based index data of indicators such as event heat, event impact, and event novelty. Thus, more detailed basic information is provided for content generation.
[0067] Step S106, based on the user statement, the target index data corresponding to the user statement is obtained by searching the basic index data;
[0068] Step S106 specifically includes the following steps:
[0069] Step S1061, obtaining the user statement input by the user, performing intent recognition on the user statement to obtain the user's basic writing intent;
[0070] Specifically, in step S1061, the user statement input by the user is obtained; based on the first preset prompt word, the user statement is rewritten by the large language model to obtain a user statement with complete semantic elements; the user statement with complete semantic elements is subjected to intent recognition through keyword matching and the UIE model to obtain the user's basic writing intent.
[0071] It should be noted that the user statement input by the user mainly includes subject information such as the variety, plate or event that the user needs to write, and also includes demand information such as the index data to be searched, the charting style display requirement, the writing emphasis, the writing word count and the like, and involves some context dialogue information. Therefore, in step S1061, first, the first preset prompt word of the specification (including the specification task role description, the futures basic knowledge and the identification output example) is used to let the large language model (preferably the ChatGLM4 model fine-tuned) complete and rewrite the user statement, and a user statement with complete semantic elements is generated; secondly, the keyword matching and the UIE model are used to perform intent recognition on the user statement with complete semantic elements, and a basic writing intent of the user is obtained, which specifically includes futures varieties (gold, crude oil, soybeans, etc.), entities (companies, individuals, organizations, countries, etc.), time (dates, time points, time periods, etc.), transactions (prices, trading volumes, positions, price fluctuations, production, import volumes, inventories, rates, etc.), events, and the like. These information is mainly used to retrieve target index data corresponding to the basic writing intent in subsequent steps S1062 and S1063. Keyword matching can ensure the accuracy of the recognition result, and the UIE model can ensure the recall rate.
[0072] In step S1062, based on the basic writing intent of the user, the SQL query statement is used to retrieve the market trend type index data and the industry chain type index data which are structured data, and obtain the target index data corresponding to the basic writing intent.
[0073] It should be noted that since the market trend type index data and the industry chain type index data are structured data, structured SQL queries are mainly performed according to the basic writing intent of the user. In addition, in addition to the index mentioned in the basic writing intent, the latest abnormal index data of the output variety / plate (such as the abnormal index data of creating N-day new high, new low, etc.) is also output, so as to provide detailed target index data for the generation of subsequent futures content.
[0074] In step S1063, based on the basic writing intent of the user, the ES keyword inverted index and the Faiss vectorization retrieval tool are used to retrieve the information type index data which is unstructured data, and obtain the target index data corresponding to the basic writing intent.
[0075] It should be noted that, since the information type index data is structured data, the ES keyword inverted index and the Faiss vectorization retrieval tool are combined for retrieval. The two are first individually retrieved to obtain the TOP-N target index data corresponding to the basic writing intention, and then the results of ES retrieval and the results of Faiss retrieval are taken as a union to obtain the final target index data, thereby improving the richness and integrity of the subsequent futures content generation. In addition, for the information type index data outside the TOP-N, a cosine similarity algorithm can be used to calculate the similarity between it and the basic writing intention, and the target index data with a similarity score of 0.5 or more is added.
[0076] Step S108, using the CoT prompt word based on the CoT, processing the target index data through the large language model to generate the futures content corresponding to the user sentence.
[0077] Step S108 specifically includes the following steps:
[0078] Step S1081, based on the second preset prompt word, performing intent recognition on the user sentence input by the user through the large language model to obtain the deep writing intention of the user, wherein the deep writing intention includes writing emphasis, writing word limit, writing charting instruction and writing disclaimer;
[0079] It should be noted that the basic writing intention identified in the above step S106 is used to retrieve the target index data, and the deep writing intention identified in step S108 is used to construct the CoT prompt word subsequently. The deep writing intention includes: writing emphasis, which is from market supply and demand long-term analysis, short-term technical operation analysis, or fund analysis, or a combination of the above; writing word limit, which is a specific character limit for the overall length, or a specific word limit for certain chapters; writing charting instruction, which is whether some indicators need to be displayed in charts; and writing disclaimer, which is the AI generation instruction and disclaimer for the financial futures content generation. By constructing a special prompt word, the role function and input and output of the large language model are defined, and some system default writing parameters are used to supplement the writing requirements explicitly mentioned by the user (such as generating content with more than 2000 words), thereby improving the conversion processing of the user's deep writing intention.
[0080] Step S1082, based on the deep writing intention of the user, constructing the CoT prompt word through entity relationship analysis and ERA-CoT;
[0081] It should be noted that the Chain-of-Thought Prompting (CoT) is a brand-new prompting method, the main idea of which is to show a small amount of examples to a large language model and explain the reasoning process in the examples, so that the large language model will also show the reasoning process when answering the prompts. This explanation process of reasoning can make the LLM processing more accurate, so as to generate more accurate results.
[0082] Further, the Chain-of-Thought through Entity Relationship Analysis (ERA-CoT) aims to help large language models (preferably ChatGLM4 models) understand the context by capturing the relationships between entities, so as to realize the planning and reasoning of the overall writing content.
[0083] In step S1083, based on the CoT prompt, the target indicator data is processed by the large language model to generate the futures content corresponding to the user sentence.
[0084] It should be noted that in step S1083, first, the input information is extracted, and the information extraction capability of the LLM is used to extract all entities and their types from the text. For futures writing, the attention mechanism of the Transformer is mainly used to focus on entity recognition (mainly futures varieties, indicators, events, writing requirements, etc.). Then, the explicit entity relationship in the input data is extracted, mainly through the context understanding ability of the LLM, the relationship between entity pairs is directly extracted from the text, and the explicit relationship between the basic data and the user writing demand entities is detected to determine the corresponding relationship between the writing associated indicators or indicators that need to be graphed and the basic data indicators, and generate internal relationship triples. Secondly, based on the entities and entity relationships analyzed by the machine, the context implicit information in the input text is analyzed to infer the entity relationships that are not explicitly mentioned but may exist, so as to find the deep corresponding relationship between the basic data and the content generation, such as the relationship between the event and the indicator in the information, and the relationship between the event and the medium and long-term analysis viewpoint. This step can deeply discover the relationship between data, and provide detailed basis for planning writing.
[0085] By the above steps in the embodiments of the present application, different futures basis data are classified and processed to improve data quality. On the basis of improving data quality, the large language model technology is embedded into the generation of futures content. The CoT prompt word is used to guide the large language model to convert high-quality futures basis data into futures content meeting the requirements of the user sentence, thereby solving the problem of how to improve the content generation quality in the futures field.
[0086] It should be noted that the steps shown in the above flow or the flowchart of 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 here.
[0087] In some embodiments, for the futures content corresponding to the user sentence generated in the above step S108, the futures content generation method based on the large language model further comprises:
[0088] The large language model is respectively defined with different functions to obtain a writing generator and a writing verifier based on the large language model.
[0089] 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.
[0090] The writing verifier proofreads and checks the futures content generated by the writing generator to generate feedback information for assisting the generation of futures content.
[0091] It should be noted that the present application adopts Agent agent technology to realize the generation of specific futures content. The Agent agent technology (based on the AutoGen multi-agent technology open source architecture) can fully exploit the generation understanding ability of the LLM large model, and can realize high-quality large model output based on a relatively poor LLM large model. In addition, a variety of chart components such as list chart, line chart, pie chart, column chart, and screenshot are provided as tools registered in the Agent agent, thereby meeting the user's needs to realize rich chart display.
[0092] It needs to be further explained that the embodiment of the application specifically adopts a "generation-checking" mode for specific chapter writing. The so-called "generation-checking" mode mainly defines two roles of the LLM large model Agent agent robot through the prompt word technology, which are: a writing generator, mainly responsible for generating futures content corresponding to the user sentence according to the user input and the feedback information of the writing checker, and can focus on enriching and perfecting the futures content generated in the above step S108; and a writing checker, which proofreads and corrects the futures content generated by the writing generator, or the chapter content after the enrichment writing of the content generated in step S108, determines which content is wrong and which content does not meet the requirements, and returns feedback information for assisting futures content generation.
[0093] In addition, since the two "generation-checking" Agents can only specifically enrich and perfect a specific chapter, and the writing enrichment processing between multiple chapters needs to introduce a "task manager" to overall grasp. The task manager is also a functional role of the large language model defined by the prompt word engineering, which mainly divides the chapters and paragraphs of the overall framework, and then hands over the writing enrichment processing task of each chapter to the "generation-checking" two Agent agents for specific implementation and perfection until the writing of the last chapter is completed.
[0094] The embodiment of the application provides a futures content generation system based on a large language model, Figure 2 The structure diagram of the futures content generation system based on the large language model according to the embodiment of the application is shown in Figure 2 The system includes a data acquisition module, a data preprocessing module, a data retrieval module, and a content generation module.
[0095] 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 further includes real-time market data and macro-industrial chain supply and demand data.
[0096] The data preprocessing module is used to perform first preprocessing on the real-time market data, second preprocessing on the macro-industrial chain supply and demand data, and third preprocessing on the futures event information data, and then obtain basic index data for futures content generation.
[0097] The data retrieval module is used to retrieve the target index data corresponding to the user sentence by retrieving the basic index data according to the user sentence.
[0098] The content generation module is used to process the target index data by the large language model to generate the futures content corresponding to the user sentence by using the CoT prompt word based on the CoT.
[0099] By the data acquisition module, the data preprocessing module, the data retrieval module and the content generation module in the embodiments of the present application, different futures basic data are classified and processed to improve the data quality. On the basis of improving the data quality, the large language model technology is embedded into the generation of futures content. The thought chain CoT prompt word is used to guide the large language model to convert high-quality futures basic data into futures content meeting the requirements of user statements, solving the problem of how to improve the content generation quality in the futures field.
[0100] It should be noted that each of the above modules can be a functional module or a program module, and can be implemented by software or hardware. For the modules implemented by hardware, each of the above modules can be located in the same processor; or each of the above modules can also be located in different processors in any combination.
[0101] The embodiment also provides an electronic device including a memory and a processor, the memory storing a computer program, and the processor being configured to execute the computer program to perform the steps in any of the method embodiments.
[0102] Optionally, the electronic device can further include a transmission device and an input / output device, wherein the transmission device is connected with the processor, and the input / output device is connected with the processor.
[0103] It should be noted that the specific examples in the embodiment can refer to the examples described in the above embodiments and optional implementation manners, and the embodiment will not be described here.
[0104] In addition, in combination with the futures content generation method based on the large language model in the above embodiments, the embodiments of the present application can provide a storage medium for implementation. The storage medium stores a computer program; the computer program is executed by a processor to implement any of the futures content generation methods based on the large language model in the above embodiments.
[0105] In one embodiment, a computer device is provided, which can be a terminal. The computer device comprises a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device comprises 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 operating system and the computer program in the non-volatile storage medium to run. The network interface of the computer device is used to communicate with external terminals through network connection. The computer program is executed by the processor to implement a futures content generation method based on a large language model. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.
[0106] 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, as Figure 3 shown, an electronic device is provided, which can be a server, and its internal structure diagram can be as Figure 3 shown. The electronic device comprises 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 external terminals through network connection, the internal memory is used to provide an environment for the operating system and the computer program to run, 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.
[0107] Those skilled in the art can understand that Figure 3 the structure shown in the figure is only a block diagram of part of the 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 can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0108] Those skilled 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 above-mentioned embodiments of each method. Any reference to memory, storage, database or other medium used in each embodiment provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), 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.
[0109] Those skilled in the art should understand that each technical feature of the above-mentioned embodiments can be combined arbitrarily, and in order to make the description simple, each technical feature in the above-mentioned embodiments is not described all possible combinations, however, as long as the combination of these technical features does not exist contradictory, it should be considered as the scope of the present application.
[0110] The above-mentioned embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the patent of the present application should be subject to the appended claims.
Claims
1. A futures content generation method based on a large language model, characterized in that, The method comprises: obtaining the basis data generated by the futures content, wherein the basis data comprises futures index data and futures event information data, and the futures index data further comprises real-time market data and macro-industrial chain supply and demand data; firstly preprocessing the real-time market data, secondly preprocessing the macro-industrial chain supply and demand data, and thirdly preprocessing the futures event information data, thereby obtaining the basis index data for futures content generation; obtaining the user sentence input by the user; based on the first preset prompt word, the user sentence is rewritten by a 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 subjected to intent recognition to obtain the basic writing intention of the user; based on the basic writing intention of the user, the market index data and the industrial chain index data as structured data are retrieved by a SQL query statement to obtain the target index data corresponding to the basic writing intention; based on the basic writing intention of the user, the information index data as unstructured data is retrieved by an ES keyword inverted index and a Faiss vectorization retrieval tool to obtain the target index data corresponding to the basic writing intention; based on the second preset prompt word, the user sentence input by the user is subjected to intent recognition by a large language model to obtain the deep writing intention of the user, wherein the deep writing intention comprises writing emphasis, writing word limit, writing charting instruction and writing disclaimer; based on the deep writing intention of the user, the CoT prompt word is constructed by entity relationship analysis and ERA-CoT, and based on the CoT prompt word, the target index data is processed by a large language model to generate the futures content corresponding to the user sentence.
2. The method of claim 1, wherein, The first preprocessing of the real-time market data comprises: normalizing the real-time market data to obtain market index data for futures content generation, wherein the normalization comprises Z-score normalization and MinMaxScaler normalization, and the market index data is structured data.
3. The method of claim 2, wherein, The second preprocessing of the macro-industrial chain supply and demand data comprises: identifying and extracting the tuple information in the macro-industrial chain supply and demand data to unify and standardize the original index, thereby obtaining industrial chain index data for futures content generation, wherein the industrial chain index data is structured data.
4. The method of claim 3, wherein, The third preprocessing of the futures event information data comprises: identifying and cutting the long text paragraphs of the futures event information data according to the text theme to obtain a plurality of short text paragraphs; respectively performing abstract analysis on the short text paragraphs to obtain the event labels corresponding to each short text paragraph; based on the short text paragraphs and the corresponding event labels, obtaining information index data for futures content generation, wherein the information index data is unstructured data.
5. The method of claim 1, wherein, The generation of the futures content corresponding to the user sentence further comprises: The large language model is respectively defined with different functions to obtain a writing generator and a writing verifier based on the large language model; The writing generator generates futures content corresponding to a user sentence according to the user sentence input by a user and feedback information of the writing verifier; The writing verifier proofreads and checks the futures content generated by the writing generator to generate feedback information for assisting in generation of the futures content.
6. The method of claim 1, wherein, After obtaining basic data for generation of the futures content, the method comprises: The basic data is subjected to initial preprocessing, wherein the initial preprocessing comprises data cleaning, removal of abnormal values and completion of missing values.
7. A futures content generation system based on a large language model, characterized by, The system is used to execute the method according to any one of claims 1 to 6, and the system comprises 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 generation of the futures content, wherein the basic data comprises futures index data and futures event information data, and the futures index data further comprises real-time market data and macro-industrial chain supply and demand data; The data preprocessing module is used to perform first preprocessing on the real-time market data, second preprocessing on the macro-industrial chain supply and demand data and third preprocessing on the futures event information data, and then obtain basic index data for generation of the futures content; The data retrieval module is used to obtain target index data corresponding to a user sentence by retrieving the basic index data according to the user sentence; The content generation module is used to process the target index data by a large language model to generate futures content corresponding to the user sentence by using CoT prompt words based on a CoT.
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
Method and system for converting natural language into SQL (Structured Query Language) statement
CN118916381A