Model training method, information reply method, device, equipment and medium

By determining preset question-answer sample pairs in the automated interactive system and performing semantic cleaning processing, the problem of requiring a large number of samples to train the language response model is solved, achieving efficient model training and accurate user responses.

CN116541494BActive Publication Date: 2025-09-23AGRICULTURAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310402861.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-14
Publication Date
2025-09-23
Estimated Expiration
2043-04-14

AI Technical Summary

Technical Problem

In automated interactive systems, training language response models requires a large number of training samples, resulting in low training efficiency.

Method used

By determining the preset question-answer sample pairs, using the initial preprocessing sub-model to perform semantic cleaning to process natural question statements, determining the question samples, and inputting them into the initial machine learning sub-model, the preset model is trained in combination with the preset answer samples to achieve the screening of interference content.

Benefits of technology

On the basis of ensuring the training effect, the training efficiency is improved, the demand for a large number of training samples is reduced, and the accuracy of the model and user experience are ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116541494B_ABST
    Figure CN116541494B_ABST
Patent Text Reader

Abstract

The present invention discloses a model training method, a method, device, equipment and medium for replying information. The method includes: determining a preset question-answer sample pair and obtaining a natural question sentence; using an initial preprocessing sub-model in a preset initial model to semantically cleanse the natural question sentence, and determining a question sample based on the processing result and the preset question sample; inputting the question sample into the initial machine learning sub-model in the preset initial model to obtain sample reply information; using the sample reply information and the preset answer sample to train the preset initial model to obtain a preset model after training. The technical solution of the embodiment of the present invention can filter out interfering content by semantically cleaning the natural question sentence during the training process, which not only does not require a large number of training samples, but also improves the efficiency of training while ensuring the training effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of natural language processing technology, and in particular to a model training method, a method, device, equipment and storage medium for replying information. Background Art

[0002] In an automated interactive system, when a customer asks a question, the system identifies the customer's intent and matches it with an appropriate answer. Accurately identifying the customer's intent is crucial. Only by correctly identifying the customer's intent can you accurately respond to the customer and resolve their issue.

[0003] When a customer engages in a conversation with an interactive system, the system typically provides direct answers to their questions or provides guiding questions to guide them in entering key questions. The interactive system typically needs to determine the answer or next guiding question based on the text or voice content currently provided by the customer.

[0004] However, in general, the conversation content input by customers is not standardized, for example, it may contain a lot of invalid or interfering content. Therefore, when training the language response model of the interactive system, a large number of training samples are required, and the training efficiency is low. Summary of the Invention

[0005] The present invention provides a model training method, a method, an apparatus, a device and a storage medium for replying information to solve the problem of requiring a large number of training samples when training a model.

[0006] In a first aspect, the present invention provides a model training method, comprising:

[0007] Determining a preset question-answer sample pair and obtaining a natural question statement, wherein the preset question-answer sample pair includes a preset question sample and a preset answer sample, and the natural question statement and the preset question sample have the same question purpose;

[0008] Using the initial preprocessing sub-model in the preset initial model to semantically cleanse the natural question sentence, and determining a question sample based on the processing result and the preset question sample;

[0009] Inputting the question sample into the initial machine learning sub-model in the preset initial model to obtain sample response information;

[0010] The preset initial model is trained using the sample reply information and the preset answer sample to obtain a preset model after training.

[0011] In a second aspect, the present invention provides a method for replying information, comprising:

[0012] Determine the dialog information entered by the user;

[0013] Using a language preprocessing sub-model in a preset model, semantic cleaning is performed on the conversation information to obtain target feature encoding, wherein the preset model is obtained using the model training method of the first aspect described above;

[0014] The target feature code is input into the preset machine learning sub-model in the preset model to obtain target response information.

[0015] In a third aspect, the present invention provides a model training device, comprising:

[0016] A sample and statement determination module is used to determine a preset question and answer sample pair and obtain a natural question statement, wherein the preset question and answer sample pair includes a preset question sample and a preset answer sample, and the natural question statement and the preset question sample have the same question purpose;

