Artificial intelligence-based chat method, device, storage medium

By analyzing the message sets and attribute information of chat channels, artificial intelligence outputs suitable target messages, solving the problem of low communication in online game chat channels during off-peak hours and improving player activity and retention rates.

CN120296136BActive Publication Date: 2025-11-07SHENZHEN MINIPLAY TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510773281.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-11
Publication Date
2025-11-07
Estimated Expiration
2045-06-11

AI Technical Summary

Technical Problem

Existing online game chat channels are prone to low communication, poor chat quality, and a cold atmosphere during off-peak hours, which affects player retention and activity.

Method used

By acquiring the set of statements in the chat channel, analyzing the channel attributes and statement characteristics, determining the scene information and target chat style, artificial intelligence outputs suitable target statements to improve chat activity.

Benefits of technology

It increased chat activity and retention rates among game players, and enhanced the interactivity and fun of the chat environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120296136B_ABST
    Figure CN120296136B_ABST
Patent Text Reader

Abstract

The application discloses an artificial intelligence-based chat method and device, and a storage medium. The method comprises the following steps: obtaining a plurality of sentences in a target channel to obtain a sentence set; determining scene information of the target channel according to each sentence in the sentence set and attribute information of the target channel; determining a target chat style of artificial intelligence according to a sentence set feature of the sentence set; and outputting a target sentence according to the scene information and the target chat style of the artificial intelligence. The technical scheme of the application increases the activity level of game players and retains the game players.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of artificial intelligence, and particularly relates to a chat method and device based on artificial intelligence and a storage medium. BACKGROUND

[0002] With the development of science and technology, network games are becoming more and more common. The chat function of a network game is a crucial link in enhancing the experience of a network game. Convenient chat can enable game players to have more interactive experience.

[0003] However, the chat channel of most current network games is prone to have problems such as low exchange between game players, poor chat quality, and cold atmosphere in off-peak periods, which further affects the retention and activity of game players.

[0004] Therefore, how to increase the activity and retention of game players is a technical problem to be solved at present. SUMMARY

[0005] The purpose of the present application is to increase the activity and retention of game players.

[0006] Other characteristics and advantages of the present application will become apparent from the following detailed description, or will be learned by practice of the present application.

[0007] According to one aspect of an embodiment of the present application, a chat method based on artificial intelligence is provided, and the method comprises:

[0008] obtaining a plurality of sentences in a target channel to obtain a sentence set;

[0009] determining scene information of the target channel according to each sentence in the sentence set and attribute information of the target channel;

[0010] determining a target chat style of artificial intelligence according to a sentence set feature of the sentence set;

[0011] The artificial intelligence outputs a target sentence according to the scene information and the target chat style.

[0012] According to one aspect of an embodiment of the present application, determining scene information of the target channel according to each sentence in the sentence set and attribute information of the target channel comprises:

[0013] obtaining an activity vector, an online number vector, and a type vector of the target channel;

[0014] obtaining a topic vector of the sentence set according to the content of each sentence in the sentence set;

[0015] According to the activity vector, the online number vector, the type vector, and the topic vector, a scene vector is calculated as the scene information.

[0016] According to an aspect of an embodiment of the present application, there is provided a method for determining a target chat style of an artificial intelligence according to a sentence set feature of a sentence set, comprising:

[0017] Obtaining a sentence set feature of a sentence set, the sentence set feature comprising at least one of a lexical feature, an interaction feature, a topic feature, a rhetoric feature, and an emotion feature;

[0018] Determining a chat style corresponding to the sentence set according to the sentence set feature, and taking the chat style corresponding to the sentence set as the target chat style.

[0019] According to an aspect of an embodiment of the present application, there is provided a method further comprising:

[0020] Obtaining a sentence set sample feature of a plurality of first sample sentence sets, and matrixing each sample feature in each of the sentence set sample features to obtain a plurality of sample feature matrices, the sample feature of the sentence set comprising a lexical sample feature, an interaction sample feature, a topic sample feature, a rhetoric sample feature, and an emotion sample feature;

[0021] Forming a cluster set by taking each sample feature matrix as a cluster, taking the two clusters closest in distance as a new cluster, and updating the cluster set;

[0022] Repeating the taking of the two clusters closest in distance as a new cluster and the updating of the cluster set until there is only one cluster in the cluster set;

[0023] Generating a cluster tree according to the synthetic records of each of the clusters, each node of the cluster tree being a different cluster, and the height of the cluster tree being used to represent the minimum distance between the clusters when a new cluster is formed;

[0024] Calculating a silhouette coefficient at different heights of the cluster tree, to determine an optimal height of the cluster tree according to the silhouette coefficient at different heights of the cluster tree;

[0025] Taking the cluster in the cluster set at the optimal height of the cluster tree as a sample cluster, each of the sample clusters corresponding to a chat style.

[0026] According to an aspect of an embodiment of the present application, there is provided a method for determining a target chat style of an artificial intelligence according to a sentence set feature of a sentence set, comprising:

[0027] Matrixing each feature in the sentence set feature to obtain a plurality of feature matrices;

[0028] The sample closest to the feature matrix is clustered as a target cluster, and the chat style corresponding to the target cluster is taken as the target chat style.

