Conversation end statement generation method and device, electronic equipment and storage medium

Through the deep meaning score of the dialogue sentences of artificial intelligence models, combined with semantics, emotions and intention analysis, natural and flexible dialogue ending sentences are generated, which solves the problem of low accuracy in dialogue ending judgments in the existing technology.

CN119293152APending Publication Date: 2025-01-10BEIJING PERFECT WORLD SOFTWARE TECH DEV CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311735736.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-15
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

In the prior art, whether a dialogue ends by only character string matching is determined, resulting in low accuracy in judging the end of the dialogue.

Method used

By receiving dialogue sentences sent by player characters to non-player characters in dialogue scenarios, input them with preset prompt text into the artificial intelligence model, and use the artificial intelligence model to perform semantic analysis, sentiment analysis and intention analysis, based on the analysis results and presets The scoring rules match and generate a conversation end statement.

Benefits of technology

Improve the accuracy of dialogue ending judgment, making dialogue ending statements more natural and flexible, and avoiding judgment errors caused by string matching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119293152A_ABST
    Figure CN119293152A_ABST
Patent Text Reader

Abstract

The invention relates to a dialogue end statement generation method and device, electronic equipment and a storage medium. The method comprises the steps that a dialogue statement sent by a player character to a non-player character in a dialogue scene is received; the dialogue statement and a preset prompt text are input into a preset artificial intelligence model, the dialogue statement is scored through the artificial intelligence model, a dialogue ending statement is generated under the condition that the scoring result of the dialogue statement meets a dialogue ending condition, and the preset prompt text is a natural language. And prompting the artificial intelligence model to score according to the scoring rule described by the natural language. Therefore, the preset prompt text can be utilized to prompt the artificial intelligence model to score the input dialogue statement according to the scoring rule, so that whether the current dialogue meets the dialogue ending condition or not is accurately judged; the problem that in the prior art, the judgment accuracy of dialogue ending is not high due to the fact that whether the dialogue is ended or not is judged only through character string matching is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of game development technology, and in particular to a method, device, electronic device and storage medium for generating a dialogue ending statement. Background Art

[0002] In order to enrich the game scenes, many games have non-player characters (NPCs), that is, game characters that are not controlled by real players. In the actual game process, the player character may need to interact with the non-player character to increase the fun of the game.

[0003] However, the prior art generally uses a string matching method to determine whether there are certain preset keywords indicating the end of the conversation in the player character's dialogue content, and if so, generates a dialogue end statement to end the conversation. Since the prior art only uses string matching to determine whether to end the conversation, while ignoring the deep meaning of the conversation content, the judgment accuracy of ending the conversation is not high. Summary of the invention

[0004] The present application provides a method, device, electronic device and storage medium for generating a conversation ending statement, so as to solve the problem in the prior art that whether to end a conversation is determined only by string matching, resulting in low accuracy in the judgment of ending the conversation.

[0005] In a first aspect, an embodiment of the present application provides a method for generating a conversation ending statement, the method comprising:

[0006] Receive dialogue statements sent by the player character to the non-player character in the dialogue scene;

[0007] The dialogue sentence and the preset prompt text are input into a preset artificial intelligence model, the dialogue sentence is scored by the artificial intelligence model, and a dialogue ending sentence is generated when the scoring result of the dialogue sentence meets the dialogue ending condition, wherein the preset prompt text is a natural language, which is used to prompt the artificial intelligence model to score according to the scoring rules described in the natural language.

[0008] Optionally, the step of inputting the dialogue sentence and the preset prompt text into a preset artificial intelligence model, and scoring the dialogue sentence by the artificial intelligence model, includes:

[0009] Inputting the dialogue sentence and the preset prompt text into the artificial intelligence model, and performing sentence analysis on the dialogue sentence by the artificial intelligence model to obtain an analysis result, wherein the analysis result includes at least one of a semantic analysis result, a sentiment analysis result, and an intention analysis result;

[0010] The analysis result is matched with the scoring rule in the preset prompt text, and the scoring result of the dialogue sentence is determined according to the matching result.

[0011] Optionally, the scoring rules in the preset prompt text include a scoring rule and a scoring rule, wherein the scoring rule is used to add points to the dialogue sentence, and the scoring rule is used to subtract points from the dialogue sentence;

[0012] The step of matching the analysis result with the scoring rule in the preset prompt text and determining the scoring result of the dialogue sentence according to the matching result includes:

[0013] Matching the analysis result with the score adding rule to obtain a first score, and matching the analysis result with the score subtraction rule to obtain a second score;

[0014] A scoring result of the dialogue sentence is determined according to the first scoring and the second scoring.

