Session information extraction method and device, equipment, storage medium and product

By converting user input into SQL statements and using a pre-trained large language model, the method improves the accuracy of conversation information extraction in complex scenarios by accurately identifying user intentions.

CN119088821APending Publication Date: 2024-12-06CHINA MERCHANTS BANK
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411208379.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

Traditional target large language models struggle to accurately identify user intentions in complex scenarios involving multiple rounds of user conversations, leading to poor accuracy in extracting conversation information.

Method used

Convert user input conversations into prompt words of a database structure SQL statement, utilize a pre-trained target large language model to extract information, and parse the resulting SQL statement to obtain accurate information extraction results.

Benefits of technology

Enhances the accuracy of conversation information extraction by leveraging the large language model's coding capabilities to process and generate complex codes, accurately distinguishing user intentions in complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088821A_ABST
    Figure CN119088821A_ABST
Patent Text Reader

Abstract

The invention discloses a session information extraction method and device, equipment, a storage medium and a product, relates to the technical field of artificial intelligence, and discloses a session information extraction method comprising the following steps: obtaining a to-be-extracted session input by a user; based on the to-be-extracted session, constructing a database storage structure MySQL table, and based on the to-be-extracted session and the MySQL table, generating a cue word; the cue word is input into a preset target large language model, a target SQL statement output by the target large language model is received, and the target SQL statement is obtained by conducting statement generation on the cue word through the target large language model based on the information extraction instruction; and analyzing the target SQL statement to obtain an information extraction result corresponding to the to-be-extracted session. According to the method, the to-be-extracted session is converted into the cue word of the SQL statement, so that the accuracy of session information extraction is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to conversation information extraction methods, devices, equipment, storage media and products. Background Art

[0002] At present, with the development of artificial intelligence technology, conversational question-answering robots are used in various fields, such as the financial field. Among them, conversational question-answering robots can output corresponding answers based on the text input by the user.

[0003] In related technologies, users usually input question text into the target large language model, which then analyzes the user's latest question, extracts conditions, and then executes and generates correct responses based on different scenarios. However, when dealing with complex scenarios such as multiple rounds of user conversations, traditional target large language models are unable to identify the user's actual intentions, resulting in poor accuracy in extracting conversation information.

