CN115033678A - Dialogue model training method, device and equipment - Google Patents

Dialogue model training method, device and equipment Download PDF

Info

Publication number
CN115033678A
CN115033678A CN202210951003.8A CN202210951003A CN115033678A CN 115033678 A CN115033678 A CN 115033678A CN 202210951003 A CN202210951003 A CN 202210951003A CN 115033678 A CN115033678 A CN 115033678A
Authority
CN
China
Prior art keywords
character string
trained
training
information
dialogue model
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.)
Withdrawn
Application number
CN202210951003.8A
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.)
Beijing Lingxin Intelligent Technology Co ltd
Original Assignee
Beijing Lingxin Intelligent 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 Beijing Lingxin Intelligent Technology Co ltd filed Critical Beijing Lingxin Intelligent Technology Co ltd
Priority to CN202210951003.8A priority Critical patent/CN115033678A/en
Publication of CN115033678A publication Critical patent/CN115033678A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/126Character encoding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/194Calculation of difference between files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • Databases & Information Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Evolutionary Computation (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Machine Translation (AREA)

Abstract

The embodiment of the application relates to the field of artificial intelligence and discloses a dialogue model training method, a device and equipment. The embodiment of the application relates to a dialogue model training method, which comprises the following steps: acquiring information to be trained; carrying out character string reorganization on the information to be trained to obtain a character string to be trained; if the number of characters corresponding to the character string to be trained is larger than a preset threshold value, preprocessing the character string to be trained to obtain a target training character string, so that the number of characters corresponding to each target training character string is smaller than or equal to the preset threshold value; and inputting the target training character string serving as a training sample into the dialogue model to finish the dialogue model training. It can be seen that the content in the character string is preprocessed, so that the complete information content to be trained is reserved and the number of characters meets the maximum character number limit of the dialogue model for training samples. Therefore, the dialogue model can completely take the information to be trained as a training sample, and the output result after the dialogue model is trained is more accurate.

Description

Dialogue model training method, device and equipment
Technical Field
The embodiment of the invention relates to the field of artificial intelligence, in particular to a method, a device and equipment for training a conversation model.
Background
The conversation model is often applied to a conversation system for providing a chat communication service for users. In the field of psychological consultation conversation, a conversation model preset in a conversation system can help a consultant to answer consultation questions according to the text information of the consultant.
In order to enable the dialogue model to help the consultant to solve the consultation questions, training of the dialogue model needs to be completed in advance. In the prior art, a historical dialog text or a preset special training text is generally used as training information of a dialog model. Taking the historical dialogue text as the training information of the dialogue model as an example, the historical dialogue text is spliced to obtain a long character string, and then the long character string is input to the dialogue model for training.
However, the dialog model typically has a limit on the maximum number of characters that the input training information may have. When the number of characters of the obtained long character string exceeds the limit of the dialogue model on the maximum number of characters of input training information, the prior art removes the exceeding part, and only the long character string within the limit of the maximum number of characters is provided for training the dialogue model. Thus, the training content of the dialogue model is lost, so that the dialogue model has a risk of distorting the output result of the counselor in practical application.
Disclosure of Invention
The embodiment of the application provides a method, a device and equipment for training a dialogue model, and aims to solve the problem that the output result of the dialogue model is distorted due to the fact that training content is lost in the existing dialogue model training.
In a first aspect, an embodiment of the present application provides a dialog model training method, where the method includes:
acquiring at least one piece of information to be trained;
performing character string reorganization on the at least one piece of information to be trained to obtain a character string to be trained;
acquiring the character number of the character string to be trained, and if the character number corresponding to the character string to be trained is larger than a preset threshold value, preprocessing the character string to be trained to obtain at least one target training character string, so that the character number corresponding to each of the at least one target training character string is smaller than or equal to the preset threshold value;
and inputting the at least one target training character string serving as a training sample into the dialogue model to finish the dialogue model training.
In some possible embodiments, the preprocessing the character string to be trained includes: and carrying out truncation processing on the character string to be trained or carrying out compression processing on the character string to be trained. Therefore, the training information obtained by the dialogue model is more complete, and the problem of output result distortion of the dialogue model caused by the loss of the training information is further reduced.
In some possible embodiments, the truncating the character string to be trained includes:
and performing truncation processing on the character string to be trained according to the preset threshold to obtain a first sub character string and a second sub character string, wherein the first sub character string is used as a first target training character string, and the second sub character string is used as a second target training character string. In this way, the sub-character strings of which the number of characters is less than or equal to the preset threshold can be obtained by truncating the character strings to be trained of which the number of characters is greater than the preset threshold, and the two sub-character strings are input into the dialogue model as target training character strings, so that the training information acquired by the dialogue model is more complete, and the problem of output result distortion of the dialogue model caused by the missing of the training information is further reduced.
In some possible embodiments, the compressing the character string to be trained includes:
acquiring the character string to be trained;
and inputting the character string to be trained to a preset compression model to obtain a compressed character string, wherein the compressed character string is used as a target training character string. Therefore, the compressed character string can be obtained by compressing the character string to be trained with the number of characters larger than the preset threshold value, and the compressed character string is input into the dialogue model as the target training character string, so that the training information acquired by the dialogue model is more complete, and the problem of output result distortion of the dialogue model caused by the loss of the training information is further reduced.
In some possible embodiments, the inputting the character string to be trained to a preset compression model to obtain a compressed character string includes:
inputting the character string to be trained to a preset abstract model to obtain the compressed character string,
or inputting the character string to be trained to a preset text coding model to obtain the compressed character string.
In some possible embodiments, the inputting the character string to be trained to a preset abstract model to obtain the compressed character string includes:
acquiring at least one key sentence in the character string to be trained;
and performing character string reorganization on the at least one key sentence to obtain the compressed character string. Therefore, the key sentences in the character string can be used as the abstract model output result to obtain the key content in the character string to be trained, and the character string is reorganized to obtain the compressed character string, so that the recognition model is used for training.
In some possible embodiments, the information category to be trained includes: historical session information and user profile information. Therefore, the recognition model is trained based on the information to be trained, and the accuracy probability parameter of the output result can be improved.
In a possible embodiment, the preset text coding model includes at least one of the following categories: convolutional neural network models, cyclic neural network models, Transformer models, and pre-trained BERT models.
In a second aspect, an embodiment of the present application further provides a dialog apparatus, where the apparatus includes:
the first acquisition module is used for acquiring at least one piece of information to be trained;
the coding module is used for carrying out character string reorganization on the at least one piece of information to be trained to obtain a character string to be trained;
a second obtaining module, configured to obtain the number of characters of the character string to be trained, and if the number of characters corresponding to the character string to be trained is greater than a preset threshold, pre-process the character string to be trained to obtain at least one target training character string, so that the number of characters corresponding to each of the at least one target training character string is less than or equal to the preset threshold;
and the output module is used for taking the at least one target training character string as a training sample to finish the training of the dialogue model.
In a third aspect, an embodiment of the present application further provides an electronic device, where the electronic device includes: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor performing the method of the first aspect or any of the possible embodiments of the first aspect by executing the computer instructions.
In a fourth aspect, the present application further provides a computer-readable storage medium, where computer instructions are stored, and the computer instructions are configured to cause the computer to execute the method in the first aspect or any possible implementation manner of the first aspect.
The embodiment of the application provides a dialogue model training method, and in the scheme, at least one piece of information to be trained is obtained; then, performing character string reorganization on the at least one piece of information to be trained to obtain a character string to be trained; then, acquiring the number of characters of the character string to be trained, and if the number of characters corresponding to the character string to be trained is larger than a preset threshold, preprocessing the character string to be trained to obtain a target training character string, so that the number of characters corresponding to the target training character string is smaller than or equal to the preset threshold; and finally, inputting the at least one target training character string serving as a training sample into the dialogue model to finish the dialogue model training. Therefore, after the information to be trained is summarized into the character string, the number of characters in the character string is judged, and if the number of characters in the character string exceeds the maximum character number limit of the dialogue model on the training sample, the content in the character string is preprocessed, so that the complete information content to be trained is reserved, and the number of characters meets the maximum character number limit of the dialogue model on the training sample. Therefore, the dialogue model can completely take the information to be trained as a training sample, so that the output result after the dialogue model is trained is more accurate, and the risk of wrong solution to the questions of the consultant in the practical application of the dialogue model is reduced.
Drawings
FIG. 1 is a schematic flow chart of a dialogue model training method provided in an embodiment of the present application;
fig. 2 is a schematic structural diagram of a dialog device according to an embodiment of the present application;
fig. 3 is an exemplary structural diagram of a dialogue device provided in an embodiment of the present application.
Detailed Description
The terminology used in the following examples of the present application is for the purpose of describing alternative embodiments and is not intended to be limiting of the present application. As used in the specification of the present application and the appended claims, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well. It should also be understood that although the terms first, second, etc. may be used in the following embodiments to describe a class of objects, the objects are not limited to these terms. These terms are used to distinguish between particular objects of that class of objects. For example, the following embodiments may adopt the terms first, second, etc. to describe other class objects in the same way, and are not described herein again.
The embodiment of the application provides a dialogue model training method, and in the scheme, at least one piece of information to be trained is obtained; then, performing character string reorganization on the at least one piece of information to be trained to obtain a character string to be trained; then, acquiring the number of characters of the character string to be trained, and if the number of characters corresponding to the character string to be trained is larger than a preset threshold, preprocessing the character string to be trained to obtain a target training character string, so that the number of characters corresponding to the target training character string is smaller than or equal to the preset threshold; and finally, taking the target training character string as a training sample to finish the training of the dialogue model. Therefore, after the information to be trained is summarized into the character string, the number of characters in the character string is judged, and if the number of characters in the character string exceeds the maximum character number limit of the dialogue model on the training sample, the content in the character string is preprocessed, so that the complete information content to be trained is reserved, and the number of characters meets the maximum character number limit of the dialogue model on the training sample. Therefore, the dialogue model can completely take the information to be trained as a training sample, so that the output result after the dialogue model is trained is more accurate, and the risk of wrong answer to the questions of the consultant in the practical application of the dialogue model is reduced.
Any electronic device related to the embodiments of the present application may be an electronic device such as a mobile phone, a tablet computer, a wearable device (e.g., a smart watch, a smart bracelet, etc.), a notebook computer, a desktop computer, and an in-vehicle device. The electronic device is pre-installed with a software deployment application. It is understood that the embodiment of the present application does not set any limit to the specific type of the electronic device.
The conversation model is often applied to a conversation system for providing a chat communication service for users. In the field of psychological consultation conversation, a preset conversation model in a conversation system can help a consultant to answer a consultation problem according to the text information of the consultant.
In order to make the dialogue model help the consultant to solve the consultation question, the training of the dialogue model needs to be completed in advance. In the prior art, a historical dialog text or a preset special training text is generally used as training information of a dialog model. Taking the historical dialogue text as the training information of the dialogue model as an example, the historical dialogue text is spliced to obtain a long character string, and then the long character string is input to the dialogue model for training.
However, the dialog model typically has a limit on the maximum number of characters that the input training information may have. When the number of characters of the obtained long character string exceeds the limit of the dialogue model on the maximum number of characters of input training information, the prior art removes the exceeding part, and only the long character string within the limit of the maximum number of characters is provided for training the dialogue model. Thus, there is a risk that the output result of the dialogue model to the counselor is distorted in practical application due to the lack of the training content of the dialogue model.
The following is a description of several exemplary embodiments, and the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application will be explained.
In a first aspect of the present application, a method for training a dialog model is provided, and referring to fig. 1, fig. 1 is a schematic flowchart of the method for training the dialog model provided in the embodiment of the present application, and includes the following steps:
acquiring at least one piece of information to be trained;
performing character string reorganization on the at least one piece of information to be trained to obtain a character string to be trained;
acquiring the character number of the character string to be trained, and if the character number corresponding to the character string to be trained is larger than a preset threshold value, preprocessing the character string to be trained to obtain at least one target training character string, so that the character number corresponding to each of the at least one target training character string is smaller than or equal to the preset threshold value;
and inputting the at least one target training character string serving as a training sample into the dialogue model to finish the dialogue model training.
For example, taking a dialog model applied to a domain of psychological consultation dialog as an example, assuming that the dialog model has a character number limit on input information to be trained, and the maximum number of characters allowed to be input is 256 bytes (i.e., a preset threshold), when the number of characters of the information to be trained exceeds 256 bytes, in order to enable the dialog model to completely receive the information to be trained, after character string reorganization is performed on the information to be trained, preprocessing is performed on a character string (i.e., a character string to be trained), so that the number of bytes of the preprocessed character string (i.e., a target training character string) can be received by the dialog model and input to the dialog model for training.
In a possible embodiment, the preprocessing the character string to be trained includes: and carrying out truncation processing on the character string to be trained or compressing the character string to be trained.
Optionally, the intercepting processing of the character string to be trained includes:
and performing truncation processing on the character string to be trained according to the preset threshold to obtain a first sub character string and a second sub character string, wherein the first sub character string is used as a first target training character string, and the second sub character string is used as a second target training character string.
Illustratively, taking the maximum number of characters of the information to be trained that can be received by the dialogue model as 5 bytes as an example,
firstly, acquiring a character string to be trained, such as ABCDEFGHI, after information to be trained is completely compiled;
then, according to the fact that the number of characters of the information to be trained which can be received by the dialog model at the maximum is 5 bytes, the character string to be trained is subjected to truncation processing, and a first substring "ABCDE" and a second substring "FGHI" are obtained;
and finally, inputting the first sub-character string and the second sub-character string into the dialogue model as target training character strings for training.
It is understood that each letter in "ABCDFFGHI" herein refers to a separate character, and has no limiting meaning.
Optionally, if the number of characters corresponding to at least one substring still exists in two substrings obtained after the string to be trained is once truncated, the truncation processing is continued for the substring of which the number of characters is greater than the preset threshold until the number of characters of the obtained substring is less than or equal to the preset threshold.
In a possible implementation manner, the compressing the character string to be trained includes:
acquiring the character string to be trained;
and inputting the character string to be trained to a preset compression model to obtain a compressed character string, wherein the compressed character string is used as a target training character string.
Optionally, the inputting the character string to be trained to a preset compression model to obtain a compressed character string includes:
inputting the character string to be trained to a preset abstract model to obtain the compressed character string,
or inputting the character string to be trained to a preset text coding model to obtain the compressed character string.
Optionally, the abstract model categories include: an abstract extraction generation model and a abstract generation model.
Exemplarily, taking an abstract generation model as a preset compression model, when the obtained information to be trained is a text paragraph, organizing the information to be trained into a character string to be trained (the number of characters of the character string to be trained is greater than a preset threshold);
s101: acquiring at least one key sentence in the character string to be trained;
specifically, before the information to be trained is compiled into the character string to be trained, the implementation steps are as follows:
s111: obtaining the semantics of a text paragraph corresponding to the information to be trained;
s112: according to a preset semantic algorithm, sentence-wise acquisition is carried out on a text paragraph to obtain at least one sentence and a semantic corresponding to each sentence in the at least one sentence, wherein each sentence corresponds to one semantic,
specifically, the preset semantic algorithm comprises an N-gram;
s113: comparing the semantic corresponding to each clause with the semantic of the text paragraph corresponding to the information to be trained to obtain at least one similarity comparison result;
s114: and if the similarity comparison result is greater than a preset similarity threshold, defining the clause corresponding to the similarity comparison result greater than the preset similarity threshold as a key sentence.
S102: and performing character string reorganization on the at least one key sentence to obtain the compressed character string.
Illustratively, taking a generative abstract generation model as a preset compression model as an example, when the acquired information to be trained is a dialog history record, the information to be trained is compiled into a character string to be trained (the number of characters of the character string to be trained is greater than a preset threshold);
s201: acquiring the occurrence probability of each input statement corresponding to the output statement in the conversation historical record;
s202: and screening according to the occurrence probability of the output sentence corresponding to each input sentence to obtain the output sentence which is most matched and corresponds to each input sentence, and taking the output sentence as the target training character.
Illustratively, taking a text encoder (a convolutional neural network, a cyclic neural network, a transform model, or a pre-trained BERT model, etc.) as a preset compression model, when the obtained information to be trained is a text sequence, the information to be trained is compiled into a character string to be trained (the number of characters of the character string to be trained is greater than a preset threshold);
s301: extracting the characteristics of the character string to be trained to obtain a vector corresponding to each character in the character string to be trained;
s302: inputting the character string to be trained and the vector corresponding to each character of the character string to be trained to a pooling layer to obtain a compressed character string to be trained (i.e. the compressed character string),
specifically, the implementation manner of obtaining the compressed character string to be trained includes: average pooling approach or maximum pooling approach.
In a possible implementation manner, the category of information to be trained includes: historical dialogue information and user profile information.
Illustratively, when the scene of the dialog model application is in a chatting scene (here, the AI chat software is taken as an example), the profile information of the user needs to be considered in the process of generating the dialog reply. Typically, the profile information is stored in some external database (e.g., identity information, preference information, etc. of the user). In this way, when inputting dialog history information and user profile information for the dialog model as training samples, the dialog model can better cope with the user in a chatty scene.
For example: and recording the favorite fruit of the user as apple in the user data, and converting the favorite fruit into favorite apple of the user in the conversation, and thus carrying out conversation to complete the chatting task.
The above embodiments introduce various implementation manners of the dialog model training method provided by the embodiments of the present application from the aspects of obtaining information to be trained, editing a character string of the information to be trained, preprocessing the character string to be trained, training a dialog model, and the like. It should be understood that the embodiments of the present application may implement the above functions in the form of hardware or a combination of hardware and computer software in the processing steps of obtaining information to be trained, performing a string compilation on the information to be trained, preprocessing a string to be trained, training a dialog model, and the like. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
For example, if the above implementation steps implement the corresponding functions through software modules. As shown in fig. 2, the dialog device may include a first obtaining module, an encoding module, a second obtaining module, and an output module. The dialogue device may be used to perform some or all of the operations of the dialogue model training method described above.
For example:
the first acquisition module is used for acquiring at least one piece of information to be trained;
the coding module is used for carrying out character string reorganization on the at least one piece of information to be trained to obtain a character string to be trained;
a second obtaining module, configured to obtain the number of characters of the character string to be trained, and if the number of characters corresponding to the character string to be trained is greater than a preset threshold, pre-process the character string to be trained to obtain at least one target training character string, so that the number of characters corresponding to each of the at least one target training character string is less than or equal to the preset threshold;
and the output module is used for inputting the at least one target training character string serving as a training sample to the dialogue model to finish the dialogue model training.
As can be seen from this, it is,
the embodiment of the application provides a dialogue model training method, and in the scheme, at least one piece of information to be trained is obtained; then, performing character string reorganization on the at least one piece of information to be trained to obtain a character string to be trained; then, acquiring the character number of the character string to be trained, and if the character number corresponding to the character string to be trained is larger than a preset threshold value, preprocessing the character string to be trained to obtain a target training character string, so that the character number corresponding to the target training character string is smaller than or equal to the preset threshold value; and finally, inputting the at least one target training character string serving as a training sample into the dialogue model to finish the dialogue model training. Therefore, after the information to be trained is summarized into the character string, the number of characters in the character string is judged, and if the number of characters in the character string exceeds the maximum character number limit of the dialogue model on the training sample, the content in the character string is preprocessed, so that the complete information content to be trained is reserved, and the number of characters meets the maximum character number limit of the dialogue model on the training sample. Therefore, the dialogue model can completely take the information to be trained as a training sample, so that the output result after the dialogue model is trained is more accurate, and the risk of wrong solution to the questions of the consultant in the practical application of the dialogue model is reduced.
It is understood that the functions of the above modules may be implemented by integrating into a hardware entity, for example, the first obtaining module, the second obtaining module and the output module may be implemented by integrating into a transceiver, the coding module may be implemented by integrating into a processor, and the programs and instructions for implementing the functions of the above modules may be maintained in a memory. As shown in fig. 3, an electronic device is provided, which includes a processor, a transceiver and a memory, wherein the transceiver is configured to execute learning result acquisition corresponding to the target reference information and each of the encoding information in the disease species identification method based on multiple information, and the memory is configured to store the program/code preinstalled by the aforementioned deployment apparatus, and may also store the code for execution by the processor, etc. When the processor executes the codes stored in the memory, the electronic device is caused to execute part or all of the operations of the software deployment method in the method.
The specific process is described in the above embodiments of the method, and is not described in detail here.
In a specific implementation, corresponding to the foregoing electronic device, an embodiment of the present application further provides a computer storage medium, where the computer storage medium disposed in the electronic device may store a program, and when the program is executed, part or all of the steps in each embodiment of the software deployment method may be implemented. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a Random Access Memory (RAM), or the like.
One or more of the above modules or units may be implemented in software, hardware or a combination of both. When any of the above modules or units are implemented in software, which is present as computer program instructions and stored in a memory, a processor may be used to execute the program instructions and implement the above method flows. The processor may include, but is not limited to, at least one of: various computing devices that run software, such as a Central Processing Unit (CPU), a microprocessor, a Digital Signal Processor (DSP), a Microcontroller (MCU), or an artificial intelligence processor, may each include one or more cores for executing software instructions to perform operations or processing. The processor may be built in an SoC (system on chip) or an Application Specific Integrated Circuit (ASIC), or may be a separate semiconductor chip. The processor may further include a necessary hardware accelerator such as a Field Programmable Gate Array (FPGA), a PLD (programmable logic device), or a logic circuit for implementing a dedicated logic operation, in addition to a core for executing software instructions to perform an operation or a process.
When the above modules or units are implemented in hardware, the hardware may be any one or any combination of a CPU, a microprocessor, a DSP, an MCU, an artificial intelligence processor, an ASIC, an SoC, an FPGA, a PLD, a dedicated digital circuit, a hardware accelerator, or a discrete device that is not integrated, which may run necessary software or is independent of software to perform the above method flows.
Further, a bus interface may also be included in FIG. 3, which may include any number of interconnected buses and bridges, with one or more processors, represented by a processor, and various circuits of memory, represented by memory, linked together. The bus interface may also link together various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. The bus interface provides an interface. The transceiver provides a means for communicating with various other apparatus over a transmission medium. The processor is responsible for managing the bus architecture and the usual processing, and the memory may store data used by the processor in performing operations.
When the above modules or units are implemented using software, they may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It should be understood that, in the various embodiments of the present application, the sequence numbers of the processes do not mean the execution sequence, and the execution sequence of the processes should be determined by the functions and the internal logic, and should not constitute any limitation to the implementation process of the embodiments.
All parts of the specification are described in a progressive mode, the same and similar parts of all embodiments can be referred to each other, and each embodiment is mainly introduced to be different from other embodiments. In particular, as to the apparatus and system embodiments, since they are substantially similar to the method embodiments, the description is relatively simple and reference may be made to the description of the method embodiments in relevant places.
While alternative embodiments of the present application have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
The above-mentioned embodiments, objects, technical solutions and advantages of the present application are further described in detail, it should be understood that the above-mentioned embodiments are only examples of the present application, and are not intended to limit the scope of the present application, and any modifications, equivalent substitutions, improvements and the like made on the basis of the technical solutions of the present application should be included in the scope of the present invention.

Claims (10)

1. A method for training a dialogue model, the method comprising:
acquiring at least one piece of information to be trained;
performing character string reorganization on the at least one piece of information to be trained to obtain a character string to be trained;
acquiring the character number of the character string to be trained, and if the character number corresponding to the character string to be trained is larger than a preset threshold value, preprocessing the character string to be trained to obtain at least one target training character string, so that the character number corresponding to each of the at least one target training character string is smaller than or equal to the preset threshold value;
and inputting the at least one target training character string serving as a training sample into the dialogue model to finish the dialogue model training.
2. The dialogue model training method of claim 1, wherein the preprocessing the character string to be trained comprises: and carrying out truncation processing on the character string to be trained or compressing the character string to be trained.
3. The dialogue model training method according to claim 1 or 2, wherein the truncating the character string to be trained comprises:
and performing truncation processing on the character string to be trained according to the preset threshold to obtain a first sub character string and a second sub character string, wherein the first sub character string is used as a first target training character string, and the second sub character string is used as a second target training character string.
4. The dialogue model training method according to claim 1 or 2, wherein the compressing the character string to be trained comprises:
acquiring the character string to be trained;
and inputting the character string to be trained to a preset compression model to obtain a compressed character string, wherein the compressed character string is used as a target training character string.
5. The dialogue model training method according to claim 4, wherein the inputting the character string to be trained to a preset compression model to obtain a compressed character string comprises:
inputting the character string to be trained to a preset abstract model to obtain the compressed character string,
or inputting the character string to be trained to a preset text coding model to obtain the compressed character string.
6. The dialogue model training method according to claim 5, wherein the inputting the character string to be trained to a preset abstract model to obtain the compressed character string comprises:
acquiring at least one key sentence in the character string to be trained;
and performing character string reorganization on the at least one key sentence to obtain the compressed character string.
7. The dialogue model training method of claim 1, wherein the information category to be trained comprises: historical session information and user profile information.
8. A dialog device, the device comprising:
the first acquisition module is used for acquiring at least one piece of information to be trained;
the coding module is used for carrying out character string reorganization on the at least one piece of information to be trained to obtain a character string to be trained;
a second obtaining module, configured to obtain the number of characters of the character string to be trained, and if the number of characters corresponding to the character string to be trained is greater than a preset threshold, pre-process the character string to be trained to obtain at least one target training character string, so that the number of characters corresponding to each of the at least one target training character string is less than or equal to the preset threshold;
and the output module is used for inputting the at least one target training character string serving as a training sample to the dialogue model to finish the dialogue model training.
9. An electronic device, characterized in that the electronic device comprises: a memory and a processor communicatively coupled to each other, the memory having stored therein computer instructions, the processor performing the method of any of claims 1-7 by executing the computer instructions.
10. A computer-readable storage medium having stored thereon computer instructions for causing a computer to perform the method of any one of claims 1-7.
CN202210951003.8A 2022-08-09 2022-08-09 Dialogue model training method, device and equipment Withdrawn CN115033678A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210951003.8A CN115033678A (en) 2022-08-09 2022-08-09 Dialogue model training method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210951003.8A CN115033678A (en) 2022-08-09 2022-08-09 Dialogue model training method, device and equipment

Publications (1)

Publication Number Publication Date
CN115033678A true CN115033678A (en) 2022-09-09

Family

ID=83131163

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210951003.8A Withdrawn CN115033678A (en) 2022-08-09 2022-08-09 Dialogue model training method, device and equipment

Country Status (1)

Country Link
CN (1) CN115033678A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109992771A (en) * 2019-03-13 2019-07-09 北京三快在线科技有限公司 A kind of method and device of text generation
CN111143551A (en) * 2019-12-04 2020-05-12 支付宝(杭州)信息技术有限公司 Text preprocessing method, classification method, device and equipment
US20210397791A1 (en) * 2020-06-19 2021-12-23 Beijing Baidu Netcom Science And Technology Co., Ltd. Language model training method, apparatus, electronic device and readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109992771A (en) * 2019-03-13 2019-07-09 北京三快在线科技有限公司 A kind of method and device of text generation
CN111143551A (en) * 2019-12-04 2020-05-12 支付宝(杭州)信息技术有限公司 Text preprocessing method, classification method, device and equipment
US20210397791A1 (en) * 2020-06-19 2021-12-23 Beijing Baidu Netcom Science And Technology Co., Ltd. Language model training method, apparatus, electronic device and readable storage medium

Similar Documents

Publication Publication Date Title
CN111814466A (en) Information extraction method based on machine reading understanding and related equipment thereof
CN111695338A (en) Interview content refining method, device, equipment and medium based on artificial intelligence
CN113239169A (en) Artificial intelligence-based answer generation method, device, equipment and storage medium
CN111597807B (en) Word segmentation data set generation method, device, equipment and storage medium thereof
CN112836521A (en) Question-answer matching method and device, computer equipment and storage medium
CN116050352A (en) Text encoding method and device, computer equipment and storage medium
CN112951233A (en) Voice question and answer method and device, electronic equipment and readable storage medium
CN111898363B (en) Compression method, device, computer equipment and storage medium for long and difficult text sentence
CN113505595A (en) Text phrase extraction method and device, computer equipment and storage medium
CN117763084A (en) Knowledge base retrieval method based on text compression and related equipment
CN116701604A (en) Question and answer corpus construction method and device, question and answer method, equipment and medium
CN109002498B (en) Man-machine conversation method, device, equipment and storage medium
CN116432705A (en) Text generation model construction method, text generation device, equipment and medium
CN115098665A (en) Method, device and equipment for expanding session data
CN111401069A (en) Intention recognition method and intention recognition device for conversation text and terminal
CN115033678A (en) Dialogue model training method, device and equipment
CN115620726A (en) Voice text generation method, and training method and device of voice text generation model
CN115048927A (en) Method, device and equipment for identifying disease symptoms based on text classification
CN113283218A (en) Semantic text compression method and computer equipment
CN113705194A (en) Extraction method and electronic equipment for short
CN112765993A (en) Semantic parsing method, system, device and readable storage medium
CN110704623A (en) Method, device, system and storage medium for improving entity identification rate based on Rasa _ Nlu framework
CN117290510B (en) Document information extraction method, model, electronic device and readable medium
CN116913278B (en) Voice processing method, device, equipment and storage medium
CN117009532B (en) Semantic type recognition method and device, computer readable medium and electronic equipment

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20220909

WW01 Invention patent application withdrawn after publication