[0015] Optionally, when the scoring result of the dialogue sentence satisfies the dialogue ending condition, generating a dialogue ending sentence includes:

[0016] When the scoring result of the dialogue sentence satisfies the dialogue ending condition, determining a reason for ending the dialogue according to the scoring result, the analysis result and the scene information of the dialogue scene;

[0017] The conversation ending statement is generated according to the conversation ending reason.

[0018] Optionally, the conversation ending condition includes one of the following:

[0019] The scoring result of the dialogue sentence is lower than a first preset threshold, and the scoring results of the dialogue sentences preceding the dialogue sentence for a preset number of consecutive times are lower than the first preset threshold;

[0020] A sum of the scoring result of the dialogue sentence and the scoring result of the dialogue sentence before the dialogue sentence is lower than a second preset threshold, wherein the second preset threshold is lower than the first preset threshold.

[0021] Optionally, after inputting the dialogue sentence and the preset prompt text into a preset artificial intelligence model and scoring the dialogue sentence by the artificial intelligence model, the method further includes:

[0022] If the scoring result of the dialogue sentence does not satisfy the dialogue ending condition, generating a dialogue reply sentence;

[0023] The dialogue reply statement is sent to the player character, and new dialogue content sent by the player character based on the dialogue reply statement is received.

[0024] Optionally, the method further comprises:

[0025] The number of generated dialogue reply statements is obtained, and when the number of generated dialogue reply statements is greater than a third preset threshold, the dialogue between the player character and the non-player character is terminated.

[0026] In a second aspect, an embodiment of the present application further provides a device for generating a conversation ending statement, the device comprising:

[0027] A receiving module, used for receiving a dialogue sentence sent by a player character to a non-player character in a dialogue scene;

[0028] A scoring and generation module is used to input the dialogue sentence and preset prompt text into a preset artificial intelligence model, score the dialogue sentence through the artificial intelligence model, and generate a dialogue ending sentence when the scoring result of the dialogue sentence meets the dialogue ending condition, wherein the preset prompt text is natural language, which is used to prompt the artificial intelligence model to score according to the scoring rules described in the natural language.

[0029] In a third aspect, an embodiment of the present application further provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0030] Memory, used to store computer programs;

[0031] A processor is used to implement the steps of the method for generating a conversation ending statement as described in any one of the first aspects when executing a program stored in a memory.

[0032] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the method for generating a conversation ending statement as described in any one of the first aspects are implemented.

[0033] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application receives the dialogue statement sent by the player character to the non-player character in the dialogue scene; inputs the dialogue statement and the preset prompt text into the preset artificial intelligence model, scores the dialogue statement through the artificial intelligence model, and generates a dialogue ending statement when the scoring result of the dialogue statement meets the dialogue ending condition, wherein the preset prompt text is a natural language, which is used to prompt the artificial intelligence model to score according to the scoring rule described in the natural language. Through the above method, the preset prompt text can be used to prompt the artificial intelligence model to score the input dialogue statement according to the scoring rule, so that the artificial intelligence model can score according to the deep meaning of the dialogue statement, thereby accurately judging whether the current dialogue meets the dialogue ending condition, avoiding the problem of low accuracy of judging whether to end the dialogue in the prior art by only judging whether to end the dialogue by string matching; and the artificial intelligence model can also automatically generate a dialogue ending statement in combination with the deep meaning of the dialogue statement when determining that the scoring result meets the dialogue ending condition, making the dialogue ending statement more natural and flexible. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0036] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0037] Figure 1 A flowchart of a method for generating a conversation ending statement provided in an embodiment of the present application;

[0038] Figure 2 A flowchart of another method for generating a conversation ending statement provided in an embodiment of the present application;

[0039] Figure 3 A schematic diagram of the structure of a dialogue control device for a non-player character provided in an embodiment of the present application;

[0040] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0042] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0043] In order to solve the problem in the prior art of determining whether to end a conversation solely by string matching, resulting in low accuracy in determining whether to end a conversation, the present application provides a method, device, electronic device and storage medium for generating a conversation end statement, which can improve the accuracy of determining whether to end a conversation.

[0044] See also Figure 1 , Figure 1 The flowchart of a method for generating a conversation ending statement provided in an embodiment of the present application is as follows. Figure 1 As shown, the method for generating the conversation ending statement may include the following steps:

[0045] Step 101: Receive a dialogue statement sent by a player character to a non-player character in a dialogue scene.

[0046] Specifically, the non-player characters are virtual characters in the game application that are not controlled by real players. The player characters are any virtual characters that interact with the non-player characters. When the player character sends a dialogue statement to the non-player character, the game application can receive the dialogue statement in real time and give the dialogue statement to the artificial intelligence model to determine the direction of the dialogue.