[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of this application is to provide a method for extracting session information, aiming to solve the technical problem of poor accuracy in extracting session information.

[0006] To achieve the above purpose, the present application proposes a method for extracting session information, the method for extracting session information comprising:

[0007] Get the session to be extracted input by the user;

[0008] Based on the conversation to be extracted, a database storage structure MySQL table is constructed, and based on the conversation to be extracted and the MySQL table, a prompt word is generated, wherein the prompt word is a database structure SQL statement;

[0009] Inputting the prompt word into a preset target large language model, and receiving a target SQL statement output by the target large language model, wherein the target SQL statement is obtained by the target large language model generating a statement for the prompt word based on an information extraction instruction;

[0010] The target SQL statement is parsed to obtain the information extraction result corresponding to the session to be extracted.

[0011] Optionally, the step of constructing a database storage structure MySQL table based on the session to be extracted includes:

[0012] Get the target virtual table;

[0013] Extracting context information from the session to be extracted;

[0014] The context information and the target virtual table are combined to construct a database storage structure MySQL table.

[0015] Optionally, the step of obtaining the target virtual table includes:

[0016] Determining the conversation scenario information of the conversation to be extracted;

[0017] Selecting an initial virtual table corresponding to the session scenario information from a preset virtual table library;

[0018] Selecting business knowledge corresponding to the conversation scenario information from a preset business knowledge base;

[0019] A target virtual table is generated based on the business knowledge and the initial virtual table.

[0020] Optionally, the step of generating prompt words based on the conversation to be extracted and the MySQL table includes:

[0021] Extracting context information from the session to be extracted;

[0022] The context information, the business knowledge and the MySQL table are combined to generate prompt words.

[0023] Optionally, before the step of obtaining the conversation to be extracted input by the user, the method includes:

[0024] Acquire historical sample data and output answer labels of the historical sample data;

[0025] Based on the historical sample data, a database storage structure MySQL table is constructed, and based on the historical sample data and the MySQL table, instruction data is generated, wherein the instruction data is a database structure SQL statement;

[0026] Based on the instruction data and the output reply label, the preset model to be trained is iteratively trained to obtain a target large language model.

[0027] Optionally, the step of iteratively training a preset model to be trained based on the instruction data and the output reply label to obtain a target large language model includes:

[0028] Acquire general data, wherein the general data includes general code data and general Chinese instruction data;

[0029] Merging the general data and the instruction data to obtain multi-task data;

[0030] Based on the instruction data and the output reply label, a preset model to be trained is iteratively trained for one stage to obtain an initial large language model;

[0031] Based on the multi-task data and the output answer label, the initial large language model is iteratively trained in two stages to obtain an instruction-enhanced target large language model.

[0032] In addition, to achieve the above purpose, the present application also proposes a session information extraction device, the session information extraction device comprising:

[0033] An acquisition module is used to obtain the session to be extracted input by the user;

[0034] A construction module, used to construct a database storage structure MySQL table based on the conversation to be extracted, and generate a prompt word based on the conversation to be extracted and the MySQL table, wherein the prompt word is a database structure SQL statement;

[0035] An extraction module, used for inputting the prompt word into a preset target large language model, and receiving a target SQL statement output by the target large language model, wherein the target SQL statement is obtained by the target large language model generating a statement for the prompt word based on an information extraction instruction;

[0036] The parsing module is used to parse the target SQL statement to obtain the information extraction result corresponding to the session to be extracted.

[0037] In addition, to achieve the above-mentioned purpose, the present application also proposes a session information extraction device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the session information extraction method described above.

[0038] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the session information extraction method described above are implemented.

[0039] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the session information extraction method described above are implemented.

[0040] One or more technical solutions proposed in this application have at least the following technical effects:

[0041] In the related art, the user usually inputs the question text into the target large language model, and the target large language model parses the user's latest question, extracts the conditions, and then executes and generates the correct response according to different scenarios. However, when dealing with complex scenarios such as multiple rounds of user conversations, the traditional target large language model cannot distinguish the user's actual intention, resulting in poor accuracy in extracting conversation information. In comparison, the present application converts the conversation to be extracted input by the user into a prompt word of a database structure SQL statement, and then extracts the information of the prompt word through the pre-trained target large language model to obtain the corresponding extracted target SQL statement, and finally parses the target SQL statement to obtain the information extraction result corresponding to the conversation to be extracted. It is understandable that the large language model has strong code capabilities and the ability to process and generate complex codes. Therefore, the large language model can extract more accurate information from the prompt words converted into SQL statements, and then accurately distinguish the user's actual intention, thereby improving the accuracy of conversation information extraction. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0044] Figure 1 A flowchart of the first embodiment of the method for extracting session information of the present application is provided;

[0045] Figure 2 This is a schematic diagram of virtual table information in the session information extraction method of this application;

[0046] Figure 3 This is a schematic diagram of a prompt word case in the conversation information extraction method of this application;

[0047] Figure 4 This is a schematic diagram of the overall process structure of the session information extraction method of this application;

[0048] Figure 5 A flowchart of the second embodiment of the method for extracting session information of the present application is provided;

[0049] Figure 6 This is a schematic diagram of the target large language model training process in the conversation information extraction method of this application;

[0050] Figure 7This is a schematic diagram of the SQL parsing process in the session information extraction method of this application;

[0051] Figure 8 This is a schematic diagram of the module structure of the session information extraction device according to an embodiment of the present application;

[0052] Fig. 9 This is a schematic diagram of the device structure of the hardware operating environment involved in the method for extracting session information in the embodiment of the present application.

[0053] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0054] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0055] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0056] The main solution of the embodiment of the present application is: obtaining a conversation to be extracted input by a user; constructing a database storage structure MySQL table based on the conversation to be extracted, and generating a prompt word based on the conversation to be extracted and the MySQL table, wherein the prompt word is a database structure SQL statement; inputting the prompt word into a preset target large language model, and receiving a target SQL statement output by the target large language model, wherein the target SQL statement is obtained by the target large language model generating a statement for the prompt word based on an information extraction instruction; parsing the target SQL statement to obtain an information extraction result corresponding to the conversation to be extracted.

