Query text data processing method and device, medium and electronic equipment

By deploying open source large language model and text format conversion model in private domain servers, unstructured text into structured text is solved, and data processing security and accuracy are achieved efficiently in private domain servers Query text data processing.

CN119128110APending Publication Date: 2024-12-13SHANSHU TECH (BEIJING) CO LTD +5
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411330028.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2024-12-13

Smart Images

  • Figure CN119128110A_ABST
    Figure CN119128110A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an inquiry text data processing method and device, a medium and electronic equipment. The method comprises the steps that inquiry text data are obtained and input into a first open-source big language model, and the first big language model has the ability of answering inquiry; obtaining first answer text data which is output by a first large language model and corresponds to the inquiry text data, wherein the first answer text data is a text in an unstructured text format; and inputting the first answer text data into a pre-trained text format conversion model, so that the text format conversion model outputs second answer text data, and the text format of the second answer text data is a text in a structured text format, the first large language model and the text format conversion model are deployed in a private domain server. According to the method and the device, the security in the inquiry text data processing process can be improved while the inquiry text data processing accuracy is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of artificial intelligence and natural language processing, and in particular to a method, device, medium and electronic device for processing inquiry text data. Background Art

[0002] With the rapid advancement of artificial intelligence and machine learning technologies, more and more companies and individuals are using large language models to make inquiries, and expect to obtain accurate and helpful questions and answers. Furthermore, users not only need the answers to meet their needs, but also expect the answers from large language models to conform to a certain text format, such as structured text format. Such structured text can help users better understand the content returned by the large language model and judge the correctness of the returned content. At present, some closed-source large language models (such as Chat GPT from Open AI) have the ability to output structured text due to their powerful prompt understanding and execution capabilities.

[0003] However, for users with high data security requirements, it is necessary to limit the query text data to their own private domain servers to prevent data leakage caused by uploading the query text data to the server of the large language model service provider. However, because the closed-source large language model is not public, it is currently impossible to deploy a closed-source large language model with powerful prompt understanding and execution capabilities in the private domain servers of enterprises or individuals. As a result, it is impossible to support the improvement of security in the process of processing query text data while ensuring the accuracy of query text data processing.

[0004] Based on this, how to ensure the accuracy of inquiry text data processing while improving the security in the process of processing inquiry text data is a technical problem that needs to be solved urgently. Summary of the invention

[0005] The embodiments of the present application provide a method, device, computer program product or computer program, computer-readable storage medium and electronic device for processing inquiry text data, which can improve the security in the process of processing inquiry text data while ensuring the accuracy of inquiry text data processing, at least to a certain extent.

[0006] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0007] According to one aspect of an embodiment of the present application, a method for processing inquiry text data is provided, the method comprising: obtaining inquiry text data, and inputting the inquiry text data into an open source first large language model, the first large language model having the ability to answer inquiries; obtaining first answer text data corresponding to the inquiry text data output by the first large language model, the first answer text data being text in an unstructured text format; inputting the first answer text data into a pre-trained text format conversion model so that the text format conversion model outputs second answer text data, the text format of the second answer text data being text in a structured text format, the first large language model and the text format conversion model being both deployed in a private domain server.

[0008] In some embodiments of the present application, based on the aforementioned scheme, a text format conversion model is trained through the following steps: obtaining multiple groups of training samples, wherein each group of training samples includes unstructured text and structured text with the same text content; training the model to be trained based on the multiple groups of training samples, so that the model to be trained learns the conversion logic between the unstructured text and the structured text in each group of training samples, and obtains the text format conversion model.

[0009] In some embodiments of the present application, based on the aforementioned scheme, obtaining multiple groups of training samples includes: sending a query request for generating the training samples to a closed-source second largest language model, the ability of the second largest language model to answer the query is higher than the ability of the first largest language model to answer the query; obtaining multiple groups of training samples generated by the second largest language model.

[0010] In some embodiments of the present application, based on the aforementioned scheme, the model to be trained includes the third largest language model that is open source.

[0011] In some embodiments of the present application, based on the aforementioned scheme, the training of the model to be trained based on the multiple groups of training samples includes: training the model to be trained based on the multiple groups of training samples according to the QLoRA method.

[0012] In some embodiments of the present application, based on the aforementioned solution, the unstructured text format is a TXT text format.

[0013] In some embodiments of the present application, based on the aforementioned scheme, the structured text format is a JSON text format.