[0017] a question sample determination module, configured to semantically cleanse the natural question sentence using an initial preprocessing sub-model in a preset initial model, and determine a question sample based on the processing result and the preset question sample;

[0018] A sample response determination module is used to input the question sample into the initial machine learning sub-model in the preset initial model to obtain sample response information;

[0019] The training module is used to train the preset initial model using the sample reply information and the preset answer sample to obtain the preset model after training.

[0020] In a fourth aspect, the present invention provides a device for replying information, comprising:

[0021] A dialogue information determination module, used to determine the dialogue information input by the user;

[0022] a feature code determination module, configured to perform semantic cleaning on the conversation information using a language preprocessing sub-model in a preset model to obtain a target feature code, wherein the preset model is obtained using the model training method of the first aspect described above;

[0023] The reply information determination module is used to input the target feature code into the preset machine learning sub-model in the preset model to obtain target reply information.

[0024] In a fifth aspect, the present invention provides an electronic device, comprising:

[0025] at least one processor;

[0026] and a memory communicatively coupled to the at least one processor;

[0027] In which, the memory stores a computer program that can be executed by at least one processor, and the computer program is executed by at least one processor so that the at least one processor can execute the model training method of the first aspect mentioned above, and / or execute the method of replying information of the second aspect mentioned above.

[0028] In a sixth aspect, the present invention provides a computer-readable storage medium storing computer instructions, which are used to enable a processor to implement the model training method of the first aspect when executed, and / or, to implement the method of replying information of the second aspect when executed.

[0029] The model training scheme provided by the present invention determines a preset question-answer sample pair and obtains a natural question sentence, wherein the preset question-answer sample pair includes a preset question sample and a preset answer sample, the natural question sentence and the preset question sample have the same question purpose, the natural question sentence is processed by semantic cleaning of the initial preprocessing sub-model in the preset initial model, and the question sample is determined based on the processing result and the preset question sample, the question sample is input into the initial machine learning sub-model in the preset initial model to obtain sample reply information, and the preset initial model is trained using the sample reply information and the preset answer sample to obtain the preset model after training. By adopting the above technical scheme, relatively standardized sample reply information can be determined based on the result of semantic cleaning of the initial preprocessing sub-model and the preset question sample, and then the sample reply information and the preset answer sample are used to train the preset initial model to obtain the preset model after training. The training method of this scheme can filter out interference content by semantic cleaning of natural question sentences during training. This method does not require a large number of training samples, and improves the efficiency of training while ensuring the training effect.

[0030] The reply message solution provided by the present invention determines the conversation information input by the user, and uses the language preprocessing sub-model of a preset model to perform semantic cleaning on the conversation information to obtain a target feature code, wherein the preset model is obtained using the model training method described above. The target feature code is then input into the preset machine learning sub-model of the preset model to obtain the target reply message. By adopting this technical solution, the preset model can filter out interfering content before recognizing the semantics of the user's conversation input. This allows the preset machine learning sub-model of the preset model to accurately and quickly determine the reply message to the user based on the target feature code corresponding to the conversation information, ensuring a good user experience.

[0031] It should be understood that the content described in this section is not intended to identify the key or important features of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0033] Figure 1 This is a flowchart of a model training method provided in accordance with the first embodiment of the present invention;

[0034] Figure 2 This is a flowchart of a model training method provided according to the second embodiment of the present invention;

[0035] Figure 3 This is a flowchart of a method for replying information provided according to Embodiment 3 of the present invention;

[0036] Figure 4 2 is a schematic structural diagram of a model training device provided according to a fourth embodiment of the present invention;

[0037] Figure 5 This is a schematic diagram of the structure of a device for replying information provided according to a fifth embodiment of the present invention;

[0038] Figure 6 It is a structural diagram of an electronic device provided according to the sixth embodiment of the present invention. DETAILED DESCRIPTION