[0057] In this embodiment, the session information extraction device is used as the execution subject. For the convenience of description, it will be described as "device" hereinafter.

[0058] In related technologies, users usually input question text into the target large language model, which then analyzes the user's context and latest question, extracts conditions, and then executes and generates correct responses based on different scenarios. However, when dealing with complex scenarios such as multiple rounds of user conversations, traditional target large language models are unable to identify the user's actual intentions, resulting in poor accuracy in extracting conversation information.

[0059] The present application provides a solution to achieve session information extraction of complex sessions, thereby improving the accuracy of session information extraction.

[0060] From the above embodiments, it can be seen that the present application converts the conversation to be extracted input by the user into the prompt words of the database structure SQL statement, and then extracts the information of the prompt words through the pre-trained target large language model to obtain the corresponding extracted target SQL statement, and finally parses the target SQL statement to obtain the information extraction result corresponding to the conversation to be extracted. It is understandable that the large language model has strong coding ability and has the ability to process and generate complex code. Therefore, the large language model can extract more accurate information from the prompt words converted into SQL statements, and then accurately identify the actual intention of the user, thereby improving the accuracy of conversation information extraction.

[0061] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a terminal system, etc. The following takes the conversation information extraction device as an example to illustrate this embodiment and the following embodiments.

[0062] Based on this, the present application embodiment provides a method for extracting session information. Figure 1 , Figure 1 This is a flow chart of the first embodiment of the method for extracting conversation information of the present application.

[0063] In this embodiment, the session information extraction method includes steps S100 to S400:

[0064] Step S100, obtaining the conversation to be extracted input by the user;

[0065] It should be noted that the conversation to be extracted refers to the conversation data input by the user that needs to be analyzed and processed. The purpose of the device is to extract valuable information from the conversation to be extracted. These conversations can be naturally occurring conversations or conversation records collected in specific scenarios.

[0066] In a specific implementation, the apparatus receives the conversation to be extracted input by the user based on a preset user interaction device, thereby obtaining the conversation to be extracted input by the user.

[0067] Step S200, constructing a database storage structure MySQL table based on the conversation to be extracted, and generating a prompt word based on the conversation to be extracted and the MySQL table, wherein the prompt word is a database structure SQL statement;

[0068] It should be noted that the database storage structure MySQL table is a structure used to store data in the MySQL database management system. MySQL is a popular relational database management system that uses structured query language (SQL) to manage data. The MySQL table consists of rows (records) and columns (fields), and each column can store a type of data, such as integers, floating point numbers, strings, dates, etc.

[0069] In the specific implementation, a prompt usually refers to an input method used to guide or instruct the model to generate a specific output, where the prompt can be a question, a text, an instruction, or any form of input that stimulates the large language model to respond in a certain way.

[0070] In a specific implementation, the present application constructs a database storage structure MySQL table based on the conversation to be extracted through a device, and generates prompt words based on the conversation to be extracted and the MySQL table, wherein the prompt words are database structure SQL statements, thereby converting the conversation to be extracted input by the user into prompt words of the database structure SQL statement, that is, writing SQL conditional statements according to the user's questions and the table structure, wherein the prompt words can also be called instruction data for subsequent large language model processing. It is understandable that the large language model has strong code capabilities and has the ability to process and generate complex codes, so the large language model can extract more accurate information from the prompt words converted into SQL statements, and then accurately identify the user's actual intentions, thereby improving the accuracy of conversation information extraction.

[0071] In a specific implementation, the device constructs a database storage structure MySQL table based on the to-be-extracted session, including:

[0072] Acquire a target virtual table; extract context information from the session to be extracted; combine the context information with the target virtual table to construct a database storage structure MySQL table.

