Training method of thinking type recognition model and bad thinking recognition method
By splicing conversation background samples with conversation samples and using attention masks for parallel processing, the initial thought type recognition model is trained, which solves the shortcomings of traditional models in poor thought recognition in multi-person and multi-round conversation scenarios, and achieves more accurate recognition and faster training speed.
Patent Information
- Application Number
- CN202510834812.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-20
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2045-06-20
AI Technical Summary
The problem with existing technologies is that they are difficult to identify and analyze bad thinking in multi-person, multi-round conversations. Especially in multi-person, multi-round conversation scenarios, traditional large language models lack the ability to deeply analyze the semantics of multi-role interactions in group conversations, and lack effective identification methods for bad thinking.
By splicing the conversation background sample with multiple conversation samples to form a group conversation sample, and using attention mask for parallel processing, the initial thought type recognition model is trained to obtain the target thought recognition model, which can identify the test probability distribution of multiple conversation samples in the thought type space, and identify bad thought types through a preset mapping function.
It achieves accurate identification of bad thinking of different individuals in multi-person and multi-round dialogue scenarios, improves training speed and recognition accuracy, optimizes the training process, and solves the shortcomings of traditional models in group decision-making.
Smart Images

Figure CN120687918A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a training method for a thinking type recognition model, a method for recognizing bad thinking, a device, equipment, medium, and program product. Background Art
[0002] With the continuous development of artificial intelligence technology, large language models have shown significant advantages in text summarization, topic extraction, machine translation and other fields with their powerful semantic analysis and knowledge reasoning capabilities. Through its efficient processing of one-way text, the efficiency of content generation and information processing has been greatly improved.
[0003] However, the limitations of large language models are becoming increasingly apparent in scenarios involving multiple people and multiple rounds of conversation. While existing large language models can assist in analyzing conversational content to a certain extent, they primarily focus on one-way text processing and lack the ability to deeply analyze the semantics of multi-role interactions in group conversations. Furthermore, these existing large language models lack a specific solution for the specialized task of identifying unhealthy thinking, making it difficult to effectively monitor and identify unhealthy thinking during group decision-making. Summary of the Invention
[0004] In view of the above problems, the present disclosure provides a training method for a thinking type recognition model, a method for recognizing bad thinking, an apparatus, a device, a medium and a program product.
[0005] According to one aspect of the present disclosure, a training method for a thinking type recognition model is provided, comprising: splicing a conversation background sample with a plurality of conversation samples to obtain a group conversation sample, wherein the plurality of conversation samples are determined based on a plurality of rounds of conversations between a plurality of objects, and each conversation sample is spliced together by an object portrait of the object and the conversation content generated by the object; inputting the group conversation sample and an attention mask into an initial thinking type recognition model, so that the initial thinking type recognition model processes the plurality of conversation samples in parallel based on dependency information of the plurality of conversation samples included in the conversation background sample and the attention mask, and obtains a test probability distribution of the plurality of conversation samples in the thinking type space; training the initial thinking type recognition model based on the plurality of test probability distributions and the label probability distribution corresponding to the plurality of test probability distributions to obtain a target thinking recognition model.
[0006] According to one aspect of the present disclosure, a method for identifying bad thoughts is provided, comprising: in response to being in the i-th round of dialogue, splicing the dialogue background determined from a database, the object portraits of multiple objects participating in the group dialogue, and the dialogue contents from the 1st round to the i-th round to obtain input data for the i-th round; inputting the input data for the i-th round into a target thought recognition model to obtain a recognition probability distribution of the conversation content for the i-th round in the thought type space; and mapping the recognition probability distribution to a thought type recognition result based on a preset mapping function, the thought type recognition result being a bad thought type or a normal thought type.
[0007] Another aspect of the present disclosure provides a training device for a thinking type recognition model, including: a splicing module for splicing a conversation background sample with multiple conversation samples to obtain a group conversation sample, wherein the multiple conversation samples are determined based on multiple rounds of conversations between multiple objects, and each conversation sample is spliced by the object portrait of the object and the conversation content generated by the object; a processing module for inputting the group conversation sample and the attention mask into the initial thinking type recognition model, so that the initial thinking type recognition model processes the multiple conversation samples in parallel based on the dependency information of the multiple conversation samples included in the conversation background sample and the attention mask, and obtains the test probability distribution of the multiple conversation samples in the thinking type space; a training module for training the initial thinking type recognition model based on the multiple test probability distributions and the label probability distribution corresponding to the multiple test probability distributions to obtain a target thinking recognition model.
[0008] Another aspect of the present disclosure provides a device for identifying bad thoughts, including: a data determination module for, in response to being in the i-th round of dialogue, splicing the dialogue background determined from the database, the object portraits of multiple objects participating in the group dialogue, and the dialogue content from the 1st round to the i-th round to obtain the input data of the i-th round; an input module for inputting the input data of the i-th round into the target thought recognition model to obtain the recognition probability distribution of the dialogue content of the i-th round in the thought type space; a mapping module for mapping the recognition probability distribution into a thought type recognition result based on a preset mapping function, and the thought type recognition result is a bad thought type or a normal thought type.
[0009] Another aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above method.
[0010] Another aspect of the present disclosure further provides a computer-readable storage medium having a computer program or instructions stored thereon, which implements the steps of the above method when the computer program or instructions are executed by a processor.
[0011] Another aspect of the present disclosure further provides a computer program product, including a computer program or instructions, which implements the steps of the above method when the computer program or instructions are executed by a processor.
[0012] According to the training method of the thinking type recognition model disclosed in the present invention, by splicing the conversation background sample and the conversation sample, the conversation sample is spliced together by the object portrait and the conversation content of the object, and the dependency information of multiple conversation samples in the attention mask is used to realize the parallel processing of multiple conversation samples by the initial thinking type recognition model. And the test probability distribution of multiple conversation samples obtained by parallel processing in the thinking type space is used to train the initial thinking type recognition model. Since each conversation sample in the conversation sample is obtained by splicing the object portrait and the conversation content, that is, each conversation content is given an object feature, the model can capture the semantics of multi-role interaction and provide support for multi-person multi-round conversation scenarios. At the same time, the training process is optimized through the parallel calculation of the attention mask, which at least partially solves the problem in the related art that large language models are difficult to effectively monitor and identify the bad thinking generated by the group in the decision-making process, and achieves the technical effect of improving the training speed while ensuring more accurate identification of bad thinking of different individuals in multi-person multi-round conversations. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0014] Figure 1 Schematically illustrates an application scenario diagram of a training method for a thinking type recognition model and a method for identifying bad thinking according to an embodiment of the present disclosure;
[0015] Figure 2 The flowchart of the training method of the thinking type recognition model according to the embodiment of the present disclosure is schematically shown;
[0016] Figure 3 Schematically shows an architecture diagram of an initial thought type recognition model according to an embodiment of the present disclosure;
[0017] Figure 4 Schematically illustrates an attention mask applied to an initial thought type recognition model according to an embodiment of the present disclosure;
[0018] Figure 5 Schematically shows an architecture diagram of an initial thought type recognition model according to another embodiment of the present disclosure;
[0019] Figure 6 Schematically illustrates an attention mask applied to an initial thought type recognition model according to another embodiment of the present disclosure;
[0020] Figure 7Schematically shows a flow chart of generating multiple conversation samples according to an embodiment of the present disclosure;
[0021] Figure 8 Schematically shows a flow chart of a method for identifying bad thinking according to an embodiment of the present disclosure;
[0022] Figure 9 The following schematically shows a structural block diagram of a training device for a thinking type recognition model according to an embodiment of the present disclosure;
[0023] Figure 10 Schematically shows a structural block diagram of an unhealthy thinking recognition device according to an embodiment of the present disclosure; and
[0024] Figure 11 The block diagram schematically shows an electronic device suitable for implementing a training method for a thinking type recognition model and a method for recognizing bad thinking according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0025] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the detailed description below, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0026] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise," "include," etc. used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0027] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0028] When expressions such as "at least one of A, B, and C, etc." are used, they should generally be interpreted in accordance with the meaning commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0029] In the technical solutions disclosed herein, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0030] In scenarios where personal information is used for automated decision-making, the methods, devices, and systems provided by the embodiments of the present disclosure all provide users with corresponding operation portals for them to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered. The expression "automated decision-making" here refers to the activity of automatically analyzing and evaluating an individual's behavioral habits, interests and hobbies, or economic, health, credit status, etc. through computer programs and making decisions. The expression "expert decision-making" here refers to the activity of making decisions by people who specialize in a certain field, have specialized experience, knowledge, and skills, and have reached a certain level of professionalism.
[0031] During the research process, we discovered that due to factors such as participants' lack of ability to propose high-quality solutions, divergent interests within and outside the meeting, and meeting time constraints, decisions are often made by the highest decision-maker or simply by the majority rule. This demonstrates unhealthy group thinking, such as dependency, rigidity, and divergent thinking. Furthermore, solutions proposed under this decision-making approach are often based on partial information, resulting in a high risk of decision failure.
[0032] With the continuous development of artificial intelligence technology, especially large language model technology, natural language processing technology has made significant progress in text processing. However, traditional natural language processing technology mainly focuses on areas such as text summarization, topic extraction, and machine translation, and lacks semantic analysis of group conversations, especially technology for identifying unhealthy thoughts. In addition, while classic large language model technology can assist in understanding and analyzing meeting content to a certain extent, it cannot natively support the perception of each individual in a group conversation. The meeting content must be relayed to the model through the user role. Moreover, there is a lack of effective methods to achieve good classification accuracy for the special classification scenario of unhealthy thoughts, which has an extremely uneven distribution.
[0033] In view of this, an embodiment of the present disclosure provides a training method for a thinking type recognition model, comprising: splicing a conversation background sample with multiple conversation samples to obtain a group conversation sample, wherein the multiple conversation samples are determined based on multiple rounds of conversations between multiple objects, and each conversation sample is spliced by an object portrait of the object and the conversation content generated by the object; inputting the group conversation sample and the attention mask into an initial thinking type recognition model, so that the initial thinking type recognition model processes the multiple conversation samples in parallel based on the dependency information of the multiple conversation samples included in the conversation background sample and the attention mask, and obtains a test probability distribution of the multiple conversation samples in the thinking type space; training the initial thinking type recognition model based on the multiple test probability distributions and the label probability distribution corresponding to the multiple test probability distributions to obtain a target thinking recognition model.
[0034] Figure 1 The following schematically illustrates an application scenario diagram of a training method for a thinking type recognition model and a method for identifying bad thinking according to an embodiment of the present disclosure.
[0035] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links or optical fiber cables.
[0036] A user may use a first terminal device 101, a second terminal device 102, or a third terminal device 103 to interact with a server 105 via a network 104 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, or the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (for example only).
[0037] The first terminal device 101 , the second terminal device 102 , and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0038] The server 105 may be a server that provides various services, such as a background management server (for example only) that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process received data such as user requests, and feed back processing results (e.g., web pages, information, or data obtained or generated based on user requests) to the terminal devices.
[0039] It should be noted that the training method of the thinking type recognition model and the bad thinking recognition method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the training device of the thinking type recognition model and the bad thinking recognition device provided in the embodiment of the present disclosure can generally be set in the server 105. The training method of the thinking type recognition model and the bad thinking recognition method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the training device of the thinking type recognition model and the bad thinking recognition device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.
[0040] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.
[0041] The following will be based on Figure 1 The scene described by Figures 2 to 8 The training method of the thinking type recognition model and the method for identifying bad thinking in the disclosed embodiment are described in detail.
[0042] Figure 2 The flowchart of the training method of the thinking type recognition model according to the embodiment of the present disclosure is schematically shown.
[0043] like Figure 2 As shown, the method includes operations S210 to S230.
[0044] In operation S210, the conversation background sample is spliced with multiple conversation samples to obtain a group conversation sample, wherein the multiple conversation samples are determined based on multiple rounds of conversations between multiple objects, and each conversation sample is spliced by an object portrait of the object and the conversation content generated by the object.
[0045] In operation S220, the group conversation samples and the attention mask are input into the initial thinking type recognition model, so that the initial thinking type recognition model processes the multiple conversation samples in parallel based on the dependency information of the multiple conversation samples included in the conversation background sample and the attention mask, and obtains the test probability distribution of the multiple conversation samples in the thinking type space.
[0046] In operation S230 , the initial thought type recognition model is trained based on the multiple test probability distributions and the label probability distributions corresponding to the multiple test probability distributions to obtain a target thought recognition model.
[0047] A multi-round conversation between multiple subjects may correspond to a multi-person multi-round conversation scenario or a group conversation scenario, such as a multi-person discussion scenario or a multi-person meeting scenario. The conversation context sample may include information such as the background and goal of the group conversation.
[0048] The subjects can be people participating in a seminar or meeting, and the dialogue can be the subject's speech during the seminar or meeting. The dialogue content is the content of the dialogue.
[0049] Each conversation sample includes the conversation content of any object in a round of conversation and the object portrait of the object.
[0050] The subject profile can include one or more of: basic information, personality traits, professional background, hobbies, and social network. Basic information can include name, age, gender, contact information, etc.; personality traits can include extroversion, introversion, optimism, etc.; professional background can include industry, position, work experience, etc.; hobbies can include reading, sports, travel preferences, etc.; social network can include commonly used social platforms, interpersonal circles, etc. Knowledge and skills
[0051] In some embodiments, a social network may also include relationships between multiple objects. For example, if objects A and B have a teacher-student relationship, this relationship can help the model more accurately understand the logic of the conversation. For example, by clarifying the relationship between the two parties, such as superiors and subordinates, or friends, it can determine the power structure and emotional tendencies in the speech, thereby better determining whether the current conversation content embodies unhealthy thinking.
[0052] The subject's profile can be actively filled in by the subject in the thought type recognition system, or it can be extracted from publicly available online information after obtaining basic information such as the subject's name. For example, it can be obtained from platforms such as Wikipedia. The thought type recognition system can include a thought type recognition model.
[0053] The conversation background sample may be spliced before the multiple conversation samples, and in some embodiments, the multiple conversation samples may be spliced according to the order in which they were generated, or according to a preset arrangement order.
[0054] The initial thought type recognition model can be a pre-trained language model, such as a pre-trained Large Language Model (LLM). System prompts for thought type recognition and attention masking can be set in the initial thought type recognition model, so that the initial thought type recognition model can use and process the input group conversation samples and attention masks based on the system prompts.
[0055] The attention mask may include dependency information of each dialogue sample when the initial thought type recognition model processes each dialogue sample, such as position information or index information of dependent dialogue samples that have a dependency relationship with each dialogue sample.
[0056] When processing each conversation sample, the initial thought type recognition model can use the dependency information of each conversation sample, included in the attention mask, to achieve parallel processing of multiple conversation samples. This improves the processing speed of the initial thought type recognition model when processing multiple conversation samples, and thus increases the training speed of the initial thought type recognition model. Furthermore, the model's use of the attention mask to obtain dependency information improves the accuracy of dependency information acquisition, thereby improving processing accuracy.
[0057] The label probability distribution may correspond to the conversation sample one by one. In some embodiments, each conversation sample may form a sample group with the label probability distribution, such as:<speaker:utterance,label> ,...], speaker can be the subject's portrait, utterance can be the conversation content, speaker:utterance is a conversation sample, and label is the label probability distribution corresponding to the conversation sample. By concatenating the subject's subject portrait and the conversation content generated by the subject to generate a conversation sample, and inputting this conversation sample into the initial thought type recognition model, the initial thought type recognition model can recognize the conversation content of multiple characters, that is, multiple objects, resolving the problem that related technologies can only process single characters.
[0058] According to the training method of the thinking type recognition model disclosed in the present invention, by splicing the conversation background sample and the conversation sample, the conversation sample is spliced together by the object portrait and the conversation content of the object, and the dependency information of multiple conversation samples in the attention mask is used to realize the parallel processing of multiple conversation samples by the initial thinking type recognition model. And the test probability distribution of multiple conversation samples obtained by parallel processing in the thinking type space is used to train the initial thinking type recognition model. Since each conversation sample in the conversation sample is obtained by splicing the object portrait and the conversation content, that is, each conversation content is given an object feature, the model can capture the semantics of multi-role interaction and provide support for multi-person multi-round conversation scenarios. At the same time, the training process is optimized through the parallel calculation of the attention mask, which at least partially solves the problem in the related art that large language models are difficult to effectively monitor and identify the bad thinking generated by the group in the decision-making process, and achieves the technical effect of improving the training speed while ensuring more accurate identification of bad thinking of different individuals in multi-person multi-round conversations.
[0059] According to an embodiment of the present disclosure, the attention mask is obtained in the following manner.
[0060] For each dialogue sample, the dialogue sample is segmented to obtain multiple sample words; based on the position information of the multiple sample words included in the multiple dialogue samples and the generation order of the multiple dialogue samples in multiple rounds of dialogue, an attention mask is obtained.
[0061] A preset word segmenter can be used to segment each conversation sample to obtain multiple sample words. Position information within the conversation sample is assigned to each sample word to obtain position indexes of multiple samples.
[0062] Based on the position information of sample words within a conversation sample, i.e., the word order relationship, and the order in which multiple conversation samples were generated, the dependency relationships between conversation samples and sample words are determined: for example, later conversations can depend on earlier ones, and later sample words within the same conversation sample can depend on earlier ones. Attention masks are then generated based on these dependencies.
[0063] According to the embodiments of the present disclosure, an attention mask is constructed based on the word segmentation and position information of conversation samples. The conversation samples are segmented into sample words and assigned position indexes. The dependency rules between conversation samples and sample words are determined by combining the word order relationship with the order of conversation generation. Attention masks are generated based on these rules. This effectively models the temporal dependencies and semantic associations in multi-round conversations, preventing the model from incorrectly associating unrelated conversation content. Furthermore, the structured attention mask facilitates parallel computation of the initial thought type recognition model.
[0064] According to an embodiment of the present disclosure, the dependency information includes position information of dependent dialogue samples that have a dependency relationship with the dialogue samples; based on the position information of multiple sample words included in each of the multiple dialogue samples and the order in which the multiple dialogue samples are generated in multiple rounds of dialogue, an attention mask is obtained, which may include the following operations.
[0065] For each dialogue sample, based on the position information of multiple sample words in the dialogue sample, the sample word at the target position is marked to obtain a marked word; based on the generation order of multiple dialogue samples in multiple rounds of dialogue, the first dialogue sample in the multiple dialogue samples whose generation order is after the marked word is determined; the position information corresponding to each of the multiple sample words included in the first dialogue sample is masked to obtain a mask processing result for the dialogue sample, wherein the second dialogue sample in the multiple dialogue samples whose generation order is before the marked word of the dialogue sample is a dependent dialogue sample of the dialogue sample; based on the mask processing results of the multiple dialogue samples, an attention mask is obtained.
[0066] Multiple conversation samples can be spliced together in the order they were generated to obtain a spliced sample. The position information of a dependent conversation sample having a dependency relationship with the conversation sample may include the position information of multiple sample words of the dependent conversation sample. For example, if dependent conversation sample a is the sixth conversation sample in the spliced sample and includes sample word 1 and sample word 2, the position information of dependent conversation sample a may include (6, 1) and (6, 2).
[0067] For each dialogue sample, based on the position information of the sample words in the dialogue sample, the sample words at a pre-set target position, such as the end of a sentence or a specific position, are marked to obtain a marked word.
[0068] A spliced sample can be obtained and mapped from a sample sequence to a position information sequence. Thus, for each dialogue sample, in the process of obtaining the mask processing result, the position information corresponding to the first dialogue sample located after the marker word in the position information sequence can be masked, so that the second dialogue sample located before the marker word and the dialogue sample itself are the data that the initial thinking type recognition model needs to rely on when processing the dialogue sample.
[0069] In some embodiments, the first conversation sample located after the marker word in the spliced sample may be determined based on the generation order of the multiple conversation samples, and the position information corresponding to the first conversation sample may be masked to obtain a masking result.
[0070] The first conversation sample is the sample after the marked word, that is, the conversation sample including the marked word has no dependency on the first conversation sample. Masking can be performed by assigning a value of 0 or -∞ to generate a structured attention mask. The position information that is not masked can be assigned a value of 1.
[0071] The mask processing results of all dialogue samples can be summarized and integrated into a unified matrix form, so as to finally obtain the attention mask used for model calculation. This mask clearly defines the attention and shielding relationship between sample words in each dialogue sample.
[0072] According to an embodiment of the present disclosure, the sample word at the last position in each dialogue sample is set as the sample word at the target position, and is marked and an attention mask is generated for model training. The initial thinking type recognition model can be guided to calculate the probability distribution in the thinking type space only for the last word segmentation, i.e., token, of each input data during the training process. This method not only avoids redundant calculations of irrelevant tokens and significantly improves the computational efficiency of the model in long text dialogue scenarios, but also forces the model to focus on the words that carry key semantics at the end of the dialogue, accurately captures instant thinking changes, and optimizes the temporal logic understanding of multiple rounds of dialogue in combination with the order of dialogue generation. Ultimately, the trained target thinking recognition model can achieve efficient allocation of computing resources while maintaining the ability to understand the context, thereby improving the real-time and accuracy of thinking type recognition.
[0073] According to an embodiment of the present disclosure, by marking sample words at specific locations and locating the first dialogue sample without dependencies based on the order in which the dialogue samples are generated and masking its corresponding position information, a structured mask matrix reflecting the logical dependencies of the dialogue is constructed. This enables the model that obtains the attention mask to accurately capture the temporal correlation and semantic dependencies between samples in multiple rounds of dialogue, and to mask the flow of irrelevant information, thereby improving the model's ability to understand the dialogue context. It is also more suitable for identifying thinking types in group dialogue scenarios, enabling the model to focus more on effective dependency paths and reduce redundant calculations. At the same time, it provides dependency information support for parallel processing, enhancing processing accuracy and reasoning efficiency.
[0074] According to an embodiment of the present disclosure, the initial thought type recognition model processes multiple conversation samples in parallel based on the dependency information of multiple conversation samples included in the conversation background sample and the attention mask to obtain the test probability distribution of the multiple conversation samples in the thought type space, which may include the following operations.
[0075] For each dialogue sample, based on the position information of the dependent dialogue samples that have a dependency relationship with the dialogue sample included in the dependency information, the dependent dialogue sample of the dialogue sample is determined from multiple dialogue samples; based on the dialogue background sample and the dependent dialogue sample, the test probability distribution of the sample word at the target position in the thinking type space is calculated to obtain the test probability distribution of the dialogue sample in the thinking type space.
[0076] The initial thought type recognition model can be based on the conversation background sample, dependent conversation samples, and previous sample words that precede the target position in the conversation sample. Specifically, the initial thought type recognition model performs semantic analysis on the sample word at the target position in the current conversation sample, combining the contextual information provided by the dependent conversation samples, conversation background samples, and previous sample words. In the thought type space, it calculates the test probability values of the sample word at the target position belonging to different thought types and calculates the test probability distribution.
[0077] The test probability distribution of the sample word at the target position in the thought type space can be used as the test probability distribution of the entire conversation sample in the thought type space.
[0078] According to the embodiments of the present disclosure, by relying on the location information of conversation samples to accurately locate related samples and combining them with conversation context samples, the probability distribution of thought type space is calculated by focusing on sample words at the target location. This dynamically acquires contextual information through dependency relationships, enabling the model to deeply capture the semantic connections and logical context of conversations and achieve parallel computation of conversation samples.
[0079] Figure 3 The following schematically shows an architecture diagram of an initial thought type recognition model according to an embodiment of the present disclosure.
[0080] like Figure 3 As shown, the initial thought type recognition model of the embodiment of the present disclosure includes a tokenizer, multiple decoder layers, and a linear classifier. The decoder layer includes multiple normalization layers, a self-attention mechanism, and a feed-forward neural network (FFN).
[0081] In a multi-person conference scenario, group conversation samples can be conference sequences, consisting of a foreground conversation background sample and concatenated conversation samples in the order they were generated. This is accomplished by inputting the conference sequence into a tokenizer for tokenization and performing vector mapping to generate a vector sequence. This vector sequence and attention mask are then input into the first decoder layer of multiple decoder layers for feature extraction. The first decoder layer outputs conversation features corresponding to each conversation sample, which are then fed into the next decoder layer for layer-by-layer feature extraction. This yields the target conversation features for each conversation sample after multi-level feature extraction.
[0082] By inputting the target conversation features of each conversation sample into a linear classifier, the output layer of the linear classifier, which originally had a hidden_state dimension * vocabulary dimension, is modified to a hidden_state dimension * thought type dimension. This allows the target conversation features to be converted into a test probability distribution in the thought type space. The thought type dimension is typically the number of undesirable thought types + 1.
[0083] The test probability distribution of the i-th conversation sample in the thought type space is the thought type distribution at the i-th classification point. This can be combined with the label probability distribution corresponding to the test probability distribution of the i-th conversation sample in the label list to obtain the focal loss and perform gradient backpropagation. The database can store label lists and meeting records, and the meeting sequence can be obtained from the meeting records.
[0084] In some embodiments, the identifier of the object in each round, such as name, can be filled in the corpus, such as the position of system, user, and assistant.
[0085] Figure 4 The attention mask of the architecture diagram applied to the initial thought type recognition model according to an embodiment of the present disclosure is schematically shown.
[0086] like Figure 4 As shown, each cell in each column of the attention mask can correspond to a sample word, with cells of different colors corresponding to different conversation samples, and each cell can correspond to different positional information. This attention mask enables the initial thought type recognition model to know when to use dependent conversation samples from previous sequences when processing subsequent conversation samples, facilitating parallel processing rather than relying on a fixed sequential order for serial processing.
[0087] Since the sample words at the end of each dialogue sample are marked with the end marker EOS token, the attention mask can be generated through the marker, and the test probability distribution and loss calculation are only performed on the marked positions during the forward reasoning of the model.
[0088] In some embodiments, <s>Can represent the beginning, <c>Representing sample words in conversation samples, <e>The representation ends. Similarly, <s>、 <c> 、 <e>You can also continue to represent different contents as needed.
[0089] Figure 5 The following schematically shows an architecture diagram of an initial thought type recognition model according to another embodiment of the present disclosure.
[0090] like Figure 5 As shown, the initial thought type recognition model of another embodiment includes an embedding layer (Embeddings), multiple decoder layers (N×Decoder Layer), a root mean square layer normalization (RMSNorm) layer, and a linear classifier layer (LM Head). Each of the multiple decoder layers includes an RMSNorm, a self-attention mechanism (Self Attention), and FFN.
[0091] The group conversation samples can be the Input IDs in the figure. The Output Logits are the test probability distribution of the conversation samples in the thought type space.
[0092] In the QKV→RoPE→SDPA model, QKV represents: Query (query vector), Key (key vector), and Value (value vector). These are the three key matrices in the self-attention mechanism. They calculate the attention weights between positions in the input sequence through matrix operations. RoPE stands for Rotary Position Embedding. It introduces position information into the self-attention mechanism, enabling the model to perceive the positional order of elements in the input sequence and addressing the ineffectiveness of conventional position encoding for long sequences. SDPA stands for Scaled Dot-Product Attention. It calculates attention weights based on the Q, K, and V matrices, enabling efficient attention calculation.
[0093] Gate×Up→Down: usually involves a gating mechanism Gate, as well as upsampling Up and downsampling Down operations.
[0094] Figure 6 The figure schematically shows an attention mask applied to an initial thought type recognition model according to another embodiment of the present disclosure.
[0095] like Figure 6 As shown, the attention mask applied to the initial thought type recognition model in another embodiment of the present disclosure can be calculated for each sample word. When the model processes each sample word, it depends on the previous sample word. Thus, each sample word generates a test probability distribution.
[0096] According to an embodiment of the present disclosure, the conversation content is generated by a conversation generation agent loaded with an object portrait; the conversation generation agent is used to simulate the object; and a plurality of conversation samples are obtained in the following manner.
[0097] In response to the i-th round of dialogue, multiple dialogue generation agents obtain historical dialogue content before the i-th round from the group dialogue topic, and generate thinking information and dialogue content to be sent based on the historical dialogue content and the bad thinking generation instruction generated according to the preset probability, wherein, when i=1, the historical dialogue content is the dialogue background sample or the dialogue content generated by any of the objects for the dialogue background sample in the actual group dialogue scenario; in response to the target dialogue generation agent among the multiple dialogue generation agents receiving the permission to send instruction sent by the chairman agent, the target dialogue generation agent sends the dialogue content to be sent to the group dialogue topic to obtain the dialogue content to be verified, wherein the target dialogue generation agent is determined by the chairman agent based on the thinking information of each of the multiple dialogue generation agents; when the verification agent obtains the dialogue content to be verified from the group dialogue topic and determines that the verification result of the dialogue content to be verified is verification passed, the multiple dialogue generation agents use the dialogue content to be verified as the dialogue content of the i-th round; the object portrait loaded by the target dialogue generation agent and the dialogue content of the i-th round are spliced to obtain the dialogue sample of the i-th round.
[0098] The historical conversation content may include the conversation content from round 1 to round i-1.
[0099] The multiple conversation samples can be obtained by expanding conversation samples from actual group conversation scenarios using multiple agents. For example, n rounds of actual conversations from an actual group conversation scenario can be used as historical conversation content, and multiple agents can use this historical content to generate subsequent conversation samples. Alternatively, the multiple agents can be generated by conducting conversations based on conversation background samples. i can be a positive integer greater than or equal to 1.
[0100] The multiple agents may include a chairperson agent, multiple dialogue generation agents, a verification agent, etc. In some embodiments, such as a simulated jury scenario, a jury initiation agent, a jury voting agent, a jury termination agent, etc. may also be included.
[0101] After multiple agents are activated, they can subscribe to the GroupChattopic, a group conversation topic for open communication between agents, and the Permission topic, a permission topic for publishing speech permissions. Multiple conversation-generating agents can load object profiles and object memories. Object memories can include various types of knowledge and skills of the subject. For example, if the subject is a programmer, the object memory includes programming common sense; for example, if the subject is a subway driver, the object memory includes information such as the speed and length of the subway.
[0102] An intelligent agent is a collaborative entity composed of program code and a large inference model. The program code implements the agent's logical control, task scheduling, information exchange, and other functions; the large inference model provides core semantic understanding and content generation capabilities. After receiving instructions and data from the program code, it uses deep learning algorithms to output text content that meets the requirements. The large inference model can be a pre-trained or fine-tuned large language model.
[0103] The probability of generating random bad thoughts can be initialized for each of the multiple dialogue-generating agents, so that the multiple dialogue-generating agents have the ability to randomly generate dialogue content that is bad. It is also possible to manually generate bad thought generation instructions to make the dialogue-generating agents generate dialogue content that is bad.
[0104] The chair agent can plan the conversation agenda based on the conversation context sample. If the group conversation scenario is a meeting, the conversation context sample is the meeting background, including the meeting introduction, meeting objectives, and other information. The chair agent can also subscribe to the SpeakApply topic for other agents to express their willingness to speak. The chair agent can publish the conversation context sample to the GroupChat topic.
[0105] Each conversation-generating agent subscribed to the GroupChat topic combines conversation background samples, historical conversation content prior to the i-th round, and probabilistically generated instructions for undesirable thoughts into prompts. These are then fed into the inference model using a callable search tool, such as RAG mcp workshop. The inference model then independently chooses whether to invoke the search tool. The search tool receives the object profile and object memory loaded by the conversation-generating agent and then searches the database for preset operation information or preset conversation content that matches the object settings. This information is then returned to the inference language model, helping it optimize its thinking and the conversation content to be sent.
[0106] After the dialogue generation agent generates thinking information and dialogue content to be sent, it will temporarily store the generated thinking information and dialogue content to be sent in its own storage space, and publish the thinking information to the SpeakApply topic.
[0107] The chair agent obtains thinking information from the SpeakApply topic, waits to collect thinking information from all dialogue generation agents in the current round, adds the entire dialogue content sequence and thinking information to the input, calls the inference model inside the chair agent to determine who has the highest willingness to speak, and then publishes the identifier of the target dialogue generation agent with the highest willingness to speak to the Permission topic, or sends a permission to send instruction to the target dialogue generation agent.
[0108] Each conversation-generating agent obtains the ID of the conversation-generating agent with the highest willingness to speak from the Permission topic and verifies it is its own ID. It then updates its internal state, which consists of organizing and summarizing its past thoughts. If allowed to speak, it publishes the conversation content to be sent to the GroupChat topic. The above steps of generating thoughts and conversation content to be sent, as well as the following steps, repeat. Iterations cease until one of the following occurs: the chair agent determines that the expected conversation goal has been completed, the preset maximum number of discussion rounds has been reached, the input data from any agent exceeds the maximum text length that can be processed by the large model, or a manual stop command is issued.
[0109] In some embodiments, for different scenarios, object portraits and object memories may be obtained by performing file format conversion and content recognition on preset object background files, and may be stored in a database.
[0110] In the jury scenario, the generation of each dialogue content is the responsibility of the chairman agent, the dialogue generation agent, and the voting agent. The chairman agent is responsible for summarizing the case background information and initiating the discussion at the beginning of the jury discussion, observing the dialogue history during the jury discussion and choosing the appropriate time to initiate voting, and ending the jury meeting and giving the jury conclusion when all dialogue generation agents reach a consensus or reach the dialogue round limit or find that the reason for not reaching a consensus is that a few dialogue generation agents are set to rigid thinking.
[0111] According to the embodiments of the present disclosure, the automatic construction of multi-round dialogue samples is achieved by combining the bad thinking generation instructions triggered by preset probabilities, the personalized dialogue generation of dialogue generation agents driven by object portraits, and the speech decision-making mechanism based on thinking information screening. The problem of scarcity of bad thinking identification data can be at least partially solved. By dynamically injecting bad thinking instructions with preset probabilities, complex dialogue samples with annotations can be generated in batches, significantly improving the diversity and authenticity of the data set. And by using object portraits to drive dialogue generation, the role simulated by each agent has differentiated characteristics, enhancing the authenticity of the dialogue scene. Target speakers are screened based on thinking information, and the content quality is ensured through a verification mechanism to avoid invalid or low-quality dialogue interference. Finally, dialogue samples that are logically coherent, semantically rich, and fit the actual scene are generated, providing high-quality data support for the training of subsequent thinking type recognition models.
[0112] According to an embodiment of the present disclosure, the verification agent includes: an object verification agent and a speech background verification agent; the training method of the thinking type recognition model may further include the following operations.
[0113] The object verification agent verifies the degree of matching between the conversation content to be verified and the object portrait loaded by the target conversation generation agent based on the database, and obtains a first sub-verification result, wherein the database includes the object portrait and preset operation information or preset conversation content corresponding to the object portrait; the speech background verification agent verifies the degree of matching between the conversation content to be verified and the conversation background sample, and obtains a second sub-verification result; when both the first sub-verification result and the second sub-verification result are characterized as passed, the verification result of the initial conversation content is determined to be passed.
[0114] Verification agents may include: object verification agents, speech background verification agents and bad thought instruction verification agents.
[0115] After the dialogue generation agent generates the current round of dialogue content based on case background information, such as dialogue background samples and subject profiles, the role verification agent, the unhealthy thought instruction verification agent, and the case information verification agent can each verify whether the dialogue content conforms to the settings. For example, the unhealthy thought instruction verification agent can determine whether the unhealthy thought generation instruction should be triggered in the current round based on the preset unhealthy thought generation probability. If the trigger probability is hit, the generated dialogue content is verified to ensure that it contains the specified unhealthy thought pattern.
[0116] If any verification agent detects unsatisfactory dialogue content, the dialogue generation agent will modify the previously generated dialogue content until the generated dialogue content passes all verification agents. The bad thinking instruction verification agent does not require the dialogue generation agent to always generate bad thinking. Instead, it selectively displays bad thinking in certain rounds. The output of each round is also labeled with the corresponding bad thinking type. Finally, the above dialogue content and bad thinking labels are sorted, and the label probability distribution of dialogue samples corresponding to dialogue content labeled with bad thinking is calculated.
[0117] In some embodiments, labels for unhealthy thinking can be obtained by manually labeling multiple conversation samples by thought experts, or automatically labeling using a general-purpose large-scale model-based intelligent agent and then subject to expert review. Specifically, labels can be assigned to speech that exhibits unhealthy thinking patterns such as forced substitution, disconnection, language barriers, groupthink, blind application of experience, failure to distinguish between assumptions and facts, and excessive leaps in thought.
[0118] According to the embodiments of the present disclosure, a multi-dimensional collaborative verification mechanism has been constructed. This mechanism uses an object verification agent to verify the semantic matching of conversation content and subject profiles based on a database. This is combined with a speech context verification agent to verify the consistency of conversation background samples, and a probabilistic trigger-based detection of unhealthy thinking patterns by an unhealthy thinking instruction verification agent, forming a comprehensive content verification system. This ensures that the generated conversation content simultaneously meets the requirements of character consistency, context relevance, and controllable thinking patterns, thereby avoiding character behavior breakdown, better ensuring the semantic coherence of conversation content and case background information, and preventing information deviation, among other technical benefits.
[0119] Figure 7 The flowchart of generating multiple dialogue samples according to an embodiment of the present disclosure is schematically shown.
[0120] like Figure 7 As shown, when generating multiple conversation samples, multiple agents can be involved, each with different functions or roles. For example, the chairperson agent 701 is responsible for planning the conversation agenda based on the conversation background sample. Agents 702-708 can all be conversation generation agents. After each conversation generation agent is allowed to speak and sends the conversation content to the group conversation thread, the verification agent must verify the content. For example, the verification involves checking whether the content conforms to the role setting based on the personal data (i.e., conversation history data), whether it conforms to undesirable thinking instructions, and whether the reasoning based on the case background information (i.e., conversation background sample) is reasonable. If the verification fails, the pass:regenerate function is triggered, ignoring this operation and regenerating the conversation content.
[0121] According to an embodiment of the present disclosure, training an initial thinking type recognition model based on multiple test probability distributions and label probability distributions corresponding to the multiple test probability distributions to obtain a target thinking recognition model may include the following operations.
[0122] For each test probability distribution, the difficulty weight is determined based on the preset sample importance and the difference between the test probability distribution and the preset value; the initial loss value is determined based on the difficulty weight, the test probability distribution and the label probability distribution; the multiple initial loss values are subjected to group loss extraction to obtain the target loss value; the parameters of the initial thinking type recognition model are adjusted based on the target loss value to obtain the target thinking recognition model.
[0123] The preset sample importance can be determined according to the importance of the dialogue sample, the preset value can be 1, and the difficulty weight can be Different conversation samples can have different preset sample weights. A higher difficulty weight means the conversation sample is more difficult for the model to correctly classify. During training, the model will allocate more attention resources to it to optimize feature extraction and classification decision-making capabilities for such difficult samples.
[0124] The initial loss value is determined based on the difficulty weight, test probability distribution, and label probability distribution, which can be shown in the following formula (1).
[0125] ; (1)
[0126] in, is the nth test probability distribution The initial loss function is is the class weight vector, is the onthot vector of the current round label probability distribution, is the difficulty weight, is the preset sample importance, and a is the base of the logarithm.
[0127] There is no limitation on the method of extracting group loss, which can be average value calculation, group feature extraction, etc. The group loss is extracted from multiple initial loss values to obtain the target loss value, which can be shown in the following formula (2).
[0128] ; (2)
[0129] in, is the target loss function, is the number of test probability distributions.
[0130] According to the embodiments of the present disclosure, the sample difficulty weight is dynamically adjusted by combining the preset sample importance and prediction deviation, the initial loss value is constructed, and the model training target is optimized through the group loss extraction strategy. This solves the problem of homogenization of sample importance and easy neglect of difficult-to-distinguish samples in traditional models. Through dynamic difficulty weights, the model can adaptively focus on key information and difficult-to-distinguish samples in complex dialogue scenarios, avoiding training bias caused by uneven sample difficulty; using hierarchical calculation of initial loss values and target loss values, the optimization of individual samples and the learning of group data features are accurately balanced, thereby improving the model's depth of understanding of the semantic logic of multi-round dialogues. Finally, under the guidance of the target loss value, the initial thinking type recognition model parameters are optimized, thereby enhancing the model's generalization ability, accuracy and robustness in thinking type recognition tasks.
[0131] Figure 8 The flowchart of the method for identifying unhealthy thoughts according to an embodiment of the present disclosure is schematically shown.
[0132] like Figure 8 As shown, the method includes operations S810 to S830.
[0133] In operation S810, in response to being in the i-th round of dialogue, the dialogue context determined from the database, the object portraits of multiple objects participating in the group dialogue, and the dialogue contents from the 1st round to the i-th round are spliced to obtain input data for the i-th round.
[0134] In operation S820, the input data of the i-th round is input into the target thought recognition model to obtain the recognition probability distribution of the conversation content of the i-th round in the thought type space.
[0135] In operation S830, based on a preset mapping function, the recognition probability distribution is mapped to a thinking type recognition result, and the thinking type recognition result is an unhealthy thinking type or a normal thinking type.
[0136] i can be a positive integer greater than or equal to . The conversation contents of the i-th round and the conversation contents before the i-th round can be spliced in time sequence to obtain the input data of the i-th round.
[0137] Inputting the input data of the i-th round into the target thought recognition model can enable the target thought recognition model to segment the input data of the i-th round and calculate the recognition probability distribution of the last segmentation in the input data of the i-th round, thereby obtaining the recognition probability distribution of the conversation content of the i-th round in the thought type space.
[0138] There is no limitation on the preset mapping function, which can be any function that can realize the result of converting probability distribution to thought type recognition, such as softmax function, threshold discrimination function, etc.
[0139] Bad thinking types include divergent thinking, rigid thinking, dependent thinking, etc.
[0140] According to the implementation of this disclosure, by combining multi-dimensional data and integrating conversation context, subject profiles, and historical conversation content to construct input data, the model is provided with rich contextual semantic information, enabling the target thought recognition model to accurately capture the temporal logic and character characteristics of the conversation, significantly improving the accuracy of identifying undesirable thought patterns. Furthermore, the algorithm focuses on the probability distribution calculation of the last word segment, effectively locating the semantic focus of the conversation and achieving rapid and accurate judgment of the thought pattern of the current turn.
[0141] Based on the training method of the above-mentioned thinking type recognition model, the present disclosure also provides a training device for the thinking type recognition model. Figure 9 The device is described in detail.
[0142] Figure 9 The structural block diagram of the training device for the thinking type recognition model according to an embodiment of the present disclosure is schematically shown.
[0143] like Figure 9 As shown, the training device 900 for the thinking type recognition model of this embodiment includes a splicing module 910, a processing module 920 and a training module 930.
[0144] The splicing module 910 is used to splice the conversation background sample with multiple conversation samples to obtain a group conversation sample, wherein the multiple conversation samples are determined based on multiple rounds of conversations between multiple objects, and each conversation sample is obtained by splicing the object portrait of the object and the conversation content generated by the object; in one embodiment, the splicing module 910 can be used to perform the operation S210 described above, which will not be repeated here.
[0145] The processing module 920 is used to input the group conversation samples and the attention mask into the initial thinking type recognition model, so that the initial thinking type recognition model processes the multiple conversation samples in parallel based on the conversation background samples and the dependency information of the multiple conversation samples included in the attention mask, and obtains the test probability distribution of the multiple conversation samples in the thinking type space; in one embodiment, the processing module 920 can be used to perform the operation S210 described above, which will not be repeated here.
[0146] The training module 930 is used to train the initial thinking type recognition model based on multiple test probability distributions and label probability distributions corresponding to the multiple test probability distributions to obtain a target thinking recognition model; in one embodiment, the training module 930 can be used to perform the operation S210 described above, which will not be repeated here.
[0147] Figure 10 The following schematically shows a structural block diagram of a device for identifying unhealthy thoughts according to an embodiment of the present disclosure.
[0148] The device for identifying unhealthy thoughts 1000 of this embodiment includes a data determination module 1010 , an input module 1020 , and a mapping module 1030 .
[0149] The data determination module 1010 is used to, in response to the i-th round of dialogue, combine the dialogue context determined from the database, the object portraits of multiple objects participating in the group dialogue, and the dialogue contents from the 1st round to the i-th round to obtain the input data for the i-th round. In one embodiment, the data determination module 1010 can be used to perform the operation S810 described above, which will not be repeated here.
[0150] The input module 1020 is used to input the input data of the i-th round into the target thought recognition model to obtain the recognition probability distribution of the conversation content of the i-th round in the thought type space; in one embodiment, the input module 1020 can be used to perform the operation S820 described above, which will not be repeated here.
[0151] The mapping module 1030 is used to map the recognition probability distribution into a thinking type recognition result based on a preset mapping function, and the thinking type recognition result is an unhealthy thinking type or a normal thinking type. In one embodiment, the mapping module 1030 can be used to perform the operation S830 described above, which will not be repeated here.
[0152] According to embodiments of the present disclosure, any multiple modules among the stitching module 910, processing module 920 and training module 930, data determination module 1010, input module 1020, and mapping module 1030 may be combined into a single module, or any one of these modules may be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of other modules and implemented in a single module. According to embodiments of the present disclosure, at least one of the stitching module 910, processing module 920 and training module 930, data determination module 1010, input module 1020, and mapping module 1030 may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or may be implemented in hardware or firmware through any other reasonable means of circuit integration or packaging, or may be implemented in any one of software, hardware, and firmware, or any suitable combination of any of these. Alternatively, at least one of the splicing module 910, the processing module 920 and the training module 930, the data determination module 1010, the input module 1020 and the mapping module 1030 can be at least partially implemented as a computer program module, which can perform the corresponding function when executed.
[0153] Figure 11 The block diagram schematically shows an electronic device suitable for implementing a training method for a thinking type recognition model and a method for recognizing bad thinking according to an embodiment of the present disclosure.
[0154] like Figure 11 As shown, the electronic device 1100 according to an embodiment of the present disclosure includes a processor 1101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1102 or a program loaded from a storage portion 1108 into a random access memory (RAM) 1103. The processor 1101 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1101 may also include onboard memory for caching purposes. The processor 1101 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0155] Various programs and data required for the operation of the electronic device 1100 are stored in the RAM 1103. The processor 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. The processor 1101 performs various operations of the method flow according to the embodiment of the present disclosure by executing the programs in the ROM 1102 and / or the RAM 1103. It should be noted that the programs may also be stored in one or more memories other than the ROM 1102 and the RAM 1103. The processor 1101 may also perform various operations of the method flow according to the embodiment of the present disclosure by executing the programs stored in the one or more memories.
[0156] According to an embodiment of the present disclosure, electronic device 1100 may further include an input / output (I / O) interface 1105, which is also connected to bus 1104. Electronic device 1100 may also include one or more of the following components connected to I / O interface 1105: an input section 1106 including a keyboard, mouse, etc.; an output section 1107 including devices such as a cathode ray tube (CRT), liquid crystal display (LCD), and speakers; a storage section 1108 including a hard disk; and a communication section 1109 including a network interface card such as a LAN card or modem. Communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to I / O interface 1105 as needed. Removable media 1111, such as a magnetic disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed in drive 1110 as needed, so that computer programs read from the removable media can be installed into storage section 1108 as needed.
[0157] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or may exist independently and not be incorporated into the device / apparatus / system. The computer-readable storage medium carries one or more programs, and when executed, implements the method according to the embodiments of the present disclosure.
[0158] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, and may include, for example, but not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, 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. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 1102 and / or RAM 1103 described above, and / or one or more memories other than ROM 1102 and RAM 1103.
[0159] The present disclosure also includes a computer program product comprising a computer program containing program code for executing the method shown in the flowchart. When the computer program product is executed in a computer system, the program code causes the computer system to implement the method for training a thought type recognition model and the method for identifying unhealthy thoughts provided in the present disclosure.
[0160] The computer program executes the above functions defined in the system / device of the embodiment of the present disclosure when the computer program is executed by the processor 1101. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0161] In one embodiment, the computer program may be stored on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may be transmitted and distributed in the form of a signal on a network medium, downloaded and installed via the communication portion 1109, and / or installed from removable media 1111. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to wireless, wired, or any suitable combination thereof.
[0162] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1109 and / or installed from the removable medium 1111. When the computer program is executed by the processor 1101, the above-described functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the systems, devices, means, modules, units, etc. described above can be implemented by computer program modules.
[0163] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computer programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, Python, "C" language, or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect via the Internet).
[0164] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0165] Those skilled in the art will appreciate that the features described in the various embodiments of the present disclosure may be combined and / or coupled in various ways, even if such combinations or couplings are not explicitly described in the present disclosure. In particular, the features described in the various embodiments of the present disclosure may be combined and / or coupled in various ways without departing from the spirit and teachings of the present disclosure. All such combinations and / or couplings fall within the scope of the present disclosure.
[0166] The above describes the embodiments of the present disclosure. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although each embodiment has been described separately above, this does not mean that the measures in each embodiment cannot be advantageously used in combination. Without departing from the scope of the present disclosure, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present disclosure.< / e> < / c> < / s> < / e> < / c> < / s>
Claims
1. A training method for a thinking type recognition model, characterized in that: The method comprises: splicing the conversation background sample with multiple conversation samples to obtain a group conversation sample, wherein the multiple conversation samples are determined based on multiple rounds of conversations between multiple subjects, and each conversation sample is obtained by splicing an object portrait of an subject and the conversation content generated by the subject; Inputting the group conversation sample and the attention mask into an initial thought type recognition model, so that the initial thought type recognition model processes the multiple conversation samples in parallel based on the conversation background sample and dependency information of the multiple conversation samples included in the attention mask, to obtain a test probability distribution of the multiple conversation samples in the thought type space; Based on multiple test probability distributions and label probability distributions corresponding to the multiple test probability distributions, the initial thinking type recognition model is trained to obtain a target thinking recognition model.
2. The method according to claim 1, characterized in that The attention mask is obtained as follows: For each conversation sample, performing word segmentation processing on the conversation sample to obtain multiple sample words; The attention mask is obtained based on position information of multiple sample words included in each of the multiple dialogue samples and the generation order of the multiple dialogue samples in the multiple rounds of dialogue.
3. The method according to claim 2, characterized in that The dependency information includes location information of a dependent dialogue sample having a dependency relationship with the dialogue sample; The step of obtaining the attention mask based on the position information of the multiple sample words included in each of the multiple dialogue samples and the generation order of the multiple dialogue samples in the multiple rounds of dialogue includes: For each of the conversation samples, based on position information of multiple sample words in the conversation sample, marking the sample words at the target position to obtain marked words; Based on the generation order of the plurality of dialogue samples in the plurality of rounds of dialogue, determining a first dialogue sample in the plurality of dialogue samples whose generation order is located after the marker word; Masking the position information corresponding to each of the plurality of sample words included in the first conversation sample to obtain a masking result for the conversation sample, wherein a second conversation sample that is generated before the marker word of the conversation sample in the plurality of conversation samples is a dependent conversation sample of the conversation sample; The attention mask is obtained based on the mask processing results of the plurality of dialogue samples.
4. The method according to claim 3, characterized in that The initial thought type recognition model processes the multiple conversation samples in parallel based on the conversation background sample and the dependency information of the multiple conversation samples included in the attention mask to obtain a test probability distribution of the multiple conversation samples in the thought type space, including: For each of the conversation samples, based on the position information of the dependent conversation sample having a dependency relationship with the conversation sample included in the dependency information, determining a dependent conversation sample of the conversation sample from a plurality of the conversation samples; Based on the dialogue background sample and the dependent dialogue sample, the test probability distribution of the sample word at the target position in the thought type space is calculated to obtain the test probability distribution of the dialogue sample in the thought type space.
5. The method according to claim 1, wherein The conversation content is generated by a conversation generation agent loaded with the object portrait; the conversation generation agent is used to simulate the object; and the plurality of conversation samples are obtained in the following manner: In response to the i-th round of dialogue, the plurality of dialogue generation agents obtain historical dialogue content prior to the i-th round from the group dialogue topic, and generate thought information and dialogue content to be sent based on the historical dialogue content and the bad thought generation instruction generated according to a preset probability. Wherein, when i=1, the historical dialogue content is the dialogue background sample or the dialogue content generated by any of the objects for the dialogue background sample in an actual group dialogue scenario; In response to a target dialogue generating agent among the plurality of dialogue generating agents receiving a permission to send instruction sent by the chair agent, the target dialogue generating agent sends the dialogue content to be sent to the group dialogue topic to obtain the dialogue content to be verified, wherein the target dialogue generating agent is determined by the chair agent based on the thinking information of each of the plurality of dialogue generating agents; When the verification agent obtains the conversation content to be verified from the group conversation topic and determines that the verification result of the conversation content to be verified is passed, the multiple conversation generating agents use the conversation content to be verified as the conversation content of the i-th round; The object portrait loaded by the target dialogue generation agent and the dialogue content of the i-th round are spliced to obtain the dialogue sample of the i-th round.
6. The method according to claim 5, characterized in that The verification agent includes: an object verification agent and a speech background verification agent; the method further includes: The object verification agent verifies the degree of match between the conversation content to be verified and the object portrait loaded by the target conversation generation agent based on a database, thereby obtaining a first sub-verification result, wherein the database includes the object portrait and preset operation information or preset conversation content corresponding to the object portrait; The speech background verification agent verifies the degree of matching between the conversation content to be verified and the conversation background sample to obtain a second sub-verification result; If both the first sub-verification result and the second sub-verification result indicate passing, the verification result of the initial conversation content is determined to be passing.
7. The method according to claim 1, characterized in that The training of the initial thought type recognition model based on the multiple test probability distributions and the label probability distributions corresponding to the multiple test probability distributions to obtain the target thought recognition model includes: For each test probability distribution, determine a difficulty weight based on a preset sample importance and a difference between the test probability distribution and a preset value; determining an initial loss value based on the difficulty weight, the test probability distribution, and the label probability distribution; Performing group loss extraction on the multiple initial loss values to obtain a target loss value; The parameters of the initial thinking type recognition model are adjusted based on the target loss value to obtain a target thinking recognition model.
8. A method for identifying bad thinking, characterized in that: The method comprises: In response to the i-th round of dialogue, the dialogue context determined from the database, the subject portraits of the multiple subjects participating in the group dialogue, and the dialogue contents from the first round to the i-th round are spliced together to obtain input data for the i-th round; Inputting the input data of the i-th round into the target thought recognition model to obtain the recognition probability distribution of the conversation content of the i-th round in the thought type space; Based on a preset mapping function, the recognition probability distribution is mapped into a thinking type recognition result, wherein the thinking type recognition result is an unhealthy thinking type or a normal thinking type; Wherein, the target thinking recognition model is obtained by training using the thinking type recognition model training method described in any one of claims 1 to 7.
9. An electronic device comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Call prediction model training method, call prediction method and device
CN119150014A
Bad thinking monitoring method and device based on large language model
CN119886106A
Training method of thinking chain compression large model for rewriting task, electronic equipment and storage medium
CN119940553A
Small sample language consciousness classification method and system
CN120067777A
Financial field training data construction method based on dual feedback mechanism
CN120123471A