[0039] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0040] It should be noted that the terms "first," "second," and the like in the specification and claims of the present invention and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than that illustrated or described herein. In the description of the present invention, unless otherwise specified, "plurality" refers to two or more. "And / or" describes an association relationship between associated objects, indicating that three relationships can exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship. In addition, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product, or device.

[0041] Example 1

[0042] Figure 1 A flowchart of a model training method is provided for the first embodiment of the present invention. This embodiment is applicable to the case of training models. The method can be executed by a model training device. The model training device can be implemented in the form of hardware and / or software. The model training device can be configured in an electronic device. The electronic device can be composed of two or more physical entities or one physical entity.

[0043] like Figure 1 As shown, the model training method provided in the first embodiment of the present invention specifically includes the following steps:

[0044] S101. Determine a preset question-answer sample pair and obtain a natural question statement, wherein the preset question-answer sample pair includes a preset question sample and a preset answer sample, and the natural question statement and the preset question sample have the same question purpose.

[0045] In this embodiment, a natural question sentence can be determined first, and then a corresponding preset question-answer sample pair can be compiled based on the natural question sentence. Alternatively, a preset question-answer sample pair can be compiled first, and then a corresponding natural question sentence can be determined based on the preset question-answer sample pair. The question intention, i.e., purpose, of the natural question sentence and the preset question sample is consistent. A natural question sentence can be understood as an informal question sentence spoken by the user, which usually contains interference information, such as modal particles and irrelevant content. A preset question sample can be understood as a preset standardized question sentence, which does not contain interference information. A preset answer sample can be understood as a standardized answer sentence corresponding to the preset question sample, which also does not contain interference information.

[0046] S102: semantically clean the natural question sentence using the initial preprocessing sub-model in the preset initial model, and determine a question sample based on the processing result and the preset question sample.

[0047] In this embodiment, the initial preprocessing sub-model can be used to perform semantic cleaning on natural question sentences. This process can extract semantic features from natural question sentences and remove interference information from natural question sentences. The obtained processing results and the preset question samples are then subjected to predetermined processing, such as concatenation or accumulation, to obtain the question samples.

[0048] S103: Input the question sample into the initial machine learning sub-model in the preset initial model to obtain sample response information.

[0049] In this embodiment, the initial machine learning sub-model processes the question sample to obtain the corresponding (sample) response information. The machine learning model can process data of various formats in a dynamic, large-capacity, and complex data environment. The output of the machine learning model will become more and more accurate over time, so that the obtained sample response information becomes closer and closer to the preset answer sample. The preset answer sample can also be understood as the standard answer corresponding to the question sample.

[0050] S104: Use the sample reply information and the preset answer sample to train the preset initial model to obtain a preset model after training.

[0051] In this embodiment, the preset initial model is trained for multiple rounds using sample response information and preset answer samples, so that the gap between the sample response information obtained in each round and the preset answer samples becomes smaller and smaller. When the gap is small enough, a trained preset model can be obtained. The preset model has the ability to output accurate response information by inputting only natural question sentences.

[0052] The model training method provided by the embodiment of the present invention determines a preset question-answer sample pair and obtains a natural question sentence, wherein the preset question-answer sample pair includes a preset question sample and a preset answer sample, the natural question sentence and the preset question sample have the same question purpose, the natural question sentence is semantically cleaned and processed using the initial preprocessing sub-model in the preset initial model, and a question sample is determined based on the processing result and the preset question sample, the question sample is input into the initial machine learning sub-model in the preset initial model to obtain sample reply information, and the preset initial model is trained using the sample reply information and the preset answer sample to obtain the preset model after training. The technical solution of the embodiment of the present invention can determine relatively standardized sample reply information based on the result of the semantic cleaning processing of the initial preprocessing sub-model and the preset question sample, and then use the sample reply information and the preset answer sample to train the preset initial model to obtain the preset model after training. The training method of this solution can filter out interference content by semantically cleaning the natural question sentence during the training process. This method does not require a large number of training samples, and improves the efficiency of training while ensuring the training effect.