[0073] It should be noted that in the database field, a virtual table (View) is a logical representation of a query result set. It does not store the data itself, but dynamically generates data when querying the virtual table. The context information refers to other words or sentences in the text that are related to the currently processed word or phrase. Specifically, the context information in this application includes user historical questions and user latest questions. It is understandable that there are often multiple rounds of conversations during the user's question-and-answer interaction. In this scenario, the user's latest question is asked after the user's historical question, that is, the user's latest question is raised on the user's historical question. For example, the user's historical question is: "Recommend insurance", and the user's latest question is: "What are the life insurances with a premium of 3%", that is, in the multi-round conversation scenario, the user's actual intention is to recommend life insurance with a premium of 3%. Therefore, the combination of user historical questions and user's latest questions needs to be considered in this application, rather than just answering the user's latest question.

[0074] In a specific implementation, the device may obtain the target virtual table by constructing a virtual table information for the field from which information needs to be extracted and attaching a description. Figure 2 This application takes the information extraction in the Q&A of insurance clause documents as an example. The information extraction of common insurance clause document Q&A mainly extracts important financial information in the user's question: insurance name, insurance code, insurance period, insurance premium rate, insurance type, etc. The device can construct a non-existent virtual table information according to the required information. Furthermore, the device combines the context information with the target virtual table to construct a database storage structure MySQL table.

[0075] In a specific implementation, the step of the device obtaining the target virtual table includes:

[0076] Determine the conversation scenario information of the conversation to be extracted; select an initial virtual table corresponding to the conversation scenario information from a preset virtual table library; select business knowledge corresponding to the conversation scenario information from a preset business knowledge library; generate a target virtual table based on the business knowledge and the initial virtual table.

[0077] It should be noted that the conversation scene information refers to the background information, situation setting, participant information, topic development, etc. involved in the conversation process, which together constitute the environment and context in which the conversation occurs. The device extracts the corresponding conversation scene information from the conversation to be extracted. For example, if the conversation to be extracted is: "Recommend insurance", the device determines that the conversation scene information of the conversation to be extracted is an insurance-related scene in the financial field.

[0078] In specific implementation, business knowledge refers to information, skills, experience and understanding related to a specific industry or business field. It includes in-depth understanding of business processes, industry standards, regulations, market trends, customer needs and business strategies.

[0079] In a specific implementation, the virtual table library stores virtual tables under multiple scenarios, the business knowledge library stores business knowledge under multiple scenarios, and the device selects the corresponding initial virtual table and business knowledge according to the session scenario information.

[0080] In the specific implementation, this application injects business knowledge on the basis of the initial virtual table to help the big model to generate SQL more accurately, for example: "The insurance period unit is month, which needs to be converted, such as one year is 12 months, three years is 24 months" "The insurance premium rate unit is float, which needs to be converted, such as 5% is 0.05, three points is 0.04" and so on.

[0081] In a specific implementation, the device combines the context information with the target virtual table to construct a database storage structure MySQL table, including:

[0082] Extract target virtual table information from the target virtual table; and construct a database storage structure MySQL table by combining the context information, the business knowledge, the session scenario information and the target virtual table information.

[0083] In the specific implementation, the application constructs a MYSQL table based on different scenarios, and combines the context information (including user historical questions and user latest questions), the target virtual table and the business knowledge. The database storage structure MySQL table specifically refers to Figure 3 .

[0084] In a specific implementation, the step of generating a prompt word based on the conversation to be extracted and the MySQL table includes:

[0085] Extracting context information from the conversation to be extracted; and generating prompt words by combining the context information, the business knowledge and the MySQL table.

[0086] In the specific implementation, the device performs generative information extraction based on the creation of a virtual table. The first step is to construct a table in a virtual database based on the conditions to be extracted, inject some additional business knowledge as required, and generate a final instruction to query the database based on the user's context and the latest questions. That is, this application proposes to inject some business knowledge to help the large model generate SQL more accurately.

[0087] Step S300, inputting the prompt word into a preset target large language model, and receiving a target SQL statement output by the target large language model, wherein the target SQL statement is obtained by the target large language model generating a statement for the prompt word based on an information extraction instruction;

[0088] It should be noted that the target large language model refers to an artificial intelligence model that has been trained with a large amount of data and has the ability to understand and generate natural language text. In this embodiment, the target large language model is specifically a generative code large model, which adopts an autoregressive decoding model. Since the traditional code large model has a general response effect on business knowledge type instructions, this application fine-tunes the large model's ability to write MySQL based on business knowledge, thereby enhancing the model's ability to follow business knowledge instructions when writing MySQL statements.