[0029] According to an aspect of the embodiment of the present application, the artificial intelligence outputs a target sentence according to the scene information and the target chat style, including:

[0030] According to the scene information and the target chat style of the artificial intelligence, a sentence construction prompt word is generated, which is used to prompt the chat style, environmental information, and topic information of the artificial intelligence when outputting the target sentence.

[0031] The artificial intelligence generates a target sentence according to the sentence construction prompt word.

[0032] According to an aspect of the embodiment of the present application, the method further includes:

[0033] According to the number of online users and the speaking frequency of the target channel, the activity of the target channel is calculated.

[0034] According to the activity of the target channel, the speaking frequency of the artificial intelligence is determined.

[0035] According to an aspect of the embodiment of the present application, after the artificial intelligence outputs a target sentence according to the scene information and the target chat style, the method further includes:

[0036] According to the response degree of the target sentence, the target sentence is scored, and the target sentence with a score less than a set score is taken as a negative sentence.

[0037] According to the negative sentence, the artificial intelligence is corrected.

[0038] According to an aspect of the embodiment of the present application, a chat device based on artificial intelligence is provided, including a memory, a processor, and a readable program stored in the memory, and the processor executes the readable program to realize the method according to any one of the above.

[0039] According to an aspect of the embodiment of the present application, a readable storage medium is provided, and a readable program / instruction is stored on the readable storage medium. When the readable program / instruction is executed by a processor, the method according to any one of the above is realized.

[0040] In the present application, first, a plurality of sentences in a chat channel are acquired to obtain a sentence set. Then, according to the sentences in the sentence set and attribute information of the target channel, scene information of the target channel is determined, and then according to sentence set features of the sentence set, a target chat style of artificial intelligence is determined, and finally the artificial intelligence outputs a target sentence according to the scene information and the target chat style. In the embodiments of the present application, the sentences in the chat channel are analyzed to determine what kind of chat style the current active player needs, and then the scene information of the chat channel is obtained according to the content of the sentence set to clarify the chat environment of the current chat channel. Finally, the artificial intelligence outputs a target sentence based on the target chat style suitable for the game player and the scene information of the chat channel. The target sentence can be highly adapted to the speaking manner of the current chat channel game player and the chat environment, and thus the game player in the game channel can be more active and retained.

[0041] Other characteristics and advantages of the present application will become apparent from the following detailed description, or will be learned by practice of the present application.

[0042] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and are not restrictive of the present application. BRIEF DESCRIPTION OF DRAWINGS

[0043] The drawings herein are incorporated into the specification and constitute a part of the specification, show embodiments consistent with the present application, and together with the specification serve to explain the principles of the present application. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0044] Figure 1 A flowchart of an artificial intelligence-based chat method according to an embodiment of the present application is shown.

[0045] Figure 2 A flowchart of determining scene information of a target channel according to sentences in a sentence set and attribute information of the target channel according to an embodiment of the present application is shown.

[0046] Figure 3 A flowchart of determining a target chat style of artificial intelligence according to sentence set features of a sentence set according to an embodiment of the present application is shown.

[0047] Figure 4 A flowchart of dividing chat styles of a sentence set according to an embodiment of the present application is shown.

[0048] Figure 5A flowchart is shown for determining a target chat style of an artificial intelligence according to a sentence set feature of a sentence set according to one embodiment of the present application.

[0049] Figure 6 A flowchart is shown for an artificial intelligence outputting a target sentence according to scene information and a target chat style according to one embodiment of the present application.

[0050] Figure 7 A flowchart is shown for adjusting a speaking frequency of an artificial intelligence according to one embodiment of the present application.

[0051] Figure 8 A flowchart is shown for automatically correcting a speaking of an artificial intelligence according to a target sentence feedback according to one embodiment of the present application.

[0052] Figure 9 A block diagram of a computer system structure is shown for implementing a chat method based on an artificial intelligence according to one embodiment of the present application. DETAILED DESCRIPTION

[0053] Example implementations will now be described more fully with reference to the accompanying drawings. Example implementations can be implemented in any

[0054] Moreover, described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the

[0055] The block diagrams in the drawings show only the functional entities and not necessarily the physical separate entities. That is, the functional entities can be implemented in software, or in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0056] The flowcharts shown in the drawings are only exemplary illustrations, and not necessarily including all the contents and operations / steps, nor necessarily executed in the described order. For example, some operations / steps can be further decomposed, and some operations / steps can be combined or partially combined, so that the actual execution order can be changed according to the actual situation.

[0057] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined target, and can be implemented entirely or partially by using software, hardware (such as a processing circuit or a memory), 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 an integral module or unit that includes the functions of the module or unit.

[0058] Referring to Figure 1 , Figure 1 A flowchart of an artificial intelligence-based chat method according to an embodiment of the present application is shown. The embodiments of the present application provide steps of an artificial intelligence-based chat method, which include:

[0059] Step S110, obtaining a plurality of sentences in a target channel to obtain a sentence set;

[0060] Step S120, determining scene information of the target channel according to each sentence in the sentence set and attribute information of the target channel;

