CN-122021856-A - Data processing method, device, equipment and storage medium based on large language model
Abstract
The embodiment of the disclosure provides a data processing method, device, equipment and storage medium based on a large language model, and relates to the technical field of large models. The method comprises the steps of obtaining a text to be processed, obtaining a system prompt word, wherein the system prompt word comprises a first prompt word and a second prompt word, the first prompt word is used for prompting a target task of a large language model, the second prompt word is used for prompting task execution logic and a target output data format of the large language model, inputting the text to be processed and the system prompt word into the large language model, and executing the target task on the text to be processed according to the task execution logic and the target output data format prompted by the second prompt word by the large language model to obtain a task processing result with the data format being the target output data format. Based on the scheme provided by the embodiment of the disclosure, the model output effect can be effectively improved, and the actual application requirements can be better met.
Inventors
- LEI MENG
- LI YANG
- YANG XIAOFENG
- CHEN PENG
- JIANG JIE
Assignees
- 腾讯科技(深圳)有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20241111
Claims (15)
- 1. A method for processing data based on a large language model, the method comprising: Acquiring a text to be processed; acquiring system prompt words, wherein the system prompt words comprise a first prompt word and a second prompt word, the first prompt word is used for prompting a target task of the large language model, and the second prompt word is used for prompting task execution logic and a target output data format of the large language model; Inputting the text to be processed and the system prompt word into a large language model, and executing the target task on the text to be processed by the large language model according to task execution logic and target output data format prompted by the second prompt word to obtain a task processing result with the data format being the target output data format.
- 2. The method as recited in claim 1, further comprising: Acquiring a data format verification strategy corresponding to the target output data format; And automatically checking the data format of the task processing result based on the data format checking strategy to obtain a checking result.
- 3. The method of claim 1, wherein the second prompting word is further used for prompting at least one target content to be output by the large language model, and the task processing result includes each target content obtained based on the text to be processed.
- 4. The method of claim 3, wherein the at least one item of target content comprises at least one chart element and a chart type recommended by a large language model; Wherein the task execution logic includes inference logic between various chart elements and chart types recommended by the large language model; The second prompting word is used for prompting the large language model to select the recommended chart type from the plurality of candidate chart types.
- 5. The method of claim 4, wherein the at least one item object content comprises at least one of an inference process that further comprises a large language model or a recommended chart title.
- 6. A method according to claim 3, wherein the text to be processed comprises a target question related to a data query, and a target query statement corresponding to the target question.
- 7. The method of claim 6, wherein the obtaining text to be processed comprises: acquiring a target problem input by a target object; Analyzing the target problem to obtain a query object, a query condition and a target database to be queried, which are related to the target problem; Generating a target query statement corresponding to the target problem based on the query object, the query condition and a target database; And obtaining the text to be processed based on the target question and the target query statement.
- 8. The method of claim 6, wherein the at least one item of target content comprises at least one chart element and a chart type recommended by a large language model; the method further comprises the steps of: Executing the target query statement on a target database corresponding to the target query statement to obtain a query result, wherein the query result comprises data query results corresponding to at least part of chart elements in the at least one chart element; And generating a target chart of the corresponding chart type according to the chart type recommended by the large language model according to the at least part of chart elements and the corresponding data query result.
- 9. The method of any one of claims 1 to 6, wherein the acquiring a system hint word comprises: In response to obtaining the text to be processed, displaying a data format list, wherein the data format list comprises a plurality of candidate data formats; Determining any one of the plurality of candidate data formats as a target output data format in response to a selection operation for the any one of the data formats; determining a second prompting word corresponding to the target output data format according to a preset first mapping relation, wherein the first mapping relation comprises the second prompting word corresponding to each candidate data format in the plurality of candidate data formats; and obtaining a system prompt word based on the preset first prompt word and the determined second prompt word.
- 10. The method according to any one of claims 1 to 6, further comprising: Acquiring at least one learning sample, wherein the learning sample comprises a sample text, task execution logic aiming at the sample text, and a task processing result of the sample text with a data format of the target output data format; The task processing result with the data format being the target output data format is obtained, and the task processing result comprises: Inputting the to-be-processed problem, the system prompt word and the learning sample into a large language model, and executing the target task on the to-be-processed problem according to task execution logic and a target output data format prompted by the second prompt word by the large language model with reference to the learning sample to obtain a task processing result.
- 11. The method according to any one of claims 1 to 6, wherein obtaining the task processing result in the data format that is the target output data format includes: Inputting the text to be processed and the system prompt word into a large language model, and executing the following operations through the large language model to obtain a task processing result: Coding the text to be processed and the system prompt word to obtain a coding result; And continuously executing character prediction operation based on the coding result until the predicted next target character is a preset ending character, and combining the predicted target characters except the last target character to obtain the task processing result: wherein the character prediction operation includes the steps of: Predicting a next candidate character based on the encoding result and the predicted characteristics of the target character; Taking the next candidate character as a next target character under the condition that the predicted character meets the task constraint condition corresponding to the task execution logic, wherein the predicted character comprises the predicted target character and the next candidate character; and under the condition that the predicted character does not meet the task constraint condition, determining the next target character according to the task constraint condition.
- 12. A large language model based data processing apparatus, the apparatus comprising: the data acquisition model to be processed is used for acquiring a text to be processed; The system prompt word acquisition module is used for acquiring system prompt words, wherein the system prompt words comprise a first prompt word and a second prompt word, the first prompt word is used for prompting a target task of the large language model, and the second prompt word is used for prompting task execution logic and a target output data format of the large language model; The data processing module is used for inputting the text to be processed and the system prompt word into a large language model, and executing the target task on the text to be processed by the large language model according to task execution logic and a target output data format prompted by the second prompt word to obtain a task processing result with the data format being the target output data format.
- 13. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 11.
- 14. A computer-readable storage medium, characterized in that the storage medium has stored therein a computer program which, when executed by a processor, implements the steps of the method of any of claims 1 to 11.
- 15. A computer program product, characterized in that it comprises a computer program which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 11.
Description
Data processing method, device, equipment and storage medium based on large language model Technical Field The disclosure belongs to the technical field of computers, and can relate to the fields of artificial intelligence, large models, natural language processing and the like, and in particular, an embodiment of the disclosure relates to a data processing method, device, equipment and storage medium based on a large language model. Background In recent years, with the rapid development of artificial intelligence technology, the application of the artificial intelligence technology in various fields is more and more widespread, and more intelligent products based on man-machine interaction technology are also generated. Large language models play an increasingly important role. The large language model is a natural language processing model based on deep learning technology. The large language model is trained through a large amount of language data, so that the model learns how to understand, generate and translate human language, and can automatically generate articles, answer questions, conduct conversations and the like. At present, although a large language model is widely applied to diversified scenes to provide more convenient and effective service, how to promote the output of the model to better meet the actual application requirements is always one of the key problems of related technicians in research. Disclosure of Invention The embodiment of the disclosure provides a data processing method, device, equipment and storage medium based on a large language model, which can effectively improve the data processing effect and better meet the actual application demands. In order to achieve the purpose, the technical scheme provided by the embodiment of the disclosure is as follows: In one aspect, an embodiment of the present disclosure provides a data processing method based on a large language model, the method including: Acquiring a text to be processed; acquiring system prompt words, wherein the system prompt words comprise a first prompt word and a second prompt word, the first prompt word is used for prompting a target task of the large language model, and the second prompt word is used for prompting task execution logic and a target output data format of the large language model; Inputting the text to be processed and the system prompt word into a large language model, and executing the target task on the text to be processed by the large language model according to task execution logic and target output data format prompted by the second prompt word to obtain a task processing result with the data format being the target output data format. In another aspect, an embodiment of the present disclosure provides a data processing apparatus based on a large language model, the apparatus including: the data acquisition model to be processed is used for acquiring a text to be processed; The system prompt word acquisition module is used for acquiring system prompt words, wherein the system prompt words comprise a first prompt word and a second prompt word, the first prompt word is used for prompting a target task of the large language model, and the second prompt word is used for prompting task execution logic and a target output data format of the large language model; The data processing module is used for inputting the text to be processed and the system prompt word into a large language model, and executing the target task on the text to be processed by the large language model according to task execution logic and a target output data format prompted by the second prompt word to obtain a task processing result with the data format being the target output data format. Optionally, the device further comprises a verification module, wherein the verification module is used for acquiring a data format verification strategy corresponding to the target output data format, and automatically verifying the data format of the task processing result based on the data format verification strategy to obtain a verification result. Optionally, the second prompting word is further used for prompting at least one item target content to be output by the large language model, and the task processing result comprises each item target content obtained based on the text to be processed. Optionally, the at least one project label content comprises at least one chart element and a chart type recommended by a large language model, wherein the task execution logic comprises reasoning logic between various chart elements and chart types recommended by the large language model; The second prompting word is used for prompting the large language model to select the recommended chart type from the plurality of candidate chart types. Optionally, the at least one item title includes at least one of an inference process that further includes a large language model or a recommended chart title. Optionally, the text to be processed in