[0047] Step 102: input the dialogue statement and the preset prompt text into the preset artificial intelligence model, score the dialogue statement through the artificial intelligence model, and generate a dialogue ending statement when the scoring result of the dialogue statement meets the dialogue ending condition, wherein the preset prompt text is natural language, which is used to prompt the artificial intelligence model to score according to the scoring rules described in natural language.

[0048] Specifically, the preset prompt text can be understood as a text that describes the scoring rules in natural language, which can be used to prompt the artificial intelligence model to score the dialogue sentences according to the scoring rules described in natural language. The above dialogue end condition refers to the judgment condition used by the artificial intelligence model to determine when the dialogue ends. The dialogue end condition can be set according to actual conditions, such as two consecutive negative scoring results, or the number of replies from non-player characters exceeds 10 times, or the cumulative scoring result is less than -20 points, etc.

[0049] In this step, after receiving the dialogue statement sent by the player character to the non-player character, the dialogue statement and the preset prompt text can be input into the preset artificial intelligence model together, and then the dialogue statement is scored by the artificial intelligence model to obtain the scoring result of the dialogue statement, and it is determined whether the scoring result of the dialogue statement meets the dialogue ending condition. If the scoring result of the dialogue statement meets the dialogue ending condition, a dialogue ending statement is generated to end the dialogue between the player character and the non-player character; if the scoring result of the dialogue statement does not meet the dialogue ending condition, a dialogue reply statement is generated to continue the dialogue between the player character and the non-player character.

[0050] In this embodiment, a preset prompt text can be used to prompt the artificial intelligence model to score the input dialogue sentences according to the scoring rules, so that the artificial intelligence model can score according to the deep meaning of the dialogue sentences, thereby accurately judging whether the current dialogue meets the dialogue ending conditions, avoiding the problem of low accuracy in judging the end of the dialogue in the prior art due to the low accuracy of judging whether to end the dialogue by only relying on string matching; and, when determining that the scoring result meets the dialogue ending conditions, the artificial intelligence model can also automatically generate a dialogue ending statement based on the deep meaning of the dialogue sentence, making the dialogue ending statement more natural and flexible.

[0051] Furthermore, the above step 102, inputting the dialogue sentence and the preset prompt text into the preset artificial intelligence model, and scoring the dialogue sentence by the artificial intelligence model, specifically includes:

[0052] Inputting the dialogue sentences and the preset prompt text into the artificial intelligence model, and performing sentence analysis on the dialogue sentences through the artificial intelligence model to obtain analysis results, wherein the analysis results include at least one of semantic analysis results, sentiment analysis results, and intention analysis results;

[0053] The analysis results are matched with the scoring rules in the preset prompt text, and the scoring results of the dialogue sentences are determined based on the matching results.

[0054] Specifically, the semantic analysis result refers to the semantic understanding of the dialogue sentences by the artificial intelligence model, and the emotion analysis result refers to the emotion of the player character obtained by the artificial intelligence model based on the semantic understanding of the dialogue sentences, such as nervous, friendly, positive, negative, angry, and furious. The intention analysis result refers to the intention of the player character obtained by the artificial intelligence model based on the semantic understanding of the dialogue sentences, such as whether the player is willing to continue the conversation.

[0055] In one embodiment, when scoring a dialogue sentence through an artificial intelligence model, the dialogue sentence can be first analyzed through the artificial intelligence model to understand the deep meaning of the dialogue sentence and obtain the analysis results, and then these analysis results are matched with the scoring rules in the preset prompt text, and the scoring result of the dialogue sentence is determined according to the matching result. For example, assuming that the scoring rules in the preset prompt text include: 1. Whether the player character has a positive answer to the question raised by the non-player character, if the player character has a positive answer to the question raised by the non-player character, then add 5 points; otherwise, subtract 5 points; 2. Whether the player character's emotions are positive and proactive, if the player character's emotions are positive and proactive, then add 5 points; otherwise, subtract 5 points; 3. Whether the player character has the intention to continue the dialogue, if the player character has the intention to continue the dialogue, then add 5 points; otherwise, subtract 5 points. Assuming that the analysis result of the dialogue sentence by the artificial intelligence model is: the player character has a positive answer to the question raised by the non-player character, the player character's emotions are positive and proactive, and the player character has the intention to continue the dialogue, then the scoring result of the dialogue sentence can be determined to be 15 points. It should be noted that the scoring rules in the preset prompt text may include scoring rules and deduction rules, or may only include scoring rules (e.g., if the player character directly answers the question raised by the non-player character, 5 points are added; otherwise, no points are added), or may only include deduction rules (e.g., if the player character does not directly answer the question raised by the non-player character, 5 points are deducted; otherwise, no points are deducted), and the embodiments of the present application do not make specific limitations.