[0061] Step S130, determining a target chat style of the artificial intelligence according to a sentence set feature of the sentence set;

[0062] Step S140, the artificial intelligence outputs a target sentence according to the scene information and the target chat style.

[0063] The above four steps will be described in detail below.

[0064] In step S110, a plurality of sentences in a target channel are obtained to obtain a sentence set. The target channel refers to a chat channel that needs to be spoken by the artificial intelligence, that is, a chat channel that needs to be warmed up. The chat record in the target channel is obtained, and there are a plurality of sentences in the chat record, and then a sentence set formed by the plurality of sentences is obtained. Each sentence is a message sent by a game player.

[0065] In some embodiments, the time of obtaining the sentences of the target channel is taken as the current time, and the chat record of a first set time before the current time is obtained to obtain the sentence set.

[0066] In some embodiments, the speaking frequency and / or activity of the current chat channel are calculated. The speaking frequency refers to the number of sentences generated in the chat channel within a second set time. The activity refers to the percentage of active players among all online users. Among them, the active player refers to the game player in the chat channel, and the number of sentences sent within a third set time is greater than the number threshold. It should be clear that the first set time, the second set time, and the third set time are preset. For example, the game developer customizes.

[0067] In some embodiments, the chat channel with a speaking frequency and / or an activity level less than a set value is targeted as the target channel.

[0068] In step S120, scene information of the target channel is determined according to the sentences in the sentence set and the attribute information of the target channel.

[0069] In some embodiments, the scene information can include environment information. For obtaining the environment information, first, the type of the target channel needs to be determined according to the attribute information of the target channel. It needs to be clear that the type of the target channel is used to represent the interactive environment required by the game players in the target channel, and also represents the chat environment in the target channel. For example, the type of the target channel is divided into multiple types based on different interactive environments required by the players, and each channel corresponds to a different interactive environment. For example, the transaction channel corresponds to a transaction environment, the competition channel corresponds to a competition environment, the entertainment channel corresponds to an entertainment environment, the leisure channel corresponds to a leisure environment, the activity channel corresponds to an activity environment, and so on. Different types of channels focus on different communication, such as the transaction channel tends to discuss commodity transactions, price comparisons, and the like.

[0070] Secondly, the environment information also needs to obtain the activity level 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 manners.

[0071] The environment information of the target channel is determined according to the type, the number of online users, and the activity level of the target channel, so that the speech of the artificial intelligence is more suitable for the environment of the target channel.

[0072] In some embodiments, the scene information can include topic information. For obtaining the topic information, the positive topic of interest of the target channel and the negative topic of disinterest need to be analyzed according to the sentence set. The positive topic is a topic that is discussed more by the players, and the negative topic is a topic that is discussed less by the players. If the number of sentences related to a topic in the sentence set accounts for more than a set proportion in the sentence set, the topic is a positive topic, otherwise it is a negative topic. The sentences related to a topic include but are not limited to the sentences that directly include the keywords of the topic in the sentences, and the sentences that quote or reply to the topic.

[0073] In the above embodiments, the environment information is determined according to the attribute information of the target channel, the topic information is determined according to the sentence set, and finally the scene information of the target channel is constructed according to the environment information and the topic information, so that the artificial intelligence can more accurately obtain the target sentence suitable for the current chat environment and the topic of the target channel based on the accurate speaking environment, the positive topic, and the negative topic. Thus, the interest of the game players is aroused, the activity level of the game players is increased, and the game players are retained.

[0074] In some embodiments, the scene information can further include mood information. For obtaining the mood information, the mood of each sentence in the sentence set can be analyzed, such as excitement, depression, and the mood information of the sentence set can be obtained. For example, the mood value of each sentence is calculated, and the sum value (mood sum value) of the mood values of each sentence in the sentence set is taken as the mood information. If the mood sum value is greater than a first threshold value, it is excitement, if the mood sum value is less than a second threshold value, it is depression, and if the mood sum value is greater than or equal to the first threshold value and less than or equal to the second threshold value, it is flat. The second threshold value is less than the first threshold value.

[0075] The mood information can describe the current atmosphere of the target channel. This can enable the artificial intelligence to jointly construct the scene information of the target channel according to the environment information, the topic information, and the mood information. Further, the artificial intelligence has more dimensional restrictions when generating the target sentence, so that the target sentence is more suitable for the chat environment in the target channel.

[0076] Referring to Figure 2 , Figure 2 A flowchart for determining the scene information of the target channel according to the content of each sentence in the sentence set and the attribute information of the target channel is shown according to an embodiment of the present application. The embodiment of the present application provides a step S120 for determining the scene information of the target channel according to the content of each sentence in the sentence set and the attribute information of the target channel, which includes:

[0077] In step S121, the activity vector, the online number vector, and the type vector of the target channel are obtained.

[0078] In step S122, the topic vector of the sentence set is obtained according to the content of each sentence in the sentence set, which is used to represent the positive topic and the negative topic of the target channel.

[0079] In step S123, the scene vector is calculated as the scene information according to the activity vector, the online number vector, the type vector, and the topic vector.

[0080] The above three steps are described below.