[0053] Example 2

[0054] Figure 2 This is a flowchart of a model training method provided in the second embodiment of the present invention. The technical solution of the embodiment of the present invention is further optimized on the basis of the above-mentioned optional technical solutions, and a specific method for training the model is given.

[0055] Optionally, the natural question sentence is semantically cleansed using an initial preprocessing submodel in a preset initial model, and a question sample is determined based on the processing result and the preset question sample, including: inputting the natural question sentence into the initial preprocessing submodel in the preset initial model to obtain a semantic feature code; determining a text code sequence of keywords of the preset question sample; and determining a question sample based on the semantic feature code and the text code sequence. The advantage of this arrangement is that by splicing the text code sequence and the semantic feature code, a question sample containing both standardized question information and colloquial question information can be obtained, which improves training efficiency compared to traditional question samples containing only colloquial question information.

[0056] Optionally, the use of the sample response information and the preset answer sample to train the preset initial model to obtain the preset model after training includes: determining a loss function based on the sample response information and the preset answer sample, and using the loss function to train the preset initial model to obtain the preset model after training. The advantage of this setting is that by training the preset initial model with the loss function determined based on the sample response information and the preset answer sample, the output result of the preset initial model can be made closer and closer to the standardized preset answer sample, thereby obtaining a high-precision preset model.

[0057] like Figure 2 As shown, a model training method provided by the second embodiment of the present invention specifically includes the following steps:

[0058] S201. Determine preset question and answer sample pairs and obtain natural question sentences.

[0059] S202: Input the natural question sentence into an initial preprocessing sub-model in a preset initial model to obtain semantic feature coding.

[0060] Specifically, the preset initial model may be a model that can extract semantic features, such as BERT (Bidirectional Encoder Representations from Transformers), and is not limited here.

[0061] S203: Determine a text encoding sequence of keywords of the preset question sample.

[0062] Specifically, a seq2seq (Sequence2sequence) model can be used in advance to extract keywords from preset question samples and convert the keywords into a text encoding sequence. The model typically includes an encoder and a decoder, and the input and output of the model can be a sequence. The preset initial model may not include a model for determining the text encoding sequence. Keywords can be determined based on the fields and application scenarios involved in the preset question samples. For example, if the field involved in the preset question samples is finance and the application scenario is banking, the keywords can be determined as financial terms and business names, etc.

[0063] S204: Determine a question sample according to the semantic feature code and the text code sequence.

[0064] For example, the semantic feature coding and the text coding sequence can be spliced ​​together to obtain a question sample.

[0065] Optionally, determining the question sample based on the semantic feature code and the text code sequence includes: extracting a first preset proportion of code content from the semantic feature code to obtain a first question code, and extracting a second preset proportion of code content from the text code sequence to obtain a second question code; splicing the first question code and the second question code to obtain a question sample, wherein, in the first preset round of training of the preset initial model, the proportion of the first question code in the question sample is less than the proportion of the second question code in the question sample. The advantage of this setting is that, since the preset question sample does not contain irrelevant information, by ensuring that the second question code accounts for a high proportion of the question sample in the early stage of training, the preset initial model can be helped to converge quickly to obtain accurate response information, thereby shortening the training cycle of the model.

[0066] For example, if the first preset rounds are the first five rounds, the first preset ratio is 40%, and the second preset ratio is 70%, then during the first five rounds of training the preset initial model, 40% of the encoding content can be extracted from the semantic feature encoding, and 70% of the encoding content can be extracted from the text encoding sequence. The two obtained encoding contents are then spliced ​​together to obtain the question samples. Since the encoding lengths of the semantic feature encoding and the text encoding sequence are generally different, the relationship between the first preset ratio and the second preset ratio is not limited here. However, in the early stages of training, in order to ensure training efficiency, the ratio of the first question encoding to the question samples needs to be greater than the ratio of the second question encoding to the question samples.

