CN117633170A - Thinking chain data construction method and device, electronic equipment and storage medium - Google Patents

Thinking chain data construction method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117633170A
CN117633170A CN202311470831.0A CN202311470831A CN117633170A CN 117633170 A CN117633170 A CN 117633170A CN 202311470831 A CN202311470831 A CN 202311470831A CN 117633170 A CN117633170 A CN 117633170A
Authority
CN
China
Prior art keywords
answer data
sample
question
data
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311470831.0A
Other languages
Chinese (zh)
Inventor
郑志军
陈自岩
彭旋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Glabal Tone Communication Technology Co ltd
Original Assignee
Glabal Tone Communication Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Glabal Tone Communication Technology Co ltd filed Critical Glabal Tone Communication Technology Co ltd
Priority to CN202311470831.0A priority Critical patent/CN117633170A/en
Publication of CN117633170A publication Critical patent/CN117633170A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Machine Translation (AREA)

Abstract

The embodiment of the disclosure discloses a thinking chain data construction method and device, electronic equipment and a storage medium, and belongs to the technical field of data processing. The method comprises the following steps: acquiring sample question-answer data crawled in a network; the sample question and answer data comprise sample question instructions and sample answer data; performing data rewriting on the sample answer data based on an open source conversation large model to generate target answer data; reversely generating a target question instruction corresponding to the target answer data based on the open-source conversation large model; and responding to the similarity between the target questioning instruction and the sample questioning instruction is larger than the preset similarity, and constructing thinking chain data based on the target questioning instruction and the target answer data. By the method, the thinking chain data can be constructed conveniently in a large scale with high quality through a large amount of question-answer data on the network.

Description