[0081] In step S121, the activity vector, the online number vector, and the type vector of the target channel are obtained. The activity vector is used to represent the activity of the target channel. The online number vector is used to represent the online number of the target channel. The type vector is used to represent the type of the target channel.

[0082] In step S122, the topic vector of the sentence set is obtained according to the content of each sentence in the sentence set, which is used to represent the positive topic and the negative topic of the target channel.

[0083] In step S123, the activity vector, the online number vector, the type vector, and the topic vector are combined into a vector as a scene vector. The scene vector is taken as the scene information. The scene vector is obtained by vectorizing the activity, the online number, the type, the mood value of the statement set, and the topic of the target channel, so that the artificial intelligence can obtain the scene information more conveniently and quickly.

[0084] In some embodiments, the mood vector of the statement is also obtained, and the activity vector, the online number vector, the mood vector, the type vector, and the topic vector are combined into a vector as a scene vector.

[0085] In step S130, the target chat style of the artificial intelligence is determined according to the scene information and the statement set characteristics of the statement set.

[0086] In some embodiments, the target chat style of the artificial intelligence is determined according to the analysis result of the statement set and the topic information in the scene information of the target channel. Specifically, the positive topic is determined according to the topic information, and the positive statement corresponding to the positive topic is obtained. The chat style obtained by analyzing the positive statement is taken as the target chat style of the artificial intelligence. The positive statement is a statement in which the positive statement corresponds to the keyword. The statement that quotes or replies to the positive statement is also a positive statement.

[0087] In some embodiments, according to the interaction between each statement in the statement set, such as the statement whose answering times and quoting times exceed a set value is taken as the statement to be analyzed, and then the chat style of the statement to be analyzed is obtained by analyzing the expression style, language tone, semantic regional attribute, etc. of the statement to be analyzed, and then the chat style is taken as the target chat style suitable for the artificial intelligence. Wherein, the expression style is explained as follows: the expression style includes concise style, detailed style, 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 to be answered in detail by the dedicated customer service within 24 hours, please wait patiently ~”. Analysis method: calculate the average sentence length (word / character number); identify information redundancy (such as repeated emphasis, excessive explanation). Humorous / creative style: contains metaphors, network hot fragments (such as “this operation is simply 666”), and text of expression package. Analysis method: extract network popular language, homophonic fragments (such as “absolute absolute” and “emo”); identify rhetorical devices (such as personification and exaggeration).

[0088] 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 cheer together~". Neutral: such as "The system will be upgraded tomorrow". Negative (such as "This problem cannot be solved". Analysis method: Calculate the proportion of positive / negative words (such as "happy", "regret"); Identify modal particles (such as "ya", "ne" convey a sense of intimacy, "oh", "en" are more neutral). Formal: such as "Dear user, thank you for your feedback". Informal: such as "Dear, I'll help you solve this problem~". Analysis method: Detect the usage frequency of professional terms and honorifics (such as "Your Excellency", "Please be informed"); Observe the sentence structure (long sentences / compound sentences are more formal, short sentences / spoken expressions are more casual).

[0089] The following is an explanation of the regional attributes of semantics: Regional attributes include dialectal vocabulary and content related to festivals and solar terms. Dialectal vocabulary: such as regional custom-related expressions like "Do you understand?" and "Right?". Analysis method: Extract dialects and slang (such as the Sichuan dialect "Bashi", the Cantonese "handsome guy"); Detect content related to festivals and solar terms (such as "Happy Dragon Boat Festival", "Winter Solstice customs").

[0090] Please refer to Figure 3 , Figure 3 FIG. shows a flowchart for determining the target chat style of an artificial intelligence based on the sentence set features of a sentence set according to an embodiment of the present application. An embodiment of the present application provides step S130 for determining the target chat style of an artificial intelligence based on the sentence set features of a sentence set, including:

[0091] Step S131a, obtaining the sentence set features of the sentence set, where the sentence set features at least include one of morphological features, interaction features, topic features, rhetorical features, and emotional features;

[0092] Step S132a, determining the chat style corresponding to the sentence set according to the sentence set features, and taking the chat style corresponding to the sentence set as the target chat style.

[0093] The following is a detailed description of the above two steps.

[0094] In step S131a, the sentence set features of the sentence set are obtained. The sentence set features at least include one of morphological features, interaction features, topic features, rhetorical features, and emotional features. The morphological feature refers to the common sentence patterns in the sentence set, such as the commonly used words and sentence patterns in the sentence. The interaction feature is used to represent the situation where each sentence in the sentence set is replied to and cited. The topic feature is used to represent the characteristics of the chat style under different topics. The rhetorical feature represents the distribution of rhetorical devices used in each sentence in the sentence set, such as the proportion of sentences applying each rhetorical device. The emotional feature represents the overall emotional tendency of the sentence set.

[0095] For the syntax feature, the frequency of the appearance of the words in the sentence set can be obtained by statistics, such as high-frequency words or low-frequency words in the explicit sentence set. For the interaction feature, the determination can be made by statistics of the cases in which the sentence is cited and / or replied. For the rhetoric feature, the determination can be made by determining the rhetoric of each sentence. For the sentiment feature, the mood value of each sentence can be obtained to obtain the mood value of the entire sentence set as the sentiment feature.