[0067] S205: Input the question sample into the initial machine learning sub-model in the preset initial model to obtain sample response information.

[0068] S206. Determine a loss function based on the sample reply information and the preset answer sample, and use the loss function to train the preset initial model to obtain a preset model after training.

[0069] Specifically, a loss function and its corresponding value can be determined based on the difference between the sample response information and the preset answer sample, and the magnitude of the loss function can be used to determine whether the training of the preset model is complete. For example, if the loss function value is sufficiently small, it can be determined that the training of the preset model is complete.

[0070] Optionally, during multiple rounds of training, as the value of the loss function decreases, the proportion of the first question code in the question sample can also gradually decrease, while the proportion of the second question code in the question sample increases, until the proportion of the first question code in the question sample drops to zero and the proportion of the second question code in the question sample increases to 100%.

[0071] The model training method provided by the embodiment of the present invention reduces the complexity of learning and processing of the subsequent initial machine learning sub-model by preprocessing the natural question sentences through the initial preprocessing sub-model, and then obtains question samples that contain both standardized question information and colloquial question information by splicing the text encoding sequence and the semantic feature encoding. Compared with the traditional question samples that only contain colloquial question information, the training efficiency is improved. Then, the preset initial model is trained using the loss function to train a high-precision preset model, achieving the effect of obtaining a satisfactory training model using fewer training samples.

[0072] Example 3

[0073] Figure 3 A flowchart of a method for replying to information is provided for embodiment three of the present invention. This embodiment is applicable to situations where a user's conversation information is replied to. The method can be executed by a model training device. The device for replying to information can be implemented in the form of hardware and / or software. The device for replying to information can be configured in an electronic device, which can be composed of two or more physical entities or one physical entity.

[0074] like Figure 3 As shown, the method for replying information provided in the third embodiment of the present invention specifically includes the following steps:

[0075] S301: Determine the dialogue information input by the user.

[0076] In this embodiment, the conversation information input by the user can be determined based on the text or voice input by the user. For example, when the user inputs a voice, text recognition can be performed based on the voice, and the recognition result is the conversation information. The conversation information usually contains interference information.

[0077] S302. Using a language preprocessing sub-model in a preset model, perform semantic cleaning on the dialogue information to obtain target feature coding, wherein the preset model is obtained using the model training method described above.

[0078] In this embodiment, the language preprocessing submodel in the pre-trained model described above can be used to perform semantic cleaning on the conversation information, thereby extracting semantic features from the conversation information and removing noise words from the conversation information to obtain the (target) feature encoding. The language preprocessing submodel is the trained initial preprocessing submodel.

[0079] S303: Input the target feature code into the preset machine learning sub-model in the preset model to obtain target response information.

[0080] In this embodiment, the target feature encoding is processed using a preset machine learning sub-model to obtain the target reply information corresponding to the dialogue information. The preset machine learning sub-model is a trained initial machine learning sub-model.

[0081] The method for replying to messages provided in an embodiment of the present invention determines conversation information input by a user, performs semantic cleaning on the conversation information using a language preprocessing sub-model within a preset model, and obtains a target feature code. The preset model is obtained using the model training method described above, and the target feature code is input into a preset machine learning sub-model within the preset model to obtain a target reply message. The technical solution of this embodiment of the present invention, by utilizing the preset model, can filter out interfering content before recognizing the semantics of the conversation input by the user. This allows the preset machine learning sub-model within the preset model to accurately and quickly determine a reply message to the user based on the target feature code corresponding to the conversation information, thereby ensuring a superior user experience.

[0082] Optionally, determining the conversation information input by the user includes obtaining an initial conversation statement input by the user, and deleting characters that are consistent with preset characters from the initial conversation statement to obtain the conversation information. This arrangement has the advantage that by deleting characters that are consistent with preset characters from the initial conversation statement, meaningless characters in the initial conversation statement can be filtered out.