Thinking chain data construction method and device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of data processing, and in particular relates to a thinking chain data construction method and device, electronic equipment and a storage medium.
Background
The passage of ChatGPT (a large model of conversational language) is marked by the advent of the large model of conversational age at about 11 and 30 days 2022, and formally enters the fourth paradigm age in this industry and academia. ChatGPT has a strong language understanding capability, a rich text generating capability, an excellent knowledge representation capability, can understand various instructions of a plurality of languages input by human beings, and gives effective replies. Based on the superior performance of ChatGPT, chatGPT attracts 1 billion registered users within a short period of two months after pushing out ChatGPT from 11 months and 30 days of 2022, becoming the application engine with the fastest historic use number of billions.
The technology of generating AI (Artificial Intelligence ) represented by ChatGPT has extremely important influence on the production and life of the whole human body, and the influence is continuously and increasingly strong. More and more enterprises are developing their own large models of conversation following this wind vane.
The main stream research and development route of the current large model is to lift the model strength according to a three-step strategy on the basis of an open source frame, and the three steps are respectively as follows: 1. fine tuning the open source model using the instruction dataset; 2. manually judging the performance of the model subjected to the fine adjustment in the first step, and constructing a reward model by using the generated data; 3. the fine-tuning model generated in the first step is corrected using a reinforcement learning technique for the bonus model by a human being in combination with the bonus model. In the three-step lifting method, the first step is the foundation and is the most important in all steps, and the quality and the bad of the model are directly and fundamentally determined; assuming that the fine tuning model produced in the first step is relatively poor in performance, the latter two steps can be said to be poor without the means of modification.
However, the judgment mark of the instruction data set for quality requires that the data set must contain thought chain data in addition to the idea of 3H. The research shows that the thinking chain data can promote the reasoning capacity of the model, optimize the answer capacity of the model, and is an eye-catching pen with improved model capacity. Three common ways of obtaining instruction data sets are mainly used, one is artificial construction; secondly, using an open source data set on the network; thirdly, the instruction data set is automatically built by means of a ChatGPT, GPT4 and other large models by using self-instruct technology. However, the three modes have relatively large defects in constructing a special thinking chain instruction data set, and the main defects of manual construction are time and labor consumption; the open source data set on the network faces the problem of uncontrollable quality and control data set field; the self-instruct technology also faces the problems of difficult quality control, single style and the like of the thinking data set.
Disclosure of Invention
This disclosure is provided in part to introduce concepts in a simplified form that are further described below in the detailed description. This disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
The embodiment of the disclosure provides a thinking chain data construction method, a thinking chain data construction device, electronic equipment and a storage medium, so as to solve the technical problems.
In a first aspect, an embodiment of the present disclosure provides a method for constructing mental chain data, including: acquiring sample question-answer data crawled in a network; the sample question and answer data comprise sample question instructions and sample answer data; performing data rewriting on the sample answer data based on an open source conversation large model to generate target answer data; reversely generating a target question instruction corresponding to the target answer data based on the open-source conversation large model; and responding to the similarity between the target questioning instruction and the sample questioning instruction is larger than the preset similarity, and constructing thinking chain data based on the target questioning instruction and the target answer data.
Optionally, in some embodiments, the acquiring sample question-answer data crawled in the network includes: acquiring initial question-answer data crawled in a network; the initial question and answer data comprise initial question instructions and initial answer data; generating the sample question-answer data in response to the initial answer data including the related words; the sample question and answer data are the initial question and answer data, the sample question instruction is the initial question instruction, and the sample answer data are the initial answer data.
Optionally, in some embodiments, the generating the sample question-answer data in response to the initial answer data including the related word includes: responding to the initial answer data including related words, and verifying the initial answer data based on the open source conversation large model; and responding to the open source conversation big model to verify that the initial answer data has actual causal logic and correctness, and generating the sample question-answer data.
Optionally, in some embodiments, the generating the target answer data based on the open source conversation large model performing data rewriting on the sample answer data includes: inputting the sample answer data into the open source conversation large model, and carrying out text semantic recognition on the sample answer data to obtain a semantic recognition text; and according to a preset rewrite rule, performing data rewrite on the semantic recognition text to generate the target answer data.
Optionally, in some embodiments, the preset rewrite rules include: modifying associated words of the semantic recognition text, adjusting sentence length of the semantic recognition text, modifying uncommon words and spoken language expressions of the semantic recognition text, adjusting grammar errors of the semantic recognition text, adjusting wrong vocabulary of the semantic recognition text, and adjusting wrong punctuation marks of the semantic recognition text.
Optionally, in some embodiments, before the constructing of the mental chain data based on the target question instruction and the target answer data, the method further comprises: and determining that the similarity between the target questioning instruction and the questioning instruction is larger than the preset similarity.
Optionally, in some embodiments, the method further comprises: inputting the constructed mental chain data into a mental chain data set; and fine-tuning a sample open source model based on the thinking chain data set to generate a target conversation large model.
In a second aspect, embodiments of the present application provide a mental chain data construction apparatus, including: the acquisition module is used for acquiring sample question-answer data crawled in a network; the sample question and answer data comprise sample question instructions and sample answer data; the first generation module is used for carrying out data rewriting on the sample answer data based on the open source conversation big model to generate target answer data; the second generation module is used for reversely generating a target question instruction corresponding to the target answer data based on the open-source conversation large model; and the construction module is used for responding to the fact that the similarity between the target questioning instruction and the sample questioning instruction is larger than the preset similarity, and constructing thinking chain data based on the target questioning instruction and the target answer data.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: one or more processors; and a storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the method of mental chain data construction as described in the first aspect.
In a fourth aspect, embodiments of the present disclosure provide a computer-readable medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method for constructing mental chain data according to the first aspect.
The thinking chain data construction method, the thinking chain data construction device and the electronic equipment provided by the embodiment of the disclosure firstly acquire sample question-answer data crawled in a network; the sample question and answer data comprise sample question instructions and sample answer data; then, based on the open source conversation big model, carrying out data rewriting on the sample answer data to generate target answer data; then, reversely generating a target question instruction corresponding to the target answer data based on the open source conversation large model; finally, the mental chain data is constructed based on the target question instruction and the target answer data. By the method, the thinking chain data can be constructed conveniently in a large scale with high quality through a large amount of question-answer data on the network.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
FIG. 1 is a schematic diagram of mental chain data;
FIG. 2 is a schematic diagram of an example of a question-answer based on a mental chain;
FIG. 3 is a flow chart of one embodiment of a mental chain data construction method according to the present disclosure;
FIG. 4 is a flow chart of another embodiment of a mental chain data construction method according to the present disclosure;
FIG. 5 is a schematic diagram of a structure of one embodiment of a mental chain data construction apparatus according to the present disclosure;
fig. 6 is a schematic diagram of a basic structure of an electronic device provided according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
The main stream research and development route of the current large model is to lift the model strength according to a three-step strategy on the basis of an open source frame, and the three steps are respectively as follows: 1. fine tuning the open source model using the instruction dataset; 2. manually judging the performance of the model subjected to the fine adjustment in the first step, and constructing a reward model by using the generated data; 3. the fine-tuning model generated in the first step is corrected using a reinforcement learning technique for the bonus model by a human being in combination with the bonus model. In the three-step lifting method, the first step is the foundation and is the most important in all steps, and the quality and the bad of the model are directly and fundamentally determined; assuming that the fine tuning model produced in the first step is relatively poor in performance, the latter two steps can be said to be poor without the means of modification.
However, the judgment mark of the instruction data set for quality requires that the data set must contain thought chain data in addition to the idea of 3H. The research shows that the thinking chain data can promote the reasoning capacity of the model, optimize the answer capacity of the model, and is an eye-catching pen with improved model capacity. Three common ways of obtaining instruction data sets are mainly used, one is artificial construction; secondly, using an open source data set on the network; thirdly, the instruction data set is automatically built by means of a ChatGPT, GPT4 and other large models by using self-instruct technology. However, the three modes have relatively large defects in constructing a special thinking chain instruction data set, and the main defects of manual construction are time and labor consumption; the open source data set on the network faces the problem of uncontrollable quality and control data set field; the self-instruct technology also faces the problems of difficult quality control, single style and the like of the thinking data set.
The mental chain data is important to improving the reasoning capacity of the large model, and particularly when the problem of the field is faced, the large model trained by the mental chain data often has logic and accuracy in problem analysis and recovery.
The thought Chain (COT) is a natural language-based reasoning process, which includes three parts (as shown in fig. 1) of inputting questions, the thought chain (reasoning process), and outputting conclusions. Unlike traditional instruction modes, thinking chain instruction data pay more attention to the reasoning process, so that the accuracy of a large model in complex reasoning tasks can be remarkably improved. As shown in fig. 2, which shows that when a problem is entered, a conclusion is reached according to the process of reasoning.
Typically, the inference process is used as an output part of the mental chain data along with the conclusions. That is, usual thinking chain data includes an input Instruction (Instruction) and an Output (Output). I.e., < Instruction, output > form.
However, due to the strict logic structure of the thinking chain data, the data in such a form rarely exists on the network; how to efficiently and cheaply mass-produce high-quality thinking chain data integration is a key point for restricting the capability improvement of a large model.
Accordingly, the present embodiments provide an embodiment to solve the above-described problems.
Referring to fig. 3, a flow of one embodiment of a mental chain data construction method according to the present disclosure is shown. The thinking chain data construction method can be applied to electronic equipment. The thinking chain data construction method as shown in fig. 3 includes: steps 301 to 304.
Step 301: and acquiring sample question-answer data crawled in the network.
First, sample question-answer data can be crawled out of the network through a crawler tool. The sample question and answer data comprise sample question instructions and sample answer data.
For example, the sample question and answer data may be an article including a sample question instruction "write a campus security", and the sample answer data "campus security is a precondition for learning knowledge of each department, and security is one of the primary tasks of the school. So the campus safety must be concerned by people, and the campus is kept in constant position. School leaders design many safety signs at the heart, warn us that safety is important. In order to thank the teacher for our care, the first team members should do the following: first, we need to have a high degree of security awareness, fully knowing the importance of security. Secondly, care should be taken to prevent mental security. "
Step 302: and carrying out data rewriting on the sample answer data based on the open source conversation large model to generate target answer data.
Here, the open source conversation large model may be, but is not limited to, a GPT4 conversation large model, a lattice conversation large model.
The content of the sample answer data is rewritten here with the open-source conversation large model so as to meet the modeling requirements of the subsequently built model. After overwriting, target answer data is generated.
Step 303: and reversely generating a target question instruction corresponding to the target answer data based on the open source conversation large model.
Then, the generated target answer data is input to the open-source conversation model, and a target question instruction corresponding to the target answer data is reversely generated by the open-source conversation model.
Step 304: and constructing thinking chain data based on the target questioning instruction and the target answer data in response to the similarity between the target questioning instruction and the sample questioning instruction being greater than the preset similarity.
That is, after the target question instruction corresponding to the target answer data is reversely generated based on the open source dialogue large model, the similarity between the target question instruction and the question instruction can be judged, if the similarity is larger than the preset similarity, the thinking chain data can be constructed based on the target question instruction and the target answer data, by introducing the feedback mechanism, the strong correlation of the thinking chain question and answer can be ensured, the quality of the constructed thinking chain data is further ensured, and secondly, the accuracy of rewriting can be ensured, and the occurrence of semantic deviation caused by rewriting is avoided.
It should be noted that the above similarity determination may still be implemented based on an open-source large dialogue model, that is, the similarity between the target question instruction and the question instruction is compared through the open-source large dialogue model.
Of course, the comparison may be implemented by other similarity algorithms, such as a cosine similarity algorithm, a euclidean distance similarity algorithm.
And finally, generating a corresponding thinking chain data based on a sample question-answer data crawled from the network.
In summary, according to the thinking chain data construction method provided by the embodiment of the present disclosure, first, sample question-answer data crawled in a network is obtained; the sample question and answer data comprise sample question instructions and sample answer data; then, based on the open source conversation big model, carrying out data rewriting on the sample answer data to generate target answer data; then, reversely generating a target question instruction corresponding to the target answer data based on the open source conversation large model; finally, the mental chain data is constructed based on the target question instruction and the target answer data. By the method, the thinking chain data can be constructed conveniently in a large scale with high quality through a large amount of question-answer data on the network.
Optionally, in some embodiments, the acquiring, by the step 301, sample question-answer data crawled in the network may specifically include: acquiring initial question-answer data crawled in a network; the initial question and answer data comprise initial question instructions and initial answer data; generating sample question-answer data in response to the initial answer data including the related words; the sample question-answering data are initial question-answering data, the sample question instruction is an initial question instruction, and the sample answer data are initial answer data.
It should be noted that, the initial question-answer data may be crawled out from the network through the crawler tool, and then the initial question-answer data is detected to determine whether there is an associated word, and if there is an associated word, the initial question-answer data may be determined as sample answer data used subsequently. If not, the initial question-answer data may be discarded.
By screening out the initial answer data with associated words, the answer data without logic can be primarily filtered out. When determining whether the related words exist, word segmentation processing can be performed on the initial question-answer data.
The above-mentioned related words may include, but are not limited to, "because", "so", "therefore", "however", "albeit", "so", and the like.
Optionally, in some embodiments, the step of generating sample question-answer data in response to the initial answer data including the related word includes: responding to the initial answer data including the related words, and verifying the initial answer data based on the open source conversation big model; and responding to the open source conversation big model to verify that the initial answer data represents that the initial answer data has real causal logic and correctness, and generating sample question-answer data.
That is, after determining that the associated word is included in the initial answer data, the initial answer data may be validated based on the open source conversation large model. The process of verification mainly involves whether the initial answer data is truly causal logical, and the correctness of the answer.
The causality can be understood as whether causal logic is met, such as whether the use of related words is correct, and whether context semantics are met.
While the correctness of the answer can be understood as whether the initial question instruction corresponds, for example, the initial question instruction is "what the color of the apple is," and the answer of the initial answer data is "black," it can be determined that the initial answer data is incorrect. When the verification result represents that the initial answer data has real causal logic and correctness, the initial question-answer data is used as sample question-answer data for subsequent use.
Optionally, in some embodiments, the generating the target answer data in step 302 may specifically include: inputting sample answer data into the open source conversation large model, and carrying out text semantic recognition on the sample answer data to obtain a semantic recognition text; and according to a preset rewrite rule, performing data rewrite on the semantic recognition text to generate target answer data.
Optionally, the preset rewrite rule may include at least one of:
1. the associated word of the semantically recognized text is changed.
Wherein, the related words of the modified semantic recognition text are mainly expressed as the logic of the reinforced sample answer data.
2. The sentence length of the semantically recognized text is adjusted.
Namely, the sentence length and the complexity degree are adjusted, and too long or too complicated sentences bring reading disorder to a large model and influence understanding effect. Here, a processing method of changing a long sentence into a short sentence may be employed.
3. Altering the rarely used words and spoken language expressions of the semantically recognized text.
On the premise of keeping original meaning unchanged, the method avoids using rare words and spoken expression forms, namely, enhances the accuracy and authority of sentence expression by utilizing proper vocabulary.
4. Grammar errors of the semantically recognized text are adjusted.
5. The wrong vocabulary of the semantically recognized text is adjusted.
6. And adjusting the error punctuation marks of the semantic recognition text.
It should be noted that, the data is rewritten continuously by the preset rewrite rule so as to meet the modeling requirement of the subsequent building model. After overwriting, target answer data is generated.
Optionally, in some embodiments, before constructing the mental chain data based on the target question instruction and the target answer data in step 304, the method further includes: and determining that the similarity between the target questioning instruction and the questioning instruction is larger than the preset similarity.
Optionally, in some embodiments, the method further comprises: inputting the constructed mental chain data into a mental chain data set; based on the thinking chain data set, fine-tuning the sample open source model to generate a target conversation large model.
After the thinking chain data are acquired, the thinking chain data can be stored in a thinking chain data set, and finally, a sample open source model can be finely tuned by using the thinking chain data set to generate a target conversation large model required by a user.
The above process is described below in conjunction with the flow of fig. 4:
firstly, an initial question-answer pair < Instruction, output > is crawled out from a network, then filtering is carried out based on Output, namely whether related words exist or not is judged, if so, filtering is carried out through a large dialogue model, namely whether causal logic exists or not is judged, and the correctness of the section of words is simultaneously judged from the text semantic point of view. If it passes, the Output is modified, i.e. rewritten. And then reversely generating the Instruction1 based on the conversation large model. Then, filtering is performed through the dialogue large model, that is, similarity between the instructions 1 and 1 is compared. If the similarity is greater than the preset similarity, a thinking chain data COT < Instruction1, output1> can be successfully generated.
The following description is made in connection with a specific example:
assuming an original question-answer pair, the Instruction is "do the thunder day hide under the tree? "Output is" haha ", which is a problem I am-! I say the bar like this, there is a large amount of moisture in the body of the tree, and big tree is higher, is the conductor, draws the thunder easily, if hide under big tree, once strike a mine, the lightning will leave along the trunk, then the electricity is people. Therefore, the thunder-striking day cannot be hidden under the tree unless the user is not afraid of death. "
Firstly, word segmentation is carried out on the text of Output, and then whether words such as 'therefore', 'so', 'cause' and the like exist or not is judged; if any, performing a second step, and if not, discarding the data set; it has the causal word "so" from the text.
And secondly, judging the Output by using a GPT4 large model, analyzing whether the section of speech has causal logic, and judging the correctness of the section of speech simultaneously by using causal logic before and after the section of speech from the text semantic perspective.
And thirdly, rewriting Output, and rendering the grammar, so that the writing is more standard, and the front and rear sentences have more logicality, for example, the rendering result of the GPT4 large model is as follows: "haha, I can interpret. First, trees are considered good conductors because they contain a large amount of moisture and adult trees are typically very tall. In the event of a thunderstorm, lightning tends to travel along the trunk and eventually hit man-made objects on the ground. Thus, the stay under the tree during thunderstorms is avoided unless you want to be life threatening. "
Fourth, generating an Instruction according to the Output after color rendering, and generating the following result by GPT 4: "please explain why should it be avoided to stay under the tree during thunderstorms? ";
fifthly, judging the similarity relation between the newly generated Instruction and the original Instruction by using GPT4, reserving the similarity, and removing the dissimilarity; from a text semantic perspective, both are similar, so < Instruction, output > is considered a set of COT datasets.
In summary, in the embodiment of the application, GPT4 (an open source conversation large model) is introduced into the construction process of the thinking chain, so that the advantage of containing massive world knowledge is fully exerted. The method utilizes the mass world knowledge contained in GPT and means such as judgment, color rendering, reverse thrust and the like to construct high-thinking chain data in a large scale, high quality and low cost, and greatly improves the reasoning capacity of the model.
And a color rendering mechanism is introduced to enable the recovery of the thinking chain to be more logical.
In addition, a feedback mechanism is introduced, so that the strong correlation of the questions and answers of the thinking chain is ensured, and the quality of the constructed thinking chain data is further ensured.
With further reference to fig. 5, as an implementation of the method shown in the above figures, the present disclosure provides an embodiment of a mental chain data construction apparatus 501, which corresponds to the mental chain data construction method embodiment shown in fig. 1, and which is particularly applicable to an electronic device.
The device comprises:
the acquisition module 501 is used for acquiring sample question-answer data crawled in a network; the sample question and answer data comprise sample question instructions and sample answer data.
The first generation module 502 is configured to perform data rewriting on the sample answer data based on the open source conversation large model, and generate target answer data.
And a second generating module 503, configured to reversely generate a target question instruction corresponding to the target answer data based on the open source conversation large model.
And a construction module 504, configured to construct, based on the target question instruction and the target answer data, thinking chain data in response to the similarity between the target question instruction and the sample question instruction being greater than a preset similarity.
Optionally, in some embodiments, the obtaining module 501 is further specifically configured to obtain initial question-answer data crawled in a network; the initial question and answer data comprise initial question instructions and initial answer data; generating the sample question-answer data in response to the initial answer data including the related words; the sample question and answer data are the initial question and answer data, the sample question instruction is the initial question instruction, and the sample answer data are the initial answer data.
Optionally, in some embodiments, the obtaining module 501 is further specifically configured to verify the initial answer data based on the open source conversation large model in response to including an associated word in the initial answer data; and responding to the open source conversation big model to verify that the initial answer data has actual causal logic and correctness, and generating the sample question-answer data.
Optionally, in some embodiments, the first generating module 502 is further specifically configured to input the sample answer data to the open source conversation large model, and perform text semantic recognition on the sample answer data to obtain a semantic recognition text; and according to a preset rewrite rule, performing data rewrite on the semantic recognition text to generate the target answer data.
Optionally, in some embodiments, the preset rewrite rules include: modifying associated words of the semantic recognition text, adjusting sentence length of the semantic recognition text, modifying uncommon words and spoken language expressions of the semantic recognition text, adjusting grammar errors of the semantic recognition text, adjusting error vocabulary of the semantic recognition text, and adjusting error punctuation marks of the errors.
Optionally, in some embodiments, the constructing module is further specifically configured to determine, before the constructing of the mental chain data based on the target question instruction and the target answer data, that a similarity between the target question instruction and the question instruction is greater than a preset similarity.
Optionally, the apparatus further comprises a model building module. The model construction module is used for inputting the constructed thinking chain data into the thinking chain data set; and fine-tuning a sample open source model based on the thinking chain data set to generate a target conversation large model.
Referring now to fig. 6, a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 6 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 6, the electronic device may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data required for the operation of the electronic apparatus are also stored. The processing device 601, the ROM602, and the RAM603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
In general, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, magnetic tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 shows an electronic device having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via communication means 609, or from storage means 608, or from ROM 602. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 601.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring sample question-answer data crawled in a network; the sample question and answer data comprise sample question instructions and sample answer data; performing data rewriting on the sample answer data based on an open source conversation large model to generate target answer data; reversely generating a target question instruction corresponding to the target answer data based on the open-source conversation large model; and constructing thinking chain data based on the target question instruction and the target answer data.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.