[0096] In step S132a, the chat style corresponding to the sentence set is determined based on the sentence set feature, different sentence set features correspond to different chat styles, and the chat style corresponding to the sentence set is taken as the target chat style of the artificial intelligence.

[0097] In the embodiments of the present application, the target chat style of the artificial intelligence is more accurately obtained by multi-angle analysis of the sentence set, so that the target sentence issued by the artificial intelligence has the feeling of a real person speaking, and is no longer mechanical. Therefore, the activity of the game players can be more effectively increased to retain the game players.

[0098] In some embodiments, according to the content of each sentence in the sentence set, the sentence published by the user with the most interaction times is obtained as the target sentence; wherein the interaction times refer to the sum of the reply times and the citation times of the sentence issued by the game player. According to the sentence feature of the target sentence, the chat style of the target sentence is obtained, and the chat style of the target sentence is taken as the target chat style of the artificial intelligence. In the embodiments of the present application, by taking 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. Further, the technical effect of increasing the activity of the game players in the target channel is achieved.

[0099] Please refer to Figure 4 , Figure 4 A flowchart for dividing the chat style of the sentence set according to an embodiment of the present application is shown. The embodiments of the present application provide steps for dividing the chat style of the sentence set, including:

[0100] Step S201, obtaining the sentence set sample features of a plurality of first sample sentence sets, and matrixing each sample feature in each sentence set sample feature to obtain a plurality of sample feature matrices. The sample features of the sentence set include morphological sample features, interaction sample features, topic sample features, rhetoric sample features, and sentiment sample features.

[0101] Step S202, forming a cluster set by taking each sample feature matrix as a cluster, taking the two clusters closest to each other as a new cluster, and updating the cluster set.

[0102] Step S203, repeat taking the two closest clusters as a new cluster, and update the cluster set until there is only one cluster in the cluster set;

[0103] Step S204, generate a cluster tree according to the synthetic 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;

[0104] Step S205, calculate the silhouette coefficient at different heights of the cluster tree, to determine the optimal height of the cluster tree according to the silhouette coefficient at different heights of the cluster tree;

[0105] 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.

[0106] The above six steps will be described in detail below.

[0107] In step S201, a plurality of first sample sentence sets are obtained, each sample sentence set having corresponding lexical sample features, interactive sample features, topic sample features, rhetorical sample features, and emotional sample features. Each lexical sample feature, interactive sample feature, topic sample feature, rhetorical sample feature, and emotional sample feature is matrixed to obtain a plurality of sample feature matrices. That is, a plurality of lexical sample feature matrices, interactive sample feature matrices, rhetorical sample feature matrices, emotional sample feature matrices, and topic sample feature matrices are obtained.

[0108] In step S202, each sample feature matrix is taken as a cluster, that is, a plurality of clusters are obtained. All clusters form a cluster set. At this time, each cluster corresponds to a sample feature matrix, the position of each sample feature matrix is calculated as the position of the cluster, the two closest clusters are taken as a new cluster, and the two sample feature matrices corresponding to the new cluster are obtained. The position of the centroid of the two sample feature matrices is taken as the position of the new cluster, and a new cluster set is obtained, at which time the number of clusters in the cluster set is reduced by one.

[0109] It should be noted that if a cluster includes a plurality of sample feature matrices, the centroid of the plurality of sample feature matrices is calculated as the position of the cluster.

[0110] In step S203, the two closest clusters are repeatedly taken as a new cluster, and the cluster set is updated each time the two clusters are taken as a new cluster, until there is only one cluster in the cluster set, and the integration of all clusters is completed.

[0111] In step S204, a cluster tree is generated according to the history records of all the clusters. The bottom of the cluster tree corresponds to the clusters of the sample feature matrices respectively. The top of the cluster tree corresponds to a cluster of all the sample feature matrices. The height of the cluster tree represents the minimum distance between the clusters when a new cluster is formed. For example, if the heights of the cluster tree from small to large are a, b and c, it means that the distances between the two clusters when a new cluster is formed are a, b and c respectively. That is, the minimum distance between the clusters when two clusters are taken as a new cluster for the first time is a. The minimum distance between the clusters when two clusters are taken as a new cluster for the second time is b. The minimum distance between the clusters when two clusters are taken as a new cluster for the third time is c.

[0112] It should be noted that the cluster set can form a new cluster N times in some embodiments, where N is a positive integer. The above embodiments do not limit the height of the cluster number and the number of times of updating the cluster set.

[0113] In step S205, as the cluster tree increases, the nodes (clusters) of the cluster tree also become fewer and fewer. For example, in the embodiment of step S204, the cluster tree is updated for a total of 3 times. The original number is the number of sample feature matrices. The number of clusters in the cluster set is x after the first update of the cluster set. The number of clusters in the cluster set is y after the second update of the cluster set. The number of clusters is y after the third update of the cluster set. If x chat styles are to be extracted, x clusters are directly taken as sample clusters, and each sample cluster corresponds to a chat style. The sample cluster corresponding to the feature of the sentence set in the target channel is taken as a target cluster, and the chat style of the target cluster is taken as the target chat style of the artificial intelligence.