[0083] Specifically, when the dialogue information input by the user is typed text information, when the user types too fast, irrelevant characters will often be mixed in. For example, if the initial dialogue sentence is "I want to handle k, account opening business", where "k," is an irrelevant character, then preset characters can be set in advance, and the characters consistent with the preset characters can be deleted from the initial dialogue sentence to obtain the dialogue information.

[0084] Example 4

[0085] Figure 4 This is a structural diagram of a model training device provided by the fourth embodiment of the present invention. Figure 4 As shown, the apparatus includes: a sample and sentence determination module 401, a question sample determination module 402, a sample reply determination module 403 and a training module 404, wherein:

[0086] A sample and statement determination module is used to determine a preset question and answer sample pair and obtain a natural question statement, wherein the preset question and answer sample pair includes a preset question sample and a preset answer sample, and the natural question statement and the preset question sample have the same question purpose;

[0087] a question sample determination module, configured to semantically cleanse the natural question sentence using an initial preprocessing sub-model in a preset initial model, and determine a question sample based on the processing result and the preset question sample;

[0088] A sample response determination module is used to input the question sample into the initial machine learning sub-model in the preset initial model to obtain sample response information;

[0089] The training module is used to train the preset initial model using the sample reply information and the preset answer sample to obtain the preset model after training.

[0090] The model training device provided by the embodiment of the present invention can determine relatively standardized sample response information based on the results of the semantic cleaning processing of the initial preprocessing sub-model and the preset question samples, and then use the sample response information and the preset answer samples to train the preset initial model to obtain the preset model after training. The training method of this scheme can filter out interference content through semantic cleaning processing of natural question sentences during the training process. This method does not require a large number of training samples, and improves the efficiency of training while ensuring the training effect.

[0091] Optionally, the question sample determination module includes:

[0092] A feature code determination unit, configured to input the natural question sentence into an initial preprocessing sub-model in a preset initial model to obtain a semantic feature code;

[0093] A coding sequence determining unit, configured to determine a text coding sequence of keywords of the preset question sample;

[0094] The question sample determination unit is used to determine the question sample according to the semantic feature code and the text code sequence.

[0095] Optionally, determining the question sample based on the semantic feature code and the text code sequence includes: extracting a first preset proportion of code content from the semantic feature code to obtain a first question code, and extracting a second preset proportion of code content from the text code sequence to obtain a second question code; splicing the first question code and the second question code to obtain a question sample, wherein, in the first preset round of training of the preset initial model, the proportion of the first question code in the question sample is less than the proportion of the second question code in the question sample.

[0096] Optionally, the training module is specifically used to determine a loss function based on the sample response information and the preset answer sample, and use the loss function to train the preset initial model to obtain the preset model after training.

[0097] The model training device provided in the embodiment of the present invention can execute the model training method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0098] Example 5

[0099] Figure 5 This is a structural diagram of a device for replying information provided by Example 5 of the present invention. Figure 5 As shown, the device includes: a dialogue information determination module 501, a feature code determination module 502 and a reply information determination module 503, wherein:

[0100] A dialogue information determination module, used to determine the dialogue information input by the user;

[0101] a feature code determination module, configured to perform semantic cleaning on the conversation information using a language preprocessing sub-model in a preset model to obtain a target feature code, wherein the preset model is obtained using the model training method described above;

[0102] The reply information determination module is used to input the target feature code into the preset machine learning sub-model in the preset model to obtain target reply information.

[0103] The device for replying information provided by an embodiment of the present invention can filter out interference content before identifying the conversation semantics input by the user by utilizing a preset model, so that the preset machine learning sub-model in the preset model can accurately and quickly determine the reply information to the user based on the target feature encoding corresponding to the conversation information, thereby ensuring the user experience.

[0104] Optionally, the dialogue information determination module is specifically configured to obtain an initial dialogue statement input by the user, delete characters consistent with preset characters from the initial dialogue statement, and obtain dialogue information.

[0105] The device for replying information provided in the embodiment of the present invention can execute the model training method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0106] Example 6