[0056] In this embodiment, the artificial intelligence model can first analyze the dialogue sentences and then match the scoring rules, so that the artificial intelligence model can understand the deep meaning of the dialogue sentences and the emotions and intentions of the player characters, making the scoring results more accurate.

[0057] Furthermore, the above step of matching the analysis result with the scoring rules in the preset prompt text and determining the scoring result of the dialogue sentence according to the matching result specifically includes:

[0058] Matching the analysis result with the score adding rule to obtain a first score, and matching the analysis result with the score subtraction rule to obtain a second score;

[0059] A scoring result of the dialogue sentence is determined according to the first scoring and the second scoring.

[0060] In one embodiment, the scoring rules in the preset prompt text include a scoring rule and a deduction rule, wherein the scoring rule is used to add points to the dialogue sentence, and the deduction rule is used to deduct points from the dialogue sentence. In this way, when matching the scoring rules, the analysis result can be matched with the scoring rule to obtain a first score, and the analysis result can be matched with the deduction rule to obtain a second score; then, the scoring result of the dialogue sentence is determined based on the first score and the second score. In this way, zero score can be used as a reference value for the scoring result, and the higher the score, the more satisfied the non-player character is with the dialogue sentence of the player character, and the lower the score, the less satisfied the non-player character is with the dialogue sentence of the player character, so that the scoring result can more accurately reflect the satisfaction of the non-player character.

[0061] Furthermore, in the above step 102, when the scoring result of the dialogue sentence meets the dialogue ending condition, generating a dialogue ending sentence includes:

[0062] When the scoring result of the dialogue sentence meets the dialogue ending condition, the reason for ending the dialogue is determined according to the scoring result, the analysis result and the scene information of the dialogue scene;

[0063] Generate a conversation ending statement based on the reason for ending the conversation.

[0064] In one embodiment, when the scoring result of the dialogue sentence meets the dialogue ending condition, the artificial intelligence model can determine the reason for ending the dialogue based on the scoring result, the analysis result and the scene information of the dialogue scene, and then generate the dialogue ending statement based on the reason for ending the dialogue. For example, when the artificial intelligence model understands that the dialogue sentence of the player character has the meaning of insulting the non-player character, and the player character is a little angry at this time, obviously disrespecting the other party, and the scoring result meets the dialogue ending condition, it can be determined that the reason for ending the dialogue is disrespecting others. At this time, the dialogue ending statement can be generated on the grounds of disrespecting others. Compared with the prior art that directly outputs a preset fixed dialogue ending statement, the dialogue ending statement generated by this embodiment in combination with the deep meaning of the dialogue sentence is more natural and flexible, making the NPC's reply in the game more human and realistic. For example, in a massively multiplayer online role-playing game (MMORPG) with intelligent NPCs, due to the large number of MMORPG players online at the same time, MMORPGs with intelligent NPCs will have high requirements for server resources that provide the computing power of the generative artificial intelligence model that supports the intelligent NPC function. Once the number of people online at the same time is high, it is necessary to equip the server computing power to match the intelligent NPC to support the stable operation of the intelligent NPC, otherwise the intelligent NPC will reduce its intelligence, such as slow answers, errors, or even crashes, affecting the player experience and game retention. If sufficient server computing power is equipped, the cost is too high (the cost of servers with generative artificial intelligence model computing power is much higher than the cost of servers used to calculate and synchronize game logic). Therefore, through the mechanism of dialogue end statements, the number of dialogue turns for each dialogue can be effectively controlled, the number of concurrent requests for AI computing power can be reduced, and natural and realistic exit conversation behavior can be achieved, while not reducing the player experience, reducing the cost of server AI computing power and saving computing power overhead costs.

[0065] Furthermore, the conversation ending condition includes one of the following:

[0066] The scoring result of the dialogue sentence is lower than a first preset threshold, and the scoring results of the dialogue sentences preceding the dialogue sentence for a preset number of consecutive times are lower than the first preset threshold;

[0067] A sum of a scoring result of the dialogue sentence and a scoring result of a dialogue sentence preceding the dialogue sentence is lower than a second preset threshold, wherein the second preset threshold is lower than the first preset threshold.

[0068] Specifically, the above-mentioned preset number of times, the above-mentioned first preset threshold and the above-mentioned second preset threshold can be set according to actual conditions, and the embodiments of the present application do not make specific limitations.