[0114] In some embodiments, the silhouette coefficients at different heights of the cluster tree are calculated to determine the optimal height of the cluster tree according to the silhouette coefficients at different heights of the cluster tree. The clusters at the optimal height are taken as sample clusters. For example, the optimal height of the cluster tree is m, which is greater than or equal to b and less than c. The y clusters obtained after the second update are taken as sample clusters, and each sample cluster corresponds to a chat style.

[0115] The optimal height can make the boundaries of each cluster clearer, and thus make the classification of each chat style clearer and make the target chat style of the artificial intelligence more accurate.

[0116] In some embodiments, the height of each synthesis in the cluster tree is taken as an initial height, the height difference between adjacent initial heights is calculated, the adjacent initial heights with the largest height difference are taken as initial optimal heights, and the larger initial optimal height is taken as the optimal height.

[0117] In step S206, the clusters retained at the optimal height of the cluster tree are taken as sample clusters, each sample cluster corresponding to a chat style, and each chat style corresponding to a sample feature matrix. Then, the sample feature matrix to which the sentence set feature of the target channel conforms can be taken as a target sample feature matrix, the sample cluster corresponding to the target sample feature matrix can be taken as a target cluster, and the chat style corresponding to the target cluster can be taken as the target chat style of the artificial intelligence.

[0118] In some embodiments, after the clusters retained at the optimal height of the cluster tree are taken as sample clusters, the method further includes:

[0119] First, the position of each sample cluster is obtained; then, at least one second sample sentence set is obtained, and the sample feature matrix of the second sample sentence set is obtained, the sample feature matrix of each second sample sentence set is added to the nearest cluster, and the position of the sample cluster is recalculated; the second sample sentence set is repeatedly obtained to update the position of the sample cluster until the fluctuation of the position of the sample cluster is less than a fluctuation threshold or the number of updates is greater than a preset number. This makes the position of the sample cluster more accurate, and thus the division of the chat style is more clear, thereby providing an accurate reference for the target chat style of the artificial intelligence.

[0120] Please refer to Figure 5 , Figure 5 A flowchart for determining the target chat style of the artificial intelligence according to the sentence set feature of the sentence set is shown according to an embodiment of the present application. The embodiment of the present application provides a step S130 for determining the target chat style of the artificial intelligence according to the sentence set feature of the sentence set, which includes:

[0121] In step S131b, each feature in the sentence set feature is matrixed to obtain a plurality of feature matrices.

[0122] In step S132b, the sample cluster nearest to the feature matrix is taken as a target cluster, and the chat style corresponding to the target cluster is taken as the target chat style.

[0123] The above two steps are described in detail below.

[0124] In step S131b, each feature in the sentence set feature is matrixed to obtain a plurality of feature matrices.

[0125] In step S132b, according to the position of each feature matrix, the sample cluster to which the feature matrix belongs is determined as a target cluster, and the chat style corresponding to the target cluster is taken as the chat style corresponding to the sentence set.

[0126] In some embodiments, the distance between each feature matrix and each sample cluster is obtained, and the sum of the distances between all feature matrices and a sample cluster is taken as an initial distance, and each sample cluster corresponds to an initial distance. The sample cluster corresponding to the minimum initial distance is taken as the target cluster.

[0127] In some embodiments, the centroid of all feature matrices is obtained as the target position. The sample cluster closest to the target position is taken as the target cluster.

[0128] In step S140, the artificial intelligence outputs the target sentence according to the scene vector and the target chat style.

[0129] In some embodiments, the artificial intelligence speaks on positive topics based on the set scene information such as the speaking environment and the target chat style, so that the obtained target sentence is more suitable for the type of chat channel and the topic discussed by the game players, thereby increasing the player activity to retain the game players.

[0130] Please refer to Figure 6 , Figure 6 A flowchart showing the artificial intelligence outputting a target sentence according to scene information and a target chat style according to an embodiment of the present application. The embodiment of the present application provides a step 140 of the artificial intelligence outputting a target sentence according to scene information and a target chat style, which includes:

[0131] Step S141, generating a sentence construction prompt word according to the scene information and the target chat style of the artificial intelligence, the sentence construction prompt word being used to prompt the chat style, environmental information, and topic information when the artificial intelligence outputs the target sentence.

[0132] Step S142, the artificial intelligence generating a target sentence according to the sentence construction prompt word.

[0133] The above two steps are described in detail below.

[0134] In step S141, a text construction prompt word is generated according to the scene information and the target chat style of the artificial intelligence, and the text construction prompt word is used to prompt the chat style, environmental information, and topic information when the artificial intelligence outputs the target sentence. For example, generate a sentence in what environment (number of online users, activity, channel type), on what topic, and in what chat style.

[0135] In step S142, the artificial intelligence generates a target sentence according to the text construction prompt word. In some life instances, the artificial intelligence accesses a big data model, inputs the sentence construction prompt word into the big data model, and directly generates the target sentence.

[0136] Please refer to Figure 7 , Figure 7A flowchart of adjusting the speaking frequency of the artificial intelligence is shown according to an embodiment of the present application. The embodiment of the present application provides steps of adjusting the speaking frequency of the artificial intelligence, including:

[0137] Step S301, calculating the activity of the target channel according to the number of online users and the speaking frequency of the target channel;

[0138] Step S302, determining the speaking frequency of the artificial intelligence according to the activity of the target channel.

[0139] The above two steps are described in detail below.

[0140] In step S301, the activity of the chat channel is calculated according to the number of online users and the speaking frequency of the chat channel. The activity refers to the percentage of active players among all online users. The active player refers to a game player who sends a number of statements in the current chat channel and the number is greater than the number threshold in a third set time period, that is, the game player whose speaking frequency is greater than the frequency threshold.

[0141] In step S302, the speaking frequency of the artificial intelligence is determined according to the activity of the chat channel. This avoids the artificial intelligence from frequently sending target statements when the activity of the target channel is high, which causes the game players to be bored. It also avoids the artificial intelligence from sending less target statements when the activity of the target channel is low, which causes the game players to have a poor experience.

[0142] Please refer to Figure 8 , Figure 8 A flowchart of automatically correcting the speaking of the artificial intelligence according to the feedback of the target statement is shown according to an embodiment of the present application. The embodiment of the present application provides steps of automatically correcting the speaking of the artificial intelligence according to the feedback of the target statement, including:

[0143] 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;

[0144] Step S402, correcting the artificial intelligence according to the negative statement.

[0145] The above two steps are described in detail below.

[0146] In step S401, the response degree of the statement sent by the artificial intelligence is obtained, each target statement is scored, and the target statement with a score less than a set score is taken as a negative statement. For example, the number of references and the number of replies of each target statement in a set period are calculated as the number of responses, and the ratio of the number of responses to the number of all statements is taken as the response degree. According to the response degree score, the score of the target statement is obtained, such as taking the response degree as the score directly.

[0147] In step S402, the artificial intelligence is corrected according to the negative statement. For example, the topic feature, the syntax feature, the rhetoric feature, and the negative feature of the negative statement are obtained to prevent the artificial intelligence from having the target statement with the negative feature. This greatly improves the intelligence level of the artificial intelligence and improves the experience of the user,

[0148] In some embodiments, the time at which the statement set is obtained is taken as the current time, and activity information suitable for the target channel is obtained at the current time, so as to send the activity information to the target channel and provide a discussion topic for the game players. In this way, the activity level of the game players is increased. The activity information suitable for the target channel refers to determining, according to the channel type of the target channel, an activity related to the channel type as the activity information suitable for the target channel. In addition, the activity information suitable for all channel types is taken as the activity information suitable for the target channel.

[0149] In some embodiments, a type label is set for the activity when the activity is established. According to the obtained type label, the channel type suitable for the activity can be determined. If there is no type label, it means that the activity is suitable for all types of channels.

[0150] In some embodiments, the activity information suitable for the target channel at the current time is obtained, and the artificial intelligence generates a target statement of the activity information in the target chat style, so as to send the activity information to the target channel and provide a discussion topic for the game players. In this way, the activity level of the game players is increased.

[0151] In some embodiments, if the target statement is not generated after the set time length of the statement set is generated, the generation of the target statement is stopped, the statement set is re-obtained, and the target statement is re-generated.

[0152] In some embodiments, when the artificial intelligence fails, a preset template is used as the target statement.

[0153] Figure 9 A structural block diagram of a computer system for implementing the chat method based on artificial intelligence according to an embodiment of the present application is shown.

[0154] It should be noted that, Figure 9 The computer system 800 shown is only an example, and should not bring any limitation to the functions and use range of the embodiments of the present application.

[0155] As Figure 9As shown, the computer system 800 includes a central processing unit 801 (CPU), which can execute the various application programs and / or the operating system in accordance with stored program code. The computer system 800 also includes a read only memory (ROM) 802, which can store the program code required by the CPU 801 to operate the computer system 800. The computer system 800 further includes a random access memory (RAM) 803, which is used to store the program code that is being executed and / or data required for execution. The CPU 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0156] Connected to the I / O interface 805 are an input portion 806 including a keyboard, a mouse, etc.; an output portion 807 including a display such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 808 including a hard disk, etc.; and a communication portion 809 including a network interface card such as a local area network card, a modem, etc. The communication portion 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as necessary. A removable media 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is attached to the drive 810 as necessary, so that a computer program read out therefrom is installed in the storage portion 808 as necessary.

[0157] In particular, according to embodiments of the present application, the processes described in the various method flowcharts can be implemented as a computer software program. For example, embodiments of the present application include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program code for executing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via the communication portion 809, and / or installed from the removable media 811. When the computer program is executed by the CPU 801, various functions defined in the systems of the present application are performed.

[0158] It should be noted that the computer-readable medium in the embodiments of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The computer-readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination thereof. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, 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 disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus or device. In this application, the computer-readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take many forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium that can transmit, propagate or transport a program for use by or in connection with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium can be transmitted or propagated using any suitable medium, including but not limited to wireless, wired, or the like, or any suitable combination thereof.