Claims (10)

1. A method of constructing mental chain data, comprising:
acquiring sample question-answer data crawled in a network; the sample question and answer data comprise sample question instructions and sample answer data;
performing data rewriting on the sample answer data based on an open source conversation large model to generate target answer data;
reversely generating a target question instruction corresponding to the target answer data based on the open-source conversation large model;
and responding to the similarity between the target questioning instruction and the sample questioning instruction is larger than the preset similarity, and constructing thinking chain data based on the target questioning instruction and the target answer data.
2. The method for constructing thinking chain data as claimed in claim 1, wherein the step of obtaining sample question-answer data crawled in a network comprises:
Acquiring initial question-answer data crawled in a network; the initial question and answer data comprise initial question instructions and initial answer data;
generating the sample question-answer data in response to the initial answer data including the related words; the sample question and answer data are the initial question and answer data, the sample question instruction is the initial question instruction, and the sample answer data are the initial answer data.
3. The method of claim 2, wherein generating the sample question-answer data in response to the initial answer data including the related word includes:
responding to the initial answer data including related words, and verifying the initial answer data based on the open source conversation large model;
and responding to the open source conversation big model to verify that the initial answer data has actual causal logic and correctness, and generating the sample question-answer data.
4. The method for constructing thinking chain data according to claim 1, wherein the generating target answer data by data-rewriting the sample answer data based on the open-source conversation model comprises:
Inputting the sample answer data into the open source conversation large model, and carrying out text semantic recognition on the sample answer data to obtain a semantic recognition text;
and according to a preset rewrite rule, performing data rewrite on the semantic recognition text to generate the target answer data.
5. The thinking chain data construction method of claim 1, characterized in that the preset rewrite rules include: modifying associated words of the semantic recognition text, adjusting sentence length of the semantic recognition text, modifying uncommon words and spoken language expressions of the semantic recognition text, adjusting grammar errors of the semantic recognition text, adjusting wrong vocabulary of the semantic recognition text, and adjusting wrong punctuation marks of the semantic recognition text.
6. The method of claim 1, wherein before constructing the mental chain data based on the target question instruction and the target answer data in response to the similarity of the target question instruction and the sample question instruction being greater than a preset similarity, the method further comprises:
and judging the similarity between the target question instruction and the sample question instruction based on the open-source conversation large model.
7. The thinking chain data construction method of claim 1, characterized in that the method further comprises:
inputting the constructed mental chain data into a mental chain data set;
and fine-tuning a sample open source model based on the thinking chain data set to generate a target conversation large model.
8. A thinking chain data construction apparatus, comprising:
the acquisition module is used for acquiring sample question-answer data crawled in a network; the sample question and answer data comprise sample question instructions and sample answer data;
the first generation module is used for carrying out data rewriting on the sample answer data based on the open source conversation big model to generate target answer data;
the second generation module is used for reversely generating a target question instruction corresponding to the target answer data based on the open-source conversation large model;
and the construction module is used for responding to the fact that the similarity between the target questioning instruction and the sample questioning instruction is larger than the preset similarity, and constructing thinking chain data based on the target questioning instruction and the target answer data.
9. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
When executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-7.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-7.
CN202311470831.0A 2023-11-07 2023-11-07 Thinking chain data construction method and device, electronic equipment and storage medium Pending CN117633170A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311470831.0A CN117633170A (en) 2023-11-07 2023-11-07 Thinking chain data construction method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311470831.0A CN117633170A (en) 2023-11-07 2023-11-07 Thinking chain data construction method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117633170A true CN117633170A (en) 2024-03-01