[0089] In a specific implementation, the device inputs the prompt word into a preset target large language model, and receives a target SQL statement output by the target large language model, wherein the target SQL statement is obtained by the target large language model generating a statement for the prompt word based on an information extraction instruction.

[0090] Step S400, parsing the target SQL statement to obtain the information extraction result corresponding to the session to be extracted.

[0091] In the specific implementation, the parsing of SQL statements is a process of converting SQL text into executable operations, involving multiple steps, which is completed by the SQL parser in the database management system. Specifically, the device parses the target SQL statement to obtain the information extraction result corresponding to the session to be extracted, that is, the device parses the generated SQL to obtain the SPO (subject, predicate, object) in traditional information extraction. If the parsing fails, the parsed error information is returned to the large model for SQL correction. After adopting this solution, the overall end-to-end information extraction accuracy is effectively improved.

[0092] In the specific implementation, refer to Figure 4 The device performs generative information extraction based on the creation of virtual tables. The first step is to construct a table in a virtual database based on the conditions to be extracted, inject some additional business knowledge according to the needs, and generate a final instruction to query the database based on the user's context and the latest questions; then input the instruction into the generative large model to generate the required response, that is, the SQL statement; finally, standardize the SQL statement and parse the conditional field.

[0093] In the related art, the user usually inputs the question text into the target large language model, and the target large language model parses the user's latest question, extracts the conditions, and then executes and generates the correct response according to different scenarios. However, when dealing with complex scenarios such as multiple rounds of user conversations, the traditional target large language model cannot distinguish the user's actual intention, resulting in poor accuracy in extracting conversation information. In comparison, the present application converts the conversation to be extracted input by the user into a prompt word of a database structure SQL statement, and then extracts the information of the prompt word through the pre-trained target large language model to obtain the corresponding extracted target SQL statement, and finally parses the target SQL statement to obtain the information extraction result corresponding to the conversation to be extracted. It is understandable that the large language model has strong code capabilities and the ability to process and generate complex codes. Therefore, the large language model can extract more accurate information from the prompt words converted into SQL statements, and then accurately distinguish the user's actual intention, thereby improving the accuracy of conversation information extraction.

[0094] Based on the above first embodiment, the present application also proposes another embodiment, referring to Figure 5 , the session information extraction method comprises:

[0095] In a specific implementation, before the step of the device obtaining the conversation to be extracted input by the user, the method includes:

[0096] Step A100, obtaining historical sample data and output reply labels of the historical sample data;

[0097] It should be noted that the historical sample data is sample data that contains historical conversation data, and the output response label of the historical sample data is the output response label of the corresponding historical sample data that is manually annotated, that is, the output response label is regarded as the accurate response output by the large language model when receiving the historical sample data during the model training process.

[0098] Step A200, constructing the historical sample data into a database storage structure MySQL table, and generating instruction data corresponding to the MySQL table, wherein the instruction data is a database structure SQL statement;

[0099] In a specific implementation, the device constructs the historical sample data into a database storage structure MySQL table, and generates instruction data corresponding to the MySQL table, wherein the instruction data is a database structure SQL statement, specifically referring to the following Table 1:

[0100]

[0101]

[0102] Step A300, based on the instruction data and the output response label, iteratively train the preset model to be trained to obtain a target large language model.

[0103] In a specific implementation, the device iteratively trains a preset model to be trained based on the instruction data and the output reply label to obtain a target large language model, including:

[0104] Acquire general data, wherein the general data includes general code data and general Chinese instruction data; merge the general data and the instruction data to obtain multi-task data; based on the instruction data and the output reply label, perform a first-stage iterative training on a preset model to be trained to obtain an initial large language model; based on the multi-task data and the output reply label, perform a second-stage iterative training on the initial large language model to obtain an instruction-enhanced target large language model.