[0014] According to one aspect of an embodiment of the present application, a query text data processing device is provided, the device comprising: an input unit, used to obtain query text data, and input the query text data into an open source first large language model, the first large language model having the ability to answer inquiries; an acquisition unit, used to obtain first answer text data corresponding to the query text data output by the first large language model, the first answer text data being text in an unstructured text format; an output unit, used to input the first answer text data into a pre-trained text format conversion model so that the text format conversion model outputs second answer text data, the text format of the second answer text data being text in a structured text format, the first large language model and the text format conversion model being both deployed in a private domain server.

[0015] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method described in the above embodiments.

[0016] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method described in the above embodiment is implemented.

[0017] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the methods described in the above embodiments.

[0018] The technical solution proposed in this application, since the open source first large language model can be directly obtained, the first large language model can be deployed in the private domain server, so that the inquiry needs of users and individuals can be realized directly based on the open source first large language model deployed in the private domain server of users and individuals. Furthermore, this application converts the first answer text data in the unstructured text format into the second answer text data in the structured text format through a pre-trained text format conversion model, which can help users better understand the answer content returned by the large language model. In this way, the problem caused by the current inability to deploy a closed-source large language model with powerful prompt understanding and execution capabilities in the private domain server of an enterprise or individual can be solved, and the accuracy of the inquiry text data processing can be guaranteed while improving the security in the process of processing the inquiry text data.

[0019] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0021] Figure 1 A system architecture diagram showing the technical solution of the embodiment of the present application can be applied;

[0022] Figure 2 A flowchart of a method for processing inquiry text data according to an embodiment of the present application is shown;

[0023] Figure 3 A block diagram of a query text data processing device according to an embodiment of the present application is shown;

[0024] Figure 4 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION

[0025] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.

[0026] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0027] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0028] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0029] It should be noted that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the objects used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those shown or described.

[0031] Figure 1 A schematic diagram of an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied is shown.