[0159] The flowcharts and block diagrams in the drawings illustrate the possible implementation architectures, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowcharts or block diagrams can represent a module, a program segment, or a portion of code that contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different orders than that shown in the figures. For example, two blocks noted in succession can actually be executed substantially concurrently, or they can sometimes be executed in reverse order, depending on the functionality involved. It should also be noted that each block in the flowcharts or block diagrams, and combinations of blocks in the flowcharts or block diagrams, can be implemented by special-purpose hardware-based systems that perform the specified functions or operations, or can be implemented by a combination of special-purpose hardware and computer instructions.

[0160] It should be noted that, although several modules or units for a device for action execution are mentioned in the above detailed description, such a division is not mandatory. Indeed, according to an embodiment of the application, the features and functionalities of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functionalities of one module or unit described above can be further divided into several modules or units embodied.

[0161] From the above description of the embodiments, those skilled in the art will readily perceive that the example embodiments described herein can be implemented by software and / or by software in combination with the necessary hardware. Thus, the technical solution 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 (which can be a CD-ROM, U disk, mobile hard disk, etc.) or network, and includes several instructions to make a computing device (which can be a personal computer, server, touch terminal, or network device, etc.) execute the method according to the embodiments of the present application.

[0162] Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. It is intended that the present application cover any and all variations of the application that come within the scope of the general inventive concepts described herein and including all such variations as fall within the scope of the following claims.

[0163] It should be understood that the application is not limited to the precise construction that has been described above and illustrated in the accompanying drawings, and that various modifications and changes can be made by those skilled in the art without departing from the scope of the application. The scope of the application should be limited only by the appended claims.

Claims

1. An artificial intelligence-based chat method, characterized by, The method comprises: acquiring a plurality of sentences in a target channel to obtain a sentence set; determining scene information of the target channel according to each sentence in the sentence set and attribute information of the target channel; acquiring sentence set sample features of a plurality of first sample sentence sets, and matrixing each sample feature in each sentence set sample feature to obtain a plurality of sample feature matrices, the sample feature of the sentence set comprising a lexical sample feature, an interaction sample feature, a topic sample feature, a rhetoric sample feature, and an emotion sample feature; forming a cluster set by taking each sample feature matrix as a cluster, taking the two clusters closest in distance as a new cluster, and updating the cluster set; repeating the taking of the two clusters closest in distance as a new cluster and the updating of 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 being a different cluster, and the height of the cluster tree being used to represent the minimum distance between the clusters when a new cluster is formed; calculating contour coefficients at different heights of the cluster tree to determine an optimal height of the cluster tree according to the contour coefficients at different heights of the cluster tree; taking the clusters in the cluster set at the optimal height of the cluster tree as sample clusters, each sample cluster corresponding to a chat style; after taking the clusters at the optimal height of the cluster tree as sample clusters, acquiring the positions of each sample cluster and acquiring at least one second sample sentence set; acquiring sample feature matrices of the second sample sentence sets to add the sample feature matrix of each second sample sentence set to the cluster closest in distance and recalculate the positions of the sample clusters; repeating the acquisition of the second sample sentence sets to update the positions of the sample clusters until the fluctuation of the positions of the sample clusters is less than a fluctuation threshold or the number of updates is greater than a preset value; matrixing each feature in the sentence set features to obtain a plurality of feature matrices, acquiring the distances between each feature matrix and each sample cluster, taking the sum of the distances between all feature matrices and a sample cluster as an initial distance, each sample cluster corresponding to an initial distance, taking the sample cluster corresponding to the smallest initial distance as a target cluster, and taking the chat style corresponding to the target cluster as a target chat style; the artificial intelligence outputs a target sentence according to the scene information and the target chat style.

2. The method of claim 1, wherein, The determination of the scene information of the target channel according to each sentence in the sentence set and the attribute information of the target channel comprises: acquiring an activity vector, an online number vector, and a type vector of the target channel; acquiring a topic vector of the sentence set according to the content of each sentence in the sentence 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 of claim 1, wherein, The output of the target sentence by the artificial intelligence according to the scene information and the target chat style comprises: generating a sentence construction prompt word according to the scene information and the target chat style of the artificial intelligence, the sentence construction prompt word being used to prompt the chat style, environmental information, and topic information when the artificial intelligence outputs the target sentence. The artificial intelligence constructs a target sentence according to the prompt word of the sentence.

4. The method of claim 1, wherein, The method further comprises: According to the online number and speaking frequency of the target channel, the activity of the target channel is calculated; According to the activity of the target channel, the speaking frequency of the artificial intelligence is determined.

5. The method of claim 1, wherein, After the artificial intelligence outputs the target sentence according to the scene information and the target chat style, the method further comprises: According to the response degree of the target sentence, the target sentence is scored, and the target sentence with a score less than a set score is regarded as a negative sentence; According to the negative sentence, the artificial intelligence is corrected.

6. An artificial intelligence-based chatting device comprising a memory, a processor, and a readable program stored on the memory, characterized in that, The processor executes the readable program to realize the method in any one of claims 1-5.

7. A readable storage medium, characterized by, The readable program / instructions are stored thereon, and when the readable program / instructions are executed by the processor, the method in any one of claims 1-5 is realized.

Citation Information

Patent Citations

  • 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