[0105] In the specific implementation, this application divides the training of the large language model into two stages. First, the constructed instruction data is used for training to obtain the initial large language model, and then the training data of the traditional code large model is integrated, and the data set ratio is continuously adjusted to perform multi-task training. Without losing the model code ability, the Chinese understanding ability of the large language model is enhanced, and the final target large language model is obtained. During the training process, the device can perform mask operations on the instruction input, and only let the model calculate the loss based on the expected output, so as to enhance the model's ability to understand the instructions.

[0106] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the session information extraction method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0107] This application also provides a session information extraction device, please refer to Figure 8 , the session information extraction device comprises:

[0108] An acquisition module 10 is used to acquire the session to be extracted input by the user;

[0109] A construction module 20 is used to construct a database storage structure MySQL table based on the conversation to be extracted, and generate a prompt word based on the conversation to be extracted and the MySQL table, wherein the prompt word is a database structure SQL statement;

[0110] The extraction module 30 is used to input the prompt word into a preset target large language model, and receive a target SQL statement output by the target large language model, wherein the target SQL statement is obtained by the target large language model generating a statement for the prompt word based on the information extraction instruction;

[0111] The parsing module 40 is used to parse the target SQL statement to obtain the information extraction result corresponding to the session to be extracted.

[0112] Optionally, the building module 20 includes:

[0113] A virtual table acquisition module is used to acquire a target virtual table;

[0114] An extraction module, used to extract context information from the session to be extracted;

[0115] The combining module is used to combine the context information with the target virtual table to construct a database storage structure MySQL table.

[0116] Optionally, the virtual table acquisition module includes:

[0117] A session scene determination module, used to determine the session scene information of the session to be extracted;

[0118] A virtual table selection module, used to select an initial virtual table corresponding to the session scenario information from a preset virtual table library;

[0119] A business knowledge selection module, used to select business knowledge corresponding to the session scenario information from a preset business knowledge base;

[0120] A generating module is used to generate a target virtual table based on the business knowledge and the initial virtual table.

[0121] Optionally, the building module 20 further includes:

[0122] An information extraction module, used to extract context information from the conversation to be extracted;

[0123] The prompt word generation module is used to generate prompt words by combining the context information, the business knowledge and the MySQL table.

[0124] Optionally, the session information extraction device further includes:

[0125] A sample acquisition module, used to acquire historical sample data and output reply labels of the historical sample data;

[0126] A sample processing module, used to construct a database storage structure MySQL table based on the historical sample data, and generate instruction data based on the historical sample data and the MySQL table, wherein the instruction data is a database structure SQL statement;

[0127] The training module is used to iteratively train the preset model to be trained based on the instruction data and the output response label to obtain a target large language model.

[0128] Optionally, the training module includes:

[0129] A general data acquisition module, used to acquire general data, wherein the general data includes general code data and general Chinese instruction data;

[0130] A merging module, used for merging the general data and the instruction data to obtain multi-task data;

[0131] A one-stage training module, used for performing one-stage iterative training on a preset model to be trained based on the instruction data and the output reply label to obtain an initial large language model;

[0132] The two-stage training module is used to perform two-stage iterative training on the initial large language model based on the multi-task data and the output response label to obtain a target large language model for instruction enhancement.

[0133] The session information extraction device provided by the present application adopts the session information extraction method in the above embodiment, which can solve the technical problem of session information extraction. Compared with the prior art, the beneficial effects of the session information extraction device provided by the present application are the same as the beneficial effects of the session information extraction method provided by the above embodiment, and other technical features in the session information extraction device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0134] The present application provides a session information extraction device, which includes: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the session information extraction method in the above-mentioned embodiment 1.

[0135] Reference below Fig. 9 , which shows a schematic diagram of the structure of a session information extraction device suitable for implementing the embodiment of the present application. The session information extraction device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig. 9 The session information extraction device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0136] like Fig. 9 As shown, the conversation information extraction device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the conversation information extraction device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the session information extraction device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a session information extraction device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0137] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0138] The session information extraction device provided by the present application adopts the session information extraction method in the above embodiment, which can solve the technical problem of session information extraction. Compared with the prior art, the beneficial effects of the session information extraction device provided by the present application are the same as the beneficial effects of the session information extraction method provided by the above embodiment, and other technical features in the session information extraction device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0139] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0140] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0141] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the method for extracting session information in the above-mentioned embodiment.

