Information processing method and device, electronic equipment, storage medium and program product
By identifying the target knowledge field of the requested information and querying the analysis strategy with the highest matching degree, targeted reply information is generated, and the problems of low efficiency and accuracy in the existing technology are solved, and the efficiency and accuracy of information processing are achieved.
Patent Information
- Application Number
- CN202510332080.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2025-07-04
AI Technical Summary
In the prior art, information processing methods rely on fixed analysis strategies, resulting in low efficiency and accuracy when facing complex and changing request information, and cannot effectively adapt to complex needs in different fields.
By identifying the target knowledge field of the request information, querying multiple analysis strategies from the database, determining the analysis strategy with the highest matching degree with the request information, generating reply information, and using the language model to imitate the analysis strategy to generate targeted responses.
It improves the efficiency and accuracy of information processing, can adapt to complex needs in different fields, provide more accurate and targeted response information, and has broad applicability and flexibility.
Smart Images

Figure CN120256572A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular, to an information processing method, apparatus, electronic device, storage medium, and program product. Background Art
[0002] With the development of artificial intelligence technology, users submit request information through various channels (such as online platforms, customer service systems, intelligent assistants, etc.) to obtain the required knowledge or solutions. These requests cover multiple fields, such as finance, medicine, law, and technical support, etc.
[0003] In the related art, in order to effectively respond to these requests, information processing methods usually rely on a fixed analysis strategy written manually to generate response information, resulting in low efficiency and accuracy of information processing when facing complex and changeable request information. Summary of the Invention
[0004] Embodiments of this application provide an information processing method, apparatus, electronic device, storage medium, and program product, which can improve the efficiency and accuracy of replying to request information.
[0005] The technical solution of the embodiments of this application is implemented as follows:
[0006] Embodiments of this application provide an information processing method, the method includes:
[0007] Identify the target knowledge field to which the request information to be processed belongs;
[0008] Based on the request information, query a plurality of analysis strategies for the target knowledge field from the first database;
[0009] Determine the matching degree between each of the analysis strategies and the request information;
[0010] Based on the matching degree between each of the analysis strategies and the request information, and the plurality of analysis strategies, determine at least one target analysis strategy;
[0011] Based on the request information and the target analysis strategy, generate a response message for the request information.
[0012] In the above solution, the querying a plurality of analysis strategies for the target knowledge field from the first database based on the request information includes: when no target keyword belonging to the target knowledge field is extracted from the request information, obtain a plurality of analysis strategies from the first database.
[0013] In the above solution, generating at least one target analysis policy based on the request information and at least one analysis policy includes: obtaining a fourth prompt word, where the fourth prompt word is used to indicate generating a target analysis policy that matches the request information by imitating the at least one analysis policy;
[0014] Invoking a language model based on the fourth prompt word, the request information, and the at least one analysis policy, so as to generate a target analysis policy that matches the request information by imitating the at least one analysis policy.
[0015] An embodiment of the present application provides an information processing device, including:
[0016] An identification module, configured to identify a target knowledge field to which the request information to be processed belongs;
[0017] A query module, configured to query, based on the request information, a plurality of analysis policies of the target knowledge field from a first database;
[0018] A matching module, configured to determine the matching degree between each analysis policy and the request information;
[0019] A processing module, configured to determine at least one target analysis policy based on the matching degree between each analysis policy and the request information, and the plurality of analysis policies;
[0020] A reply module, configured to generate a reply message for the request information based on the request information and the target analysis policy.
[0021] An embodiment of the present application provides an electronic device, where the electronic device includes:
[0022] A memory, configured to store computer-executable instructions or computer programs;
[0023] A processor, configured to implement the information processing method provided by the embodiment of the present application when executing the computer-executable instructions or computer programs stored in the memory.
[0024] An embodiment of the present application provides a computer-readable storage medium, storing a computer program or computer-executable instructions, which are configured to implement the information processing method provided by the embodiment of the present application when being executed by a processor.
[0025] An embodiment of the present application provides a computer program product, including a computer program or computer-executable instructions, where the computer program or computer-executable instructions implement the information processing method provided by the embodiment of the present application when being executed by a processor.
[0026] The embodiment of the present application has the following beneficial effects:
[0027] By identifying the target knowledge domain to which the request information to be processed belongs, querying multiple analysis strategies from the first database, and evaluating based on the matching degree between each analysis strategy and the request information, it is ensured that the selected analysis strategy matches the request information. Furthermore, based on the matching degree and the target analysis strategy determined by multiple analysis strategies, the reply content can be made more accurate and targeted, effectively improving the efficiency and accuracy of information processing, achieving the adaptive use of matching analysis strategies for different request information to generate reply information, being able to adapt to the complex requirements of different fields, and having wide applicability and flexibility. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 is a schematic structural diagram of the information processing system provided by an embodiment of the present application;
[0029] Figure 2 is a schematic structural diagram of the electronic device provided by an embodiment of the present application;
[0030] Figure 3 is a flowchart of the information processing method provided by an embodiment of the present application Figure 1 ;
[0031] Figure 4 is a flowchart of the information processing method provided by an embodiment of the present application Figure 2 ;
[0032] Figure 5 is a flowchart of the information processing method provided by an embodiment of the present application Figure 3 ;
[0033] Figure 6 is a schematic diagram of the knowledge graph provided by an embodiment of the present application;
[0034] Figure 7 is a flowchart of the information processing method provided by an embodiment of the present application Figure 4 ;
[0035] Figure 8 is a flowchart of the information processing method provided by an embodiment of the present application Figure 5 ;
[0036] Figure 9 is a flowchart of the information processing method provided by an embodiment of the present application Figure 6 ;
[0037] Figure 10 is a flowchart of the information processing method provided by an embodiment of the present application Figure 7 ;
[0038] Figure 11 is a flowchart of the information processing method provided by an embodiment of the present application Figure 8 ;
[0039] Figure 12 is a schematic flowchart of the information processing method provided by an embodiment of the present application Figure 9 ;
[0040] Figure 13 is a schematic flowchart of the information processing method provided by an embodiment of the present application Figure 10 ;
[0041] Figure 14 is a schematic diagram of the processing flow of the financial question-answering system provided by an embodiment of the present application in the offline processing and online reasoning stages;
[0042] Figure 15 is a schematic diagram of the processing flow of the financial question-answering system provided by an embodiment of the present application in the model training stage. Detailed implementation manners
[0043] In order to make the objectives, technical solutions, and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be construed as limiting the present application. All other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present application.
[0044] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.
[0045] In the following description, the terms "first / second / third" are only used to distinguish similar objects and do not represent a specific order for the objects. It can be understood that "first / second / third" can be interchanged with a specific order or sequence when permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0046] In the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other related parts to achieve a predetermined goal, and can be fully or partially implemented by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of the overall module or unit that includes the function of the module or unit.
[0047] Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by those skilled in the art to which this application belongs. The terms used in the embodiments of this application are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0048] In the practical application of the relevant data collection and processing in the embodiments of this application, the informed consent or separate consent of the personal information subject should be obtained strictly in accordance with the requirements of relevant laws and regulations, and subsequent data use and processing should be carried out within the scope authorized by laws and regulations and the personal information subject.
[0049] Before further elaborating on the embodiments of this application, the nouns and terms involved in the embodiments of this application are described. The nouns and terms involved in the embodiments of this application are subject to the following explanations.
[0050] 1) Large Language Model (LLM), simply referred to as language model in this application, refers to a deep learning model generated through training with a large amount of text data, which has the ability of natural language understanding and generation. For example, the model structure of the large language model can be Generative Pre-trained Transformer (GPT-3), Bidirectional Encoder Representations from Transformers (BERT), Text-to-Text Transfer Transformer (T5), etc.
[0051] 2) Prompt: It is the instruction or guiding text input to the large language model, used to clarify the task requirements and restrict the scope and format of the generated content, and guide the large language model to generate content. The prompt can include information such as instructions, examples, and context. For example, the prompt can be "Write an analysis report from the perspective of an analyst".
[0052] 3) Prompt template: It is a predefined structured text framework in natural language processing or dialogue systems, which contains placeholders or variables (such as {analysis strategy}, {request information}), and is used to dynamically fill according to different inputs or scenarios to generate different prompts.
[0053] 4) Request information: Any form of information such as queries, questions, narrative content, etc. input by the user. For example, the request information can include text, charts, pictures, audio, video, etc.
[0054] 5) Knowledge Domain: The division of a specific professional field (such as finance, healthcare), used to define the professional boundaries of data sources, analysis rules, and output content.
[0055] 6) Knowledge Graph: A structured knowledge base organized in the form of entity-relationship-attribute triples, supporting semantic association queries and reasoning.
[0056] 7) Analysis Strategy: A piece of text information used to indicate the way a language model analyzes request information, which can help the language model understand the user's intention in the request information and generate accurate response information. For example, the analysis strategy can be the logical processing flow of the language model for the request information, including reasoning steps and output specifications, etc.
[0057] 8) Instruction Fine Tuning (Supervised Instruction Fine Tuning, SFT): A model training method that uses question-and-answer pairs consisting of instructions and corresponding outputs to fine-tune a pre-trained large language model to improve the ability of the large language model to follow instructions and complete specific tasks.
[0058] 9) Retrieval-Augmented Generation (RAG): A method that combines external knowledge retrieval and text generation. External knowledge retrieval can be obtaining retrieval content using an external knowledge base or search engine, and text generation can be the large language model generating content based on the retrieval content. This method extends the problem-solving boundary and answer accuracy of the large language model. RAG is usually used in scenarios that require precise information or up-to-date data, such as online Q&A systems, intelligent documents, etc.
[0059] 10) Agent: A program with the ability to make autonomous decisions, capable of perceiving the environment, making decisions based on the perceived information, and executing actions to achieve task goals. An agent can call a tool chain (such as a data interface, computing engine) according to the task goal to complete multi-step operations. For example, a financial data analysis agent can automatically perform data extraction, modeling, and report generation. An agent enables a machine to autonomously complete tasks without direct human intervention, such as tasks like online shopping, web page operations, data analysis, and information search.
[0060] In the related art, the method of directly generating responses using a large language model (LLM) cannot access external data, resulting in limited scope and depth of answers, and thus unable to provide accurate analysis and answers. When using retrieval-augmented generation (RAG) technology to generate responses, although it can access external data and expand the boundaries of answers, it cannot provide multi-dimensional analysis for specific knowledge domains when generating answers, resulting in the professionalism and quality of answers still needing to be improved. The method of manually writing expert analysis strategies can ensure the professionalism of answers, but the writing cost is high and the diversity is insufficient, making it difficult to comprehensively cover the problem requirements of different scenarios. For different types of problems, fixed analysis strategies may not provide enough variability, so they perform poorly when dealing with new problems. If directly using a large model to generate analysis strategies, for complex scenarios, the quality of the analysis strategies generated by the large model cannot be guaranteed, resulting in low accuracy of the finally generated answers.
[0061] In view of the above problems, embodiments of the present application provide an information processing method, apparatus, electronic device, storage medium, and program product, which can improve the efficiency and accuracy of information processing. The following describes the exemplary applications of the electronic device provided by the embodiments of the present application. The electronic device provided by the embodiments of the present application can be implemented as various types of terminals such as laptop computers, tablet computers, desktop computers, set-top boxes, smart phones, smart speakers, smart watches, smart TVs, in-vehicle terminals, etc., or can be implemented as a server. Next, the exemplary applications will be described when the device is implemented as a terminal or a server.
[0062] See Figure 1 , Figure 1 is a schematic diagram of the architecture of the information processing system provided by the embodiments of the present application. To support an information processing application, the information processing system 100 at least includes a database 500, a terminal 400, a network 300, and a server 200. The terminal 400 is connected to the server 200 through the network 300. The network 300 can be a wide area network, a local area network, or a combination of the two. In some embodiments, the server 200 can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery network (CDN), and big data and artificial intelligence platforms. The terminal and the server can be directly or indirectly connected through wired or wireless communication methods, which are not limited in the embodiments of the present application.
[0063] In some embodiments, the embodiments of the present application can be implemented by the terminal 400 alone. For example, the user can input request information through the client of the terminal 400. After the terminal 400 receives the request information input by the user, it obtains a target analysis strategy that matches the request information from the database 500, generates response information for replying to the request information based on the target analysis strategy, and displays the response information on the client interface.
[0064] In some embodiments, the embodiments of the present application can be implemented collaboratively by the server and the terminal. For example, the user can input request information through the client of the terminal 400. After the terminal 400 receives the request information input by the user, it sends the request information to the server 200 through the network 300. The server 200 obtains a target analysis strategy that matches the request information from the database 500, generates response information for replying to the request information based on the target analysis strategy, and sends the response information to the terminal 400. The terminal 400 displays the response information on the client interface.
[0065] The information processing method provided by the embodiments of the present application can be applied to any scenario that needs to reply to the request information input by the user, improving the efficiency and accuracy of information processing. Specific application scenarios can be:
[0066] 1) Financial investment analysis: The terminal receives the request information input by the user (for example, the request information includes the text "Analyze the reasons for the stock price fluctuations of Company A in the past 3 months" and the stock price fluctuation chart). The terminal sends the request information to the server. The server identifies that the request information belongs to the financial knowledge field, screens out the target analysis strategy that best matches the request information from the database, generates the reasons for the stock price fluctuations as the response information based on the target analysis strategy, and returns the response information to the terminal for the user to view.
[0067] 2) Medical and health consultation: The user inputs a symptom description (for example, always feeling tired and weak recently, not sleeping well at night) on the medical and health consultation platform of the terminal. The terminal obtains the target analysis strategy that matches the symptom description (for example, provides tips for improving sleep quality, recommends recording daily activities and eating habits) from the local storage or cloud database based on the symptom description, generates the response information using the target analysis strategy, and displays the response information on the page of the medical and health consultation platform. Alternatively, the user can upload a symptom picture on the medical and health consultation platform, and the terminal performs image recognition on the symptom picture to obtain the possible symptom description.
[0068] 3) Intelligent customer service system: A user sends a consultation about "mobile phone repair" through an online customer service platform. After the server receives this request, it determines the target analysis strategy that matches the request based on multiple analysis strategies stored in the database and generates a reply message: "Hello, it is recommended that you first check if the mobile phone is fully charged and try restarting the device. If the problem persists, please contact our authorized service center for further detection."
[0069] 4) Language learning: The user uploads an audio file of reading a foreign language through the terminal. The terminal recognizes that this is a problem in the field of language learning and searches for analysis strategies applicable to pronunciation correction and improvement of oral fluency. After determining the best target analysis strategy, it generates a voice analysis result (indicating inaccurate pronunciations), as well as improvement suggestions and links to practice materials as the reply message based on the target analysis strategy.
[0070] 5) Psychological counseling: The user can input a narrative content about recent work stress and anxiety as the request information, but does not clearly state what kind of help or solution is needed. The terminal first recognizes that this narrative content belongs to the field of mental health and queries multiple analysis strategies related to reducing work stress and managing anxiety from the first database. It selects the target analysis strategy most suitable for the current narrative and generates a reply message based on the target analysis strategy. The reply message may include specific strategy suggestions and encouraging words, etc.
[0071] In some embodiments, the electronic device for implementing the information processing method provided in the embodiments of the present application may be Figure 1 the terminal 400 in. Refer to Figure 2 , Figure 2 is a schematic structural diagram of the electronic device provided in the embodiments of the present application, Figure 2 The electronic device shown includes: at least one processor 410, a memory 450, at least one network interface 420, and a user interface 430. Each component in the electronic device is coupled together through a bus system 440. It can be understood that the bus system 440 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, in Figure 2 all kinds of buses are labeled as the bus system 440.
[0072] The processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0073] The user interface 430 includes one or more output devices 431 that enable the presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons, and controls.
[0074] The memory 450 can be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard disk drives, optical disk drives, etc. The memory 450 optionally includes one or more storage devices that are physically located remote from the processor 410.
[0075] The memory 450 includes volatile memory or non-volatile memory, and may also include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), and the volatile memory can be random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.
[0076] In some embodiments, the memory 450 is capable of storing data to support various operations. Examples of such data include programs, modules, and data structures, or subsets or supersets thereof, which are described below by way of example.
[0077] The operating system 451 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic services and handling hardware-based tasks;
[0078] The network communication module 452 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 420. Exemplary network interfaces 420 include: Bluetooth, wireless fidelity (WiFi), and universal serial bus (USB), etc.;
[0079] The presentation module 453 is used to enable the presentation of information (such as a user interface for operating peripheral devices and displaying content and information) via one or more output devices 431 associated with the user interface 430 (such as a display screen, speaker, etc.);
[0080] The input processing module 454 is used to detect and translate one or more user inputs or interactions from one of one or more input devices 432.
[0081] In some embodiments, the apparatus provided by the embodiments of the present application may be implemented in software. Figure 2 The information processing apparatus 455 stored in the memory 450 is shown, which may be software in the form of programs and plugins, etc., including the following software modules: an identification module 4551, a query module 4552, a matching module 4553, a processing module 4554, and a reply module 4555. These modules are logical, so they can be combined arbitrarily or further split according to the functions to be implemented. The functions of each module will be described below.
[0082] In other embodiments, the apparatus provided by the embodiments of the present application may be implemented in hardware. As an example, the apparatus provided by the embodiments of the present application may be a processor in the form of a hardware decoding processor, which is programmed to execute the information processing method provided by the embodiments of the present application. For example, a processor in the form of a hardware decoding processor may employ one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0083] Next, the information processing method provided by the embodiments of the present application will be described. As mentioned above, the electronic device implementing the information processing method of the embodiments of the present application may be a terminal, a server, or a combination of both. Therefore, the execution subject of each step will not be repeated hereinafter.
[0084] The information processing method provided by the embodiments of the present application will be described in combination with the exemplary applications and implementations of the terminals provided by the embodiments of the present application.
[0085] See Figure 3 , Figure 3 is a flowchart of the information processing method provided by the embodiments of the present application Figure 1 will be described in combination with Figure 3 the steps shown, as Figure 3 shown, taking the execution subject of the information processing method as a terminal as an example for description, the method includes the following steps 101 to 105:
[0086] In step 101, the target knowledge field to which the request information to be processed belongs is identified.
[0087] Here, the request information to be processed is information such as questions or narrative content input by the user, including but not limited to information in various modalities such as text, voice, images, charts, and videos. The knowledge domain is a way of classifying and dividing knowledge. In the embodiments of the present application, the knowledge domain is used to represent the category to which the information belongs, such as medicine, law, finance, engineering, computer science, etc.
[0088] Exemplarily, the request information input by the user can be the question "What should I do if my mobile phone screen goes black?", and the target knowledge domain to which this request information belongs is the field of electronic product repair. The request information input by the user can be the narrative content "The stock price has fluctuated frequently today", and the target knowledge domain to which this request information belongs is the financial field. The request information input by the user can be the voice "I have always felt tired and weak recently and can't sleep well at night", and the target knowledge domain to which this request information belongs is the field of medical and health.
[0089] In some embodiments, after receiving the request information to be processed input by the user, if the request information is text, the request information can be preprocessed first to obtain multiple words or phrases. The preprocessing can be achieved in the following way: perform text cleaning on the request information (remove irrelevant characters, punctuation marks, stop words, etc.), and split the sentence after text cleaning into words or phrases. Keywords can be identified from multiple words or phrases, such as "A company", "stock price", etc. Based on these identified keywords, match the keyword libraries of each preset knowledge domain. If the number of identified keywords contained in a certain keyword library is the largest, the knowledge domain corresponding to this keyword library is used as the target knowledge domain.
[0090] In some embodiments, if the request information is text or other forms of information (images, audio, etc.), feature extraction can be performed on the request information based on a pre-trained multi-modal model, and the extracted features can be classified using a pre-trained classification model to obtain the probability that the request information belongs to each knowledge domain, and the knowledge domain with the highest probability is used as the target knowledge domain.
[0091] In some embodiments, refer to Figure 4 , Figure 4 shows the target knowledge domain to which the request information to be processed identified in step 101 belongs, which can be achieved through the following steps 1011 to 1013:
[0092] In step 1011, a first prompt word is constructed based on a preset plurality of knowledge domains and the request information.
[0093] Among them, the first prompt word is used to indicate the matching of the request information and the plurality of knowledge domains.
[0094] Here, multiple knowledge domains can be predefined for classifying request information. The knowledge domains to which each historical request information received within a historical time period belongs can be queried, and the knowledge domains to which each historical request information belongs are used as the predefined multiple knowledge domains. The first prompt is used for the pre-trained language model to match the request information with the multiple knowledge domains, obtaining the probability that the request information belongs to each knowledge domain. A language model is a model trained through a large amount of text data and can understand and generate natural language. The embodiments of the present application do not limit the pre-trained language model, which can be a deep learning model, a machine learning model, etc. For example, the language model is a large language model.
[0095] Exemplarily, the predefined multiple knowledge domains include electronic product repair, finance, medicine, law, computer, etc. The request information input by the user is "Analyze the recent stock price fluctuations of Company A", then the constructed first prompt can be: "Please match the following request information with multiple knowledge domains and return the matching probability for each knowledge domain: Request information: Analyze the recent stock price fluctuations of Company A? Knowledge domains: Electronic product repair, finance, medicine, law, computer".
[0096] In step 1012, the language model is called based on the first prompt to trigger the language model to match the request information with the multiple knowledge domains, obtaining the probability that the request information belongs to each knowledge domain.
[0097] Here, the first prompt is input into the pre-trained language model. The language model can first obtain the description information of each knowledge domain according to the request information and the multiple knowledge domains in the first prompt, and then encode the request information and the description information respectively to obtain the second encoding vector of the request information and the third encoding vector of the description information of each knowledge domain. For each knowledge domain, the language model performs attention processing on the second encoding vector and the third encoding vector corresponding to this knowledge domain to obtain the attention weight corresponding to this knowledge domain. The attention weight is used to weight the third encoding vector corresponding to this knowledge domain to obtain the weighted third encoding vector. The first similarity between each knowledge domain and the request information can be obtained by calculating the cosine similarity or Euclidean distance between the second encoding vector and the weighted third encoding vector. The activation function (such as the SoftMax function) is used to perform activation processing on the first similarity between each knowledge domain and the request information to obtain the probability that the request information belongs to each knowledge domain.
[0098] Exemplarily, the first prompt is: "Please match the following request information with multiple knowledge domains and return the matching probability for each knowledge domain: Request information: Analyze the recent stock price fluctuations of Company A? Knowledge domains: Electronics product repair, Finance, Medicine, Law, Computer". By invoking the language model based on the first prompt, the probabilities of the request information belonging to each knowledge domain are: Probability of belonging to electronics product repair = 0.03, Probability of belonging to medicine = 0.02, Probability of belonging to law = 0.05, Probability of belonging to computer = 0.05, Probability of belonging to finance = 0.85.
[0099] In step 1013, the knowledge domain with the highest probability is determined as the target knowledge domain.
[0100] Exemplarily, for the request information "Analyze the recent stock price fluctuations of Company A?", the probability of belonging to electronics product repair = 0.03, the probability of belonging to medicine = 0.02, the probability of belonging to law = 0.05, the probability of belonging to computer = 0.05, and the probability of belonging to finance = 0.85. Then the probability of belonging to the finance knowledge domain is the highest, and the finance domain is taken as the target knowledge domain.
[0101] In the embodiment of the present application, by constructing the first prompt and invoking the language model to calculate the matching probabilities of the request information with multiple predefined knowledge domains, the target knowledge domain to which the request information belongs is accurately identified, which not only improves the classification accuracy but also can handle complex requests with multi-modal inputs. When calculating the matching probabilities, the attention mechanism and similarity calculation are used to effectively capture the subtle associations between the request information and each knowledge domain, and the activation function is used to activate to obtain the probabilities of the request information belonging to each knowledge domain, and the knowledge domain with the highest probability is selected as the target knowledge domain, ensuring the accuracy and interpretability of the knowledge domain classification of the request information.
[0102] In step 102, based on the request information, multiple analysis strategies for the target knowledge domain are queried from the first database.
[0103] Here, the first database is a database including knowledge in one or more specific knowledge domains. The knowledge may include multiple analysis strategies, instruction information corresponding to each analysis strategy, and the mapping relationship between the analysis strategies and the keywords included in the instruction information. Exemplarily, taking the financial knowledge domain as an example, the first database includes analysis strategies and instruction information extracted from multiple financial research reports (such as research reports from brokerage firms, investment research platforms, financial reports of various companies, industry research, investment strategy analysis, and macroeconomic reports of different types, or various high-quality research reports publicly available collected from the Internet). Taking the medical knowledge domain as an example, the first database may include analysis strategies and instruction information extracted from multiple medical research reports (such as clinical guidelines and disease management programs issued by medical institutions and professional medical research institutions, or high-quality research reports publicly available collected from the Internet). Taking the legal knowledge domain as an example, the first database may include analysis strategies and instruction information extracted from multiple legal documents (such as professional reports, case analysis, and interpretations of laws and regulations from law firms and legal service institutions, or legal information collected from the Internet).
[0104] The knowledge can be stored in the first database in the form of a knowledge graph or a mapping table. The instruction information corresponding to the analysis strategy is the information configured to be replied through the analysis strategy, and the analysis strategy is a way used to indicate the analysis based on the instruction information. For example, the analysis strategy can be a series of specific solutions, suggestions, or operation steps for the instruction information. For a specific knowledge domain, multiple keywords used to characterize the intention of the instruction information can be predefined in this knowledge domain. For example, in the financial knowledge domain, the predefined multiple keywords may include company codes, industry codes, and stock codes, etc. For each instruction information, if there are keywords in the instruction information, at least one keyword in the instruction information is extracted, and the at least one keyword has a mapping relationship with the analysis strategy corresponding to the instruction information. If there are no keywords in the instruction information, the instruction information and the analysis strategy corresponding to the instruction information are directly stored in the first database.
[0105] In the embodiment of the present application, through the extraction of keywords in the instruction information and the mapping with the analysis strategy, it is possible to quickly query relevant analysis strategies using the target keywords in the request information in the subsequent information processing stage, significantly improving the speed and accuracy of the analysis strategy recall. Even in the case of no explicit keywords, the instruction information and its corresponding analysis strategy can be directly stored, increasing the diversity of the analysis strategies, providing the possibility for processing request information in complex, ambiguous, or emerging fields, and enhancing the flexibility and adaptability of information processing.
[0106] Exemplarily, assume that multiple keywords are "market", "Company A", "real estate", etc., and the instruction information is "Analyze the reasons for the significant increase in the market and the possibility of the subsequent market trend", then the keyword "market" exists in the instruction information. Assume that the analysis strategy corresponding to this instruction information is as follows: "1. Summarize the main reasons for the significant increase in the market, including factors such as the release of important policies and major news. 2. Analyze the possibility of the subsequent market trend, considering factors such as policy expectations, economic fundamentals, and market trading volume. 3. Propose allocation suggestions, including specific directions for growth sectors and some consumer goods." Then it is determined that the keyword "market" has a mapping relationship with this analysis strategy, and the keyword "market" and this analysis strategy are stored in the first database in the form of a knowledge graph or a mapping table.
[0107] In the embodiments of the present application, target keywords belonging to the target knowledge field can be extracted from the request information, and multiple analysis strategies in the target knowledge field can be queried from the first database based on the target keywords.
[0108] In some embodiments, before processing the request information, the embodiments of the present application can extract the analysis strategy and instruction information corresponding to each piece of knowledge information from the knowledge information in each knowledge field through a pre-trained language model. Among them, the knowledge information can include background materials, theoretical bases, research reports belonging to the knowledge field, and positive sample reply information generated by processing historical request information within a historical time period. The positive sample reply information can be reply information that is manually marked as a correct reply to the historical request information. The instruction information is information configured to be replied through an analysis strategy, that is, the instruction information is a hypothetical request information generated by the language model for a certain piece of knowledge information. The analysis strategy is a way used to indicate the analysis based on the instruction information, so that the language model can generate a reply to the instruction information according to the analysis strategy. It should be noted that the reply to the instruction information generated by the language model needs to be similar to the content in the analysis strategy. The similarity between the reply to the instruction information and the content in the analysis strategy can be calculated. If the similarity is greater than or equal to a preset threshold (set according to actual needs), it is determined that the reply to the instruction information is similar to the content in the analysis strategy. If the calculated similarity is less than the preset threshold, the language model is called to regenerate new analysis strategies and instruction information for the knowledge information.
[0109] Exemplarily, taking the knowledge field as the financial knowledge field as an example, the knowledge information can include research reports in the financial industry (such as individual stock research reports, macro research reports, company research reports, and industry research reports, etc.). For example, for a research report on the investment value of an individual stock, the language model can extract multi-dimensional analysis strategies such as fundamentals, news, and technical aspects from the research report and generate instruction information.
[0110] In some embodiments, refer to Figure 5 ,Figure 5 It shows that multiple analysis strategies for the target knowledge domain are retrieved from the first database based on the request information in step 102, which can be implemented through the following steps 1021A to 1022A:
[0111] In step 1021A, at least one target keyword belonging to the target knowledge domain is extracted from the request information.
[0112] Here, multiple predefined keywords belonging to the target knowledge domain are obtained. The request information is tokenized to obtain multiple words. For each keyword belonging to the target knowledge domain, it is queried whether the multiple words of the request information contain the keyword. If the keyword is contained, the keyword is used as the target keyword.
[0113] Exemplarily, the request information is "Analyze the recent stock price fluctuations of Company A", the target knowledge domain to which this request information belongs is the financial domain, and the target keyword extracted from this request information is "Company A".
[0114] In step 1022A, multiple analysis strategies are retrieved from the first database based on the target keyword.
[0115] Here, based on each target keyword in the request information, multiple analysis strategies having a mapping relationship with each target keyword are retrieved from the first database. One target keyword may have one or more analysis strategies having a mapping relationship in the first database, or may not have an analysis strategy having a mapping relationship.
[0116] In the embodiment of the present application, multiple analysis strategies are retrieved through the target keywords belonging to the target knowledge domain in the request information, which can significantly improve the accuracy and efficiency of the query, and further improve the efficiency and accuracy of information processing.
[0117] In some embodiments, the first database includes a knowledge graph, the knowledge graph includes multiple keyword nodes and multiple analysis strategy nodes, and there is an edge between the analysis strategy node and the keyword node when the analysis strategy node is configured to process the keyword node. Retrieving multiple analysis strategies from the first database based on the target keyword in step 1022A can be implemented in the following manner: First, query the keyword nodes in the knowledge graph that match the target keyword; then, determine the edges connected to the keyword nodes that match the target keyword as the target edges; finally, obtain the analysis strategies stored in the analysis strategy nodes connected to the target edges.
[0118] Here, after extracting the analysis strategies and instruction information corresponding to each piece of knowledge information from the knowledge information in various knowledge domains through a language model, multiple keywords in each instruction information are determined, a keyword node is created for each keyword, and an analysis strategy node is created for each analysis strategy. That the analysis strategy node is configured to process the keyword node means that the analysis strategy stored in the analysis strategy node is configured to process the target instruction information, where the target instruction information contains the keyword stored in the keyword node. That is, for each analysis strategy node, the analysis strategy stored in the analysis strategy node is obtained, the target instruction information corresponding to the tokenization strategy generated by the language model is obtained, at least one keyword in the target instruction information is extracted, and at least one keyword node storing at least one keyword is connected to the analysis strategy node by an edge. After traversing each analysis strategy node through the above steps, the knowledge graph is constructed.
[0119] Exemplarily, the analysis strategy stored in the analysis strategy node is as follows: "1. Summarize the main reasons for the significant increase in the market, including factors such as important policy announcements and major news. 2. Analyze the possibility of the subsequent market trend, considering factors such as policy expectations, economic fundamentals, and market trading volume. 3. Provide allocation suggestions, including specific directions for growth sectors and some consumer goods." The target instruction information generated by the language model corresponding to this analysis strategy is "Analyze the reasons for the significant increase in the market and the possibility of the subsequent market trend", and the keyword in the target instruction information is "market". Then, the keyword "market" has a mapping relationship with this analysis strategy, and this analysis strategy node is configured to process the keyword node storing the keyword "market", and the analysis strategy node is connected to the keyword node storing the keyword "market" by an edge.
[0120] Figure 6 It is a schematic diagram of the knowledge graph provided by an embodiment of the present application. Refer to Figure 6 , the knowledge graph includes three keyword nodes a, b, and c, and two analysis strategy nodes B and D. Among them, the keyword node a stores the keyword "Company A", the keyword node b stores the keyword "real estate", and the keyword node c stores the keyword "market". If the language model extracts from a market research report the analysis strategy "1. Summarize the main reasons for the significant increase in the market, including factors such as important policy announcements and major news. 2. Analyze the possibility of the subsequent market trend, considering factors such as policy expectations, economic fundamentals, and market trading volume. 3. Provide allocation suggestions, including specific directions for growth sectors and some consumer goods.", and the instruction information "Analyze the reasons for the significant increase in the market and the possibility of the subsequent market trend", and store this analysis strategy in the analysis strategy node B (the content of the analysis strategy is not fully shown in the figure). Since the instruction information includes the keyword "market", the analysis strategy node B is connected to the keyword node c storing the keyword "market" by an edge.
[0121] If a language model extracts a real estate market research report of Company A and obtains the analysis strategies: "1. Sort out the relevance between market anomalies and Company A, and focus on interpreting the transmission effects of major corporate actions such as its strategic layout adjustment and new product line release on the real estate sector. At the same time, pay attention to macro-control factors such as land supply and credit policies. 2. Predict the differentiation trend of the real estate industry, and analyze the differential development space of the commercial real estate and residential markets in combination with the quality of Company A's project reserves, the implementation rhythm of the new urbanization policy, and market interest rate changes. 3. Develop a cross-cycle allocation plan, focus on the first-mover advantages of Company A in the fields of smart communities and urban renewal, and simultaneously evaluate the impact of the affordable housing policy on the reconstruction of the market valuation system.", and the instruction information "Analyze the impact of Company A's strategic adjustment on the real estate market and the possibility of the evolution of the industry pattern in the next 3 years", store this analysis strategy in the analysis strategy node D (the content of the analysis strategy is not fully shown in the figure). The instruction information includes the keywords "market", "Company A", and "real estate", then connect the analysis strategy node D with the keyword node c storing the keyword "market", the keyword node a storing the keyword "Company A", and the keyword node b with the keyword "real estate" with edges respectively.
[0122] In the embodiments of the present application, the keyword node in the knowledge graph that matches the target keyword refers to that the keyword stored in the keyword node is the same as the target keyword. For each target keyword, query the keyword node in the knowledge graph that matches the target keyword, determine at least one target edge connecting the keyword node, and use the analysis strategies stored in the analysis strategy nodes connected by each target edge as multiple analysis strategies in the target knowledge field queried from the first database.
[0123] In the embodiments of the present application, by querying the keyword nodes in the knowledge graph that match the target keyword and determining the target edges connected to these keyword nodes, and then obtaining the analysis strategies in the analysis strategy nodes connected to the target edges, it is possible to efficiently and accurately find the analysis strategies related to the request information, which not only improves the accuracy and efficiency of the query, but also ensures that the queried analysis strategies have high pertinence and practicality, thereby improving the accuracy of information processing.
[0124] In some embodiments, multiple analysis strategies, the instruction information corresponding to each analysis strategy, and the mapping relationship between the analysis strategy and the keywords included in the instruction information can also be stored in the first database in the form of a mapping table. The mapping table includes multiple keywords and at least one analysis strategy that has a mapping relationship with each keyword. Query the mapping table based on the target keyword, and use the analysis strategy that has a mapping relationship with the target keyword queried as the analysis strategy in the target knowledge field queried from the first database.
[0125] In some embodiments, when no target keyword belonging to the target knowledge domain is extracted from the request information, multiple analysis strategies are obtained from the first database. That is, all the analysis strategies in the first database can be directly used as the multiple analysis strategies for the target knowledge domain.
[0126] In some embodiments, when no target keyword belonging to the target knowledge domain is extracted from the request information, refer to Figure 7 , Figure 7 FIG. shows that, based on the request information in step 102, multiple analysis strategies for the target knowledge domain are obtained by querying from the first database, and can be implemented through the following steps 1021B to 1022B:
[0127] In step 1021B, multiple analysis strategies are extracted from the first database, and the extracted multiple analysis strategies are sorted.
[0128] Among them, in the sorting result, the similarity between two adjacent analysis strategies is greater than the similarity between two non-adjacent analysis strategies.
[0129] Here, all the analysis strategies stored in the first database are extracted, the similarity between any two analysis strategies is calculated as the second similarity. A similarity matrix S is constructed based on the second similarity between each pair of analysis strategies. Assume that the first database includes n (n is a positive integer greater than 2) analysis strategies {N1, N2,..., N n}, and the element S ij in the matrix represents the second similarity between analysis strategies N i and N j . The multiple analysis strategies can be sorted according to the similarity matrix to obtain the sorted multiple analysis strategies, and the sorted multiple analysis strategies are used as the sorting result. The sorting algorithm for sorting the multiple analysis strategies according to the similarity matrix in the embodiments of the present application is not limited, as long as it is ensured that the similarity between two adjacent analysis strategies in the sorting result is greater than the similarity between two non-adjacent analysis strategies. Exemplarily, the spectral clustering sorting algorithm is used to sort the multiple analysis strategies: the similarity matrix S is converted into an undirected weighted graph G=(V, E), where V is the set of nodes, each node in the set of nodes represents an analysis strategy, and E is the set of edges. The weight of each edge (N i , N j ) in the set of edges is the second similarity S ij . The Laplacian matrix of the undirected weighted graph G is determined, and sorting is performed based on the Laplacian matrix so that similar nodes are adjacent in the sorting result. Or, the greedy algorithm is used to sort the multiple analysis strategies: starting from any one analysis strategy, each time the analysis strategy with the largest second similarity to this analysis strategy and not yet selected is selected and added to the sequence until all analysis strategies are sorted.
[0130] In some embodiments, calculating the similarity between any two analysis strategies can be achieved in the following manner: Collect training data, where the training data includes multiple pairs of analysis strategies and similarity labels (e.g., numerical values between 0 and 1) between each pair of analysis strategies. Use a pre-trained language model (e.g., BERT model) to convert each analysis strategy into a vector representation, input the vector representations of the pair of analysis strategies into the similarity calculation model to be trained, and predict the predicted similarity of the pair of analysis strategies. Determine the model loss (e.g., cross-entropy loss) based on the predicted similarity and the true similarity label, and update the model parameters of the similarity calculation model through the gradient descent algorithm until the model loss reaches the minimum value, obtaining the trained similarity calculation model. Input multiple analysis strategies in the first knowledge base into the trained similarity calculation model, and output the similarity between any two analysis strategies.
[0131] In some embodiments, calculating the similarity between any two analysis strategies can also be achieved in the following manner: Perform natural language processing on the analysis strategies to obtain the keywords in each analysis strategy. Connect the multiple keywords in the analysis strategy to obtain the semantic representation of the analysis strategy. Determine the similarity between the semantic representations of any two analysis strategies. For example, encode the semantic representations as vectors, calculate the Euclidean distance between the two vectors, and take the reciprocal of the Euclidean distance as the similarity between any two analysis strategies.
[0132] In step 1022B, starting from the head of the sorting result, sample according to a preset sampling interval to obtain multiple analysis strategies in the target knowledge domain.
[0133] Here, the head of the sorting result is the first analysis strategy after sorting. The preset sampling interval represents the frequency of selecting analysis strategies from the sorting result. For example, if the sampling interval is 3, then one analysis strategy is selected from every 3 analysis strategies. The specific value of the sampling interval in the embodiments of the present application is not limited and can be set according to actual needs. Determine the position of the analysis strategy in the sorting result, and screen out multiple analysis strategies in the target knowledge domain from the sorting result based on the position and the sampling interval. Assume that the preset sampling interval is k (k is a positive integer), then select analysis strategies from the 1st, (k + 1)th, (2k + 1)th, etc. positions in the sorting result as multiple analysis strategies in the target knowledge domain.
[0134] The embodiments of the present application can sort similar analysis strategies together to obtain a sorting result when there is no target keyword in the request information, sample the sorting result at intervals to obtain multiple analysis strategies in the target knowledge domain, so that the sampled analysis strategies are representative and diverse, ensure that the selected analysis strategies are comprehensive, and improve the accuracy of information processing.
[0135] In step 103, determine the matching degree between each analysis strategy and the request information.
[0136] Here, the matching degree is an index for judging whether the analysis strategy can correctly indicate the analysis request information and generate a response information. The matching degree can be expressed as a numerical value (usually between 0 and 1). Exemplarily, if the request information is a question raised by the user, a matching degree of 1 means that the analysis strategy completely matches the request information, and a response information that can solve the user's problem can be generated based on the analysis strategy. A matching degree of 0 means that the analysis strategy does not match the request information at all, and the response information generated based on the analysis strategy cannot solve the user's problem.
[0137] In the embodiment of the present application, the first database includes multiple analysis strategies and instruction information pre-associated with each analysis strategy. The instruction information pre-associated with the analysis strategy can be obtained from the first database. Calculate the similarity between the instruction information and the request information through natural language processing technology. The embodiment of the present application does not limit the method for calculating the similarity between the instruction information and the request information. For example, a keyword matching method, a semantic analysis method, etc. can be used. Among them, the keyword matching method can be to extract a keyword set from the instruction information, extract a keyword set from the request information, directly compare the number of common keywords in the two keyword sets, calculate the ratio of the intersection and union of the two keyword sets based on the number of common keywords, and use the ratio as the similarity. The value range of the ratio is [0, 1], and the closer the value is to 1, the more similar it is. After determining the similarity, determine the matching degree between the analysis strategy and the request information based on the similarity between the instruction information and the request information.
[0138] In some embodiments, refer to Figure 8 , Figure 8 shows the determination of the matching degree between each analysis strategy and the request information in step 103, which can be implemented through the following steps 1031A to 1033A:
[0139] In step 1031A, for each analysis strategy, obtain the weight of the analysis strategy and the instruction information pre-associated with the analysis strategy from the first database.
[0140] Among them, the instruction information is information configured to be replied through the analysis strategy.
[0141] Here, the instruction information pre-associated with the analysis strategy is the instruction information corresponding to the analysis strategy in the above embodiments. For the definitions of the analysis strategy and the instruction information, reference can be made to the embodiments of step 102, which will not be elaborated here. The first database may also pre-store the weight of each analysis strategy. The weight is used to represent the priority of the analysis strategy and can be set by experts according to experience for each analysis strategy. Alternatively, historical data statistics can be performed to obtain the number of times each analysis strategy is used within a preset historical time period, and the weight is configured based on the number of times, so that the weight of the analysis strategy is positively correlated with the number of times the analysis strategy is used.
[0142] In step 1032A, determine the similarity between the request information and the instruction information.
[0143] Here, the instruction information is encoded to obtain a first encoded vector. The request information is encoded to obtain a second encoded vector. For example, using a pre-trained language model or a deep learning algorithm, the instruction information is converted into a first encoded vector, and the request information is converted into a second encoded vector. The similarity between the first encoded vector and the second encoded vector is used as the similarity between the request information and the instruction information. The similarity between the first encoded vector and the second encoded vector can be calculated through cosine similarity, Euclidean distance, or other mathematical models suitable for measuring the similarity between vectors. Taking cosine similarity as an example, the similarity is determined by measuring the cosine value of the angle between the first encoded vector and the second encoded vector. When the angle between the first encoded vector and the second encoded vector is 0 degrees, the cosine value is 1, indicating complete similarity; when the angle is 180 degrees, the cosine value is -1, indicating complete dissimilarity; when the angle is 90 degrees, the cosine value is 0, indicating no similarity between the request information and the instruction information.
[0144] In step 1033A, the product of the similarity and the weight is determined as the matching degree between the analysis strategy and the request information.
[0145] Here, for each analysis strategy, after determining the similarity between the instruction information corresponding to the analysis strategy and the request information, and the weight of the analysis strategy, the similarity is multiplied by the weight to obtain the matching degree between the analysis strategy and the request information.
[0146] Exemplarily, the request information is "Analyze the recent stock price fluctuations of Company A". The similarity between the analysis strategy N1 and the request information is 0.8, and the weight of the analysis strategy N1 is 0.9. Then the matching degree between the analysis strategy N1 and the request information is 0.8 × 0.9 = 0.72.
[0147] In the embodiments of the present application, the weights of each analysis strategy and the associated instruction information are obtained from the first database, the similarity between the request information and the instruction information is calculated, and the final matching degree is determined in combination with the weights, achieving precise information processing and response optimization. The weights are set based on expert experience or historical usage frequency to ensure that commonly used and effective analysis strategies are given priority. The similarity calculation uses the comparison between encoding vectors to improve the matching accuracy. The result of multiplying the similarity by the weight is used as the matching degree, which not only considers the relevance of the analysis strategy but also reflects the importance and applicability of the analysis strategy, thereby improving the pertinence and practicality of the generated response information.
[0148] In some embodiments, referring to Figure 9 , Figure 9 shows the determination of the matching degree between each analysis strategy and the request information in step 103, which can be implemented through the following steps 1031B to 1035B:
[0149] In step 1031B, for each analysis strategy, the instruction information pre-associated with the analysis strategy is obtained from the first database.
[0150] Among them, the instruction information is the information configured to be replied through the analysis strategy.
[0151] Here, for each analysis strategy, the process of obtaining the instruction information pre-associated with the analysis strategy from the first database can refer to step 1031A in the above embodiments and will not be described again.
[0152] In step 1032B, the instruction information is encoded to obtain a first encoding vector.
[0153] Here, a pre-trained language model (such as the Bert model) can be used to encode the instruction information to obtain a first encoding vector. For example, if the instruction information is "Analyze the reasons for the sharp rise in the market and the possibility of the subsequent market trend", the encoded first encoding vector is {x1, x2,..., x m}, where m is the length of the first encoding vector and m is a positive number.
[0154] In step 1033B, the request information is encoded to obtain a second encoding vector.
[0155] Here, a pre-trained language model (such as the Bert model) is used to encode the request information to obtain a second encoding vector. The language model is the same as the one used to encode the instruction information in step 1032B. The second encoding vector has the same length as the first encoding vector. For example, if the request information is "Analyze the recent stock price fluctuations of Company A", the encoded second encoding vector is {y1, y2,..., y m}.
[0156] In step 1034B, determine the similarity between the first encoding vector and the second encoding vector.
[0157] In the embodiments of the present application, the method for determining the similarity between the first encoding vector and the second encoding vector is not limited. For example, the cosine similarity, Euclidean distance, Manhattan distance, Pearson correlation coefficient, etc. between the first encoding vector and the second encoding vector can be calculated to obtain the similarity. Among them, the closer the values of the cosine similarity and the Pearson correlation coefficient are to 1, the more similar the first encoding vector and the second encoding vector are. The closer the values of the Euclidean distance and the Manhattan distance are to 0, the more similar the first encoding vector and the second encoding vector are. Taking the Manhattan distance as an example, subtract the elements at the same positions in the first encoding vector and the second encoding vector to obtain a difference vector. Take the absolute value of each element of the difference vector, and use the sum of all absolute values as the Manhattan distance. The reciprocal of the Manhattan distance can be used as the similarity between the first encoding vector and the second encoding vector.
[0158] In step 1035B, determine the similarity as the matching degree between the analysis strategy and the request information.
[0159] Here, directly use the similarity between the first encoding vector and the second encoding vector as the matching degree between the analysis strategy and the request information. For example, if the request information is "Analyze the recent stock price fluctuations of Company A", and the similarity between the second encoding vector after encoding the request information and the first encoding vector after encoding the analysis strategy N1 is 0.8, then the matching degree between this request information and the analysis strategy N1 is 0.8.
[0160] In the embodiments of the present application, the instruction information and the request information are respectively encoded by using a pre-trained language model to obtain encoding vectors. The language model has been trained on a large-scale corpus and can capture the deep semantic information in the text, thus significantly improving the quality of the encoding vectors. A variety of similarity measurement methods (such as cosine similarity, Euclidean distance, Manhattan distance, Pearson correlation coefficient, etc.) are provided, and the most suitable measurement method can be selected according to the specific application scenario to ensure the accuracy of the similarity calculation result. Directly use the similarity between the encoding vectors as the matching degree between the analysis strategy and the request information, which saves computing resources, improves the calculation speed of the matching degree, and further improves the efficiency of determining the target analysis strategy.
[0161] In step 104, based on the matching degree between each analysis strategy and the request information, and multiple analysis strategies, determine at least one target analysis strategy.
[0162] Here, the target analysis strategy is used to indicate the way of analyzing based on the request information. For example, the target analysis strategy can be a series of specific solutions, suggestions, or operation steps for the request information. When there is a match degree greater than or equal to the preset match degree threshold, at least one target analysis strategy is determined from multiple analysis strategies. Alternatively, when there is no match degree greater than or equal to the match degree threshold, a new target analysis strategy is generated based on the request information and multiple analysis strategies.
[0163] In some embodiments, referring to Figure 10 , Figure 10 shows that based on the match degree between each analysis strategy and the request information in step 104, and multiple analysis strategies, determining at least one target analysis strategy can be achieved through the following steps 1041A to 1042A:
[0164] In step 1041A, for each analysis strategy, compare the match degree between the analysis strategy and the request information with the preset match degree threshold.
[0165] Here, the match degree threshold is used to filter out analysis strategies that do not match the request information. The specific value of the match degree threshold in the embodiments of the present application is not limited and can be set according to actual needs. For example, an expert can set a match degree threshold based on historical experience, and different knowledge fields can set different match degree thresholds. Alternatively, obtain the match degree distribution within a preset historical time period, and use a specific percentile in the match degree distribution as the match degree threshold. For example, use the 80th percentile as the match degree threshold. For each analysis strategy, compare the size of the match degree between the analysis strategy and the request information with the match degree threshold.
[0166] In step 1042A, when the match degree is greater than or equal to the match degree threshold, determine the analysis strategy as the target analysis strategy.
[0167] Here, for each analysis strategy, when the match degree between the analysis strategy and the request information is greater than or equal to the match degree threshold, determine the analysis strategy as the target analysis strategy. Exemplarily, the request information is "analyze the recent stock price fluctuations of Company A", the match degree between analysis strategy N1 and the request information is 0.72, the match degree between analysis strategy N2 and the request information is 0.8, the match degree between analysis strategy N3 and the request information is 0.85, and the match degree threshold is 0.75. Then, determine analysis strategy N2 and analysis strategy N3 as the target analysis strategies.
[0168] The embodiments of the present application screen out analysis strategies with a match degree greater than or equal to the match degree threshold as the target analysis strategies. The process is simple and efficient, and can quickly screen out the most suitable target analysis strategy from a large number of analysis strategies, improving the information processing efficiency.
[0169] In some embodiments, referring to Figure 11 , Figure 11 it shows that based on the matching degree between each analysis strategy and the request information, and multiple analysis strategies, determining at least one target analysis strategy can be achieved through the following steps 1041B to 1042B:
[0170] In step 1041B, when the matching degree between each analysis strategy and the request information is less than the preset matching degree threshold, at least one analysis strategy is selected from the multiple analysis strategies in the order from the largest to the smallest matching degree.
[0171] Here, when the matching degree between each analysis strategy obtained by querying from the first database and the request information is less than the matching degree threshold, it indicates that there is no analysis strategy in the current first database that matches the request information. Sort the multiple analysis strategies obtained by querying in step 102 in the order from the largest to the smallest matching degree to obtain an analysis strategy sequence. Select a preset number of analysis strategies ranked at the front from the analysis strategy sequence. For example, h (h is a positive integer) analysis strategies are obtained by querying from the first database in step 102, and the h analysis strategies are sorted in the order from the largest to the smallest matching degree to obtain an analysis strategy sequence {N1, N2,..., N h}. The preset number is g (g is a positive integer, less than or equal to h), and the first g analysis strategies in the analysis strategy sequence are selected.
[0172] In step 1042B, at least one target analysis strategy is generated based on the request information and at least one analysis strategy.
[0173] In some embodiments, generating at least one target analysis strategy based on the request information and at least one analysis strategy can be achieved in the following way: First, obtain a fourth prompt word, which is used to indicate imitating at least one analysis strategy to generate a target analysis strategy that matches the request information; then, based on the fourth prompt word, the request information, and at least one analysis strategy, call a language model to generate a target analysis strategy that matches the request information by imitating at least one analysis strategy.
[0174] Here, the fourth prompt is used to instruct the pre-trained language model to generate a target analysis strategy that matches the request information according to the style and content of at least one analysis strategy. For example, the fourth prompt can be "According to at least one input analysis strategy and the request information, imitate the style and content of these analysis strategies to generate a new analysis strategy to solve the user's problem. The generated analysis strategy should include specific operation steps and ensure easy understanding and execution." Input the fourth prompt, the request information, and at least one analysis strategy into the language model so that the language model imitates at least one analysis strategy and performs text generation processing on the request information to obtain a target analysis strategy that matches the request information.
[0175] In the embodiments of the present application, by setting a preset matching degree threshold, it is ensured that the alternative solution is only activated when the matching degrees between all analysis strategies and the request information are relatively low, avoiding the selection of inappropriate analysis strategies due to mis-matching, and improving the robustness and reliability of the information processing system. When the matching degrees are all lower than the threshold, sort the analysis strategies from largest to smallest in terms of matching degree and select at least one analysis strategy to ensure that the selected analysis strategy is relatively optimal. Based on the fourth prompt, it can effectively guide the language model to refer to the at least one selected analysis strategy to generate a target analysis strategy that matches the request information, enabling the information processing system to flexibly respond to different request information. Especially in the case where there is no existing analysis strategy, it can still generate a new analysis strategy that meets the requirements and ensures that the generated target analysis strategy has professionalism and operability, thus significantly improving the accuracy of information processing.
[0176] In some embodiments, it is also possible to obtain the first analysis strategy with the maximum matching degree and use the target analysis strategy generated based on the request information and at least one analysis strategy as the second analysis strategy. Obtain a fifth prompt, where the fifth prompt is used to instruct the language model to evaluate the first analysis strategy and the second analysis strategy from a preset dimension to select a target analysis strategy from the first analysis strategy and the second analysis strategy. Then, based on the fifth prompt, the request information, the first analysis strategy, and the second analysis strategy, call the language model to select a target analysis strategy from the first analysis strategy and the second analysis strategy.
[0177] Here, the preset dimensions may include coherence and content coverage, etc. Exemplarily, the fifth prompt word may be "Please evaluate which of the following two analysis strategies is more suitable for solving the user's request information according to the input. When evaluating, determine the scores of each analysis strategy from the following preset dimensions: coherence and content coverage. Select the analysis strategy with the highest score". Input the fifth prompt word, the request information, the first analysis strategy, and the second analysis strategy into the language model. The language model will determine the coherence and content coverage of the first analysis strategy based on the request information, the first analysis strategy, and the second analysis strategy, weight the coherence and content coverage to obtain the score of the first analysis strategy, determine the coherence and content coverage of the second analysis strategy, and weight the coherence and content coverage to obtain the score of the second analysis strategy. Take the analysis strategy with the highest score as the target analysis strategy.
[0178] Among them, the language model extracts multiple target keywords in the request information as the target keyword set. Extract the first keyword set in the first analysis strategy, extract the second keyword set in the second analysis strategy, and take the ratio of the number of keywords in the intersection of the target keyword set and the first keyword set to the number of keywords in the union of the target keyword set and the first keyword set as the content coverage of the first analysis strategy. The content coverage of the second analysis strategy can be obtained in the same way.
[0179] Each analysis strategy includes multiple steps. For the first analysis strategy, the language model calculates the similarity between adjacent two steps in the first analysis strategy, and takes the average value of multiple similarities as the coherence of the first analysis strategy. The coherence of the second analysis strategy can be obtained in the same way.
[0180] The embodiment of the present application constructs a reasonable fifth prompt word, which can effectively guide the pre-trained language model to evaluate the advantages and disadvantages of the first analysis strategy and the newly generated second analysis strategy. When evaluating, multiple dimensions (such as coherence and content coverage, etc.) are comprehensively considered to ensure that the selected target analysis strategy can effectively achieve the user's intention in the request information and improve the accuracy of information processing.
[0181] In step 105, based on the request information and the target analysis strategy, a reply message to the request information is generated.
[0182] Here, the request information and the target analysis strategy can be input into a pre-trained language model so that the language model performs text generation processing on the request information to obtain a response message for the request information. The language model has powerful language understanding and generation capabilities. First, the language model can convert the input request information and target analysis strategy into vector representations. For example, the encoder in the language model is used to encode the request information and the target analysis strategy respectively to obtain a second encoding vector corresponding to the request information and a fourth encoding vector corresponding to the target analysis strategy. Then, the decoder in the language model performs attention processing on the second encoding vector and the fourth encoding vector to obtain attention features, and performs regression generation on the attention features to obtain a response message for the request information.
[0183] In the embodiments of the present application, by identifying the target knowledge domain to which the request information to be processed belongs, and querying a plurality of analysis strategies from the first database, and evaluating based on the matching degree between each analysis strategy and the request information, it is ensured that the selected analysis strategy matches the request information. Furthermore, based on the matching degree and the target analysis strategy determined by the plurality of analysis strategies, the response content can be made more accurate and more targeted, effectively improving the efficiency and accuracy of information processing, realizing the adaptive use of matching analysis strategies to generate response messages for different request information, being able to adapt to the complex requirements of different fields, and having wide applicability and flexibility.
[0184] In some embodiments, refer to Figure 12 , Figure 12 which shows that in step 105, based on the request information and the target analysis strategy, a response message for the request information is generated, and it can be implemented through the following steps 1051 to 1052:
[0185] In step 1051, based on the request information and the target analysis strategy, associated information is queried from the second database.
[0186] Among them, the second database includes a plurality of pieces of information, and the associated information is information related to the request information and the target analysis strategy.
[0187] Here, the second database is a database storing information in multiple knowledge domains. The difference between the second database and the first database is that the first database is a database deployed inside the information processing system, such as Figure 1 the database 500 in Figure 1(not shown in the figure). For example, the second database can be a database accessed by various search engines on the network. Taking the financial scenario as an example, the second database is a financial data source, including but not limited to multiple information such as financial reports, news reports, and market data. Taking the medical scenario as an example, the second database is a medical data source, including but not limited to multiple information such as clinical guidelines, drug data, and scientific research literature. Combine the request information and the target analysis strategy to obtain a combined text, query the second database based on the combined text, and use the information related to the combined text retrieved as the associated information.
[0188] In some embodiments, for each piece of information in the second database, determine the third similarity between the combined text and the information. For example, use the similarity between the vector representation of the combined text and the vector representation of the request information as the third similarity. When the third similarity is greater than a preset similarity threshold (which can be set according to actual needs, such as 0.9), it indicates that the information is related to the request information and the target analysis strategy. Determine this information as the associated information.
[0189] In some embodiments, extract multiple keywords from the combined text, query the second database using the keywords, and use the information containing at least one of the multiple keywords as the associated information related to the request information and the target analysis strategy.
[0190] Exemplarily, the request information input by the user is "Analyze the recent stock price fluctuations of Company A", the target analysis strategy is "1. Summarize the stock price fluctuation information; 2. Summarize the main reasons for the stock price fluctuations, including factors such as important policy announcements, major news, etc. 3. Analyze the possibility of the subsequent stock price trend, considering factors such as policy expectations, economic fundamentals, and market trading volume", and the second database is a financial data source. The associated information retrieved from the financial data source based on the request information and the target analysis strategy includes: the latest financial report, news reports, and market data of Company A.
[0191] In step 1052, based on the request information, the target analysis strategy, and the associated information, generate a reply message for the request information.
[0192] Here, the request information, the target analysis strategy, and the associated information can be input into a pre-trained language model so that the language model performs text generation and outputs a reply message for the request information. First, the encoder of the language model encodes the request information, the target analysis strategy, and the associated information respectively to obtain a second encoding vector corresponding to the request information, a fourth encoding vector corresponding to the target analysis strategy, and a fifth encoding vector corresponding to the associated information. The decoder in the language model performs attention processing on the second encoding vector, the fourth encoding vector, and the fifth encoding vector to obtain attention features, and performs regression generation on the attention features to obtain a reply message for the request information.
[0193] In the embodiments of the present application, an external second database is accessed, and associated information related to the request information and the target analysis strategy is retrieved from the second database. By combining this information, the final response information is generated, expanding the boundary of the answering ability of the information processing system and making the response information more professional and comprehensive. The pre-trained language model is used to perform attention processing on the request information, the target analysis strategy, and the associated information to generate a natural and fluent response information that meets the requirements, improving the pertinence and professionalism of the response.
[0194] In the embodiments of the present application, based on the request information, the target analysis strategy, and the associated information, the response information of the request information can be generated in the following manner: First, obtain the first prompt template, where the first prompt template is used to guide the language model to respond to the request information; then, fill the first prompt template according to the target analysis strategy to obtain the second prompt; finally, call the language model based on the second prompt to generate the response information based on the associated information and the request information.
[0195] Here, the first prompt template is a predefined text structure including placeholders, where the placeholders are used to be replaced by specific target analysis strategies to obtain the second prompt. Exemplarily, the first prompt template can be "You are a professional financial analyst who strictly adheres to academic integrity and is good at answering users' financial questions. You can use search tools to retrieve external information and research reports to assist you in answering users' questions. When answering questions, please refer to some analysis strategies: {target analysis strategy}", and the placeholder is {target analysis strategy}. By calling the language model based on the second prompt, the language model performs text generation on the request information and the associated information according to the target analysis strategy in the second prompt to obtain the response information. For example, the encoder in the language model encodes the request information, the second prompt, and the associated information respectively to obtain the second encoding vector corresponding to the request information, the sixth encoding vector corresponding to the second prompt, and the fifth encoding vector corresponding to the associated information. The decoder in the language model performs attention processing on the second encoding vector, the sixth encoding vector, and the fifth encoding vector to obtain attention features, and performs regression generation on the attention features to obtain the response information of the request information.
[0196] In the embodiments of the present application, the first prompt template is obtained, the template is filled according to the target analysis strategy to obtain the second prompt, and the language model is called based on the second prompt. The encoder of the language model encodes the request information, the second prompt, and the associated information respectively to generate corresponding encoding vectors. The decoder then performs attention processing on these encoding vectors, extracts key features, and performs regression generation on these key features to finally output accurate and natural response information, improving the quality and logic of the response information.
[0197] In some embodiments, a language model can be trained in the following manner: First, obtain sample request information, as well as the corresponding sample analysis strategy and sample response information for the sample request information; then, call the language model to process the sample request information to obtain a predicted analysis strategy and a predicted response information for the sample request information, where the predicted analysis strategy is used to instruct the language model to analyze the sample request information; then, determine the target loss based on the sample analysis strategy, the predicted analysis strategy, the sample response information, and the predicted response information; finally, update the model parameters of the language model based on the target loss to obtain the trained language model.
[0198] Here, the sample request information is the request information with a positive sample label input by the user within a preset historical time period, and the sample response information is the response information actually generated for the sample request information. The positive sample label indicates that the sample response information successfully solves the user's intention or problem in the sample request information, and the positive sample label can be added through user feedback, manual annotation, etc. The analysis strategy actually used by the language model during the process of processing the sample request information can be used as the sample analysis strategy, or the analysis strategy manually written by an expert for the sample request information can be used as the sample analysis strategy.
[0199] Calling the language model to process the sample request information to obtain a predicted analysis strategy and a predicted response information for the sample request information is the same as the process of determining the target analysis strategy and response information for the request information in steps 101 to 105 in the above embodiment, and will not be described here. The target loss is an index that measures the difference between the predicted analysis strategy and the sample analysis strategy, as well as the difference between the sample response information and the predicted response information. Calculate the first loss based on the sample analysis strategy and the predicted analysis strategy, and calculate the second loss based on the sample response information and the predicted response information. Perform weighted processing on the first loss and the second loss to obtain the target loss. It should be noted that the embodiments of the present application do not limit the calculation methods of the first loss and the second loss. For example, cross-entropy loss can be used. Continuously adjust the model parameters of the language model through the backpropagation algorithm (such as the gradient descent algorithm) until the target loss reaches the minimum value to obtain the trained language model.
[0200] The embodiments of the present application also use the sample analysis strategy as the training data of the language model, which can improve the understanding and analysis ability of the language model in a specific knowledge field, enabling the language model to more deeply understand the professional knowledge of the specific knowledge field and generate more accurate response information. By introducing the comparison between the sample analysis strategy and the predicted analysis strategy, and combining the difference evaluation between the sample response information and the predicted response information, it is ensured that the language model not only pays attention to the content matching degree when generating a response, but also considers the consistency of the analysis strategy, thereby improving the accuracy and relevance of the response.
[0201] In some embodiments, in step 105, to generate a response message to the request message based on the request message and the target analysis strategy, it can also be implemented in the following manner: When the request message includes information in multiple modalities, a language model is called to perform the following processing: First, feature extraction is performed on the information in each modality respectively to obtain a first feature vector corresponding to the information in each modality; then, feature extraction is performed on the target analysis strategy to obtain a second feature vector; then, feature fusion is performed on the second feature vector and the first feature vectors corresponding to the information in each modality to obtain a third feature vector; finally, a response message is generated based on the third feature vector.
[0202] Here, the request message can include information in multiple modalities such as text, image, audio, etc. At this time, the language model is a multimodal large language model. The language model can include multiple feature extraction layers. For example, the feature extraction layer is a pre-trained language model that can perform feature extraction on the information in the text modality to obtain a first feature vector corresponding to the information in the text modality. The feature extraction layer is a convolutional neural network or a pre-trained visual model that can perform feature extraction on the information in the image modality to obtain a first feature vector corresponding to the information in the image modality. The feature extraction layer is a pre-trained audio processing model that can perform feature extraction on the information in the audio modality to obtain a first feature vector corresponding to the information in the audio modality. Feature fusion of the second feature vector corresponding to the target analysis strategy and the first feature vectors corresponding to the information in each modality can be implemented in the following manner: Weighting or concatenating the second feature vector and the first feature vectors corresponding to the information in each modality to obtain a third feature vector, or performing attention processing on the second feature vector and the first feature vectors corresponding to the information in each modality to obtain a third feature vector. Text generation processing is performed on the third feature vector to obtain a response message.
[0203] It should be noted that when the request message is information in multiple modalities, the language model used in the process of determining the target analysis strategy in the above embodiments is also a multimodal large language model.
[0204] In the embodiments of the present application, feature extraction is performed on the information in each modality of the request message respectively, and then feature fusion is performed. The multimodal large language model using the fused vector can better capture the associations between different modalities and generate richer and more natural response messages to improve the flexibility of information processing. This method can support users to input request messages in multiple modalities and is applicable to various application scenarios such as intelligent customer service, virtual assistants, multimedia content generation, etc., and has wide applicability and expandability.
[0205] In some embodiments, after generating the response information for the request information in step 105, when receiving positive feedback for the response information, if the first database includes the target analysis strategy, increase the weight of the target analysis strategy; if the target analysis strategy is not included in the first database, add the target analysis strategy to the first database.
[0206] Here, after generating the response information, the response information is displayed to the user on the client interface. Positive feedback indicates that the response information effectively solves the user's intention or problem in the request information. The feedback can be implemented in two ways: display feedback or implicit feedback. For example, the display positive feedback can be the feedback that the user is satisfied or approves of the response information, such as generating normal feedback for the response information through rating (10 points out of 1 - 10 points), like operation, etc. The implicit feedback can be that the language model scores the response information. When the obtained score is greater than or equal to the preset score threshold, it represents positive feedback, and when the obtained score is less than the score threshold, it represents negative feedback.
[0207] When receiving positive feedback for the response information, query whether the first database includes the target analysis strategy. If the first database includes the target analysis strategy, the weight of the target analysis strategy can be increased. The embodiments of the present application do not limit the way of weight increase. For example, a preset gain coefficient can be determined, and the weight of the target analysis strategy is linearly increased based on the preset gain coefficient. Obtain the number of feedback times that the response information generated by using the target analysis strategy within the preset historical time period receives positive feedback. The preset gain coefficient is positively correlated with the number of feedback times. If the target analysis strategy is not included in the first database, add the target analysis strategy to the first database and use the default weight as the weight of the target analysis strategy. Among them, the default weight can be set by itself, or the average value of the weights of all analysis strategies in the first database can be used as the default weight.
[0208] In the embodiments of the present application, when receiving positive feedback for the response information, the information processing system will query whether the corresponding target analysis strategy is included in the first database. If it exists, increase the weight of the target analysis strategy; if it does not exist, add the target analysis strategy and assign an initial weight. This mechanism enables effective analysis strategies to be preferentially selected and used, ensuring that the language model performs better when processing similar request information subsequently. By linearly increasing the weight of the target analysis strategy through the preset gain coefficient, and the gain coefficient is positively correlated with the number of historical positive feedback times, not only the influence of the current feedback is considered, but also historical data is combined to ensure that analysis strategies with high-frequency success obtain higher weights, so as to achieve more stable performance improvement, enabling the information processing system to quickly adapt to new market changes and user needs.
[0209] In some embodiments, when negative feedback for a reply message is received, if the first database includes a target analysis strategy, the weight of the target analysis strategy is reduced, or the target analysis strategy is deleted from the first database.
[0210] Here, the negative feedback indicates that the reply message fails to effectively address the user's intention or problem in the request message. The display of negative feedback can be feedback indicating that the user is not satisfied with the reply message, such as generating negative feedback for the reply message through rating (1 point out of 1 - 10 points), downvoting, etc. When negative feedback for a reply message is received, query whether the first database includes a target analysis strategy. If the first database includes the target analysis strategy, the weight of the target analysis strategy can be reduced. The embodiments of the present application do not limit the way of weight reduction. For example, a preset reduction coefficient can be determined, and the weight of the target analysis strategy can be linearly reduced based on the preset reduction coefficient. Obtain the number of feedback times that the reply messages generated using this target analysis strategy received negative feedback within a preset historical time period. The preset reduction coefficient is positively correlated with the number of feedback times. Alternatively, the target analysis strategy can be directly deleted from the first database. Exemplarily, when the number of feedback times that the reply messages generated using this target analysis strategy received negative feedback within a preset historical time period reaches a threshold number of times, the target analysis strategy is directly deleted from the first database. If the first database does not include the target analysis strategy, no processing is performed.
[0211] In the embodiments of the present application, when negative feedback for a reply message is received, if the first database includes a target analysis strategy, the weight of this analysis strategy can be linearly reduced through a preset reduction coefficient. The reduction coefficient is positively correlated with the number of historical negative feedback times, ensuring that the weights of analysis strategies that frequently fail gradually decrease, thereby reducing the probability of their being selected. For those target analysis strategies that have received negative feedback multiple times (reaching the threshold number of times) within a preset historical time period, they can be directly deleted from the first database, which helps to completely exclude inefficient or incorrect analysis strategies and avoid negative impacts on the processing of subsequent request messages, so as to improve the accuracy of the information processing system in replying to request messages.
[0212] In some embodiments, referring to Figure 13 , before step 101, the information processing method provided by the embodiments of the present application further includes the following steps 201 to 204:
[0213] In step 201, a second prompt word template for the language model is obtained.
[0214] Among them, the second prompt word template is used to guide the language model to generate an analysis strategy.
[0215] Here, the second prompt template is a predefined text structure that includes placeholders, where the placeholders are used to be replaced by specific knowledge information to obtain the third prompt. Exemplarily, the second prompt template can be "Based on the following {knowledge information}, extract the analysis strategy of this knowledge information, and then generate an instruction information, and the ideal response of this instruction information is similar to some content in the knowledge information.
[0216] {knowledge information}
[0217] Please note:
[0218] The output contains two parts, namely "analysis strategy" and "instruction information", "simplified instruction", and is output in Json format. ", where the placeholder is {knowledge information}.
[0219] In step 202, for each knowledge domain, fill the second prompt template according to the knowledge information of the knowledge domain to obtain the third prompt.
[0220] Here, the definition of the knowledge information of the knowledge domain can refer to the embodiment of step 102 above and will not be described again. Replace the placeholder {knowledge information} in the second prompt template with the obtained knowledge information to generate a specific third prompt. The third prompt is used to guide the language model to generate an analysis strategy corresponding to the knowledge information and generate an instruction information associated with the analysis strategy. For example, if the knowledge domain is finance and the knowledge information is "Recently, the financial market has shown a significant upward trend. This is mainly due to the following factors: important policy announcements: the central bank announced a 0.5 percentage point interest rate cut, and the government introduced a number of economic stimulus policies; major news: many listed companies released quarterly financial reports that exceeded expectations, the international situation tended to stabilize, and investor confidence increased.", then the filled third prompt is "Based on the following {knowledge information}, extract the analysis strategy of this knowledge information, and then generate an instruction information, and the ideal response of this instruction information is similar to some content in the knowledge information.
[0221] {Recently, the financial market has shown a significant upward trend. This is mainly due to the following factors: important policy announcements: the central bank announced a 0.5 percentage point interest rate cut, and the government introduced a number of economic stimulus policies; major news: many listed companies released quarterly financial reports that exceeded expectations, the international situation tended to stabilize, and investor confidence increased.}
[0222] Please note:
[0223] The output contains two parts, namely "analysis strategy" and "instruction information", "simplified instruction", and is output in Json format".
[0224] In step 203, based on the third prompt, call the language model to generate an analysis strategy corresponding to the knowledge information.
[0225] Here, the third prompt word is input into the language model, and the language model generates text for the knowledge information in the third prompt word in the manner indicated by the third prompt word, obtaining the analysis strategy and instruction information corresponding to the knowledge information. The third prompt words obtained by filling each knowledge information into the second prompt word template are sequentially input into the language model, so that the language model sequentially outputs the analysis strategy and instruction information corresponding to each knowledge information.
[0226] Exemplarily, the analysis strategy and instruction information output by the language model can be {Instruction information: "Analyze the reasons for the sharp rise in the market and the possibility of the subsequent market trend."; Analysis strategy: "1. Summarize the main reasons for the sharp rise in the market, including factors such as the release of important policies and major news. 2. Analyze the possibility of the subsequent market trend, considering factors such as policy expectations, economic fundamentals, and market trading volume. 3. Put forward allocation suggestions, including specific directions for growth sectors and some consumer goods."}.
[0227] In step 204, the analysis strategies corresponding to the knowledge information of each knowledge area are stored in the first database.
[0228] Here, after obtaining the analysis strategy and instruction information corresponding to each knowledge information in each knowledge area, multiple keywords in each instruction information can be determined. A mapping relationship is constructed between the keywords in the instruction information corresponding to the same knowledge information and the analysis strategy. The obtained multiple analysis strategies, the instruction information corresponding to each analysis strategy, and the mapping relationship between the keywords included in the analysis strategy and the instruction information are stored in the first database in the form of a mapping table or a knowledge graph.
[0229] The embodiment of the present application obtains the second prompt word template. The second prompt word template flexibly adapts to the knowledge information of different knowledge areas through the placeholder mechanism, ensuring that the generated third prompt word can accurately guide the language model to generate high-quality analysis strategies. Generating the third prompt word by filling the template according to the knowledge information can efficiently call the language model to generate the analysis strategy corresponding to the knowledge information, construct a mapping relationship between the keywords in the instruction information corresponding to each knowledge information and the analysis strategy, and store it in the first database, automatically enriching the analysis strategies in the first database, improving the diversity of the analysis strategies, thereby enhancing the response ability of the information processing system and the accuracy of information processing. The mapping relationship stored in the first database helps to quickly retrieve and apply relevant analysis strategies, improving the response speed and efficiency of the information processing system.
[0230] It should be noted that the language models used in the above embodiments of the present application can be the same language model or different language models.
[0231] Next, an exemplary application of the embodiments of the present application in an actual application scenario will be described.
[0232] In the related art, financial question-and-answer systems can generate user answers in various ways. One way is to use a large language model (LLM) to generate user answers. The large language model utilizes a pre-trained extensive knowledge base to directly generate answers to user questions. The link of this method is simple and can use rich knowledge for answering, but it cannot access external data, resulting in limited scope and depth of answering questions. Due to the lack of external data support, the answers of the LLM are often not professional and comprehensive enough. Especially in the financial field, many questions require the combination of the latest market data and research reports to obtain accurate answers. For example, when the user's question is "Analyze the recent stock price fluctuations of Company A?", the LLM cannot provide accurate analysis and answers because it does not access recent stock prices, news, etc.
[0233] Another way is to use Retrieval-Augmented Generation (RAG) technology to generate user answers. The RAG technology expands the answer ability boundary of the financial question-and-answer system by accessing external data. The RAG method first retrieves relevant information from external data sources and then generates answers by combining this information. This enables RAG to provide more professional and comprehensive information when answering specific questions. However, the retrieval direction and answering ideas in the RAG method are difficult to meet the requirements of professional scenarios. For example, for the user's question "Analyze the recent stock price fluctuations of Company A?", RAG may only retrieve stock price and fluctuation information through keywords or semantic vectors, but lack the analysis of specific directions, such as multi-dimensional information in terms of fundamentals, news, and technical aspects. Therefore, the answers of RAG may not be comprehensive and professional enough, not meeting the preferences of financial experts, resulting in the need to improve the professionalism and quality of the answers. For example, when answering questions involving complex financial analysis, RAG may not be able to provide multi-dimensional analysis that meets the expectations of financial professionals, thus affecting the user's trust and experience.
[0234] Another approach is to manually write expert analysis strategies. Financial experts design specific analysis strategies to guide the financial Q&A system to generate high-quality answers. This method can ensure the professionalism and compliance of the answers, but the writing cost is high and the diversity is insufficient. Financial experts usually only focus on specific industries or companies, making it difficult to comprehensively cover the problem requirements of different scenarios. In addition, the number of analysis strategies is limited, making it difficult to meet the diverse needs of various complex financial problems. For example, for stock analysis questions such as "Analyze the recent stock price fluctuations of Company A?", financial experts may design an analysis strategy to guide the financial answer system to retrieve not only stock price information but also multi-dimensional information such as research reports, financial report releases, and market news. However, just for stock analysis questions, the company types include Internet, real estate, mining, etc., and the analysis strategies for different types of companies will vary, and manual efforts cannot cover enough areas. In addition, different financial experts usually have their own preferences for a certain type of question, resulting in a fixed answer style for the financial Q&A system for specific types of questions and insufficient diversity. For example, for different types of stock investment questions, the analysis strategy may not provide enough variability, resulting in poor performance of the financial Q&A system when dealing with new questions. Some existing methods directly use large models to generate analysis strategies. However, in the financial field, the scenario tasks are relatively complex, and the quality of the analysis strategies generated by the models cannot be guaranteed.
[0235] In summary, there are multiple deficiencies in the financial Q&A system in the related technologies, which limit the answer quality and adaptability of the financial Q&A system. Based on this, the embodiments of the present application provide an information processing method, which is applied to the financial scenario and is a method for automatically mining analysis strategies in high-quality financial research reports to optimize the answer quality of the financial Q&A system. The embodiments of the present application solve the problems of high cost and insufficient diversity of the analysis strategies that rely on manual writing in the financial Q&A system. By dynamically determining analysis strategies from the constructed analysis strategy database for different user questions, through automated analysis strategy mining and data synthesis technologies, the adaptability of the financial Q&A system and the professionalism of the answers are significantly improved. In addition, the embodiments of the present application also retrieve multiple candidate analysis strategies based on the entities in the user questions (corresponding to the keywords in the above embodiments), and then determine the analysis strategy that matches the user question based on the similarity between the user question and the user instructions of the candidate analysis strategies, optimizing the accuracy and recall rate of the analysis strategy retrieval, so as to be able to answer complex financial questions raised by users more effectively.
[0236] Specifically, in the embodiments of the present application, explicit analysis strategies are extracted from research reports to generate diverse analysis strategies, and an analysis strategy database (corresponding to the knowledge database in the above embodiments) is constructed. At the same time, corresponding user instructions (corresponding to the instruction information in the above embodiments) are generated for the analysis strategies for subsequent retrieval. An analysis strategy is a prompt word used to guide an Agent to answer user questions (corresponding to the request information in the above embodiments), and can be applied to aspects such as question rewriting, expansion, and content generation during the execution of the Agent, so as to improve the answer quality, professionalism, and comprehensiveness of the financial Q&A system. At the same time, it reduces the cost of manually writing analysis strategies and enhances the adaptability and diversity of the financial Q&A system. By matching the analysis strategies with specific user questions, the embodiments of the present application optimize the accuracy and recall rate of information retrieval and can answer complex financial questions raised by users more effectively.
[0237] The information processing method provided by the embodiments of the present application is applied to a financial Q&A system. By extracting and applying analysis strategies from high-quality financial research reports, the answer quality and user experience of the financial Q&A system are improved. The following details the user interaction and dynamic change process of the embodiments of the present application in the financial Q&A system.
[0238] The financial Q&A system supports various types of financial questions, including individual stock analysis, macroeconomic analysis, market trend prediction, etc. For example, users can query questions such as "Analyze the recent stock price fluctuations of Company A" and "Predict the macroeconomic trends for the next year" through the financial Q&A system. The financial Q&A system provides a user-friendly interface where users can submit questions through an input box, and the financial Q&A system will quickly generate professional answers. The client interface of the financial Q&A system is designed to be simple and clear, facilitating user understanding and operation.
[0239] The user enters a specific user question in the input box of the client interface of the financial Q&A system. For example, when the user enters "Analyze the recent stock price fluctuations of Company A", after receiving the user's input question, the financial Q&A system first retrieves the corresponding candidate analysis strategies from the analysis strategy database (corresponding to the first database in the above embodiments), and then the large model generates analysis strategies for the user question. For example, the analysis strategies include ideas for fundamental analysis, news-based analysis, and technical analysis. Combining this analysis strategy for information retrieval and content generation, based on the retrieved information, a reply message to the user question is generated in the manner of the analysis strategy. The financial Q&A system allows users to provide feedback on the generated reply message, including evaluating the quality and accuracy of the reply message. Users can submit their opinions through the feedback button in the interface. For example, users can evaluate whether the reply message is comprehensive and accurate or put forward specific improvement suggestions.
[0240] Based on user feedback, the financial Q&A system continuously optimizes the analysis strategies in the analysis strategy database. For example, if a user feedback indicates that a certain analysis strategy performs poorly in multiple uses, the financial Q&A system will remove that analysis strategy from the analysis strategy database; if a certain analysis strategy performs excellently in multiple uses, the financial Q&A system will increase the weight of that analysis strategy. This dynamic optimization process ensures that the financial Q&A system can continuously improve and provide higher-quality financial analysis and answers.
[0241] The processing flow of the financial Q&A system includes three parts: offline processing, online inference, and model training. Offline processing is used to extract analysis strategies, inference execution is used to use analysis strategies, and model training is used to enhance the model's capabilities and train the model through the analysis strategies in research reports. Figure 14 It is a schematic diagram of the processing flow of the financial Q&A system provided by the embodiments of this application in the offline processing and online inference stages.
[0242] See Figure 14 , in the offline processing stage, it includes three steps: research report preparation, analysis strategy extraction, and analysis strategy storage. Research report preparation: First, collect knowledge information 1301 from professional data sources such as financial institutions and online Q&A systems (for example, including individual stock research reports, macro research reports, and high-quality answers, where high-quality answers are answers manually marked as high-quality for a certain user question within a historical time period). As an example, research reports can be various types of reports such as research reports from securities firms and investment research platforms, financial reports research of various companies, industry research, investment strategy analysis, and macroeconomics, or collect various publicly available high-quality research reports from the Internet, etc. During the data acquisition process, if information such as company codes and industry codes appears in the research report, record the corresponding company codes, industry codes, etc. of the research report for use in subsequent links. For reports in non-text format, use document parsing tools to parse them into text format, and all knowledge information is stored in text format. It should be noted that if the embodiments of this application are applied to non-financial scenarios or other dialogue scenarios without research reports, high-quality answers can be used as knowledge information.
[0243] Analysis strategy extraction: After obtaining the knowledge information, send the knowledge information to the extraction module 1302. Through the extraction module 1302, the financial Q&A system extracts key analysis strategies from the knowledge information and generates corresponding user instructions. For example, for a research report on the analysis of the investment value of individual stocks, the financial Q&A system can extract multi-dimensional analysis strategies such as fundamentals, news, and technical aspects through the extraction module 1302 and generate matching user instructions (such as the user instruction corresponding to the strategy research report of Company A is "Analyze the recent stock price fluctuations of Company A").
[0244] In terms of specific implementation, the extraction module 1302 is a large language model. Due to the huge number of research reports, the large language model is used to assist in completing this step. The knowledge information is provided to the large language model in sequence, and it is allowed to perform analysis strategy extraction. For the extraction process of the analysis strategy, the following second prompt word template is used:
[0245] Based on the following {report type} (report_type) and the {content} of the research report, extract the analysis strategy of the research report, and then generate a user instruction. The ideal answer of the user instruction is similar to some content in the research report. At the same time, generate a simplified instruction to simulate the general questioning method of real users.
[0246] {report type}
[0247] {content}
[0248] Please note:
[0249] 1. The output contains three parts, namely "analysis strategy", "instruction", and "simplified instruction", and is output in Json format.
[0250] 2. The "analysis strategy" describes the corresponding analysis strategy, output dimension requirements, etc. in the research report, or the abstraction of the answering idea.
[0251] 3. If the "analysis strategy" of the research report can be used for reference in similar questions, then output the analysis strategy in detail.
[0252] 4. Avoid very specific events in the "analysis strategy", and it can be reused for similar questions.
[0253] 5. The "instruction" should be as concise as possible, not too redundant, and correspond to the used fragments of the research report, without including the specific answering idea.
[0254] 6. The "simplified instruction" further streamlines the "instruction" to conform to the style of real users (relatively short), 5 to 10 characters.
[0255] 7. If no additional analysis strategy is required, or the research report already contains a detailed analysis strategy, or the research report only contains data listing, then do not output the analysis strategy.
[0256] 8. The output format please refer to the following example:
[0257] Json format
[0258] {{"Analysis strategy": "1....\n2....",\n"Instruction": "...",\n"Simplified instruction": "..."}}
[0259] Fill the research report content and the report type (report_type), or only the research report content, into a preset second prompt template to obtain a third prompt. The large language model executes the third prompt to obtain the analysis strategy and user instructions (which may also include simplified instructions. In the embodiments of the present application, the simplified instructions and instructions are collectively referred to as user instructions) corresponding to the research report. The above second prompt template is only an example. In actual applications, other prompt templates can be set as long as the large language model is told to output the analysis strategy and instructions.
[0260] The following is an example of the result generated by the large language model:
[0261] {"Instruction": "Analyze the reasons for the significant market increase and the possibility of the subsequent market trend.",
[0262] "Simplified Instruction": "Analyze the reasons for the significant market increase and the subsequent trend.",
[0263] "Analysis Strategy": "1. Summarize the main reasons for the significant market increase, including factors such as important policy announcements and major news.\n2. Analyze the possibility of the subsequent market trend, considering factors such as policy expectations, economic fundamentals, and market trading volume.\n3. Propose allocation suggestions, including specific directions for growth sectors and some consumer goods."}
[0264] Analysis Strategy Storage:
[0265] Structurally store the analysis strategy, instructions (and simplified instructions) extracted by the large language model in the analysis strategy database 1303. Information such as the instructions corresponding to the analysis strategy, stock codes, and industry information can be recorded. If the instruction has a clear entity (corresponding to the keywords in the embodiments of the present application), store the mapping relationship between the "entity" and the "instructions and the analysis strategy corresponding to the instructions". The clear entity can be defined based on different scenarios, such as companies, stocks, industries, etc. Simply put, set multiple keywords manually, perform keyword retrieval on the instructions to obtain the entity. It can be stored in the form of a knowledge graph to facilitate the recall of all analysis strategies through the company name or company code. For instructions without a clear entity, such as the instructions for strategy research reports and event analysis research reports, use a semantic embedding model to semantically encode the instructions corresponding to the analysis strategy to obtain a first encoding vector, and store the first encoding vector and the corresponding analysis strategy as a semantic vector library.
[0266] During the online inference stage, it includes three steps: analysis strategy retrieval and generation, inference execution, and analysis strategy database update. Analysis strategy retrieval and generation: When the user poses a user question, the user question is sent to the loading module 1304. The loading module 1304 extracts entities such as companies and industries from the user question (corresponding to the target keywords in the above embodiments), and encodes the user question into a second encoding vector. Based on the extracted entities and the second encoding vector, the loading module 1304 loads analysis strategies from the analysis strategy database 1303. For example, when the user inputs a user question of "Analyze the recent stock price fluctuations of Company A", after extracting the entity of "Company A" from the user question, all analysis strategies corresponding to Company A are loaded from the knowledge graph, and then the user question is encoded to obtain a 1×1024-dimensional second encoding vector. The similarity is calculated using the second encoding vector and the first encoding vector of the corresponding instruction of the analysis strategy, and then the similarity is multiplied by the weight corresponding to the analysis strategy to obtain the matching degree between the user question and the analysis strategy. The analysis strategies with the TOP-K matching degrees are selected for the subsequent process. If there are no entities in the user question, the similarity is directly calculated based on the second encoding vector of the user question and each first encoding vector in the previously constructed semantic vector library, and then the matching degree between the user question and each analysis strategy in the analysis strategy database is calculated.
[0267] A matching degree threshold is set based on historical inference experience. If the matching degrees of the K analysis strategies are all less than the matching degree threshold, the large language model is used to generate a target analysis strategy that matches the user question based on the user question and the candidate analysis strategies; if there is at least one analysis strategy among the K analysis strategies whose matching degree is greater than or equal to the matching degree threshold, then at least one analysis strategy is directly used as the target analysis strategy.
[0268] Inference execution: The loading module 1304 sends the obtained target analysis strategy to the agent 1305. The agent 1305 combines the user question and the target analysis strategy to perform information retrieval and content generation. For example, the agent 1305 will use the generated target analysis strategy to retrieve (the retrieval method is not limited, keyword retrieval, condition filtering, vector similarity calculation, etc. are all possible) the latest financial reports, news reports, and market data of Company A from the financial data source (corresponding to the second database in the above embodiments). Then the agent 1305 calls the large language model to generate response information (Response) based on the retrieved information (corresponding to the associated information in the above embodiments), the user question, and the target analysis strategy. The first prompt template used by the agent 1305 to call the large language model is as follows:
[0269] You are a professional financial analyst who strictly adheres to academic integrity and is good at answering users' financial questions. You can use search tools to retrieve external information and research reports to assist you in answering users' questions.
[0270] When answering questions, please refer to some analysis strategies as follows:
[0271] {Insight (Target Analysis Strategy)}
[0272] Fill the target analysis strategy into the first prompt template to obtain the second prompt. The agent calls the large language model based on the second prompt to perform multi-step execution based on the retrieved information and the user's question, and generate response information. The multi-step execution process of agent 1305 in the embodiments of the present application is not limited, and the multi-step execution process of an agent in related technologies can be referred to. For example, it can include the process of making decisions and planning according to the prompt and the large language model, involving aspects such as the decomposition of the user's question, the setting of goals, and the reasoning path planning. The agent can divide the tasks to be executed into multiple simple steps and execute them sequentially to generate response information.
[0273] Update of the analysis strategy database: The evaluation module 1306 (Critic) evaluates the professionalism and accuracy of the generated response information. This process can be achieved through user feedback (for example, liking the answer means it is a high-quality answer, and disliking it means it is a failed answer), manual annotation, or scoring by a large model. High-quality answers (corresponding to the response information that receives positive feedback in the above embodiments) will be archived and saved, and the weight in the recall process of the analysis strategy will be increased. Failed answers (corresponding to the response information that receives negative feedback in the above embodiments) will be recorded as failed cases, and the analysis strategy corresponding to the failed answer will be removed or the weight will be reduced. If the target analysis strategy is generated by the large language model based on multiple analysis strategies, if it is a high-quality answer, the target analysis strategy will be added to the analysis strategy database and the weight will be increased; if it is a failed answer, no processing will be done.
[0274] Figure 15 It is a schematic diagram of the processing flow of the financial question and answer system provided by the embodiments of the present application during the model training stage. See Figure 15, when training the large language model called by the agent, different from the general method where only high-quality answers are used as the training target in the fine-tuning stage, the training objective of the embodiments of the present application includes outputting expert-level analysis strategies and generating high-quality answers based on these expert-level analysis strategies. Therefore, the training data includes high-quality answers (corresponding to the sample reply information in the above embodiments), the analysis strategies corresponding to the high-quality answers (corresponding to the sample analysis strategies in the above embodiments), and user questions (corresponding to the sample request information in the above embodiments). Through the high-quality answers, corresponding analysis strategies, and user questions collected in the inference stage, model fine-tuning (SFT) is performed to improve the financial analysis ability. The improvement of the financial analysis ability means that the trained large language model can output expert-level analysis strategies and generate reply information based on the analysis strategies. Due to the diversity of research reports, the financial question-answering system will extract various analysis strategies from the research reports of different analysts, and the financial question-answering system can provide professional reply information that is both accurate and diverse in expression. The embodiments of the present application construct training data with rich diversity, which is beneficial for the large language model to have strong generalization ability.
[0275] Through the design of the above three stages, the embodiments of the present application can automatically mine analysis strategies from high-quality financial research reports, generate diverse analysis strategies, and apply them to links such as question rewriting, information expansion, and content generation in the Agent execution process, significantly improving the answer quality and adaptability of the financial question-answering system.
[0276] The embodiments of the present application have the following technical effects:
[0277] 1. High-quality analysis strategies to improve answer professionalism: The embodiments of the present application adopt dynamic analysis strategies, dynamically select appropriate analysis strategies from the analysis strategy database according to user questions. Compared with the mode of relying on analysis strategies written by fixed experts in the prior art, it can better match the questions raised by users, thus generating more accurate and professional answers. This avoids the limitations of fixed analysis strategies and enables it to handle more complex and more specific financial analysis problems.
[0278] 2. More diverse analysis strategies and richer answers: The embodiments of the present application support more diverse analysis strategies, so it can provide more diverse analysis perspectives and richer answer content to meet different analysis needs of users.
[0279] 3. Faster system iteration and optimization: The embodiments of the present application adopt the method of iteratively updating the analysis strategy database and introduce a user feedback mechanism, which can continuously improve the system performance. Compared with the method of directly training the model, this iterative update method is more flexible and efficient, can quickly complete the optimization, deletion, and addition of analysis strategies, and shorten the system upgrade cycle. This enables the system to quickly adapt to new market changes and user needs.
[0280] 4. Internalize financial analysis capabilities and enhance financial scenario capabilities: The present invention uses the extracted analysis strategies as the training objectives of the model, which can internalize financial analysis capabilities into the model and improve the model's understanding and analysis capabilities in financial scenarios. This enables the system to more deeply understand the professional knowledge in the financial field and apply it to actual analysis, thereby providing more professional services.
[0281] It should be noted that the prompt words used in the stages of analysis strategy extraction, Agent execution, etc. in the embodiments of the present application can be adjusted according to the effects of different large language models, and are not limited to the examples provided in the embodiments of the present application. The solutions of the embodiments of the present application can be applied not only to the financial field, but also to other fields, such as law, medicine, etc. Taking law as an example, analysis strategies can be extracted from court judgment reports to guide the model to perform relevant legal retrieval, reasoning, and final answer generation. The embodiments of the present application are not limited to text modalities. When the domain reports are multi-modal, such as including information such as charts, the analysis strategy extraction model in the technical solution can be replaced with a multi-modal model. Similarly, in the reasoning stage, the large language model can also be replaced with a multi-modal model.
[0282] The following continues to describe the exemplary structure of the software module implementation of the information processing device 455 provided in the embodiments of the present application. In some embodiments, as Figure 2 shown, the software modules stored in the information processing device 455 in the memory 450 may include:
[0283] An identification module 4551, configured to identify the target knowledge field to which the request information to be processed belongs.
[0284] A query module 4552, configured to query a plurality of analysis strategies for the target knowledge field from the first database based on the request information.
[0285] A matching module 4553, configured to determine the matching degree between each analysis strategy and the request information.
[0286] A processing module 4554, configured to determine at least one target analysis strategy based on the matching degree between each analysis strategy and the request information, and the plurality of analysis strategies.
[0287] A reply module 4555, configured to generate a reply message for the request information based on the request information and the target analysis strategy.
[0288] In some embodiments, the query module 4552 is further configured to extract at least one target keyword belonging to the target knowledge field from the request information; and query a plurality of analysis strategies from the first database based on the target keyword.
[0289] In some embodiments, the first database includes a knowledge graph, which includes a plurality of keyword nodes and a plurality of analysis strategy nodes. When an analysis strategy node is configured to process a keyword node, there is an edge between the analysis strategy node and the keyword node; the query module 4552 is further configured to query the keyword nodes in the knowledge graph that match the target keyword; determine the edges connected to the keyword nodes that match the target keyword as target edges; and obtain the analysis strategies stored in the analysis strategy nodes connected to the target edges.
[0290] In some embodiments, the query module 4552 is further configured to extract a plurality of analysis strategies from the first database and sort the extracted plurality of analysis strategies. Among them, in the sorting result, the similarity between two adjacent analysis strategies is greater than the similarity between two non-adjacent analysis strategies; starting from the head of the sorting result, sample according to a preset sampling interval to obtain a plurality of analysis strategies in the target knowledge field.
[0291] In some embodiments, the processing module 4554 is further configured to compare the matching degree between each analysis strategy and the request information with a preset matching degree threshold for each analysis strategy; when the matching degree is greater than or equal to the matching degree threshold, determine the analysis strategy as the target analysis strategy.
[0292] In some embodiments, when the matching degree between each analysis strategy and the request information is less than the preset matching degree threshold, the processing module 4554 is further configured to select at least one analysis strategy from the plurality of analysis strategies in descending order of the matching degree; generate at least one target analysis strategy based on the request information and the at least one analysis strategy.
[0293] In some embodiments, for each analysis strategy, the matching module 4553 is further configured to obtain the weight of the analysis strategy and the instruction information pre-associated with the analysis strategy from the first database, where the instruction information is the information configured to be replied through the analysis strategy; determine the similarity between the request information and the instruction information; and determine the product of the similarity and the weight as the matching degree between the analysis strategy and the request information.
[0294] In some embodiments, the information processing device 455 further includes a feedback module, which is configured to, after generating the reply information of the request information, when receiving positive feedback for the reply information, if the first database includes the target analysis strategy, increase the weight of the target analysis strategy, and if the first database does not include the target analysis strategy, add the target analysis strategy to the first database.
[0295] In some embodiments, when receiving negative feedback for the reply information, the feedback module is further configured to, if the first database includes the target analysis strategy, reduce the weight of the target analysis strategy, or delete the target analysis strategy from the first database.
[0296] In some embodiments, the matching module 4553 is further configured to, for each analysis strategy, obtain instruction information pre-associated with the analysis strategy from the first database, where the instruction information is information configured to be replied through the analysis strategy; encode the instruction information to obtain a first encoded vector; encode the request information to obtain a second encoded vector; determine the similarity between the first encoded vector and the second encoded vector; and determine the similarity as the matching degree between the analysis strategy and the request information.
[0297] In some embodiments, the recognition module 4551 is further configured to construct a first prompt word based on a preset plurality of knowledge domains and the request information, where the first prompt word is used to indicate matching of the request information and the plurality of knowledge domains; call a language model based on the first prompt word to trigger the language model to match the request information and the plurality of knowledge domains, and obtain the probability that the request information belongs to each knowledge domain; and determine the knowledge domain with the highest probability as the target knowledge domain.
[0298] In some embodiments, the reply module 4555 is further configured to query associated information from the second database based on the request information and the target analysis strategy, where the second database includes a plurality of pieces of information, and the associated information is information related to the request information and the target analysis strategy; and generate a reply message for the request information based on the request information, the target analysis strategy, and the associated information.
[0299] In some embodiments, the reply module 4555 is further configured to obtain a first prompt word template, where the first prompt word template is used to guide the language model to reply to the request information; fill the first prompt word template according to the target analysis strategy to obtain a second prompt word; and call the language model based on the second prompt word to generate a reply message based on the associated information and the request information.
[0300] In some embodiments, the information processing device 455 further includes a training module, configured to obtain sample request information, as well as a sample analysis strategy and a sample reply message corresponding to the sample request information; call the language model to perform information processing on the sample request information to obtain a predicted analysis strategy and a predicted reply message for the sample request information, where the predicted analysis strategy is used to indicate that the language model analyzes the sample request information; determine a target loss according to the sample analysis strategy, the predicted analysis strategy, the sample reply message, and the predicted reply message; and update the model parameters of the language model based on the target loss to obtain a trained language model.
[0301] In some embodiments, the reply module 4555 is further configured to, when the request information includes information in multiple modalities, call a language model to perform the following processing: extract features from the information in each modality respectively to obtain a first feature vector corresponding to the information in each modality; extract features from the target analysis strategy to obtain a second feature vector; perform feature fusion on the second feature vector and the first feature vector corresponding to the information in each modality to obtain a third feature vector; and generate a reply information based on the third feature vector.
[0302] In some embodiments, the information processing device 455 further includes a construction module, configured to obtain a second prompt template for the language model, where the second prompt template is used to guide the language model to generate an analysis strategy; for each knowledge domain, fill the second prompt template according to the knowledge information of the knowledge domain to obtain a third prompt; call the language model based on the third prompt to generate an analysis strategy corresponding to the knowledge information; and store the analysis strategies corresponding to the knowledge information of each knowledge domain in a first database.
[0303] An embodiment of the present application provides a computer program product, which includes a computer program or computer executable instructions, and the computer program or computer executable instructions are stored in a computer-readable storage medium. A processor of an electronic device reads the computer executable instructions from the computer-readable storage medium, and the processor executes the computer executable instructions, so that the electronic device executes the information processing method described above in the embodiments of the present application.
[0304] An embodiment of the present application provides a computer-readable storage medium, in which computer executable instructions or a computer program are stored. When the computer executable instructions or the computer program are executed by a processor, the processor will be caused to execute the information processing method provided in the embodiments of the present application. For example, Figure 3 the information processing method shown.
[0305] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disc, or CD-ROM; or may be various devices including one or any combination of the above memories.
[0306] In some embodiments, the computer executable instructions may be in the form of a program, software, software module, script, or code, and may be written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including being deployed as an independent program or being deployed as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0307] By way of example, the computer-executable instructions may or may not correspond to a file in a file system, and may be stored as part of a file that holds other programs or data. For example, they may be stored in one or more scripts in a Hyper Text Markup Language (HTML) document, stored in a single file dedicated to the program being discussed, or stored in multiple cooperating files (e.g., files that store one or more modules, subroutines, or portions of code).
[0308] By way of example, the computer-executable instructions may be deployed to execute on one electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.
[0309] In summary, by adopting a dynamic analysis strategy in the embodiments of the present application, more diverse analysis perspectives and richer answer content can be provided, meeting the different analysis needs of users, and thus improving the quality of answers.
[0310] The above description is only for the embodiments of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.
Claims
1. An information processing method, characterized in that The method includes: Identifying a target knowledge domain to which the request information to be processed belongs; Querying a plurality of analysis strategies for the target knowledge domain from a first database based on the request information; Determining the matching degree between each of the analysis strategies and the request information; Determining at least one target analysis strategy based on the matching degree between each of the analysis strategies and the request information, and the plurality of analysis strategies; Generating a reply message for the request information based on the request information and the target analysis strategy.
2. The method according to claim 1, wherein The querying a plurality of analysis strategies for the target knowledge domain from a first database based on the request information includes Extracting at least one target keyword belonging to the target knowledge domain from the request information; Querying a plurality of analysis strategies from the first database based on the target keyword.
3. The method according to claim 2, wherein The first database includes a knowledge graph, and the knowledge graph includes a plurality of keyword nodes and a plurality of analysis strategy nodes. When an analysis strategy node is configured to process a keyword node, there is an edge between the analysis strategy node and the keyword node; The querying a plurality of analysis strategies from the first database based on the target keyword includes: Querying keyword nodes in the knowledge graph that match the target keyword; Determining the edges connected to the keyword nodes that match the target keyword as target edges; Obtaining the analysis strategies stored in the analysis strategy nodes connected to the target edges.
4. The method according to claim 1, wherein The querying a plurality of analysis strategies for the target knowledge domain from a first database based on the request information includes: Extracting a plurality of analysis strategies from the first database, and sorting the extracted plurality of analysis strategies. Among the sorting results, the similarity between two adjacent analysis strategies is greater than the similarity between two non-adjacent analysis strategies; Sampling from the head of the sorting result at a preset sampling interval to obtain a plurality of analysis strategies for the target knowledge domain.
5. The method according to claim 1, wherein The determining at least one target analysis strategy based on the matching degree between each of the analysis strategies and the request information, and the plurality of analysis strategies includes: For each of the analysis strategies, comparing the matching degree between the analysis strategy and the request information with a preset matching degree threshold; When the matching degree is greater than or equal to the matching degree threshold, determining the analysis strategy as the target analysis strategy.
6. The method according to claim 1, characterized in that, The determining at least one target analysis strategy based on the matching degree between each of the analysis strategies and the request information, and the plurality of analysis strategies includes: When the matching degree between each of the analysis strategies and the request information is less than the preset matching degree threshold, selecting at least one analysis strategy from the plurality of analysis strategies in descending order of the matching degree; Generating at least one target analysis strategy based on the request information and the at least one analysis strategy.
7. The method according to any one of claims 1 to 6, characterized in that, The determining the matching degree between each of the analysis strategies and the request information includes: For each of the analysis strategies, obtain the weight of the analysis strategy and the instruction information pre-associated with the analysis strategy from the first database, where the instruction information is information configured to be replied through the analysis strategy; Determine the similarity between the request information and the instruction information; Determine the product of the similarity and the weight as the matching degree between the analysis strategy and the request information.
8. The method according to claim 7, wherein After generating the reply information for the request information, the method further includes: When receiving positive feedback for the reply information, If the first database includes the target analysis strategy, increase the weight of the target analysis strategy, If the first database does not include the target analysis strategy, add the target analysis strategy to the first database.
9. The method according to claim 7, wherein After generating the reply information for the request information, the method further includes: When receiving negative feedback for the reply information, if the first database includes the target analysis strategy, reduce the weight of the target analysis strategy, or delete the target analysis strategy from the first database.
10. The method according to any one of claims 1 to 6, characterized in that, The determining the matching degree between each analysis strategy and the request information includes: For each analysis strategy, obtain the instruction information pre-associated with the analysis strategy from the first database, where the instruction information is information configured to be replied through the analysis strategy; Encode the instruction information to obtain a first encoded vector; Encode the request information to obtain a second encoded vector; Determine the similarity between the first encoded vector and the second encoded vector; Determine the similarity as the matching degree between the analysis strategy and the request information.
11. The method according to any one of claims 1 to 6, characterized in that The identifying the target knowledge domain to which the request information to be processed belongs includes: Construct a first prompt based on a preset plurality of knowledge domains and the request information, where the first prompt is used to indicate matching the request information and the plurality of knowledge domains; Call a language model based on the first prompt to trigger the language model to match the request information and the plurality of knowledge domains, and obtain the probability that the request information belongs to each knowledge domain; Determine the knowledge domain with the highest probability as the target knowledge domain.
12. The method according to any one of claims 1 to 6, characterized in that, The generating the reply information for the request information based on the request information and the target analysis strategy includes: Query associated information from a second database based on the request information and the target analysis strategy, where the second database includes a plurality of information, and the associated information is the information related to the request information and the target analysis strategy; Generate the reply information for the request information based on the request information, the target analysis strategy, and the associated information.
13. The method according to claim 12, wherein The generating the reply information for the request information based on the request information, the target analysis strategy, and the associated information includes: Obtain a first prompt template, where the first prompt template is used to guide the language model to reply to the request information; Fill the first prompt template according to the target analysis strategy to obtain a second prompt; Call the language model based on the second prompt to generate a response message based on the association information and the request information.
14. The method according to claim 13, characterized in that, The method further includes: Obtain sample request information, as well as a sample analysis strategy and a sample response message corresponding to the sample request information; Call the language model to process the sample request information to obtain a predicted analysis strategy and a predicted response message for the sample request information, where the predicted analysis strategy is used to instruct the language model to analyze the sample request information; Determine a target loss according to the sample analysis strategy, the predicted analysis strategy, the sample response message, and the predicted response message; Update the model parameters of the language model based on the target loss to obtain the trained language model.
15. The method according to any one of claims 1 to 6, characterized in that, Generating a response message for the request information based on the request information and the target analysis strategy includes: When the request information includes information in multiple modalities, call the language model to perform the following processing: Extract features from the information of each modality respectively to obtain a first feature vector corresponding to the information of each modality; Extract features from the target analysis strategy to obtain a second feature vector; Perform feature fusion on the second feature vector and the first feature vector corresponding to the information of each modality to obtain a third feature vector; Generate a response message based on the third feature vector.
16. The method according to any one of claims 1 to 6, characterized in that, Before identifying the target knowledge domain to which the request information to be processed belongs, the method further includes: Obtain a second prompt template for the language model, where the second prompt template is used to guide the language model to generate an analysis strategy; For each knowledge domain, fill the second prompt template according to the knowledge information of the knowledge domain to obtain a third prompt; Call the language model based on the third prompt to generate an analysis strategy corresponding to the knowledge information; Store the analysis strategies corresponding to the knowledge information of each knowledge domain in the first database.
17. An information processing apparatus, characterized in that, The device includes: An identification module, configured to identify the target knowledge domain to which the request information to be processed belongs; A query module, configured to query, based on the request information, a plurality of analysis strategies for the target knowledge domain from a first database; A matching module, configured to determine the matching degree between each analysis strategy and the request information; A processing module, configured to determine at least one target analysis strategy based on the matching degree between each analysis strategy and the request information, and the plurality of analysis strategies; A response module, configured to generate a response message for the request information based on the request information and the target analysis strategy.
18. An electronic device, characterized in that, The electronic device includes: A memory, configured to store computer-executable instructions or computer programs; A processor, configured to implement the information processing method according to any one of claims 1 to 16 when executing the computer-executable instructions or computer programs stored in the memory.
19. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that, The computer-executable instructions or computer programs, when executed by the processor, implement the information processing method according to any one of claims 1 to 16.
20. A computer program product, comprising computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, the information processing method according to any one of claims 1 to 16 is implemented.
Citation Information
Cited By
Data updating method and device for agent memory and electronic equipment
CN121560898A