[0032] like Figure 1 As shown, the system architecture may include terminal devices (such as Figure 1 The embodiment of the present invention is a network 104 and a server 105. The network 104 is a medium for providing a communication link between the terminal device and the server 105. The network 104 may include various connection types, such as a wired communication link, a wireless communication link, etc.

[0033] It should be noted that the inquiry text data processing method provided in the embodiment of the present application can be executed by the server 105 , and accordingly, the inquiry text data processing device is generally arranged in the server 105 .

[0034] It should also be noted that Figure 1 The number of terminal devices, networks and servers in the description is only for illustration. According to the implementation requirements, the server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides 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, CDN, and big data and artificial intelligence platforms.

[0035] The implementation details of the technical solution of the embodiment of the present application are described in detail below:

[0036] Figure 2 A flowchart of a method for processing inquiry text data according to an embodiment of the present application is shown. The method for processing inquiry text data can be executed by a device having a computing and processing function, such as Figure 1 Executed by the server 105 shown in FIG. Figure 2 As shown, the query text data processing method at least includes steps 210 to 230, which are described in detail as follows:

[0037] In step 210, query text data is obtained and input into an open source first language model, which has the ability to answer queries.

[0038] In the present application, the inquiry text data may refer to the text input by the user to describe the question.

[0039] In a specific embodiment, for example, the query text data may be:

[0040] "You are my model design assistant. I will provide you with relevant business information in the postal delivery business. Please design a postal delivery route planning model for me. The postal delivery route planning model needs to include model constraints, model objectives, and quantitative parameter definitions and variable parameter definitions in the model. The relevant business information is as follows:..."

[0041] In the present application, after obtaining the inquiry text data, the inquiry text data may be input into an open source first language model capable of answering inquiries.

[0042] It should be noted that Large Language Model (LLM) is a type of natural language processing (NLP) model based on deep learning, which is usually trained with a large amount of text data and can understand, generate and process human language. These models perform well in processing various language tasks, such as text generation, translation, question answering, summarization and sentiment analysis.

[0043] In the present application, the first language model is deployed in a private domain server.

[0044] It should also be noted that the first large language model described in this application is an open source large language model. After the development and training of the open source large language model, the model's code, parameters, training data set (or its acquisition method) and related documents are publicly released, allowing anyone to view, use, modify and distribute. Therefore, in this application, the open source first large language model can be directly obtained and deployed in the private domain server.

[0045] In step 220, first answer text data corresponding to the inquiry text data and output by the first large language model is obtained, and the first answer text data is text in an unstructured text format.

[0046] In the present application, after the inquiry text data is input into the open source first language model, the first language model can understand the questions in the inquiry text data, and generate and output first answer text data corresponding to the inquiry text data.

[0047] It should be noted that unstructured text formats refer to text data that does not follow a fixed data model or predefined structure. This type of text data usually has no clear labels, fields, or data organization methods, and the content may contain natural language, free-form text, paragraphs, sentences, conversations, etc.

[0048] In this application, the unstructured text format may be a TXT text format. For example, the following shows a text in an unstructured text format:

[0049] "Zhang San, male, 30 years old, lives in Chaoyang District, Beijing, and his contact number is 12345678901. He is a software engineer and likes reading and traveling. Li Si, female, 25 years old, lives in Pudong New District, Shanghai, and her contact number is 09876543210. She is a data scientist and likes music and cooking." It should be noted that the above-mentioned text is only an adaptive example given to better enable technical personnel in this field to better understand the present application, and it does not represent any substantive information.

[0050] In actual applications, the open-source large language model has weaker prompt understanding and execution capabilities than the closed-source large language model, and can only generate and output the first answer text data in unstructured text format. If you use an open-source large language model, you cannot set the output text format to a structured text format when calling the model API. If the user requires the output format to be structured text in the prompt definition when calling the open-source large language model API, such as requiring the open-source LLM to "return the output in JSON format, the specific JSON format is...", since the training of the open-source large language model is expected to lack JSON format data, the JSON format itself is relatively complex, and the model's ability to execute prompts is limited, such a prompt that requires JSON format output will seriously affect the quality of the large language model's answer content, rapidly increase the error rate of the answer content, and the open-source LLM sometimes does not accurately execute the prompt, that is, it cannot accurately output JSON format content with specific requirements that meet user expectations.

[0051] It should be noted that Prompt is the sentence input by the user when asking and answering using the large language model.

[0052] In step 230, the first answer text data is input into a pre-trained text format conversion model so that the text format conversion model outputs second answer text data, wherein the text format of the second answer text data is text in a structured text format.

[0053] In the present application, the pre-trained text format conversion model is deployed in a private domain server.

[0054] In the present application, by inputting the first answer text data into a pre-trained text format conversion model, the text format conversion model can output second answer text data in a structured text format.

[0055] It should be noted that structured text format refers to data organized according to a predefined pattern or structure. These data are usually presented in the form of tables, fields, tags, etc., which are convenient for computer programs to parse, store and process. For example, in this application, the structured text format can be JSON text format. Among them, JSON (JavaScript Object Notation) is a lightweight data exchange format that is easy for humans to read and write, and is also easy for machines to parse and generate. It uses key-value pairs to represent data. For example, the following shows a text in structured text format:

[0056] “[{"Name":"Zhang San","Gender":"Male","Age":30,"Address":"Chaoyang District, Beijing","Contact Number":"12345678901","Occupation":"Software Engineer","Hobbies":["Reading","Travel"]},{"Name":"Li Si","Gender":"Female","Age":25,"Address":"Pudong New District, Shanghai","Contact Number":"09876543210","Occupation":"Data Scientist","Hobbies":["Music","Cooking"]}]”. It should be noted that the above-displayed text is merely an adaptive example given to enable technicians in this field to better understand the present application, and does not represent any substantive information.

[0057] In the present application, since the open source first large language model can be directly obtained, the first large language model can be deployed in the private domain server, so that the inquiry needs of users and individuals can be realized directly based on the open source first large language model deployed in the private domain server of users and individuals. Furthermore, the present application converts the first answer text data in the unstructured text format into the second answer text data in the structured text format through a pre-trained text format conversion model, which can help users better understand the answer content returned by the large language model. In this way, the problem caused by the current inability to deploy a closed-source large language model with powerful prompt understanding and execution capabilities in the private domain server of an enterprise or individual can be solved, and the accuracy of the inquiry text data processing can be guaranteed while improving the security in the process of processing the inquiry text data.

[0058] Next, the present application will describe the training process of the text format conversion model. Specifically, the text format conversion model can be trained through the following steps 201 to 202:

[0059] Step 201 : obtaining multiple groups of training samples, wherein each group of training samples includes unstructured text and structured text with the same text content.

[0060] Step 202: training the model to be trained based on the multiple groups of training samples, so that the model to be trained learns the conversion logic between the unstructured text and the structured text in each group of training samples, and obtains the text format conversion model.

[0061] In this application, the model to be trained may include any one of the open source third largest language model, deep learning model, recurrent neural network (RNN), long short-term memory network (LSTM), convolutional neural network (CNN), Transformer model, etc., and this application does not make specific limitations on this. .

[0062] In the present application, among the multiple sets of training samples obtained, each set of training samples includes two parts: one part is unstructured text, and the other part is structured text with the same content but formatted. For example, the unstructured text can be a TXT format text data described in natural language, and the structured text can be the corresponding JSON format text data.

[0063] After obtaining multiple sets of training samples, use the collected training samples to train a model to be trained. The input of the model is unstructured text, and the output is structured text. So that the model to be trained learns the conversion logic between the unstructured text and the structured text in each set of training samples. Through training, the model will learn how to convert unstructured text into structured text. This includes understanding the information in the unstructured text and mapping it to a structured format. Finally, after training, a model that can automatically convert unstructured text into structured text is obtained.

[0064] In one embodiment of the present application, the step of obtaining multiple sets of training samples may be performed according to the following steps 2011 to 2012:

[0065] Step 211, sending a query request for generating the training sample to a second largest closed-source language model, wherein the ability of the second largest language model to answer the query is higher than the ability of the first largest language model to answer the query;

[0066] Step 2012: Obtain multiple groups of training samples generated by the second largest language model.

[0067] In practical applications, since the closed-source second largest language model has strong prompt understanding and execution capabilities, the multiple sets of training samples can be generated through the closed-source second largest language model. Specifically, the second largest language model (such as the Chat GPT model of Open AI) can be used to design a prompt, and the input is unformatted TXT text, and the output is JSON format text corresponding to the content but has been formatted according to the user's specific key-value pair requirements. For example, the prompt we set for the second largest language model can be:

[0068] "You are an assistant that converts TXT format text to JSON format text. Convert my text to JSON format. The specific structure of JSON format is LlmSchemedAnswer (TypeScript declared below):\ninterfaceLlmSchemedAnswer:......\n\nTXT format text to be converted:....."

[0069] By calling the API of the second largest language model in large numbers to execute this prompt, we obtain multiple sets of "(unstructured text, structured text)" training data, for example, 8,000 sets of "(unstructured text, structured text)" training data.

[0070] In this embodiment, based on the technical idea of ​​knowledge distillation, the multiple groups of training samples are constructed through a closed-source second-largest language model with strong prompt understanding and execution capabilities, and then these training samples are used to train an open-source third-largest language model that itself cannot accurately output structured text, so that after training, it can learn the ability of the powerful large language model to output structured text, that is, according to user needs, it can accurately convert the unformatted and relatively chaotic TXT format text output into a JSON format text answer containing certain special key-value pair requirements.

[0071] In other embodiments of the present application, multiple groups of training samples containing “(unstructured text, structured text)” may also be manually constructed.

[0072] In the present application, the training of the model to be trained based on the multiple groups of training samples may be training the model to be trained based on the multiple groups of training samples according to the QLoRA method.

[0073] It should be noted that QLoRA (Quantized Low-Rank Adapter) is an optimization technique for efficient fine-tuning and deployment on large language models. By combining the two technologies of quantization and low-rank adapter, the computing and storage requirements are significantly reduced. The quantization process converts the model parameters from high precision (such as 32-bit floating point numbers) to low precision (such as 8-bit integers), greatly reducing hardware resource requirements while maintaining model performance. The low-rank adapter inserts low-rank matrices in certain layers of the model to capture and adjust parameter changes, making it possible to perform efficient fine-tuning while keeping most parameters unchanged. Through the combination of these two technologies, the QLoRA method enables efficient fine-tuning and deployment of large language models in resource-limited environments, thereby reducing the cost of fine-tuning and deployment.

[0074] It should be noted that in this application, the ability of the open source large language model to learn structured text output is limited to processing unstructured text similar to the unstructured text content constructed by the closed source large language model, and the range of keys and values ​​of the structured text to be output must also be consistent with the range of keys and values ​​in the structured text output constructed by the closed source large language model. To put it another way, the open source large language model trained with training samples generated by the closed source large language model cannot convert any unstructured text into a structured text output with any special key-value pair requirements. The open source large language model can only process unstructured content similar to the unstructured text Prompt constructed by the closed source large language model, and can only output a structured text format answer with special key-value pair requirements similar to the structured text Response constructed by the closed source large language model. However, as long as the user reconstructs the prompt for inputting structured text, that is, requires the structured text to construct unstructured text input with specific content and structured text output with specific key-value pairs in the prompt, and then lets the closed-source large language model repeatedly execute this command to construct training samples that meet the requirements, and then quickly performs QLora supervised fine-tuning on a certain open-source large language model, the open-source large language model that the user expects can be obtained, which can convert unstructured text with specific content into structured text with specific requirements.

[0075] In general, with the rapid development of artificial intelligence and machine learning technologies, users are increasingly relying on large language models (LLMs) for inquiries and expect to obtain accurate and helpful answers, especially answers in structured text (such as JSON, etc.) to better understand and process the answers. However, many users want the data to stay on their own servers and avoid uploading the data to third-party servers, which makes it impossible for them to use closed-source large language models and they can only rely on open-source large language models. However, open-source large language models usually cannot set the text output format to structured text format when calling the model API. Forcing prompts to output structured text format will seriously affect the quality of the answers, and the model may not be able to accurately execute these instructions.

[0076] At present, there is no technical solution in the prior art that discloses how to make an open source large language model accurately output a structured answer text in a specific format. Based on the technical solution proposed in this application, according to the technical idea of ​​knowledge distillation, a training sample containing data pairs of unstructured text (such as TXT) and structured text (such as JSON) is generated by using a powerful large language model (such as Chat GPT4.0 of open AI), and then these training samples are used to train the open source large language model, so that it can accurately convert unformatted text content into structured text content that meets the user's specific key-value pair requirements. Specifically, by designing Prompt and calling a large number of closed-source large language model APIs to generate training sample sets, the open source large language model can learn the ability of a powerful large language model to output data in a specific format after training. It ensures that the open source large language model can accurately convert unstructured text into structured text with specific requirements when the user deploys it privately, thereby meeting the data processing needs of different scenarios, protecting user privacy, and improving security in the process of processing inquiry text data.

[0077] The following describes an apparatus embodiment of the present application, which can be used to execute the query text data processing method in the above embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the above embodiment of the query text data processing method of the present application.

[0078] Figure 3 A block diagram of a query text data processing device according to an embodiment of the present application is shown.

[0079] Reference Figure 3 As shown, a query text data processing device 300 according to an embodiment of the present application includes: an input unit 301, an acquisition unit 302 and an output unit 303.

[0080] Among them, the input unit 301 is used to obtain inquiry text data and input the inquiry text data into the open source first large language model, the first large language model has the ability to answer inquiries; the acquisition unit 302 is used to obtain first answer text data corresponding to the inquiry text data output by the first large language model, the first answer text data is a text in an unstructured text format; the output unit 303 is used to input the first answer text data into a pre-trained text format conversion model so that the text format conversion model outputs second answer text data, the text format of the second answer text data is a text in a structured text format, and the first large language model and the text format conversion model are both deployed in a private domain server.

[0081] In some embodiments of the present application, based on the aforementioned scheme, it also includes: a training unit, used to obtain multiple groups of training samples, wherein each group of training samples includes unstructured text and structured text with the same text content; based on the multiple groups of training samples, the model to be trained is trained so that the model to be trained learns the conversion logic between the unstructured text and the structured text in each group of training samples to obtain the text format conversion model.

[0082] In some embodiments of the present application, based on the aforementioned scheme, the training unit is configured to: send a query request for generating the training sample to a closed-source second largest language model, the ability of the second largest language model to answer the query is higher than the ability of the first largest language model to answer the query; obtain multiple groups of training samples generated by the second largest language model.

[0083] In some embodiments of the present application, based on the aforementioned scheme, the model to be trained includes the third largest language model that is open source.

[0084] In some embodiments of the present application, based on the aforementioned scheme, the training unit is configured to: train the model to be trained based on the multiple groups of training samples according to the QLoRA method.

[0085] In some embodiments of the present application, based on the aforementioned solution, the unstructured text format is a TXT text format.

[0086] In some embodiments of the present application, based on the aforementioned scheme, the structured text format is a JSON text format.

[0087] As another embodiment of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method described in the above embodiment.

[0088] Based on the same inventive concept, the embodiment of the present application also provides an electronic device. Figure 4 , shows a schematic diagram of the structure of an electronic device in an embodiment of the present application, wherein the electronic device includes one or more memories 404, one or more processors 402, and at least one computer program (program code) stored in the memories 404 and executable on the processors 402, and when the processors 402 execute the computer programs, the method described above is implemented.

[0089] Among them, Figure 4In the embodiment of the present invention, a bus architecture (represented by bus 400) is shown, which may include any number of interconnected buses and bridges, and bus 400 links various circuits including one or more processors represented by processor 402 and memory represented by memory 404. Bus 400 may also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. Bus interface 405 provides an interface between bus 400 and receiver 401 and transmitter 403. Receiver 401 and transmitter 403 may be the same element, namely a transceiver, providing a unit for communicating with various other devices over a transmission medium. Processor 402 is responsible for managing bus 400 and general processing, while memory 404 may be used to store data used by processor 402 when performing operations.

[0090] As another embodiment of the present application, a computer-readable storage medium is also provided, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiment.

[0091] The functions described herein may be implemented in hardware, software executed by a processor, firmware, or any combination thereof. If implemented in software executed by a processor, the functions may be stored as one or more instructions or codes on a computer-readable medium or transmitted via a computer-readable medium. Other examples and implementations are within the scope and spirit of the present application and the appended claims. For example, due to the nature of software, the functions described above may be implemented using software executed by a processor, hardware, firmware, hard wiring, or a combination of any of these. In addition, each functional unit may be integrated into a processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit.

[0092] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0093] The units described as separate components may or may not be physically separated, and the components of the control device may or may not be physical units, that is, they may be located in one place or distributed in multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0094] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or all or part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including instructions for making a computer device (which can be a personal computer, server or network device, etc.) perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0095] The above description is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present application shall be included in the scope of the claims of the present application.