[0142] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0143] The computer-readable storage medium may be included in the session information extraction device; or may exist independently without being assembled into the session information extraction device.

[0144] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the session information extraction device, the session information extraction device extracts session information.

[0145] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0146] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0147] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0148] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned method for extracting session information, and can solve the technical problem of extracting session information. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the method for extracting session information provided in the above-mentioned embodiment, and will not be elaborated here.

[0149] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned session information extraction method when executed by a processor.

[0150] The computer program product provided by this application can solve the technical problem of extracting session information. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the session information extraction method provided by the above embodiment, which will not be repeated here.

[0151] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A method for extracting session information, It is characterized in that The method for extracting session information includes: Get the session to be extracted input by the user; Based on the conversation to be extracted, a database storage structure MySQL table is constructed, and based on the conversation to be extracted and the MySQL table, a prompt word is generated, wherein the prompt word is a database structure SQL statement; Inputting the prompt word into a preset target large language model, and receiving a target SQL statement output by the target large language model, wherein the target SQL statement is obtained by the target large language model generating a statement for the prompt word based on an information extraction instruction; The target SQL statement is parsed to obtain the information extraction result corresponding to the session to be extracted.

2. The method for extracting session information according to claim 1, It is characterized in that The step of constructing a database storage structure MySQL table based on the to-be-extracted session includes: Get the target virtual table; Extracting context information from the session to be extracted; The context information and the target virtual table are combined to construct a database storage structure MySQL table.

3. The method for extracting session information according to claim 2, It is characterized in that The step of obtaining the target virtual table includes: Determining the conversation scenario information of the conversation to be extracted; Selecting an initial virtual table corresponding to the session scenario information from a preset virtual table library; Selecting business knowledge corresponding to the conversation scenario information from a preset business knowledge base; A target virtual table is generated based on the business knowledge and the initial virtual table.

4. The method for extracting session information according to claim 3, It is characterized in that The step of generating prompt words based on the conversation to be extracted and the MySQL table includes: Extracting context information from the session to be extracted; The context information, the business knowledge and the MySQL table are combined to generate prompt words.

5. The method for extracting session information according to claim 1, It is characterized in that Before the step of obtaining the conversation to be extracted input by the user, the method includes: Acquire historical sample data and output answer labels of the historical sample data; Based on the historical sample data, a database storage structure MySQL table is constructed, and based on the historical sample data and the MySQL table, instruction data is generated, wherein the instruction data is a database structure SQL statement; Based on the instruction data and the output reply label, the preset model to be trained is iteratively trained to obtain a target large language model.

6. The method for extracting session information according to claim 5, It is characterized in that The step of iteratively training a preset model to be trained based on the instruction data and the output reply label to obtain a target large language model includes: Acquire general data, wherein the general data includes general code data and general Chinese instruction data; Merging the general data and the instruction data to obtain multi-task data; Based on the instruction data and the output reply label, a preset model to be trained is iteratively trained for one stage to obtain an initial large language model; Based on the multi-task data and the output answer label, the initial large language model is iteratively trained in two stages to obtain an instruction-enhanced target large language model.

7. A conversation information extraction device, It is characterized in that The device comprises: An acquisition module is used to obtain the session to be extracted input by the user; A construction module, used to construct a database storage structure MySQL table based on the conversation to be extracted, and generate a prompt word based on the conversation to be extracted and the MySQL table, wherein the prompt word is a database structure SQL statement; An extraction module, used for inputting the prompt word into a preset target large language model, and receiving a target SQL statement output by the target large language model, wherein the target SQL statement is obtained by the target large language model generating a statement for the prompt word based on an information extraction instruction; The parsing module is used to parse the target SQL statement to obtain the information extraction result corresponding to the session to be extracted.

8. A conversation information extraction device, It is characterized in that The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the method for extracting session information according to any one of claims 1 to 6.

9. A storage medium, It is characterized in that The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the session information extraction method according to any one of claims 1 to 6 are implemented.

10. A computer program product, It is characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the conversation information extraction method according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • SQL (Structured Query Language) statement processing method and device, electronic equipment and storage medium

    CN120705166A