[0107] Figure 6A schematic diagram of the structure of an electronic device 60 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0108] like Figure 6 As shown, the electronic device 60 includes at least one processor 61 and a memory, such as a read-only memory (ROM) 62, a random access memory (RAM) 63, etc., which is communicatively connected to the at least one processor 61. The memory stores a computer program that can be executed by the at least one processor. The processor 61 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 62 or the computer program loaded from the storage unit 68 into the random access memory (RAM) 63. Various programs and data required for the operation of the electronic device 60 can also be stored in the RAM 63. The processor 61, ROM 62, and RAM 63 are connected to each other via a bus 64. An input / output (I / O) interface 65 is also connected to the bus 64.

[0109] Multiple components in the electronic device 60 are connected to the I / O interface 65, including an input unit 66, such as a keyboard, a mouse, etc.; an output unit 67, such as various types of displays, speakers, etc.; a storage unit 68, such as a magnetic disk, an optical disk, etc.; and a communication unit 69, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 69 allows the electronic device 60 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0110] The processor 61 can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the processor 61 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 61 executes the various methods and processes described above, such as the model training method and / or the method for replying information.

[0111] In some embodiments, the model training method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 68. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 60 via the ROM 62 and / or the communication unit 69. When the computer program is loaded into the RAM 63 and executed by the processor 61, one or more steps of the model training method described above may be performed. Alternatively, in other embodiments, the processor 61 may be configured to execute the model training method, and / or the method of replying information, in any other appropriate manner (e.g., by means of firmware).

[0112] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0113] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0114] The computer device provided above can be used to execute the model training method provided in any of the above embodiments, and / or the method of replying information, and has corresponding functions and beneficial effects.

[0115] Example 7

[0116] In the context of the present invention, a computer-readable storage medium may be a tangible medium having computer-executable instructions, when executed by a computer processor, for performing a model training method, the method comprising:

[0117] Determining a preset question-answer sample pair and obtaining a natural question statement, wherein the preset question-answer sample pair includes a preset question sample and a preset answer sample, and the natural question statement and the preset question sample have the same question purpose;

[0118] Using the initial preprocessing sub-model in the preset initial model to semantically cleanse the natural question sentence, and determining a question sample based on the processing result and the preset question sample;

[0119] Inputting the question sample into the initial machine learning sub-model in the preset initial model to obtain sample response information;

[0120] The preset initial model is trained using the sample reply information and the preset answer sample to obtain a preset model after training.

[0121] The computer executable instructions in the context of the present invention, when executed by a computer processor, are for performing a method of replying a message, the method comprising:

[0122] Determine the dialog information entered by the user;

[0123] Using a language preprocessing sub-model in a preset model, semantic cleaning is performed on the conversation information to obtain target feature encoding, wherein the preset model is obtained using the model training method described above;

[0124] The target feature code is input into the preset machine learning sub-model in the preset model to obtain target response information.

[0125] In the context of the present invention, computer-readable storage medium can be a tangible medium that can contain or store a computer program for use with an instruction execution system, device or equipment or used in conjunction with an instruction execution system, device or equipment. Computer-readable storage medium can include but is not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage medium can be a machine-readable signal medium. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0126] The computer device provided above can be used to execute the model training method provided in any of the above embodiments, and / or the method of replying information, and has corresponding functions and beneficial effects.

[0127] It is worth noting that in the embodiment of the above-mentioned model training device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0128] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the concept of the present invention. The scope of the present invention is determined by the scope of the appended claims.

Claims