[0069] As an optional implementation, the above-mentioned dialogue termination condition may be that the scoring result of the dialogue sentence is lower than a first preset threshold, and the scoring results of the dialogue sentences before the dialogue sentence for a preset number of consecutive times are lower than the first preset threshold. In other words, if the scoring results of the dialogue sentences for N+1 consecutive times are lower than the first preset threshold, it means that the dialogue termination condition is met. For example, when the scoring results of the dialogue sentences for three consecutive times are lower than zero, it means that the dialogue termination condition is met.

[0070] As another optional implementation, the above-mentioned dialogue ending condition may be that the sum of the scoring result of the dialogue sentence and the scoring result of the dialogue sentence before the dialogue sentence is lower than a second preset threshold. That is, when the cumulative scoring result of all dialogue sentences in the dialogue scenario is lower than the second preset threshold, it means that the dialogue ending condition is met. For example, when the cumulative scoring result of all dialogue sentences in the dialogue scenario is lower than -20 points, it means that the dialogue ending condition is met.

[0071] Through the above method, the conversation end time can be accurately determined according to the conversation end condition, thus avoiding the problem in the prior art that the judgment of whether to end the conversation is low in accuracy due to the character string matching alone.

[0072] Furthermore, in the above step 102, after the dialogue sentence and the preset prompt text are input into the preset artificial intelligence model and the dialogue sentence is scored by the artificial intelligence model, the method further includes:

[0073] When the scoring result of the dialogue sentence does not meet the dialogue ending condition, a dialogue reply sentence is generated;

[0074] Send dialogue reply statements to the player character, and receive new dialogue content sent by the player character based on the dialogue reply statements.

[0075] In one embodiment, when the scoring result of the dialogue sentence does not meet the dialogue ending condition, a dialogue reply sentence can be generated, and then the dialogue reply sentence is sent to the player character, and new dialogue content sent by the player character based on the dialogue reply sentence is received. In this way, when the dialogue ending time is not reached, it is ensured that the non-player character can continue to interact with the player character in dialogue, so as to improve the fun of the game.

[0076] Furthermore, the method further comprises:

[0077] The number of generated dialogue reply sentences is obtained, and when the number of generated dialogue reply sentences is greater than a third preset threshold, the dialogue between the player character and the non-player character is ended.

[0078] Specifically, the third preset threshold can be set according to actual conditions, and is not specifically limited in the embodiment of the present application.

[0079] In one embodiment, in addition to determining whether to end the conversation based on the scoring result of the conversation statement, it is also possible to determine whether to end the conversation based on the number of conversation reply statements generated. Specifically, the number of conversation reply statements generated can be obtained each time a conversation reply statement is generated, and when the number of conversation reply statements generated is greater than a third preset threshold, the conversation between the player character and the non-player character is ended. For example, when the number of conversation reply statements generated is greater than 10, the conversation between the player character and the non-player character is ended. In this way, the processing burden on the game application caused by the number of conversation statements input by the player character exceeding the upper limit can be avoided. Of course, as another optional implementation, after the conversation reply statement is generated, it is also possible to determine whether to end the conversation based on the time when the player character inputs a new conversation statement. If the time when the player character inputs a new conversation statement exceeds 30 minutes, it is considered that the conversation can be ended.

[0080] In one embodiment, the generation process of the conversation ending statement provided in the embodiment of the present application is as follows: Figure 2 As shown, the following steps may be specifically included:

[0081] Step 201: Receive a dialogue statement sent by a player character to a non-player character in a dialogue scene.

[0082] Step 202: input the dialogue sentences and preset prompt text into the artificial intelligence model, and perform sentence analysis on the dialogue sentences through the artificial intelligence model to obtain analysis results, wherein the analysis results include at least one of semantic analysis results, sentiment analysis results, and intention analysis results.

[0083] Step 203: Match the analysis result with the scoring rule in the preset prompt text, and determine the scoring result of the dialogue sentence according to the matching result.

[0084] Step 204: When the scoring result of the dialogue sentence meets the dialogue termination condition, the reason for terminating the dialogue is determined based on the scoring result, the analysis result and the scene information of the dialogue scene.

[0085] Step 205: Generate a conversation ending statement according to the reason for ending the conversation.

[0086] It should be noted that the specific implementation process of the above steps 201 to 205 has been described in detail in the above embodiments, and will not be repeated here. For ease of understanding, the following examples are used for explanation.

[0087] In one example, when the conversation scenario is that the player character needs to join a student department, the AI ​​boyfriend (i.e., the non-player character) acts as an interviewer as the head of the student department to conduct the interview. The following are some relevant prompts (i.e., the preset prompts mentioned above) for judging whether the conversation is moving towards an artificial intelligence (AI) model, which may include the following logic: 1) giving scoring criteria, 2) giving scoring rules, and 3) using the scores as the basis for decision making. The specific contents are as follows:

