Method and device for model training and business execution

文档序号:7691 发布日期:2021-09-17 浏览:24次 中文

1. A method of model training, comprising:

determining a basic user target, wherein the basic user target comprises at least one of a basic service keyword and a basic service intention, the basic service intention is used for expressing the service intention of a user in a conversation process, and the basic service keyword is used for expressing a service keyword corresponding to a service required to be executed by the user in the conversation process;

determining a first user objective matching the base user objective and determining a second user objective conflicting with the base user objective;

constructing a positive sample according to the first user target and the basic user target, and constructing a negative sample according to the second user target and the basic user target;

and training the recognition model to be trained according to the positive sample and the negative sample.

2. The method of claim 1, wherein determining a base user objective specifically comprises:

acquiring a service topological graph, wherein the service topological graph is used for representing service affiliation among service keywords of each keyword type;

selecting a reference keyword type from at least one keyword type preset aiming at a basic user target, and generating a reference keyword corresponding to the reference keyword type;

determining other keywords which accord with the business affiliation with the reference keyword according to the business topological graph and the at least one keyword type;

determining basic service keywords according to the reference keywords and the other keywords;

and determining the basic user target according to the basic service key words.

3. The method according to claim 1 or 2, wherein determining a first user objective matching the base user objective and determining a second user objective conflicting with the base user objective comprises:

acquiring a service topological graph, wherein the service topological graph is used for representing service affiliation among service keywords of each keyword type;

according to the service topological graph, determining a first service keyword which accords with the service affiliation with the basic service keyword, and determining a second service keyword which does not accord with the service affiliation with the basic service keyword;

and determining the first user target according to the first service key words, and determining the second user target according to the second service key words.

4. The method of claim 1, wherein the first user objective comprises at least one of a first business keyword and a first business intent, the second user objective comprises at least one of a second business keyword and a second business intent, the first business intent being indicative of a business intent that does not have a conflict with the base business intent, the second business intent being indicative of a business intent that does have a conflict with the base business intent;

before constructing a positive sample from the first user objective and the base user objective and constructing a negative sample from the second user objective and the base user objective, the method further comprises:

determining a simulated first user statement according to the first service keyword and/or the first service intention, and determining a simulated second user statement according to the second service keyword and/or the second service intention;

constructing a positive sample according to the first user target and the basic user target, and constructing a negative sample according to the second user target and the basic user target, specifically comprising:

constructing a positive sample according to the first user statement, the first user target and the basic user target, and constructing a negative sample according to the second user statement, the second user target and the basic user target.

5. The method according to claim 3, wherein if the basic user objective includes the basic service keyword, constructing a positive sample according to the first user objective and the basic user objective, and constructing a negative sample according to the second user objective and the basic user objective, specifically comprising:

determining a feature vector corresponding to the first service keyword, a feature vector corresponding to the second service keyword and a feature vector corresponding to the basic service keyword according to the service topological graph, wherein the feature vector corresponding to one service keyword is used for representing a corresponding topological structure of the service keyword in the service topological graph;

and constructing a positive sample according to the feature vector corresponding to the first service keyword and the feature vector corresponding to the basic service keyword, and constructing a negative sample according to the feature vector corresponding to the second service keyword and the feature vector corresponding to the basic service keyword.

6. A method of service execution, comprising:

receiving a service request sent by a user;

determining a current user target corresponding to a current statement sent by the user in the current conversation process and determining a historical user target corresponding to the user in the current conversation process according to the service request;

inputting the historical user target and the current user target into a pre-trained recognition model, and determining a matching relationship between the current user target and the historical user target, wherein the matching relationship is used for indicating whether the current user target is matched with the historical user target, and the recognition model is obtained by training through the method of any one of claims 1-5;

determining the actual user target of the current user according to the matching relation and the current user target;

and performing service execution for the user according to the actual user target.

7. The method according to claim 6, wherein determining the actual user objective of the current user according to the matching relationship and the current user objective specifically comprises:

if the current user target is matched with the historical user target, determining the actual user target of the current user according to the historical user target and the current user target;

and if the current user target is not matched with the historical user target, determining the actual user target of the current user according to the current user target.

8. An apparatus for model training, comprising:

the system comprises a first determining module, a second determining module and a third determining module, wherein the first determining module is used for determining a basic user target, the basic user target comprises at least one of a basic service keyword and a basic service intention, the basic service intention is used for representing the service intention of a user in a conversation process, and the basic service keyword is used for representing a service keyword corresponding to a service required to be executed by the user in the conversation process;

a second determining module for determining a first user objective matching the base user objective and determining a second user objective conflicting with the base user objective;

the construction module is used for constructing a positive sample according to the first user target and the basic user target and constructing a negative sample according to the second user target and the basic user target;

and the training module is used for training the recognition model to be trained according to the positive sample and the negative sample.

9. An apparatus for service execution, comprising:

the receiving module is used for receiving a service request sent by a user;

a current target determining module, configured to determine, according to the service request, a current user target corresponding to a current statement sent by the user in a current conversation process, and determine a historical user target corresponding to the user in the current conversation process;

an input module, configured to input the historical user objective and the current user objective into a trained recognition model, and determine a matching relationship between the current user objective and the historical user objective, where the matching relationship is used to indicate whether the current user objective matches the historical user objective, and the recognition model is obtained by training according to any one of the above claims 1 to 5;

an actual target determining module, configured to determine an actual user target of the current user according to the matching relationship and the current user target;

and the execution module is used for executing service execution for the user according to the actual user target.

10. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, implements the method of any of the preceding claims 1-5 or 6-7.

11. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of claims 1 to 5 or 6 to 7 when executing the program.

Background

With the continuous development of information technology, a user can search a service to be executed on line in a voice conversation mode, that is, the user can have a conversation with a service platform through a terminal, and the service platform can determine a user target of the user when the user finishes each sentence, so that the content to be replied to the user is determined.

The user target may include a service intention of the user and a service keyword corresponding to a service that the user needs to execute, for example, if the user says "want to order take-out of a chinese cabbage", the service intention of the user is want to order take-out, and the service keyword is "chinese cabbage".

In the conversation process between the user and the service platform, the service platform can determine the user target from the words spoken by the user, and as the conversation between the user and the service platform is often multi-round, in the process, the user may change the idea (for example, the user just starts to order to fry chicken for takeover and then orders to take away Sichuan dishes), so that the user target may change. In the prior art, the user target can be determined by manually setting rules, but in practice, a plurality of information may be involved in a conversation, and the manually set rules may be omitted, so that the actual user target cannot be determined accurately.

Therefore, how to accurately determine the actual user target of the user is an urgent problem to be solved.

Disclosure of Invention

The present specification provides a method and apparatus for model training and business execution, which partially solve the above problems in the prior art.

The technical scheme adopted by the specification is as follows:

the present specification provides a method of model training, comprising:

determining a basic user target, wherein the basic user target comprises at least one of a basic service keyword and a basic service intention, the basic service intention is used for expressing the service intention of a user in a conversation process, and the basic service keyword is used for expressing a service keyword corresponding to a service required to be executed by the user in the conversation process;

determining a first user objective matching the base user objective and determining a second user objective conflicting with the base user objective;

constructing a positive sample according to the first user target and the basic user target, and constructing a negative sample according to the second user target and the basic user target;

and training the recognition model to be trained according to the positive sample and the negative sample.

Optionally, determining the basic user target specifically includes:

acquiring a service topological graph, wherein the service topological graph is used for representing service affiliation among service keywords of each keyword type;

selecting a reference keyword type from at least one keyword type preset aiming at a basic user target, and generating a reference keyword corresponding to the reference keyword type;

determining other keywords which accord with the business affiliation with the reference keyword according to the business topological graph and the at least one keyword type;

determining basic service keywords according to the reference keywords and the other keywords;

and determining the basic user target according to the basic service key words.

Optionally, determining a first user objective matched with the base user objective and determining a second user objective conflicting with the base user objective specifically include:

acquiring a service topological graph, wherein the service topological graph is used for representing service affiliation among service keywords of each keyword type;

according to the service topological graph, determining a first service keyword which accords with the service affiliation with the basic service keyword, and determining a second service keyword which does not accord with the service affiliation with the basic service keyword;

and determining the first user target according to the first service key words, and determining the second user target according to the second service key words.

Optionally, the first user objective comprises at least one of a first business keyword and a first business intent, the second user objective comprises at least one of a second business keyword and a second business intent, the first business intent is used for representing a business intent without conflict with the basic business intent, and the second business intent is used for representing a business intent with conflict with the basic business intent;

before constructing a positive sample from the first user objective and the base user objective and constructing a negative sample from the second user objective and the base user objective, the method further comprises:

determining a simulated first user statement according to the first service keyword and/or the first service intention, and determining a simulated second user statement according to the second service keyword and/or the second service intention;

constructing a positive sample according to the first user target and the basic user target, and constructing a negative sample according to the second user target and the basic user target, specifically comprising:

constructing a positive sample according to the first user statement, the first user target and the basic user target, and constructing a negative sample according to the second user statement, the second user target and the basic user target.

Optionally, if the basic user target includes the basic service keyword, constructing a positive sample according to the first user target and the basic user target, and constructing a negative sample according to the second user target and the basic user target, specifically including:

determining a feature vector corresponding to the first service keyword, a feature vector corresponding to the second service keyword and a feature vector corresponding to the basic service keyword according to the service topological graph, wherein the feature vector corresponding to one service keyword is used for representing a corresponding topological structure of the service keyword in the service topological graph;

and constructing a positive sample according to the feature vector corresponding to the first service keyword and the feature vector corresponding to the basic service keyword, and constructing a negative sample according to the feature vector corresponding to the second service keyword and the feature vector corresponding to the basic service keyword.

The present specification provides a method for service execution, including:

receiving a service request sent by a user;

determining a current user target corresponding to a current statement sent by the user in the current conversation process and determining a historical user target corresponding to the user in the current conversation process according to the service request;

inputting the historical user target and the current user target into a pre-trained recognition model, and determining a matching relationship between the current user target and the historical user target, wherein the matching relationship is used for indicating whether the current user target is matched with the historical user target, and the recognition model is obtained by training through the model training method;

determining the actual user target of the current user according to the matching relation and the current user target;

and performing service execution for the user according to the actual conversation state.

Optionally, determining an actual user objective of the current user according to the matching relationship and the current user objective, specifically including:

if the current user target is matched with the historical user target, determining the actual user target of the current user according to the historical user target and the current user target;

and if the current user target is not matched with the historical user target, determining the actual user target of the current user according to the current user target.

The present specification provides an apparatus for model training, comprising:

the system comprises a first determining module, a second determining module and a third determining module, wherein the first determining module is used for determining a basic user target, the basic user target comprises at least one of a basic service keyword and a basic service intention, the basic service intention is used for representing the service intention of a user in a conversation process, and the basic service keyword is used for representing a service keyword corresponding to a service required to be executed by the user in the conversation process;

a second determining module for determining a first user objective matching the base user objective and determining a second user objective conflicting with the base user objective;

the construction module is used for constructing a positive sample according to the first user target and the basic user target and constructing a negative sample according to the second user target and the basic user target;

and the training module is used for training the recognition model to be trained according to the positive sample and the negative sample.

The present specification provides a service execution apparatus, including:

the receiving module is used for receiving a service request sent by a user;

a current target determining module, configured to determine, according to the service request, a current user target corresponding to a current statement sent by the user in a current conversation process, and determine a historical user target corresponding to the user in the current conversation process;

an input module, configured to input the historical user target and the current user target into a trained recognition model, and determine a matching relationship between the current user target and the historical user target, where the matching relationship is used to indicate whether the current user target matches the historical user target, and the recognition model is obtained by training according to the model training method;

an actual target determining module, configured to determine an actual user target of the current user according to the matching relationship and the current user target;

and the execution module is used for executing service for the user according to the actual conversation state.

The present specification provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the above-described method of model training or business execution.

The present specification provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the above method of model training or business execution when executing the program.

The technical scheme adopted by the specification can achieve the following beneficial effects:

in the method for model training and service execution provided in this specification, a service platform may determine a basic user target, where the basic user target includes at least one of a basic service keyword and a basic service intention, the basic service intention is used to represent a service intention of a user in a conversation process, the basic service keyword is used to represent a service keyword corresponding to a service that the user needs to execute in the conversation process, and then, the service platform may determine a first user target matching the basic user target and determine a second user target conflicting with the basic user target, thereby constructing a positive sample according to the first user target and the basic user target, constructing a negative sample according to the second user target and the basic user target, and finally, training an identification model to be trained according to the positive sample and the negative sample, and subsequently determining the actual user target of the user through the trained recognition model.

It can be seen from the above method that the service platform can automatically generate positive and negative samples for training the recognition model, where the positive sample corresponds to a case where the user's mind is unchanged, and the negative sample corresponds to a case where a conflict occurs before and after the user's mind, and therefore, after the recognition model training is completed, it can be determined whether a conflict exists between the historical user goal and the current user goal, that is, whether the user's mind changes, so as to accurately determine the user goal of the user.

Drawings

The accompanying drawings, which are included to provide a further understanding of the specification and are incorporated in and constitute a part of this specification, illustrate embodiments of the specification and together with the description serve to explain the specification and not to limit the specification in a non-limiting sense. In the drawings:

FIG. 1 is a schematic flow chart of a method of model training in the present specification;

FIG. 2 is a schematic diagram of a recognition model provided herein;

FIG. 3 is a flow chart illustrating a method for performing a service in the present specification;

fig. 4 is a schematic diagram of constructing a positive sample and a negative sample through a service topology map provided in the present specification;

FIG. 5 is a schematic diagram of an apparatus for model training provided herein;

fig. 6 is a schematic diagram of a service execution apparatus provided in the present specification;

fig. 7 is a schematic diagram of an electronic device corresponding to fig. 1 or fig. 3 provided in the present specification.

Detailed Description

In order to make the objects, technical solutions and advantages of the present disclosure more clear, the technical solutions of the present disclosure will be clearly and completely described below with reference to the specific embodiments of the present disclosure and the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present disclosure, and not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present specification without any creative effort belong to the protection scope of the present specification.

The technical solutions provided by the embodiments of the present description are described in detail below with reference to the accompanying drawings.

Fig. 1 is a schematic flow chart of a method for model training in this specification, which includes the following steps:

s101: determining a basic user target, wherein the basic user target comprises at least one of a basic service keyword and a basic service intention, the basic service intention is used for expressing the service intention of a user in a conversation process, and the basic service keyword is used for expressing a service keyword corresponding to a service required to be executed by the user in the conversation process.

In practical application, the service platform can provide voice conversation service for users, and the users can inquire the service to be executed through the voice conversation service, so that the service execution of the users is facilitated. In the voice conversation service, the service platform needs to determine a user target after each user finishes a sentence, that is, determine a service intention when the user finishes the sentence and a service keyword of a service that the user needs to execute, and in actual life, the user can execute various services such as point takeout, ticket booking, restaurant query and the like through man-machine conversation services.

In some services, a user may express a great variety of service keywords in a man-machine conversation process, for example, in a takeout service, the user may express takeout of desired points through a business name, a dish name, a business type, a dish practice, and the like, or may express a variety of service intentions, so that a service platform needs to determine a user target expressed when the user finishes each sentence in a man-machine conversation process, the user may speak a lot of service keywords in a complete conversation process, and the user may change ideas in the conversation process, so that the service platform cannot continuously refer to some service keywords spoken historically by the user, and the unreferenced service keywords should not appear in the current user target of the user, and therefore, the service platform needs to accurately determine the actual user target of the user at each moment, thereby accurately determining the content to be replied to the user.

The business platform can determine a user target corresponding to each word spoken by the user through the machine learning model, and the business platform needs to determine a large number of training samples in advance to train the machine learning model, so that the business platform can generate a basic user target, the basic user target comprises at least one of a basic business keyword and a basic business intention, the basic business intention can represent the simulated business intention of the user in the conversation process, and the basic business keyword can represent the business keyword corresponding to the business required to be executed by the simulated user in the conversation process. The basic user target may refer to a user target corresponding to a speech spoken by the user in the dialog process, that is, the basic user target may represent an object of the speech spoken by the user.

The basic service keyword may include a plurality of service keywords automatically generated by the service platform, for example, the basic service keyword may be [ takeaway type: fast food, merchant: cc fried chicken store, address: home ], which may correspond to a sentence spoken by the simulated user, from which the simulated user sentence is available, e.g., the business platform may convert the basic business keyword into "fast food for the desired point cc fried chicken restaurant to home" as the spoken word of the simulated user. The specific conversion manner may be various, for example, such a statement may be determined by a data enhancement technique, and for example, a variety of statement templates may be preset, and the statement template is filled with the basic service keyword to obtain such a statement.

It should be noted that, when generating the service keywords, the service platform may refer to the service topology map to generate the service keywords, for example, taking generating the basic service keywords as an example, the service platform may obtain the service topology map, where the service topology map is used to represent service dependencies between the service keywords of each keyword type. Still taking the takeout service as an example for explanation, the service topological graph can show the affiliation among the service keywords of the merchant, the dishes, the takeout type and the like, for example, a node showing that the takeout type is the sichuan dish can be connected with a node showing a chuan dish house, and a node showing that the chuwan dish house can be connected with a node showing the dishes in the chuwan dish house.

The service platform can select a reference keyword type from at least one keyword type preset aiming at a basic user target, generate a reference keyword corresponding to the reference keyword type, further determine other keywords which accord with service affiliation with the reference keyword according to the service topological graph and the at least one keyword type, determine a basic service keyword according to the reference keyword and the other keywords, and determine the basic user target according to the basic service keyword.

Since the basic service keywords may include service keywords of multiple keyword types, as in the above example, the basic service keywords include service keywords of two keyword types, namely, a takeaway type and a merchant, and one basic service keyword corresponds to a sentence spoken by the simulated user, it is necessary to ensure that each service keyword included in the basic service keyword conforms to the service dependency relationship in order to ensure that the determined basic service keyword is close to reality.

For example, for basic service keywords including two keyword types, namely a takeaway type and a merchant, the takeaway type can be used as a reference keyword type, a keyword of "fast food" in the reference keyword type can be randomly found out as a reference keyword, and then a merchant satisfying a service dependency relationship with the "fast food" can be randomly found out: "cc fried chicken house" as another keyword, and combining the other keyword with the reference keyword to obtain the basic service keyword. It can be seen that in other examples, the basic service keyword also contains an address, but such a keyword does not need to satisfy a service dependency relationship with other keywords, and therefore, if such a keyword needs to be generated, the service topology does not need to be referred to.

S102: a first user objective matching the base user objective is determined, and a second user objective conflicting with the base user objective is determined.

After determining the basic user target, the service platform may determine a first user target matching the basic user target and determine a second user target conflicting with the basic user target.

The basic user target, the first user target and the second user target can be user targets simulated by the service platform, namely, the user targets are not required to be obtained from words actually spoken by users in history and can be automatically generated by the service platform. The first user objective and the basic user objective are matched, corresponding to the situation that the user always maintains a thought in the actual application, and the second user objective and the basic user objective are corresponding to the situation that the user changes the thought in the actual application. For example, in the whole conversation process, the user first mentions that the user wants to order Sichuan dishes for takeout, then the user suddenly says that the user cannot order the Sichuan dishes or wants to watch milk tea, the idea of the user is changed at the moment, and if the user continuously says that the user wants to watch all dishes in the A Sichuan dish store, the idea of the user is not changed.

As can be seen from the above example, when the user changes his mind, the service keyword of the service to be executed may be changed, that is, the above-mentioned chinese cabbage is changed to be milk tea, and also the service intention may be changed, so that the second user objective that conflicts with the basic user objective may refer to a user objective that includes the service intention that conflicts with the basic service intention, and/or the service keyword and the basic service keyword do not conform to the above-mentioned service affiliation. The first user target matched with the basic user target may refer to a user target which includes a service intention that does not conflict with the basic service intention and/or includes a service keyword and a basic service keyword that conform to a service affiliation. Therefore, the service platform can determine the first user target and the second user target on the dimension of the service keyword and the dimension of the service intention.

The service platform can determine a first service keyword which is in accordance with the dependency relationship with the basic service keyword and a second service keyword which is not in accordance with the dependency relationship with the basic service keyword according to the service topological graph, wherein the first service keyword and the second service keyword can both comprise a plurality of keywords. Because the connection relation between each node in the service topological graph can represent the affiliation relation between each service keyword, the first service keyword which is in accordance with the affiliation relation with the basic service keyword can be generated according to the connection relation of each node in the service topological graph.

For the second service keyword, the service platform may determine, from the service topological graph, another service keyword that does not have any connection relationship with the service keyword in the basic service keyword, and determine, according to the other service keyword, the second service keyword, and the service platform may generate a first user target according to the first service keyword, and generate a second user target according to the second service keyword.