1. A model training method, characterized in that: include: Determining a preset question-answer sample pair and obtaining a natural question statement, wherein the preset question-answer sample pair includes a preset question sample and a preset answer sample, and the natural question statement and the preset question sample have the same question purpose; Using the initial preprocessing sub-model in the preset initial model to semantically cleanse the natural question sentence, and determining a question sample based on the processing result and the preset question sample; Inputting the question sample into the initial machine learning sub-model in the preset initial model to obtain sample response information; Using the sample reply information and the preset answer sample to train the preset initial model to obtain a preset model after training; The process of semantically cleaning and processing the natural question sentence using the initial preprocessing sub-model in the preset initial model, and determining the question sample based on the processing result and the preset question sample, includes: Inputting the natural question sentence into the initial preprocessing sub-model in the preset initial model to obtain semantic feature encoding; Determining a text encoding sequence of keywords for the preset question sample; the keywords are determined based on the fields and application scenarios involved in the preset question sample; Extracting a first preset ratio of coding content from the semantic feature coding to obtain a first question coding, and extracting a second preset ratio of coding content from the text coding sequence to obtain a second question coding; The first question code and the second question code are spliced ​​together to obtain a question sample, wherein, in a previous preset round of training of the preset initial model, the proportion of the first question code in the question sample is smaller than the proportion of the second question code in the question sample.

2. The method according to claim 1, characterized in that The method of training the preset initial model using the sample reply information and the preset answer sample to obtain a preset model after training is completed includes: A loss function is determined based on the sample reply information and the preset answer sample, and the preset initial model is trained using the loss function to obtain the preset model after training.

3. A method for replying information, characterized in that: include: Determine the dialog information entered by the user; Using a language preprocessing sub-model in a preset model, performing semantic cleaning on the dialogue information to obtain target feature encoding, wherein the preset model is obtained using the model training method according to any one of claims 1-2; The target feature code is input into the preset machine learning sub-model in the preset model to obtain target response information.

4. The method according to claim 3, characterized in that The determining of the dialogue information input by the user includes: An initial dialogue sentence input by a user is obtained, and characters consistent with preset characters are deleted from the initial dialogue sentence to obtain dialogue information.

5. A model training device, characterized in that: include: A sample and statement determination module is used to determine a preset question and answer sample pair and obtain a natural question statement, wherein the preset question and answer sample pair includes a preset question sample and a preset answer sample, and the natural question statement and the preset question sample have the same question purpose; a question sample determination module, configured to semantically cleanse the natural question sentence using an initial preprocessing sub-model in a preset initial model, and determine a question sample based on the processing result and the preset question sample; A sample response determination module is used to input the question sample into the initial machine learning sub-model in the preset initial model to obtain sample response information; A training module, configured to train the preset initial model using the sample reply information and the preset answer sample to obtain a preset model after training; The question sample determination module includes: A feature code determination unit, configured to input the natural question sentence into an initial preprocessing sub-model in a preset initial model to obtain a semantic feature code; A coding sequence determining unit, configured to determine a text coding sequence of a keyword of the preset question sample; the keyword is determined based on the field and application scenario involved in the preset question sample; a question sample determination unit, configured to extract a first preset ratio of code content from the semantic feature code to obtain a first question code, and to extract a second preset ratio of code content from the text code sequence to obtain a second question code; The first question code and the second question code are spliced ​​together to obtain a question sample, wherein, in a previous preset round of training of the preset initial model, the proportion of the first question code in the question sample is smaller than the proportion of the second question code in the question sample.

6. A device for replying information, characterized in that: include: A dialogue information determination module, used to determine the dialogue information input by the user; a feature coding determination module, configured to perform semantic cleaning on the conversation information using a language preprocessing sub-model in a preset model to obtain a target feature coding, wherein the preset model is obtained using the model training method according to any one of claims 1-2; The reply information determination module is used to input the target feature code into the preset machine learning sub-model in the preset model to obtain target reply information.

7. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the model training method described in any one of claims 1-2, and / or implement the method for replying information described in any one of claims 3-4.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, which are used to enable a processor to implement the model training method described in any one of claims 1-2 and / or the method for replying information described in any one of claims 3-4 when executed.

Citation Information

Patent Citations

  • Model training method, dialogue generation method and device, equipment and medium

    CN110188182A

  • Training method and device suitable for financial field, question answering method, device and storage medium

    CN110825843A