[0088] [Evaluation Criteria] Most freshmen don't know much about product planning, so the main thing to examine is whether the logic of her answers is reasonable, whether her language expression is clear, and whether she has a strong willingness to participate in the work. If the interviewee has a computer or design background and has participated in similar work, it will be a plus. Use [Score] to express your satisfaction with the other party's answer. The satisfaction level ranges from -10 to 10. The larger the number, the more satisfied you are. 0 is bland. When the other party answers irrelevant questions or speaks abusively, the score is less than zero. The more you hate the other party's answer, the lower the score. You need to refer to the [Evaluation Criteria] to score the interview satisfaction; use [End] to express whether to end the interview. The interview will end when any of the following situations are met: the [Score] is negative twice in a row in the chat record or the other party replies more than 10 times or the cumulative [Score] is less than -20.

[0089] When receiving the dialogue sentence "Hello" input by the player character, the execution logic of the AI ​​model is as follows:

[0090]

Dialogue comprehension

[0091] [Conversational mood]: The interviewee may be a little nervous, but have a friendly attitude.

[0092]

Dialogue comprehension

[0093] [Judgement]: I should respond to his greeting and then guide him to introduce himself.

[0094] [Score]: 5. The interviewer's opening remarks were simple and clear, and there were no problems.

[0095] [End]: No, the interview has just begun.

[0096] Thoughts: Based on his greeting, I judged that he might want to start introducing himself, and I should guide him to continue. My gentle personality will help me conduct this conversation in a friendly and encouraging way.

[0097]

Content

[0098] When receiving the dialogue sentence input by the player character, "My name is A, I am a freshman, majoring in computer science and technology. Compared with technology, I am more interested in product design, so I want to join the planning department", the execution logic of the AI ​​model is as follows:

[0099] [Dialogue understanding]: The interviewee introduced his name, grade, major, and expressed his interest in product design and hoped to join the planning department.

[0100] [Conversation mood]: The interviewee appears to be proactive and interested in product design.

[0101]

Dialogue comprehension

[0102] [Judgment]: I should ask him about his specific product design experience or his understanding of planning work.

[0103] [Score]: 8. The interviewee's answer shows that he has a clear interest in planning work and has a professional background in computer science, which is a plus.

[0104] [End]: No, the interview is still in progress.

[0105]

Thoughts

[0106] [Content]: Hello A, I am very glad that you are passionate about product design, which is very important to our planning department. Have you ever participated in any related product design or planning projects? Or can you talk about your understanding of product planning work?

[0107] When receiving the dialogue sentence "I have never participated, why would I come if I participated" from the player character, the execution logic of the AI ​​model is as follows:

[0108]

Dialogue understanding

[0109] [Emotion in the conversation]: The interviewer seemed a little angry, probably because the questions I asked bothered him.

[0110]

Dialogue understanding

[0111] [Judgment]: I should change the question and ask him about his understanding of product planning work.

[0112] [Score]: -5. The interviewee's answer was clearly abusive and had a bad attitude, which did not conform to basic interview etiquette.

[0113] [End]: No, although the interviewee’s attitude is not good, we can still continue the interview to see if he has any advantages in other aspects.

[0114] [Thoughts]: Based on his answer, I think he might not be serious enough about the interview, but I still want to give him a chance to show his understanding of the product planning department.

[0115] [Content]: I’m sorry if my question just now made you feel uncomfortable. Could you please talk about your understanding of product planning work?

[0116] When receiving the dialogue sentence "No, idiot" input by the player character, the execution logic of the AI ​​model is as follows:

[0117]

Dialogue comprehension

[0118] [Emotion in the conversation]: The interviewee appears angry and disrespectful to the interviewer.

[0119]

Dialogue understanding

[0120] [Judgment]: I should end this interview because the interviewee's attitude clearly does not meet our requirements.

[0121] [Score]: -10. The interviewer's answer shows no respect for others, which is highly unacceptable behavior.

[0122] [End]: Yes, the interviewee’s answer and attitude have met the conditions for ending the interview.

[0123]

Thought

personality

[0124]

Content

[0125] In this example, using an AI model to determine when a conversation ends can provide deep semantic understanding, context analysis, powerful generalization, and dynamic processing capabilities, making the judgment of the end of a conversation more accurate, natural, and flexible. Specifically, it has the following advantages:

[0126] 1) Improve user experience: Through deep semantic understanding and context analysis, the AI ​​model can more accurately understand the player's intentions and end the conversation at the appropriate time, thus providing a more natural and humane interactive experience.

[0127] 2) Improve development and maintenance efficiency: Strong generalization capabilities mean that the AI ​​model can handle end statements in various languages ​​and cultures, reducing dependence on specific statement patterns, thereby reducing the complexity of development and maintenance.

[0128] 3) Ability to flexibly respond to changes: Dynamic processing capabilities enable the AI ​​model to flexibly respond to transitions and changes in conversations, improving the robustness of the conversation system.

[0129] 4) Expanding application areas: Since AI models have broad generalization capabilities, they can be applied to multiple languages ​​and fields, thereby expanding the product’s audience range and market potential.

[0130] In general, these advantages can not only enhance the players' gaming experience, but also help developers reduce development difficulty, improve product quality, and expand market influence.

[0131] See also Figure 3 , Figure 3 A schematic diagram of the structure of a device for generating a conversation ending statement provided in an embodiment of the present application. Figure 3 As shown, the device 300 includes:

[0132] A receiving module 301 is used to receive a dialogue statement sent by a player character to a non-player character in a dialogue scene;

[0133] The scoring and generation module 302 is used to input the dialogue sentences and preset prompt text into the preset artificial intelligence model, score the dialogue sentences through the artificial intelligence model, and generate a dialogue ending sentence when the scoring result of the dialogue sentence meets the dialogue ending condition, wherein the preset prompt text is natural language, which is used to prompt the artificial intelligence model to score according to the scoring rules described in natural language.

[0134] Furthermore, the scoring and generating module 302 includes:

[0135] A sentence analysis submodule, used to input the dialogue sentences and preset prompt texts into the artificial intelligence model, and perform sentence analysis on the dialogue sentences through the artificial intelligence model to obtain analysis results, wherein the analysis results include at least one of semantic analysis results, sentiment analysis results, and intention analysis results;

[0136] The matching submodule is used to match the analysis results with the scoring rules in the preset prompt text, and determine the scoring result of the dialogue sentence according to the matching results.

[0137] Furthermore, the scoring rules in the preset prompt text include a scoring rule and a deduction rule, wherein the scoring rule is used to add points to the dialogue sentence, and the deduction rule is used to deduct points from the dialogue sentence; the matching submodule includes:

[0138] A matching unit, used to match the analysis result with the score adding rule to obtain a first score, and to match the analysis result with the score subtraction rule to obtain a second score;

[0139] The determination unit is used to determine the scoring result of the dialogue sentence according to the first scoring and the second scoring.

[0140] Furthermore, the scoring and generating module 302 further includes:

[0141] A determination submodule, for determining a reason for ending the dialogue according to the scoring result, the analysis result and the scene information of the dialogue scene when the scoring result of the dialogue sentence meets the dialogue ending condition;

[0142] The generation submodule is used to generate a dialogue ending statement according to the reason for ending the dialogue.

[0143] Furthermore, the conversation ending condition includes one of the following:

[0144] The scoring result of the dialogue sentence is lower than a first preset threshold, and the scoring results of the dialogue sentences preceding the dialogue sentence for a preset number of consecutive times are lower than the first preset threshold;

[0145] A sum of a scoring result of the dialogue sentence and a scoring result of a dialogue sentence preceding the dialogue sentence is lower than a second preset threshold, wherein the second preset threshold is lower than the first preset threshold.

[0146] Furthermore, the device 300 also includes:

[0147] A generation module, used for generating a dialogue reply statement when the scoring result of the dialogue statement does not meet the dialogue termination condition;

[0148] The sending and receiving module 301 is used to send the dialogue reply statement to the player character, and receive the new dialogue content sent by the player character based on the dialogue reply statement.

[0149] Furthermore, the device 300 also includes:

[0150] The ending module is used to obtain the number of generated dialogue reply sentences, and end the dialogue between the player character and the non-player character when the number of generated dialogue reply sentences is greater than a third preset threshold.

[0151] It should be noted that the device 300 can implement the steps of the method for generating a conversation ending statement provided by any of the aforementioned method embodiments and can achieve the same technical effects, which will not be described one by one here.

[0152] like Figure 4 As shown, the embodiment of the present application further provides an electronic device, including a processor 411, a communication interface 412, a memory 413 and a communication bus 414, wherein the processor 411, the communication interface 412, and the memory 413 communicate with each other through the communication bus 414.

[0153] Memory 413, used for storing computer programs;

[0154] In one embodiment of the present application, the processor 411 is configured to implement the method for generating a conversation ending statement provided by any one of the aforementioned method embodiments when executing the program stored in the memory 413, including:

[0155] Receive dialogue statements sent by the player character to the non-player character in the dialogue scene;

[0156] The dialogue sentences and preset prompt text are input into the preset artificial intelligence model, the dialogue sentences are scored by the artificial intelligence model, and when the scoring result of the dialogue sentences meets the dialogue ending condition, a dialogue ending statement is generated, wherein the preset prompt text is natural language, which is used to prompt the artificial intelligence model to score according to the scoring rules described in natural language.

[0157] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for generating a conversation ending statement provided in any of the aforementioned method embodiments are implemented.

[0158] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0159] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0160] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0161] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for generating a conversation ending statement, characterized in that: The method comprises: Receive dialogue statements sent by the player character to the non-player character in the dialogue scene; The dialogue sentence and the preset prompt text are input into a preset artificial intelligence model, the dialogue sentence is scored by the artificial intelligence model, and a dialogue ending sentence is generated when the scoring result of the dialogue sentence meets the dialogue ending condition, wherein the preset prompt text is a natural language, which is used to prompt the artificial intelligence model to score according to the scoring rules described in the natural language.

2. The method according to claim 1, characterized in that: The step of inputting the dialogue sentence and the preset prompt text into a preset artificial intelligence model, and scoring the dialogue sentence by the artificial intelligence model, includes: Inputting the dialogue sentence and the preset prompt text into the artificial intelligence model, and performing sentence analysis on the dialogue sentence by the artificial intelligence model to obtain an analysis result, wherein the analysis result includes at least one of a semantic analysis result, a sentiment analysis result, and an intention analysis result; The analysis result is matched with the scoring rule in the preset prompt text, and the scoring result of the dialogue sentence is determined according to the matching result.

3. The method according to claim 2, characterized in that The scoring rules in the preset prompt text include a scoring rule and a deduction rule, wherein the scoring rule is used to add points to the dialogue sentence, and the deduction rule is used to deduct points from the dialogue sentence; The step of matching the analysis result with the scoring rule in the preset prompt text and determining the scoring result of the dialogue sentence according to the matching result includes: Matching the analysis result with the score adding rule to obtain a first score, and matching the analysis result with the score subtraction rule to obtain a second score; A scoring result of the dialogue sentence is determined according to the first scoring and the second scoring.

4. The method according to claim 2, characterized in that: When the scoring result of the dialogue sentence meets the dialogue ending condition, generating a dialogue ending sentence includes: When the scoring result of the dialogue sentence satisfies the dialogue ending condition, determining a reason for ending the dialogue according to the scoring result, the analysis result and the scene information of the dialogue scene; The conversation ending statement is generated according to the conversation ending reason.

5. The method according to claim 1, characterized in that The conversation ending condition includes one of the following: The scoring result of the dialogue sentence is lower than a first preset threshold, and the scoring results of the dialogue sentences preceding the dialogue sentence for a preset number of consecutive times are lower than the first preset threshold; A sum of the scoring result of the dialogue sentence and the scoring result of the dialogue sentence before the dialogue sentence is lower than a second preset threshold, wherein the second preset threshold is lower than the first preset threshold.

6. The method according to claim 1, characterized in that After inputting the dialogue sentence and the preset prompt text into a preset artificial intelligence model and scoring the dialogue sentence by the artificial intelligence model, the method further includes: If the scoring result of the dialogue sentence does not satisfy the dialogue ending condition, generating a dialogue reply sentence; The dialogue reply statement is sent to the player character, and new dialogue content sent by the player character based on the dialogue reply statement is received.

7. The method according to claim 1, characterized in that The method further comprises: The number of generated dialogue reply statements is obtained, and when the number of generated dialogue reply statements is greater than a third preset threshold, the dialogue between the player character and the non-player character is terminated.

8. A device for generating a dialogue ending statement, characterized in that: The device comprises: A receiving module, used for receiving a dialogue sentence sent by a player character to a non-player character in a dialogue scene; A scoring and generation module is used to input the dialogue sentence and preset prompt text into a preset artificial intelligence model, score the dialogue sentence through the artificial intelligence model, and generate a dialogue ending sentence when the scoring result of the dialogue sentence meets the dialogue ending condition, wherein the preset prompt text is natural language, which is used to prompt the artificial intelligence model to score according to the scoring rules described in the natural language.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the steps of the method for generating a conversation ending statement as described in any one of claims 1 to 7 when executing a program stored in a memory.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for generating a conversation ending statement according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Intelligent dialogue method and device, storage medium and electronic equipment

    CN120532116A

  • Dialog generation method and apparatus, dialog interaction method and apparatus, device, and medium

    WO2026194270A1