Taking the above example, the basic service keyword is [ merchant type: fast food, merchant: cc fried chicken store, address: the basic business keyword lacks dish information, and in practical application, the business intention corresponding to the basic business keyword can be 'see menu', that is, the basic user target is { [ merchant type: fast food, merchant: cc fried chicken store, address: house ], "see menu" }, so the sentence behind the user may contain the dish information, and the first service keyword and the second service keyword may contain the dish information. For example, the first business keyword may be [ dish: fried chicken package a ], the second service keyword is a keyword that can be [ dish: tomato-fried eggs ], the first service keyword is a fried chicken package A which is selected from a service topological graph and satisfies service affiliation with the cc fried chicken store in the basic service keyword, and the second service keyword is a tomato-fried egg which is randomly selected and does not satisfy service affiliation with the cc fried chicken store in the basic service keyword.

The first service keyword and the second service keyword are subjected to sentence conversion to respectively obtain a 'want to click to fry chicken package A' and a 'want to click to fry tomato eggs', and it can be clearly found from the sentence conversion that in an actual situation, the first service keyword and the basic service keyword conform to a situation that a user does not change ideas in a conversation process, namely, the user always wants to click to fry chicken, while the second service keyword and the basic service keyword conform to a situation that the user changes ideas in the conversation process, namely, the user just starts to click to fry chicken and then wants to click tomato to fry eggs. Thus, when a first user objective contains a first service keyword, the first user objective matches the base user objective, and a second user objective contains a second service keyword, the first user objective conflicts with the base user objective.

The above is that the station is in the dimension of the service keyword to illustrate the matched or conflicting user target, and in practical application, the idea changed by the user may not be represented by the service keyword, for example, the user just starts to express the intention of wanting to fry chicken, but then suddenly says a sentence: "if not clicked," this phrase does not contain any business keywords, but contains negative business intents. Therefore, a second user target conflicting with the base user target and a first user target matching with the base user target can be constructed through the service intention. For example, a second service intent contained in a second user objective, which may not contain a service keyword, may be defined as "negative", or a service keyword in the second user objective may be defined as null, and such second user objective, together with the base user objective in the above example, may also indicate a change in user intent.

Of course, the first user objective matching the basic user objective can be represented by the service intention, and still in the above example, if the user says "look at another dish of the store again", the sentence does not include the service keyword, but has an intention to continue to take out of the store, so the first service intention included in the first user objective can be defined as [ "need to see more dishes"), the first user objective may not include the service keyword, or the service keyword is defined as null, and such first user objective can be embodied as matching with the basic user objective, that is, the first user objective and the basic user objective.

S103: and constructing a positive sample according to the first user target and the basic user target, and constructing a negative sample according to the second user target and the basic user target.

S104: and training the recognition model to be trained according to the positive sample and the negative sample.

After the service platform determines the first user target, the second user target and the basic user target, a positive sample can be constructed according to the first user target and the basic user target, a negative sample can be constructed according to the second user target and the basic user target, and the service platform can train the recognition model to be trained according to the positive sample and the negative sample. That is, the combination of the first user objective with the base user objective can reflect that the user's mind remains the same, while the combination between the second user objective and the base user objective can reflect that the user has changed mind. Therefore, the trained recognition model can determine whether the idea of the user changes or not through the historical user target and the current user target, and therefore the real user target of the user can be determined.

In this specification, since the user can express the purpose of the user even when speaking, one training sample may include user sentences in addition to two user targets, and since the first user target and the second user target are both simulated user targets, the service platform needs to convert the user targets into user sentences when performing model training. Therefore, the service platform may determine the simulated first user sentence according to the first service keyword and/or the first service intention, determine the simulated second user sentence according to the second service keyword and/or the second service intention, then may construct a positive sample according to the first user sentence, the first user target and the basic user target, and construct a negative sample according to the second user sentence, the second user target and the basic user target.

The manner of determining the first user sentence and the second user sentence is similar to the manner of determining the user sentence corresponding to the basic user target. The service platform can fill the first service keywords and the second service keywords according to a preset sentence template, so that the first user sentences and the second user sentences are obtained, or the user sentences are determined through a data enhancement technology. Of course, the service platform may also determine the user sentence according to the service intention, for example, a corresponding user sentence may be preset for some service intentions, for example, the service intention of [ "negative" ] mentioned above, and this user sentence may be "counted" as "bad".

It should be further noted that the service platform may determine, according to the service topology map, a feature vector corresponding to the first service keyword, a feature vector corresponding to the second service keyword, and a feature vector corresponding to the basic service keyword, construct a positive sample according to the feature vector corresponding to the first service keyword and the feature vector corresponding to the basic service keyword, and construct a negative sample according to the feature vector corresponding to the second service keyword and the feature vector corresponding to the basic service keyword. The feature vector corresponding to one service keyword can represent a corresponding topological structure of the service keyword in a service topological graph, that is, can represent the characteristic of a local topological structure centered on the service keyword in the service topological graph, so that the service dependency relationship between the service keyword and other service keywords can be represented.

In this specification, the recognition model may determine whether two user targets are matched, that is, whether a conflict exists between the two user targets, and the following describes training the recognition model by taking the first user target and the basic user target as an example, so that the recognition model can determine the relationship between the user targets, as shown in fig. 2.

Fig. 2 is a schematic structural diagram of a recognition model provided in this specification.

As can be seen from fig. 2, the historical behavior of the input recognition model including the first user statement, the first business intent and the business platform may refer to the behavior that the business platform needs to make with respect to the basic user goal, for example, if the basic user goal represents that the user needs to take out of the tea restaurant, the business platform may show a menu of the tea restaurant. It can also be seen that the input recognition model further includes a first service keyword, a keyword type corresponding to the first service keyword, a basic service keyword, and a keyword type corresponding to the basic service keyword, wherein the service topological graph can show a service dependency relationship of the service keyword and a relationship between the keyword types, so that the service keyword and a feature vector corresponding to the keyword type can be determined through the service topological graph, and feature fusion is performed to obtain a feature vector corresponding to the first service keyword and a feature vector corresponding to the basic service keyword, respectively.

In this example, the recognition model outputs the result of whether the first user target and the basic user target are matched, and after the service platform trains the recognition model, the recognition model may determine whether the two user targets are matched.

In the model training, the input is the simulated user target, and in the practical application, whether the current user target and the historical user target conflict or not needs to be recognized, so that in the model application, the recognition model inputs the position of the basic user target, can input the historical user target, and inputs the current user target at the position of the first user target.

The above is to explain the present invention from the perspective of model training, and after the training of the recognition model is completed, the service platform needs to determine the actual user target of the user through the recognition model, so the following is to explain the present invention from the perspective of model application, as shown in fig. 3.

Fig. 3 is a flowchart illustrating a method for executing a service according to the present disclosure.

S301: and receiving a service request sent by a user.

S302: and determining a current user target corresponding to a current statement sent by the user in the current conversation process and determining a historical user target corresponding to the user in the current conversation process according to the service request.

In the man-machine conversation service, a complete man-machine conversation process between a user and a service platform often comprises multiple rounds of interactive sentences, namely, the user speaks a sentence, the service platform replies the sentence to the user or determines information aiming at the spoken sentence of the user, and the user can speak the next sentence according to the reply of the service platform until the whole man-machine conversation process is completed. When the user finishes a sentence, the service platform can determine the service intention expressed by the user in the sentence and the service key words of the service required to be executed by the user, thereby determining the current user target of the user. When a service is executed for a user, service intentions and service keywords included in the words spoken by the user before in the whole man-machine conversation process need to be considered, so that the service platform needs to determine a historical user target corresponding to the user in the current conversation process. For this word, the historical user target refers to an actual user target determined by the service platform when the user finishes the last word, and how to determine the actual user target after the user finishes each word is specifically described below.

S303: inputting the historical user target and the current user target into a pre-trained recognition model, and determining a matching relationship between the current user target and the historical user target, wherein the matching relationship is used for indicating whether the current user target is matched with the historical user target, and the recognition model is obtained by training through the model training method.

S304: and determining the actual user target of the current user according to the matching relation and the current user target.

S305: and performing service execution for the user according to the actual conversation state.

The business platform can input the historical user target and the current user target into a pre-trained recognition model so as to determine a matching relation between the current user target and the historical user target, wherein the matching relation is used for indicating whether the current user target is matched with the historical user target, the recognition model is obtained by training through the model training method, and then the business platform can determine the actual user target of the current user according to the matching relation and the current user target so as to perform business execution for the user according to the actual user target.

The determination of whether the current user goal matches the historical user goal may refer to determining whether the current idea of the user conflicts with the previous idea, that is, if the current user goal matches the historical user goal, the current idea of the user is consistent with the previous idea, and the actual user goal needs to be determined by both the current user goal and the historical user goal. That is, if it is determined that the current user target matches the historical user target, the actual user target of the current user is determined according to the historical user target and the current user target, wherein when determining the service keyword in the actual user target, the actual user target needs to be determined according to the historical service keyword included in the historical user target and the current service keyword in the current user target.

If the current user target is not matched with the historical user target, it indicates that the current idea of the user is conflicted with the previous idea, and then the historical user target is not consistent with the current idea of the user, the actual user target can be determined only according to the current user target, wherein when determining the business keyword in the actual user target, the actual user target only needs to be determined according to the current business keyword in the current user target, and the historical business keyword contained in the historical user target does not need to be inherited.

It can be seen from the above method that the service platform can automatically generate positive and negative samples for training the recognition model, and the positive sample corresponds to a case that the user's mind is not changed, and the negative sample corresponds to a case that the user's mind is in conflict before and after the recognition model training is completed, so that after the recognition model training is completed, it can be determined whether a conflict exists between the historical user goal and the current user goal, that is, whether the user's mind is changed, thereby accurately determining the user goal of the user.

In summary, it can be seen that the service platform can construct a positive sample and a negative sample through the service topology map, as shown in fig. 4.

Fig. 4 is a schematic diagram of constructing a positive sample and a negative sample through a service topology map provided in this specification.

As can be seen from fig. 4, when generating the positive and negative examples, the positive and negative examples can be generated not only by the service topology, but also by real user data (e.g. search sentences historically input by the user in the service platform), that is, any user target mentioned above can be constructed according to the service topology, and also can be constructed by obtaining the real user target of the user in the real voice conversation process through the real user data. The basic user target and the second user target which are in conflict with each other need to be generated through the service topological graph, and the basic user target and the second user target are used as negative samples, or the user targets which are not in line with the user and can be spoken in the actual conversation process are randomly generated, and through the process, the training samples for training the recognition model can be automatically generated.

Based on the same idea, the present specification also provides a corresponding model training and business execution device, as shown in fig. 5 and fig. 6.

Fig. 5 is a schematic diagram of an apparatus for model training provided in the present specification, including:

a first determining module 501, configured to determine a basic user target, where the basic user target includes at least one of a basic service keyword and a basic service intention, where the basic service intention is used to represent a service intention of a user in a conversation process, and the basic service keyword is used to represent a service keyword corresponding to a service that the user needs to execute in the conversation process;

a second determining module 502, configured to determine a first user objective matching the base user objective and determine a second user objective conflicting with the base user objective;

a construction module 502, configured to construct a positive sample according to the first user target and the basic user target, and construct a negative sample according to the second user target and the basic user target;

a training module 504, configured to train the recognition model to be trained according to the positive sample and the negative sample.

Optionally, the second determining module 502 is specifically configured to obtain a service topological graph, where the service topological graph is used to represent service affiliations between service keywords of each keyword type; selecting a reference keyword type from at least one keyword type preset aiming at a basic user target, and generating a reference keyword corresponding to the reference keyword type; determining other keywords which accord with the business affiliation with the reference keyword according to the business topological graph and the at least one keyword type; determining basic service keywords according to the reference keywords and the other keywords; and determining the basic user target according to the basic service key words.

Optionally, the second determining module 502 is specifically configured to obtain a service topological graph, where the service topological graph is used to represent service affiliations between service keywords of each keyword type; according to the service topological graph, determining a first service keyword which accords with the service affiliation with the basic service keyword, and determining a second service keyword which does not accord with the service affiliation with the basic service keyword; and determining the first user target according to the first service key words, and determining the second user target according to the second service key words.

Optionally, the first user objective comprises at least one of a first business keyword and a first business intent, the second user objective comprises at least one of a second business keyword and a second business intent, the first business intent is used for representing a business intent without conflict with the basic business intent, and the second business intent is used for representing a business intent with conflict with the basic business intent;

before constructing a positive sample according to the first user target and the basic user target and constructing a negative sample according to the second user target and the basic user target, the second determining module 502 is further configured to determine a simulated first user sentence according to the first service keyword and/or the first service intention and determine a simulated second user sentence according to the second service keyword and/or the second service intention;

the second determining module 502 is specifically configured to construct a positive sample according to the first user statement, the first user target, and the basic user target, and construct a negative sample according to the second user statement, the second user target, and the basic user target.

Optionally, the second determining module 502 is specifically configured to determine, according to the service topological graph, a feature vector corresponding to the first service keyword, a feature vector corresponding to the second service keyword, and a feature vector corresponding to the basic service keyword, where the feature vector corresponding to one service keyword is used to represent a corresponding topological structure of the service keyword in the service topological graph; and constructing a positive sample according to the feature vector corresponding to the first service keyword and the feature vector corresponding to the basic service keyword, and constructing a negative sample according to the feature vector corresponding to the second service keyword and the feature vector corresponding to the basic service keyword.

Fig. 6 is a schematic diagram of an apparatus for model training provided in the present specification, including:

a receiving module 601, configured to receive a service request sent by a user;

a current target determining module 602, configured to determine, according to the service request, a current user target corresponding to a current statement sent by the user in a current conversation process, and determine a historical user target corresponding to the user in the current conversation process;

an input module 603, configured to input the historical user target and the current user target into a trained recognition model, and determine a matching relationship between the current user target and the historical user target, where the matching relationship is used to indicate whether the current user target matches the historical user target, and the recognition model is obtained by training through the model training method;

an actual target determining module 604, configured to determine an actual user target of the current user according to the matching relationship and the current user target;

and the executing module 605 is configured to perform service execution for the user according to the actual user target.

Optionally, the actual target determining module 604 is specifically configured to, if it is determined that the current user target matches the historical user target, determine the actual user target of the current user according to the historical user target and the current user target; and if the current user target is not matched with the historical user target, determining the actual user target of the current user according to the current user target.

The present specification also provides a computer readable storage medium having stored thereon a computer program operable to execute a method of model training and business execution as provided in fig. 1 or 3 above.

The present specification also provides a schematic block diagram of an electronic device corresponding to fig. 1 or fig. 3 shown in fig. 7. As shown in fig. 7, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, but may also include hardware required for other services. The processor reads a corresponding computer program from the non-volatile memory into the memory and then runs the computer program to implement the method for model training or service execution described in fig. 1 or 3 above. Of course, besides the software implementation, the present specification does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may be hardware or logic devices.

In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.

The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.

The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the various elements may be implemented in the same one or more software and/or hardware implementations of the present description.

As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

The description has been presented with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the description. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.

The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.

Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.

It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.

As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.

The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.

The above description is only an example of the present specification, and is not intended to limit the present specification. Various modifications and alterations to this description will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification should be included in the scope of the claims of the present specification.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:一种基于智能交互的IPTV端健康咨询方法和系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!