Family

ID=90015451

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311470831.0A Pending CN117633170A (en) 2023-11-07 2023-11-07 Thinking chain data construction method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117633170A (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110263330A (en) * 2019-05-22 2019-09-20 腾讯科技(深圳)有限公司 Improvement, device, equipment and the storage medium of problem sentence
CN112364150A (en) * 2021-01-12 2021-02-12 南京云创大数据科技股份有限公司 Intelligent question and answer method and system combining retrieval and generation
CN112667794A (en) * 2020-12-31 2021-04-16 民生科技有限责任公司 Intelligent question-answer matching method and system based on twin network BERT model
CN112749262A (en) * 2020-07-24 2021-05-04 腾讯科技(深圳)有限公司 Question and answer processing method and device based on artificial intelligence, electronic equipment and storage medium
CN112966081A (en) * 2021-03-05 2021-06-15 北京百度网讯科技有限公司 Method, device, equipment and storage medium for processing question and answer information
CN113704434A (en) * 2021-09-01 2021-11-26 内蒙古大学 Knowledge base question and answer method, electronic equipment and readable storage medium
CN113742469A (en) * 2021-09-03 2021-12-03 科讯嘉联信息技术有限公司 Pipeline processing and ES storage based question-answering system construction method
CN114896382A (en) * 2022-05-18 2022-08-12 网思科技股份有限公司 Artificial intelligent question-answering model generation method, question-answering method, device and storage medium
CN115168562A (en) * 2022-07-28 2022-10-11 中国农业银行股份有限公司 Method, device, equipment and medium for constructing intelligent question-answering system
CN116226349A (en) * 2023-03-02 2023-06-06 北京智通云联科技有限公司 Question and answer method and system based on table semantic fasttet question analysis
CN116701604A (en) * 2023-07-07 2023-09-05 中国平安人寿保险股份有限公司 Question and answer corpus construction method and device, question and answer method, equipment and medium
US20230334072A1 (en) * 2022-04-18 2023-10-19 Hitachi, Ltd. Automatic question answering system and question-answer pair data generation method

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110263330A (en) * 2019-05-22 2019-09-20 腾讯科技(深圳)有限公司 Improvement, device, equipment and the storage medium of problem sentence
CN112749262A (en) * 2020-07-24 2021-05-04 腾讯科技(深圳)有限公司 Question and answer processing method and device based on artificial intelligence, electronic equipment and storage medium
CN112667794A (en) * 2020-12-31 2021-04-16 民生科技有限责任公司 Intelligent question-answer matching method and system based on twin network BERT model
CN112364150A (en) * 2021-01-12 2021-02-12 南京云创大数据科技股份有限公司 Intelligent question and answer method and system combining retrieval and generation
CN112966081A (en) * 2021-03-05 2021-06-15 北京百度网讯科技有限公司 Method, device, equipment and storage medium for processing question and answer information
CN113704434A (en) * 2021-09-01 2021-11-26 内蒙古大学 Knowledge base question and answer method, electronic equipment and readable storage medium
CN113742469A (en) * 2021-09-03 2021-12-03 科讯嘉联信息技术有限公司 Pipeline processing and ES storage based question-answering system construction method
US20230334072A1 (en) * 2022-04-18 2023-10-19 Hitachi, Ltd. Automatic question answering system and question-answer pair data generation method
CN114896382A (en) * 2022-05-18 2022-08-12 网思科技股份有限公司 Artificial intelligent question-answering model generation method, question-answering method, device and storage medium
CN115168562A (en) * 2022-07-28 2022-10-11 中国农业银行股份有限公司 Method, device, equipment and medium for constructing intelligent question-answering system
CN116226349A (en) * 2023-03-02 2023-06-06 北京智通云联科技有限公司 Question and answer method and system based on table semantic fasttet question analysis
CN116701604A (en) * 2023-07-07 2023-09-05 中国平安人寿保险股份有限公司 Question and answer corpus construction method and device, question and answer method, equipment and medium

Similar Documents

Publication Publication Date Title
US20230040095A1 (en) Method for pre-training model, device, and storage medium
KR20210092147A (en) Method and apparatus for mining entity focus in text
CN111177393A (en) Knowledge graph construction method and device, electronic equipment and storage medium
US20230252354A1 (en) Method for pre-training language model
CN111489735B (en) Voice recognition model training method and device
CN110929094A (en) Video title processing method and device
CN116820429B (en) Training method and device of code processing model, electronic equipment and storage medium
WO2023159767A1 (en) Target word detection method and apparatus, electronic device and storage medium
CN111563390A (en) Text generation method and device and electronic equipment
CN112528654A (en) Natural language processing method and device and electronic equipment
CN115062617A (en) Task processing method, device, equipment and medium based on prompt learning
CN110647613A (en) Courseware construction method, courseware construction device, courseware construction server and storage medium
CN116894188A (en) Service tag set updating method and device, medium and electronic equipment
CN115438149A (en) End-to-end model training method and device, computer equipment and storage medium
US20210004603A1 (en) Method and apparatus for determining (raw) video materials for news
CN111161724B (en) Method, system, equipment and medium for Chinese audio-visual combined speech recognition
CN109657046B (en) Content analysis processing method and device, electronic equipment and storage medium
US20220300717A1 (en) Method and apparatus for generating dialogue state
CN117633170A (en) Thinking chain data construction method and device, electronic equipment and storage medium
CN116957006A (en) Training method, device, equipment, medium and program product of prediction model
CN115620726A (en) Voice text generation method, and training method and device of voice text generation model
CN115827865A (en) Method and system for classifying objectionable texts by fusing multi-feature map attention mechanism
CN116821327A (en) Text data processing method, apparatus, device, readable storage medium and product
CN114791950A (en) Method and device for classifying aspect-level emotions based on part-of-speech position and graph convolution network
CN110852043B (en) Text transcription method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination