Chat method and device based on artificial intelligence, and storage medium
By analyzing the statement set of chat channels, determining the target chat style and outputting target statements, the problem of sluggish communication between online game chat channels is solved, and player activity and retention rate is improved.
Patent Information
- Application Number
- CN202510773281.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2045-06-11
AI Technical Summary
Existing online game chat channels are prone to problems such as sluggish communication, poor chat quality and deserted atmosphere during non-peak periods, which affects the retention and activity of gamers.
By obtaining the statement set in the chat channel, analyzing the scene information and statement set characteristics, determining the target chat style, and outputting the target statements by artificial intelligence to mobilize the interest of gamers and increase activity.
It improves the chat activity and retention rate of gamers and enhances the interactive experience of chat channels.
Smart Images

Figure CN120296136A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of artificial intelligence, and specifically relates to a chat method, device, and storage medium based on artificial intelligence. Background Art
[0002] With the development of science and technology, online games are becoming more and more popular. The chat function of online games is a crucial part of enhancing the online gaming experience. Convenient chat can enable game players to have more interactive experiences.
[0003] However, the chat channels of most online games are currently prone to problems such as low communication among gamers, poor chat quality, and a cold atmosphere during non-peak hours, which in turn affects the retention and activity of gamers.
[0004] Therefore, how to increase the activity of game players and retain them is a technical problem that needs to be solved urgently. Summary of the invention
[0005] The purpose of this application is to increase the activity of game players and retain them.
[0006] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0007] According to one aspect of an embodiment of the present application, there is provided a chat method based on artificial intelligence, the method comprising: Get multiple sentences in the target channel to obtain a sentence set; Determining scene information of the target channel according to the attribute information of each of the sentences in the sentence set and the target channel; Determining a target chat style of the artificial intelligence according to the sentence set features of the sentence set; The artificial intelligence outputs a target sentence according to the scenario information and the target chat style.
[0008] According to one aspect of an embodiment of the present application, there is provided a method for determining scene information of the target channel according to attribute information of each of the statements in the statement set and the target channel, including: Obtaining the activity vector, online number vector, and type vector of the target channel; Obtaining a topic vector of the sentence set according to the content of each sentence in the sentence set; A scene vector is calculated as the scene information according to the activity vector, the number of online users vector, the type vector, and the topic vector.
[0009] According to one aspect of an embodiment of the present application, there is provided a method for determining a target chat style of artificial intelligence according to a sentence set feature of the sentence set, including: Obtain the statement set features of the statement set, where the statement set features include at least one of lexical features, interaction features, topic features, rhetorical features, and emotional features; Determine the chat style corresponding to the statement set according to the statement set features, and use the chat style corresponding to the statement set as the target chat style. According to one aspect of the embodiments of the present application, the method further includes: Obtain the statement set sample features of multiple first sample statement sets, and matrixize each sample feature in each statement set sample feature to obtain multiple sample feature matrices. The sample features of the statement set include lexical sample features, interaction sample features, topic sample features, rhetorical sample features, and emotional sample features; Use each sample feature matrix as a cluster to form a cluster set, take the two clusters with the closest distance as a new cluster, and update the cluster set; Repeat taking the two clusters with the closest distance as a new cluster and updating the cluster set until there is only one cluster in the cluster set; Generate a cluster tree according to the synthesis records of each cluster. Each node of the cluster tree is a different cluster, and the height of the cluster tree is used to represent the minimum distance between the clusters when forming a new cluster; Calculate the silhouette coefficients at different heights of the cluster tree, and determine the optimal height of the cluster tree according to the silhouette coefficients at different heights of the cluster tree; Use the clusters in the cluster set at the optimal height of the cluster tree as sample clusters, and each sample cluster corresponds to a chat style.
[0010] According to one aspect of the embodiments of the present application, there is provided a method for determining the target chat style of an artificial intelligence according to the statement set features of the statement set, including: Matrixize each feature in the statement set features to obtain multiple feature matrices; Take the sample cluster closest to the feature matrix as the target cluster, and use the chat style corresponding to the target cluster as the target chat style.
[0011] According to one aspect of the embodiments of the present application, there is provided a method for the artificial intelligence to output a target statement according to the scenario information and the target chat style, including: Generate a statement construction prompt word according to the scenario information and the target chat style of the artificial intelligence. The statement construction prompt word is used to prompt the chat style, environment information, and topic information of the artificial intelligence when outputting the target statement; The artificial intelligence generates a target statement according to the statement construction prompt word.
[0012] According to one aspect of the embodiments of the present application, the method further includes: Calculate the activity of the target channel according to the number of online users and the speech frequency of the target channel; Determine the speech frequency of the artificial intelligence according to the activity of the target channel.
[0013] According to one aspect of the embodiments of the present application, after the artificial intelligence outputs a target statement according to the scenario information and the target chat style, the method further includes: Score the target statement according to the response degree of the target statement, and use the target statement with a score less than the set score as a negative statement; Correct the artificial intelligence according to the negative statement.
[0014] According to one aspect of the embodiments of the present application, there is provided a chat device based on artificial intelligence, including a memory, a processor, and a readable program stored on the memory, and the processor executes the readable program to implement the method described in any one of the above.
[0015] According to one aspect of the embodiments of the present application, there is provided a readable storage medium, on which a readable program / instructions are stored, and when the readable program / instructions are executed by a processor, the method described in any one of the above is implemented.
[0016] In the present application, first, a plurality of statements in the chat channel are obtained to form a statement set. Then, according to each statement in the statement set and the attribute information of the target channel, the scenario information of the target channel is determined. Then, according to the statement set characteristics of the statement set, the target chat style of the artificial intelligence is determined. Finally, the artificial intelligence outputs a target statement according to the scenario information and the target chat style. In the embodiments of the present application, by analyzing the statements in the chat channel to determine what kind of chat style the current active players need, and then obtaining the scenario information of the chat channel according to the content of the statement set to clarify the chat environment of the current chat channel. Finally, the artificial intelligence outputs a target statement based on the target chat style suitable for game players and the scenario information of the chat channel. So that the target statement can be highly adapted to the speech mode of game players in the current chat channel and the chat environment, thereby increasing the activity and retention of game players in the game channel.
[0017] Other features and advantages of the present application will become apparent through the following detailed description, or be learned in part through the practice of the present application.
[0018] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. Description of the Drawings
[0019] The accompanying drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with this application, and are used together with the specification to explain the principles of this application. Obviously, the accompanying drawings in the following description are only some embodiments of this application, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts.
[0020] Figure 1 The flowchart shows a method for artificial intelligence-based chatting according to an embodiment of the present application.
[0021] Figure 2 The flowchart shows determining the scene information of a target channel according to the attributes of each statement in a statement set and the target channel according to an embodiment of the present application.
[0022] Figure 3 The flowchart shows determining the target chatting style of artificial intelligence according to the statement set features of a statement set according to an embodiment of the present application.
[0023] Figure 4 The flowchart shows dividing the chatting style of a statement set according to an embodiment of the present application.
[0024] Figure 5 The flowchart shows determining the target chatting style of artificial intelligence according to the statement set features of a statement set according to an embodiment of the present application.
[0025] Figure 6 The flowchart shows that artificial intelligence outputs a target statement according to the scene information and the target chatting style according to an embodiment of the present application.
[0026] Figure 7 The flowchart shows adjusting the speaking frequency of artificial intelligence according to an embodiment of the present application.
[0027] Figure 8 The flowchart shows automatically correcting the speech of artificial intelligence according to the feedback of the target statement according to an embodiment of the present application.
[0028] Figure 9 The block diagram shows a computer system for implementing the method for artificial intelligence-based chatting according to an embodiment of the present application. Detailed implementation manners
[0029] Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more complete and comprehensive, and will fully convey the concept of the example embodiments to those skilled in the art.
[0030] In addition, the described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, numerous specific details are provided to give a thorough understanding of the embodiments of the present application. However, those skilled in the art will realize that the technical solutions of the present application can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be employed. In other cases, well-known methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the present application.
[0031] The block diagrams shown in the drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0032] The flowcharts shown in the drawings are merely illustrative and not necessarily include all the content and operations / steps, nor are they necessarily executed in the described order. For example, some operations / steps may be decomposed, and some operations / steps may be combined or partially combined, so the actual execution order may change according to the actual situation.
[0033] In the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works with other related parts to achieve a predetermined goal, and can be fully or partially implemented by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of the overall module or unit that includes the function of that module or unit.
[0034] Please refer to Figure 1 , Figure 1 which shows a flowchart of a chat method based on artificial intelligence according to an embodiment of the present application. The embodiments of the present application provide steps of a chat method based on artificial intelligence, including: Step S110, obtaining a plurality of statements in a target channel to obtain a statement set; Step S120, determining the scene information of the target channel according to each statement in the statement set and the attribute information of the target channel; Step S130, determining the target chat style of the artificial intelligence according to the statement set characteristics of the statement set; Step S140, the artificial intelligence outputs a target statement according to the scene information and the target chat style.
[0035] The above four steps will be described in detail below.
[0036] In step S110, a set of statements is obtained by acquiring multiple statements of a target channel. The target channel refers to a chat channel where artificial intelligence is required to speak, that is, a chat channel where warm-up is needed. The chat records in the target channel are acquired. There are multiple statements in the chat records, and thus a set of statements formed by the multiple statements is obtained. Each statement is a message sent by a game player.
[0037] In some embodiments, the time when the statements of the target channel are acquired is used as the current time, and the chat records for the first set duration before the current time are acquired to obtain the set of statements.
[0038] In some embodiments, the speech frequency and / or activity of the current chat channel are calculated. The speech frequency refers to the number of statements generated in the chat channel within the second set duration. The activity refers to the percentage of active players among all online users. Among them, an active player is a game player who is in the chat channel and the number of statements sent within the third set duration is greater than the number threshold. It should be clear that the first set duration, the second set duration, and the third set duration are preset. For example, they are customized by the game developer.
[0039] In some embodiments, the chat channel with a speech frequency and / or activity less than the set value is used as the target channel.
[0040] In step S120, according to each statement in the set of statements and the attribute information of the target channel, the scene information of the target channel is determined.
[0041] In some embodiments, the scene information may include environmental information. For the acquisition of environmental information, first, the type of the target channel needs to be determined according to the attribute information of the target channel. It should be clear that the type of the target channel is used to represent the interaction environment required by the game players in the target channel, and also represents the chat environment in the target channel from the side. Exemplarily, the types of the target channel are divided into multiple types based on the different interaction environments required by players. Each channel corresponds to a different interaction environment. For example, the trading channel corresponds to the trading environment, the competitive channel corresponds to the competitive environment, the entertainment channel corresponds to the entertainment environment, the leisure channel corresponds to the leisure environment, the activity channel corresponds to the activity environment, and so on. The focuses of communication in different types of channels are different. For example, the trading channel tends to discuss commodity trading, price comparison, and so on.
[0042] Secondly, the environmental information also needs to obtain the activity and the number of online users of the target channel according to the attribute information of the target channel. Different activity levels and the number of online users require different speaking environments and speaking methods.
[0043] Determine the environmental information of the target channel according to the type, number of online users, and activity level of the target channel, so that the remarks made by the artificial intelligence are more in line with the environment of the target channel.
[0044] In some embodiments, the scenario information may include topic information. For obtaining the topic information, it is necessary to analyze from the statement set the positive topics that the target channel is interested in and the negative topics that it is not interested in. Positive topics are those topics that players discuss more, and negative topics are those topics that players discuss less. If the proportion of statements related to a topic in the statement set is greater than the set ratio, then that topic is a positive topic; otherwise, it is a negative topic. Statements related to a topic include, but are not limited to, statements that directly include the keyword of the topic in the statement, including statements that reference or reply to the topic.
[0045] In the above embodiments, determine the environmental information according to the target channel attribute information, determine the topic information according to the statement set, and finally jointly construct the scenario information of the target channel based on the environmental information and topic information. Furthermore, the artificial intelligence can more accurately obtain the target statements suitable for the current chat environment and topics of the target channel based on the precise speech environment, positive topics, and negative topics. Thus, it can arouse the interest of game players, increase the activity level of game players, and retain game players.
[0046] In some embodiments, the scenario information may further include emotion information. For obtaining the emotion information, it is possible to analyze the emotion situation in each statement in the statement set, such as excitement or depression, and then obtain the emotion information of the statement set. For example, calculate the emotion value of each statement, and use the sum value of the emotion values of all statements in the statement set (emotion sum value) as the emotion information. If the emotion sum value is greater than the first threshold, it is excitement; if the emotion sum value is less than the second threshold, it is depression; if the emotion sum value is greater than or equal to the first threshold and less than or equal to the second threshold, it is flat. The second threshold is less than the first threshold.
[0047] The emotion information can describe the current atmosphere of the target channel. This can enable the artificial intelligence to jointly construct the scenario information of the target channel based on the environmental information, topic information, and emotion information. Furthermore, when generating the target statement, there are more dimensional restrictions on the artificial intelligence, making the target statement more in line with the chat environment in the target channel.
[0048] Please refer to Figure 2 , Figure 2 which shows a flowchart of determining the scenario information of the target channel according to each statement in the statement set and the attribute information of the target channel according to an embodiment of the present application. The embodiment of the present application provides step S120 for determining the scenario information of the target channel according to each statement in the statement set and the attribute information of the target channel, including: Step S121, obtain the activity vector, online user number vector, and type vector of the target channel; Step S122: Obtain the topic vector of the statement set according to the content of each statement in the statement set. Step S123: Calculate the scene vector as the scene information according to the activity vector, the online user number vector, the type vector, and the topic vector.
[0049] The above three steps are described below.
[0050] In step S121, obtain the activity vector, the online user number vector, and the type vector of the target channel. The activity vector is used to represent the activity of the target channel. The online user number vector is used to represent the number of online users of the target channel. The type vector is used to represent the type of the target channel.
[0051] In step S122, obtain the topic vector of the statement set according to the content of each statement in the statement set, which is used to represent the positive topics and negative topics of the target channel.
[0052] In step S123, synthesize the activity vector, the online user number vector, the type vector, and the topic vector into one vector as the scene vector. And use the scene vector as the scene information. The scene vector can make it more convenient and fast for the artificial intelligence to obtain the scene information by vectorizing the activity, the online user number, the type of the target channel, the emotion value of the statement set, and the topics.
[0053] In some embodiments, also obtain the emotion vector of the statement, and synthesize the activity vector, the online user number vector, the emotion vector, the type vector, and the topic vector into one vector as the scene vector.
[0054] In step S130, determine the target chat style of the artificial intelligence according to the scene information and the statement set features of the statement set.
[0055] In some embodiments, determine the target chat style of the artificial intelligence according to the analysis result of the statement set and the topic information in the scene information of the target channel. Specifically, determine the positive topics according to the topic information, obtain the positive statements corresponding to the positive topics, and use the chat style obtained by analyzing the positive statements as the target chat style of the artificial intelligence. The positive statements are the statements that include the keywords corresponding to the positive statements. The statements that quote or reply to the positive statements are also positive statements.
[0056] In some embodiments, according to the interaction between each sentence in the sentence set, such as taking sentences whose number of answers and citations exceeds a set value as sentences to be analyzed, the sentences to be analyzed are then analyzed or feature extracted from the perspectives of expression style, language tone, semantic regional attributes, etc., to obtain the chat style of the sentences to be analyzed, and then use this chat style as the target chat style applicable to artificial intelligence. Among them, the expression style is explained as follows: the expression style includes concise style, detailed style, and humorous / creative style. Concise style: such as "Received, reply within 24 hours", detailed style: such as "We have received your request, and it is expected that the exclusive customer service will give you a detailed answer within 24 hours, please wait patiently~". Analysis method: calculate the average sentence length (number of words / characters); identify information redundancy (such as repeated emphasis, over-explanation). Humorous / creative style: contains metaphors, Internet hot stalks (such as "This wave of operations is simply 666"), and emoticon text. Analysis method: extract Internet buzzwords and homophonic stalks (such as "Jue Jue Zi" and "emo"); identify rhetorical techniques (such as personification and exaggeration).
[0057] The following is an explanation of the language tone: the language tone includes positive, negative, neutral, formal, and informal. Positive: such as "Great! Let's work hard together~". Neutral: such as "The system will be upgraded tomorrow". Negative (such as "This problem cannot be solved". Analysis method: Count the proportion of positive / negative words (such as "happy" and "regretful"); identify modal particles (such as "Yeah" and "Yeah" convey intimacy, "Oh" and "Well" are more neutral). Formal: such as "Dear user, thank you for your feedback". Informal: such as "Baby, I will help you solve this problem~". Analysis method: Detect the frequency of use of professional terms and honorifics (such as "Your Excellency" and "Please be aware"); observe the sentence structure (long sentences / complex sentences are more formal, short sentences / colloquial expressions are more casual).
[0058] The regional attributes of semantics are explained as follows: Regional attributes include dialect vocabulary and content related to festivals and solar terms. Dialect vocabulary: such as "knowingly not" and "not in the middle" and other expressions related to regional customs. Analysis method: extract dialects and slang (such as Sichuan dialect "bashi" and Cantonese "handsome boy"); detect content related to festivals and solar terms (such as "Dragon Boat Festival Ankang" and "Winter Solstice Customs").
[0059] See also Figure 3 , Figure 3 A flowchart of determining the target chat style of artificial intelligence according to the statement set features of a statement set according to an embodiment of the present application is shown. The present application embodiment provides a step S130 of determining the target chat style of artificial intelligence according to the statement set features of the statement set, including: Step S131a, obtain the sentence set features of the sentence set, where the sentence set features include at least one of lexical features, interaction features, topic features, rhetorical features, and emotional features; Step S132a, determine the chat style corresponding to the sentence set according to the sentence set features, and use the chat style corresponding to the sentence set as the target chat style.
[0060] The above two steps are described in detail below.
[0061] In step S131a, obtain the sentence set features of the sentence set. The sentence set features include at least one of lexical features, interaction features, topic features, rhetorical features, and emotional features. Lexical features refer to common sentence patterns in the sentence set, such as frequently used words and sentence patterns in the sentences. Interaction features are used to represent the situation of each sentence in the sentence set being replied to and cited. Topic features are used to represent the characteristics of chat styles under different topics. Rhetorical features represent the distribution of rhetorical devices used in each sentence in the sentence set, such as the proportion of sentences applying each rhetorical device. Emotional features represent the overall emotional tendency of the sentence set.
[0062] For syntactic features, they can be obtained by counting the occurrence frequencies of words in the sentence set, such as identifying high-frequency or low-frequency words in the sentence set. For interaction features, they can be determined by counting the situation of sentences being cited and / or replied to. For rhetorical features, they can be determined by identifying the rhetorical devices of each sentence. For emotional features, the emotional value of the entire sentence set can be obtained by the emotional values of each sentence (for example, criticism, disgust, calm, excitement, and praise correspond to different emotional values) as the emotional feature.
[0063] In step S132a, determine the chat style corresponding to the sentence set based on the sentence set features. Different sentence set features correspond to different chat styles, and use the chat style corresponding to the sentence set as the target chat style of the artificial intelligence.
[0064] In the embodiment of the present application, by analyzing the sentence set from multiple angles, the target chat style of the artificial intelligence can be obtained more accurately, making the target sentences sent by the artificial intelligence have the feeling of real human speech and no longer being rigid. Thus, the activity of game players can be increased more effectively, so as to retain game players.
[0065] In some embodiments, according to the content of each statement in the statement set, the statement posted by the user with the most interaction times is obtained as the target statement; where the interaction times refer to the sum of the reply times and citation times of the statements issued by game players. According to the statement features of the target statement, the chat style of the target statement is obtained, and the chat style of the target statement is used as the target chat style of the artificial intelligence. In the embodiments of the present application, by using the chat style of the most popular game user as the target chat style of the artificial intelligence, the target chat style can be quickly determined and it is ensured that the target chat style is accepted by other game players. Furthermore, the technical effect of increasing the activity of game players in the target channel is achieved.
[0066] Please refer to Figure 4 , Figure 4 which shows a flowchart for dividing the chat style of a statement set according to an embodiment of the present application. The embodiments of the present application provide steps for dividing the chat style of a statement set, including: Step S201, obtain the statement set sample features of multiple first sample statement sets, and matrixize each sample feature in the statement set sample features to obtain multiple sample feature matrices. The sample features of the statement set include lexical sample features, interaction sample features, topic sample features, rhetorical sample features, and emotional sample features; Step S202, take each sample feature matrix as a cluster to form a cluster set, make the two clusters with the closest distance as a new cluster, and update the cluster set; Step S203, repeat making the two clusters with the closest distance as a new cluster and updating the cluster set until there is only one cluster in the cluster set; Step S204, generate a cluster tree according to the synthesis records of each cluster. Each node of the cluster tree is a different cluster, and the height of the cluster tree is used to represent the minimum distance between clusters when forming a new cluster; Step S205, calculate the silhouette coefficients at different heights of the cluster tree to determine the optimal height of the cluster tree according to the silhouette coefficients at different heights of the cluster tree; Step S206, make the clusters in the cluster set at the optimal height of the cluster tree as sample clusters, and each sample cluster corresponds to a chat style.
[0067] The above 6 steps will be described in detail below.
[0068] In step S201, multiple first sample statement sets are obtained. Each sample statement set has corresponding lexical sample features, interaction sample features, topic sample features, rhetorical sample features, and sentiment sample features. And each lexical sample feature, interaction sample feature, topic sample feature, rhetorical sample feature, and sentiment sample feature is matrixized to obtain multiple sample feature matrices. That is, multiple lexical sample feature matrices, interaction sample feature matrices, rhetorical sample feature matrices, sentiment sample feature matrices, and topic sample feature matrices are obtained respectively.
[0069] In step S202, each sample feature matrix is taken as a cluster, that is, multiple clusters are obtained. All the clusters form a cluster set. At this time, each cluster corresponds to a sample feature matrix. Calculate the position of each sample feature matrix as the position of the cluster. Take the two closest clusters as a new cluster. In the new cluster, there are two corresponding sample feature matrices. Take the centroid of the positions of the two sample feature matrices as the position of the new cluster, and then a new cluster set is obtained. At this time, the number of clusters in the cluster set is reduced by one.
[0070] It should be clear that if a cluster includes multiple sample feature matrices, calculate the centroid of the multiple sample feature matrices as the position of the cluster.
[0071] In step S203, repeatedly take the two closest clusters as a new cluster. Each time two clusters are taken as a new cluster, update the cluster set until there is only one cluster in the cluster set to complete the integration of all clusters.
[0072] In step S204, according to the historical record of integrating all clusters, a cluster tree is generated. The bottom of the cluster tree is a cluster corresponding to a sample feature matrix respectively. The top of the cluster tree is a cluster corresponding to all sample feature matrices. The height of the cluster tree is used to represent the minimum distance between clusters when forming new clusters. For example, if the heights of the cluster tree from small to large are a, b, c, it means that when forming new clusters in sequence, the distances between two clusters are a, b, c respectively when forming new clusters. That is, when taking two clusters as a new cluster for the first time, the minimum distance between clusters is a. When taking two clusters as a new cluster for the second time, the minimum distance between clusters is b. When taking two clusters as a new cluster for the third time, the minimum distance between clusters is c.
[0073] It should be clear that in some embodiments, the cluster set can form new clusters N times, where N is a positive integer. The above embodiments do not specifically limit the height of the cluster number and the number of times of updating the cluster set.
[0074] In step S205, as the clustering tree grows taller, the number of nodes (clusters) in the clustering tree becomes fewer and fewer. Taking the example in the embodiment of step S204, if the clustering tree is updated a total of 3 times, the original quantity is the quantity of the sample feature matrix. When the clustering set is updated for the first time, the number of clusters in the clustering set is x. When the clustering set is updated for the second time, the number in the clustering set is y. When the clustering set is updated for the third time, the number of clusters is y. If you want to extract x chat styles, directly use the x clusters as sample clusters, and each sample cluster corresponds to a chat style. Use the sample cluster that the sentence set features in the target channel conform to as the target cluster, and then use the chat style of the target cluster as the target chat style of the artificial intelligence.
[0075] In some embodiments, calculate the silhouette coefficient at different heights of the clustering tree to determine the optimal height of the clustering tree according to the silhouette coefficient at different heights of the clustering tree. Use the clusters at the optimal height as sample clusters. For example, if the optimal height of the clustering tree is m, where m is greater than or equal to b and less than c. Then use the y clusters obtained from the second update as sample clusters, and each sample cluster corresponds to a chat style.
[0076] The optimal height can make the boundaries of each cluster clearer, and further make the classification of each chat style clearer, making the target chat style of the artificial intelligence more accurate.
[0077] In some embodiments, use the height at which each synthesis occurs in the clustering tree as the initial height, calculate the height difference between adjacent initial heights, use the adjacent initial heights with the largest height difference as the initial optimal height, and use the larger initial optimal height as the optimal height.
[0078] In step S206, use the clusters retained at the optimal height of the clustering tree as sample clusters. Each sample cluster corresponds to a chat style, and each chat style corresponds to a different sample feature matrix. Furthermore, the sample feature matrix that the sentence set features in the target channel conform to can be used as the target sample feature matrix, the sample cluster corresponding to the target sample feature matrix can be used as the target cluster, and the chat style corresponding to the target cluster can be used as the target chat style of the artificial intelligence.
[0079] In some embodiments, after using the clusters retained at the optimal height of the clustering tree as sample clusters, it further includes: First, obtain the positions of each sample cluster; then, obtain at least one second sample statement set, and obtain the sample feature matrix of the second sample statement set. Add the sample feature matrix of each second sample statement set to the cluster with the closest distance, and recalculate the positions of the sample clusters; repeat obtaining the second sample statement set to update the positions of the sample clusters until the fluctuation of the positions of the sample clusters is less than the fluctuation threshold or the number of updates is greater than the preset value. This makes the positions of the sample clusters more accurate, and further makes the division of chat styles more distinct, thereby providing an accurate reference for the target chat style of artificial intelligence.
[0080] Please refer to Figure 5 , Figure 5 which shows a flowchart of determining the target chat style of artificial intelligence according to the statement set features of the statement set according to an embodiment of the present application. The embodiments of the present application provide step S130 of determining the target chat style of artificial intelligence according to the statement set features of the statement set, including: Step S131b: Matrixize each feature in the statement set features to obtain multiple feature matrices; Step S132b: Use the sample cluster closest to the feature matrix as the target cluster, and use the chat style corresponding to the target cluster as the target chat style.
[0081] The above two steps are described in detail below.
[0082] In step S131b, each feature in the statement set features is matrixized to obtain multiple feature matrices.
[0083] In step S132b, according to the positions of each feature matrix, determine the sample cluster to which the feature matrix belongs as the target cluster, and use the chat style corresponding to the target cluster as the chat style corresponding to the statement set.
[0084] In some embodiments, obtain the distances between each feature matrix and each sample cluster, use the sum of the distances between all feature matrices and a sample cluster as the initial distance, and each sample cluster corresponds to an initial distance. Use the sample cluster corresponding to the minimum initial distance as the target cluster.
[0085] In some embodiments, obtain the centroid of all feature matrices as the target position. Use the sample cluster closest to the target position as the target cluster.
[0086] In step S140, the artificial intelligence outputs a target statement according to the scenario vector and the target chat style.
[0087] In some embodiments, the artificial intelligence makes statements regarding positive topics based on set scenario information such as the speaking environment and the target chat style, such that the resulting target statements are more in line with the type of the chat channel and the topics discussed by the game players, thereby increasing the player activity and retaining the game players.
[0088] Please refer to Figure 6 , Figure 6 which shows a flowchart of an artificial intelligence outputting a target statement according to scenario information and a target chat style according to an embodiment of the present application. The embodiments of the present application provide step 140 for the artificial intelligence to output a target statement according to scenario information and a target chat style, including: Step S141, generating a statement construction prompt word according to the scenario information and the target chat style of the artificial intelligence, where the statement construction prompt word is used to prompt the chat style, environment information, and topic information when the artificial intelligence outputs the target statement; Step S142, the artificial intelligence generating a target statement according to the statement construction prompt word.
[0089] The above two steps will be described in detail below.
[0090] In step S141, a text construction prompt word is generated according to the scenario information and the target chat style of the artificial intelligence, where the text construction prompt word is used to prompt the chat style, environment information, and topic information when the artificial intelligence outputs the target statement. For example, in what environment (number of online people, activity, channel type), for what topic, and in what chat style to generate a statement.
[0091] In step S142, the artificial intelligence generates a target statement according to the text construction prompt word. In some real-life examples, the artificial intelligence accesses a big data model and inputs the statement construction prompt word into the big data model to directly generate a target statement.
[0092] Please refer to Figure 7 , Figure 7 which shows a flowchart of adjusting the speaking frequency of the artificial intelligence according to an embodiment of the present application. The embodiments of the present application provide steps for adjusting the speaking frequency of the artificial intelligence, including: Step S301, calculating the activity of the target channel according to the number of online people and the speaking frequency of the target channel; Step S302, determining the speaking frequency of the artificial intelligence according to the activity of the target channel.
[0093] The above two steps will be described in detail below.
[0094] In step S301, the activity of the chat channel is calculated based on the number of online users and the speech frequency in the chat channel. The activity refers to the percentage of active players among all online users. An active player is a game player who is in the current chat channel and whose number of sent statements within a third set duration is greater than a quantity threshold, that is, a game player with a speech frequency greater than a frequency threshold.
[0095] In step S302, the speech frequency of the artificial intelligence is determined according to the activity of the chat channel. This avoids the artificial intelligence frequently sending target statements when the activity of the target channel is high, which may cause annoyance to game players. It also avoids the artificial intelligence sending fewer target statements when the activity of the target channel is low, resulting in a poor experience for game players.
[0096] Please refer to Figure 8 , Figure 8 , which shows a flowchart of automatically correcting the speech of an artificial intelligence according to a target statement in an embodiment of the present application. The embodiment of the present application provides steps for automatically correcting the speech of an artificial intelligence according to a target statement, including: Step S401, scoring the target statement according to the response degree of the target statement, and taking the target statement with a score less than a set score as a negative statement; Step S402, correcting the artificial intelligence according to the negative statement.
[0097] The above two steps are described in detail below.
[0098] In step S401, the response degree of the statement sent by the artificial intelligence is obtained, each target statement sent is scored, and the target statement with a score less than the set score is taken as a negative statement. Exemplarily, the number of citations and the number of replies of each target statement within a set period are calculated as the response times, and the ratio of the response times to the total number of statements is taken as the response degree. According to the response degree, the score of the target statement is obtained, such as directly taking the response degree as the score.
[0099] In step S402, the artificial intelligence is corrected according to the negative statement. For example, the topic feature, syntactic feature, and rhetorical feature of the negative statement are obtained as negative features to prevent the artificial intelligence from having target statements with negative features. This greatly improves the intelligence level of the artificial intelligence and enhances the user experience. In some embodiments, the time when the statement set is obtained is used as the current time, and the activity information suitable for the target channel at the current time is obtained to send the activity information to the target channel, providing a discussion topic for game players. Thus, the activity level of game players is increased. The activity information suitable for the target channel refers to determining the activities related to the channel type as the activity information suitable for the target channel according to the channel type of the target channel. And using the activity information suitable for all channel types as the activity information suitable for the target channel.
[0100] In some embodiments, when an activity is established, a type tag is set for the activity. According to the obtained type tag, the channel type suitable for the activity can be determined. If there is no type tag, it means that the activity is suitable for all types of channels.
[0101] In some embodiments, the activity information suitable for the target channel at the current time is obtained, and the artificial intelligence generates the target statement of the activity information in the target chat style to send the activity information to the target channel, providing a discussion topic for game players. Thus, the activity level of game players is increased.
[0102] In some embodiments, if the target statement has not been generated after the statement set has been generated for the set duration, the generation of the target statement is stopped, and the statement set is obtained again to regenerate the target statement.
[0103] In some embodiments, when the artificial intelligence fails, a preset template is used as the target statement.
[0104] Figure 9 The block diagram of the computer system for implementing the chat method based on artificial intelligence according to an embodiment of the present application is shown.
[0105] It should be noted that Figure 9 The shown computer system 800 is only an example and should not bring any limitation to the functions and usage scope of the embodiments of the present application.
[0106] Such as Figure 9As shown, computer system 800 includes a central processing unit 801 (CPU), which can perform various appropriate actions and processes according to programs stored in read-only memory 802 (ROM) or programs loaded from storage section 808 into random access memory 803 (RAM). In random access memory 803, various programs and data required for system operation are also stored. The central processing unit 801, read-only memory 802, and random access memory 803 are connected to each other via bus 804. Input / output interface 805 (Input / Output interface, i.e., I / O interface) is also connected to bus 804.
[0107] The following components are connected to input / output interface 805: input section 806 including a keyboard, mouse, etc.; output section 807 including, for example, a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; storage section 808 including a hard disk, etc.; and communication section 809 including a network interface card such as a local area network card, modem, etc. Communication section 809 performs communication processing via a network such as the Internet. Drive 810 is also connected to input / output interface 805 as needed. Removable medium 811, such as a magnetic disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 810 as needed so that a computer program read from it can be installed into storage section 808 as needed.
[0108] In particular, according to an embodiment of the present application, the processes described in each method flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via communication section 809, and / or installed from removable medium 811. When the computer program is executed by central processing unit 801, various functions defined in the system of the present application are executed.
[0109] It should be noted that the computer-readable medium shown in the embodiments of the present application may be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0110] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in a flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented by a dedicated hardware-based system that performs the specified functions or operations, or by a combination of dedicated hardware and computer instructions.
[0111] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more of the above-described modules or units can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0112] From the description of the above embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solutions according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (such as a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.
[0113] After considering the specification and practicing the invention disclosed herein, those skilled in the art will readily conceive of other embodiments of the present application. The present application is intended to cover any variations, uses, or adaptations of the present application, which follow the general principles of the present application and include known common knowledge or conventional technical means in the technical field not disclosed in the present application.
[0114] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.
Claims
1. A chat method based on artificial intelligence, characterized in that, The method includes: Obtaining a plurality of statements in a target channel to obtain a statement set; Determining the scene information of the target channel according to each statement in the statement set and the attribute information of the target channel; Determining the target chat style of the artificial intelligence according to the statement set characteristics of the statement set; The artificial intelligence outputs a target statement according to the scene information and the target chat style.
2. The method according to claim 1, characterized in that, Determining the scene information of the target channel according to each statement in the statement set and the attribute information of the target channel includes: Obtaining the activity vector, the online number vector, and the type vector of the target channel; Obtaining the topic vector of the statement set according to the content of each statement in the statement set; Calculating a scene vector as the scene information according to the activity vector, the online number vector, the type vector, and the topic vector.
3. The method according to claim 1, characterized in that Determining the target chat style of the artificial intelligence according to the statement set characteristics of the statement set includes: Obtaining the statement set characteristics of the statement set, where the statement set characteristics include at least one of lexical characteristics, interaction characteristics, topic characteristics, rhetorical characteristics, and emotional characteristics; Determining the chat style corresponding to the statement set according to the statement set characteristics, and using the chat style corresponding to the statement set as the target chat style.
4. The method according to claim 1, wherein The method further includes: Obtaining the statement set sample characteristics of a plurality of first sample statement sets, and matrixifying each sample characteristic in each statement set sample characteristic to obtain a plurality of sample characteristic matrices. The sample characteristics of the statement set include lexical sample characteristics, interaction sample characteristics, topic sample characteristics, rhetorical sample characteristics, and emotional sample characteristics; Regarding each sample characteristic matrix as a cluster to form a cluster set, making the two clusters with the closest distance as a new cluster, and updating the cluster set; Repeating making the two clusters with the closest distance as a new cluster and updating the cluster set until there is only one cluster in the cluster set; Generating a cluster tree according to the synthesis records of each cluster. Each node of the cluster tree is a different cluster, and the height of the cluster tree is used to represent the minimum distance between the clusters when forming a new cluster; Calculating the silhouette coefficients at different heights of the cluster tree to determine the optimal height of the cluster tree according to the silhouette coefficients at different heights of the cluster tree; Making the clusters in the cluster set at the optimal height of the cluster tree as sample clusters, and each sample cluster corresponds to a chat style.
5. The method according to claim 3 or 4, characterized in that, Determining the target chat style of the artificial intelligence according to the statement set characteristics of the statement set includes: Matrixifying each feature in the statement set characteristics to obtain a plurality of feature matrices; Regarding the sample cluster closest to the feature matrix as the target cluster, and using the chat style corresponding to the target cluster as the target chat style.
6. The method according to claim 1, wherein The artificial intelligence outputs a target statement according to the scene information and the target chat style, including: Generating a statement construction prompt word according to the scene information and the target chat style of the artificial intelligence. The statement construction prompt word is used to prompt the chat style, environment information, and topic information when the artificial intelligence outputs the target statement; The artificial intelligence generates a target statement according to the statement construction prompt word.
7. The method according to claim 1, characterized in that The method further includes: Calculating the activity of the target channel according to the number of online users and the speech frequency of the target channel; Determining the speech frequency of the artificial intelligence according to the activity of the target channel.
8. The method according to claim 1, characterized in that, After the artificial intelligence outputs a target statement according to the scene information and the target chat style, the method further includes: Scoring the target statement according to the response degree of the target statement, and taking the target statement with a score less than the set score as a negative statement; Correcting the artificial intelligence according to the negative statement.
9. An artificial intelligence-based chat device, comprising a memory, a processor, and a readable program stored on the memory, characterized in that, The processor executes the readable program to implement the method according to any one of claims 1 to 8.
10. A readable storage medium, characterized in that, A readable program / instruction is stored thereon, and when the readable program / instruction is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Man-machine chatting method and device, computer equipment and storage medium
CN117493520A
Chat message processing method and device, electronic equipment and storage medium
CN117618933A
Social assistance method and device, electronic equipment and computer readable storage medium
CN118395227A
Call method, electronic equipment, storage medium and product
CN119096252A
Automatic interview method and system and computer program product
CN119226468A