Claims

1. A method for processing inquiry text data, It is characterized in that The method comprises: Obtaining inquiry text data, and inputting the inquiry text data into an open-source first language model, wherein the first language model has the ability to answer inquiries; Acquire first answer text data corresponding to the inquiry text data and output by the first language model, wherein the first answer text data is text in an unstructured text format; The first answer text data is input into a pre-trained text format conversion model so that the text format conversion model outputs second answer text data, wherein the text format of the second answer text data is text in a structured text format, and the first language model and the text format conversion model are both deployed in a private domain server.

2. The method according to claim 1, It is characterized in that Train the text format conversion model through the following steps: Acquire multiple groups of training samples, wherein each group of training samples includes unstructured text and structured text with the same text content; The model to be trained is trained based on the multiple groups of training samples, so that the model to be trained learns the conversion logic between the unstructured text and the structured text in each group of training samples, and obtains the text format conversion model.

3. The method according to claim 2, It is characterized in that The obtaining of multiple sets of training samples comprises: Sending a query request for generating the training sample to a closed-source second largest language model, wherein the ability of the second largest language model to answer the query is higher than the ability of the first largest language model to answer the query; Obtain multiple groups of training samples generated by the second largest language model.

4. The method according to claim 2, It is characterized in that The model to be trained includes the open source third largest language model.

5. The method according to claim 2, It is characterized in that The training of the model to be trained based on the multiple groups of training samples includes: According to the QLoRA method, the model to be trained is trained based on the multiple groups of training samples.

6. The method according to any one of claims 1 to 5, It is characterized in that The unstructured text format is TXT text format.

7. The method according to any one of claims 1 to 5, It is characterized in that The structured text format is JSON text format.

8. A query text data processing device, It is characterized in that The device comprises: An input unit, used to obtain inquiry text data, and input the inquiry text data into an open source first language model, wherein the first language model has the ability to answer inquiries; an acquisition unit, configured to acquire first answer text data corresponding to the inquiry text data and output by the first language model, wherein the first answer text data is text in an unstructured text format; An output unit is used to input the first answer text data into a pre-trained text format conversion model so that the text format conversion model outputs second answer text data, wherein the text format of the second answer text data is text in a structured text format, and the first language model and the text format conversion model are both deployed in a private domain server.

9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores at least one program code, and the at least one program code is loaded and executed by a processor to implement the operations performed by the method according to any one of claims 1 to 7.

10. An electronic device, It is characterized in that The electronic device includes one or more processors and one or more memories, wherein the one or more memories store at least one program code, and the at least one program code is loaded and executed by the one or more processors to implement the operations performed by the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Chinese dental intelligent diagnosis and treatment question and answer method, electronic equipment and storage medium

    CN117574921A

  • Meteorological query system and meteorological query method

    CN118626575A