Content analysis and message interaction method, computer device, medium, program product

By filtering redundant text through a semantic analysis system and combining it with a sentiment analysis model for smooth correction, this technology solves the technical problems in text analysis in existing technologies. It generates innovative applications for text intent and sentiment analysis in existing technologies, and generates applications for content analysis and message interaction.

CN122347142APending Publication Date: 2026-07-07YIYUNYING (SHANDONG) NETWORK TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
YIYUNYING (SHANDONG) NETWORK TECHNOLOGY CO LTD
Filing Date
2026-04-30
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

In existing technologies, textual intent and sentiment analysis are susceptible to noise interference, leading to unreliable analysis results.

Method used

The semantic analysis system identifies and filters redundant text, uses a sentiment analysis model for smoothing correction, generates intent and sentiment labels, and analyzes them in conjunction with the real situation of the target industry scenario.

Benefits of technology

It improves the reliability of intent and sentiment analysis, reduces noise interference, and enhances the accuracy and stability of analysis results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122347142A_ABST
    Figure CN122347142A_ABST
Patent Text Reader

Abstract

The application discloses a content analysis and message interaction method, computer equipment, medium, program product, and relates to the technical field of artificial intelligence. The content analysis method comprises the following steps: identifying and filtering redundant text in input text by using a semantic analysis system to obtain key text, and performing intention discrimination on the key text to obtain an interaction intention; wherein, the redundant text represents text content with semantic discontinuity with a target industry scene; performing emotion recognition on target text by using an emotion analysis model to obtain an interaction emotion; wherein, the target text comprises the input text and / or the key text; generating an intention label matched with the interaction intention, and generating an emotion label matched with the interaction emotion. The technical problem that the analysis degree is simple and susceptible to noise interference, so that the analysis result is unreliable is solved, and the technical effect of improving the content analysis reliability by distinguishing and filtering the interference information inconsistent with the actual intention in the input text is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a content analysis method, a message interaction method, a computer device, a computer-readable storage medium, and a computer program product. Background Technology

[0002] In scenarios involving message interaction, such as logistics, e-commerce, and social networking, or in applications like article analysis, travel services, and article content moderation, there is a need for intent analysis and sentiment analysis of text. Currently, the input text is usually treated as the direct object of semantic analysis to obtain superficial intent and sentiment recognition results, which are prone to being affected by noise, leading to unreliable analysis results. Summary of the Invention

[0003] This application provides a content analysis method, a message interaction method, a computer device, a computer-readable storage medium, and a computer program product to at least solve the problem in related technologies that the analysis is superficial and easily affected by noise, resulting in unreliable analysis results.

[0004] This application provides a content analysis method, which includes: acquiring input text; using a semantic analysis system to identify and filter redundant text within the input text to obtain key text, and performing intent discrimination on the key text to obtain the interaction intent; wherein, redundant text represents text content that has semantic discontinuities with the target industry scenario; using a sentiment analysis model to perform sentiment recognition on the target text to obtain the interaction sentiment; wherein, the target text includes the input text and / or key text; generating intent tags matching the interaction intent, and generating sentiment tags matching the interaction sentiment.

[0005] In one embodiment of this application, the semantic analysis system includes a semantic analysis model; using the semantic analysis system to identify and filter redundant text in the input text to obtain key text includes: inputting the input text into the semantic analysis model; using the semantic analysis model to identify industry keywords of the target industry scenario in the input text; performing semantic analysis on the input text to determine whether its context has semantic continuity; taking text content that has semantic discontinuity with the industry keywords as redundant text; and deleting the redundant text in the input text to obtain key text. In one embodiment of this application, before using a semantic analysis system to identify and filter redundant text within the input text to obtain key text, the process includes: acquiring training samples labeled with industry keywords for at least one interaction stage, to train a semantic analysis model using these samples; wherein, industry keywords include at least one of product keywords, industry terminology keywords, and business keywords, and interaction stages include consultation stages, transaction stages, after-sales stages, and other stages; and / or, acquiring verification samples of at least one type of perturbation sample to perform model verification and iterative optimization of the trained semantic analysis model using these samples; wherein, perturbation sample types include sample confusion category types, industry synonym expression sample types for the target industry scenario, sample classification bias types, and questionable sample types, where the questionable sample type indicates that the sample confidence level is lower than a confidence level threshold.

[0006] In one embodiment of this application, the semantic analysis system includes an intent output layer and a joint discriminator; obtaining the interaction intent by determining the intent of key text includes: transmitting the key text to the intent output layer and the joint discriminator; using the intent output layer to combine industry keywords in the key text to evaluate and output the probability distribution of the key text belonging to each preset intent; using the joint discriminator to extract industry keywords in the key text to match the keyword information associated with the industry keywords in the target industry scenario; and selecting the preset intent as the interaction intent by combining the keyword information and the probability distribution.

[0007] In one embodiment of this application, selecting a preset intent as an interaction intent by combining keyword information and probability distribution includes: identifying the interaction category represented by keyword information, and evaluating the category confidence of the key text belonging to each preset intent in combination with the interaction category; wherein, the interaction category includes at least one of the purchase category, inquiry category, and order constraint condition category; and selecting a preset intent as an interaction intent by combining probability distribution and category confidence.

[0008] In one embodiment of this application, after obtaining the input text, the process includes: using a semantic analysis system to identify whether the input text contains redundant text; in response to the semantic analysis system identifying redundant text, determining to filter the redundant text; and in response to the semantic analysis system not identifying redundant text, using the semantic analysis system to perform intent discrimination on the input text to obtain the interaction intent.

[0009] In one embodiment of this application, obtaining interactive emotion by using a sentiment analysis model to identify the emotion of target text includes: inputting the target text into a sentiment analysis model; using the sentiment analysis model to identify the emotion features of the target text to obtain the current emotion represented by the target text; and performing smoothing correction processing on the current emotion to obtain interactive emotion.

[0010] In one embodiment of this application, smoothing and correcting the current emotion to obtain the interactive emotion includes: analyzing the emotion type represented by the textual factors of the historical input text and the input text to obtain a text correction factor; wherein, the textual factors include at least one of the time interval between the input text and the historical input text, the trend of historical emotion notes, the semantic transition structure, and the trend of text content changes; correcting the current emotion using the text correction factor; and / or, in response to the input text being converted from a speech message, analyzing the emotion type represented by the sound features of the speech message to obtain a speech correction factor; wherein, the sound features include at least one of the speech rate features, pause features, and pitch features; correcting the current emotion using the speech correction factor.

[0011] In one embodiment of this application, before inputting the target text into the sentiment analysis model, the method further includes: acquiring text content corpus carrying preset sentiment labels as sentiment samples; converting the sentiment samples into word vectors and extracting local sentiment features representing the word vectors; performing pooling processing on the local sentiment features to obtain the discrimination features when using the preset sentiment labels for sentiment discrimination; evaluating the probability distribution of the discrimination features belonging to each preset sentiment through a fully connected layer; using the preset sentiment to which the sentiment sample belongs as the training sentiment to adapt to the probability distribution; and updating the sentiment analysis model using the training loss corresponding to the training sentiment and the preset sentiment labels.

[0012] In one embodiment of this application, obtaining input text includes: obtaining an image to be recognized containing input text; detecting text occurrence regions within the image to be recognized that match region features; wherein, region features include at least one of text box features, font features, language arrangement features, and background features; using a preset corpus of a target industry scenario to assist in character recognition of the text occurrence regions to obtain initial text; wherein, the preset corpus includes at least one of industry terminology, product information, and multilingual mixed text; evaluating text metrics of the initial text, and using the text metrics to filter the initial text to obtain input text; wherein, the text metrics include at least one of matching degree with the target industry scenario, semantic continuity of the initial text, and character confidence.

[0013] In one embodiment of this application, obtaining an image to be recognized containing input text includes: obtaining an original image; performing grayscale conversion on the original image to obtain a grayscale image; performing binarization on the grayscale image based on the local window brightness distribution to obtain a normalized image; identifying text feature indicators of text regions within the normalized image; deleting text regions corresponding to text feature indicators that match preset noise features to obtain a filtered image; wherein, the text feature indicators include at least one of character stroke width, connected component area, size ratio, position distribution, and color layering information; performing text enhancement processing on the filtered image to obtain the image to be recognized; wherein, the text enhancement processing includes at least one of image opening / closing operations and edge preservation smoothing processing.

[0014] This application also provides a message interaction method, which includes: acquiring input text formed by interaction data with the current round of the conversation object; analyzing the input text using any of the above content analysis methods to obtain its intent tags and sentiment tags; and adapting the intent tags and sentiment tags to generate candidate responses to assist in responding to the interaction data.

[0015] In one embodiment of this application, the process of generating candidate responses to assist in responding to interactive data by adapting intent tags and sentiment tags includes: fusing intent tags, sentiment tags, industry keywords in the input text, confidence scores of the input text, and time information to obtain fusion analysis information; updating the user profile of the conversation object using the fusion analysis information; wherein, when the current tag and / or sentiment tag of the conversation object contradicts the historical tag, the weight of the historical tag is reduced when updating the user profile; and generating candidate responses that fit the user profile.

[0016] This application also provides a computer device, which includes: a memory and a processor, wherein the memory is used to store a computer program; and the processor is used to execute the computer program to implement the steps of any of the above-described content analysis methods; or to implement the steps of any of the above-described message interaction methods.

[0017] This application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps of any of the above-described content analysis methods; or, implements the steps of any of the above-described message interaction methods.

[0018] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described content analysis methods; or, implements the steps of any of the above-described message interaction methods.

[0019] This application addresses the challenge of identifying redundant text within the input text. By considering the real-world context of the target industry scenario during intent analysis, it identifies semantically disjointed text that is considered redundant. Since redundant text typically lacks substantial meaning in the target industry scenario, it filters this redundant text from the input to extract key information. This simplifies the text content and extracts effective information, thereby improving the reliability of intent analysis. Therefore, it solves the problem of superficial analysis being susceptible to noise interference, leading to unreliable results. It effectively identifies and filters interfering information within the input text that is inconsistent with the actual intent, thus enhancing the reliability of content analysis. Attached Figure Description

[0020] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a flowchart illustrating an embodiment of the content analysis method of this application; Figure 2 This is a flowchart illustrating another embodiment of the content analysis method of this application; Figure 3 This is a schematic diagram of a process for obtaining input text according to an embodiment of this application; Figure 4 This is a schematic flowchart illustrating an embodiment of obtaining an image to be recognized according to this application; Figure 5 This is a flowchart illustrating an embodiment of intent recognition of key text in this application; Figure 6 This is a flowchart illustrating an embodiment of emotion recognition of target text according to this application; Figure 7 This is a flowchart illustrating an embodiment of the message interaction method of this application. Detailed Implementation

[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0023] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0024] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0025] The embodiments of this application provide a content analysis method, and the content analysis method is described in detail in conjunction with the execution flow of the content analysis method.

[0026] Please see Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the content analysis method of this application.

[0027] S101: Get the input text.

[0028] In this embodiment, the input text can be actively collected or passively received.

[0029] Taking message interaction scenarios as an example, the raw text content input by the user can be collected to complete the acquisition of input text. The input text can be the text content directly entered by the user, or the text content converted from the user's voice message, video message, etc., or the text content obtained by converting the user's multimodal input data. There are no restrictions here.

[0030] S102: Use a semantic analysis system to identify and filter redundant text in the input text to obtain key text, and perform intent judgment on the key text to obtain the interaction intent; among them, redundant text represents text content that has semantic discontinuity with the target industry scenario.

[0031] In this embodiment, a pre-set or pre-trained semantic analysis system can be used to perform semantic screening on the complete input text. This identifies redundant text that may be semantically disconnected from the target industry scenario and has no practical interactive value. Redundant text is then filtered out, and relatively core and effective key text is extracted from the input text. It is easy to understand that redundant text can be considered as content that is detached from the business scenario, semantically fragmented, and invalid, which may pose a risk of interfering with the accuracy of subsequent interaction recognition. By relying on a semantic analysis system to perform semantic parsing and intent determination on the simplified key text, the accuracy of identifying the user's true interaction needs can be improved, and the reliability of the output interaction intent can be enhanced.

[0032] S103: Use a sentiment analysis model to identify the sentiment of the target text to obtain the interactive sentiment; wherein, the target text includes the input text and / or key text.

[0033] In this embodiment, either the input text or the key text, or a combination of both, can be selected as the input to the sentiment analysis model. At least one of the input text or the key text is used as the target text for sentiment analysis. The model leverages its sentiment recognition logic to capture emotional expression features within the text, thereby determining the user's emotional tendency and quantifying the user's current interactive emotions.

[0034] S104: Generate intent tags that match the interaction intent, and generate emotion tags that match the interaction emotion.

[0035] In this embodiment, based on the identified interaction intent, corresponding intent tags can be automatically generated according to preset tagging specifications; simultaneously, based on the parsed interaction emotion, corresponding emotion tags are generated. This dual-tag annotation method distinguishes between the demand attributes and emotional attributes of the input text.

[0036] Therefore, this embodiment, at least when performing intent analysis on the input text, can identify text content within the input text that has semantic gaps with the target industry scenario, treating it as redundant text. It can be assumed that redundant text in the target industry scenario typically lacks substantial content, thus filtering it from the input text to obtain key text. This simplifies the text content to be identified and extracts effective information, thereby improving the reliability of intent analysis. Specifically, it can identify and filter interfering information within the input text that is inconsistent with the actual intent, thus enhancing the reliability of content analysis. Furthermore, using key text for sentiment analysis can also reduce noise interference. Simultaneously, sentiment analysis can be performed using the input text to reduce the risk of filtering out emotionally expressive words.

[0037] Please see Figure 2 , Figure 2 This is a flowchart illustrating another embodiment of the content analysis method of this application.

[0038] In one embodiment, input text can be obtained.

[0039] Taking the input text as an example of image recognition, the following is an example of the principle behind its acquisition.

[0040] It can acquire an image containing the input text to be recognized. For example, an image acquisition unit can capture a scene containing the text to be extracted, forming a complete image to be recognized, within which the input text can be contained.

[0041] This method can detect text-generating regions within an image that match regional features. These regional features include at least one of text box features, font features, language arrangement features, and background features. In other words, this embodiment can pre-configure various regional features adapted to the target recognition scenario, and rely on feature matching algorithms to perform a full-domain search and comparison of the image to be recognized, accurately locating text-generating regions containing text content within the image. It is easy to understand that features such as text box outlines, font styles, text layout, and background can all distinguish text regions from blank background regions, thereby achieving rapid and accurate text region locking and narrowing the processing scope for subsequent text recognition.

[0042] Furthermore, a pre-defined corpus of the target industry scenario can be used to assist in character recognition of the text region to obtain the initial text. The pre-defined corpus includes at least one of industry terminology, product information, and multilingual mixed text. Text metrics of the initial text can be evaluated, and these metrics can be used to filter the initial text to obtain the input text. These text metrics include at least one of the following: matching degree with the target industry scenario, semantic continuity of the initial text, and character confidence.

[0043] In other words, collaborative text recognition is performed on the identified text generation areas using a pre-built corpus corresponding to the target industry scenario. By leveraging industry-specific terminology, product-related materials, and multilingual text samples, the adaptability of text recognition is optimized, reducing errors in recognizing technical terms and special expressions, thereby extracting the original initial text content from the text generation areas. The generated initial text is then comprehensively evaluated using multi-dimensional metrics, verifying the text's relevance to the target industry scenario, the semantic coherence of the sentence context, and the reliability of single-character recognition. Based on the evaluation results of these text metrics, invalid content with recognition errors, semantic breaks, and poor industry adaptability can be relatively effectively eliminated, purifying the initial text and ultimately yielding standardized input text suitable for subsequent analysis and processing.

[0044] In response to the acquisition of input text, a semantic analysis system can be used to identify whether the input text contains redundant text.

[0045] In response to the semantic analysis system failing to identify redundant text, the semantic analysis system is used to determine the intent of the input text to obtain the interaction intent. The principle of determining the intent of the input text is similar to that of determining the intent of the key text, which can be found in the later section on the determination principle of the intent of the key text, and will not be repeated here.

[0046] In response to the semantic analysis system identifying redundant text, the redundant text is filtered out.

[0047] Optionally, the semantic analysis system includes a semantic analysis model. Input text can be fed into the semantic analysis model. The model identifies industry keywords related to the target industry scenario within the input text. Semantic analysis is performed on the input text to determine its semantic continuity. Text content with semantic breaks from the industry keywords is considered redundant text. Redundant text is then removed from the input text to obtain the key text. Here, redundant text refers to text content with semantic breaks from the target industry scenario.

[0048] In other words, a semantic analysis system can use a trained semantic analysis model as a processing unit. Input text is fed into a sentiment analysis model, which then identifies industry-specific keywords relevant to the target industry scenario. Based on keyword relationships, the system assesses the contextual coherence of the entire text, identifying redundant text fragments that are logically disconnected from industry keywords or semantically fragmented. Redundant text is then removed to retain only the valid information fragments in the input text, thereby improving the conciseness and semantic integrity of the key text used for intent recognition.

[0049] Optionally, the semantic analysis system may also include an intent output layer and a joint discriminator.

[0050] Key text can be transmitted to the intent output layer and the joint discriminator. The intent output layer, combined with industry keywords within the key text, evaluates and outputs the probability distribution of the key text belonging to various preset intents. The joint discriminator extracts industry keywords from the key text to match keyword information associated with those keywords in the target industry scenario. Finally, the preset intent, based on a combination of keyword information and probability distribution, is selected as the interaction intent.

[0051] In layman's terms, the semantic analysis system in this embodiment integrates an intent output layer and a joint discriminator. It synchronously distributes the extracted key text to both the intent output layer and the joint discriminator for collaborative discrimination. The intent output layer combines industry keywords from the key text with preset interactive intents (i.e., preset intents), quantifying the probability of the key text matching each intent to form a probability distribution of the input text containing each preset intent. The joint discriminator extracts industry keywords from the key text, retrieves industry databases to match keyword association information, and clarifies the scenario and business attributes corresponding to the keywords. Combining keyword association information and intent probability distribution as references, the system selects the preset intent with the highest matching degree from multiple preset intents and determines it as the interactive intent of the input text and the key text.

[0052] Specifically, the interaction categories represented by keyword information can be identified, and the confidence level of the key text belonging to each preset intent can be evaluated by combining the interaction categories. The interaction categories include at least one of the following: purchasing, inquiry, and order constraint categories. Based on the combined probability distribution and category confidence level, the preset intent is selected as the interaction intent. Furthermore, the matched keyword information can be categorized and analyzed to classify different interaction categories such as purchasing, inquiry, and order constraints. Based on the interaction category to which the key text belongs, the category confidence level of its corresponding preset intent is specifically calculated, supplementing the criteria for category dimension determination. Combining intent probability distribution and category confidence level enables multi-dimensional verification to improve the comprehensiveness and accuracy of verification, effectively reducing intent recognition bias and thus improving the accuracy of identifying the user's true needs through interaction intent.

[0053] Furthermore, in this embodiment, a sentiment analysis model can be used to identify the emotion of the target text to obtain the interactive emotion. The target text includes the input text and / or key text.

[0054] Specifically, the target text can be input into a sentiment analysis model. The model then identifies the sentiment features of the target text to obtain the current sentiment represented by the text. Finally, a smoothing process is applied to the current sentiment to obtain the interactive sentiment.

[0055] The target text is input into a preset or pre-trained sentiment analysis model. The model captures multi-dimensional information such as word usage features, emotional vocabulary, and sentence tone to extract the emotional tendency and characteristics within the target text, thus initially identifying the current emotion corresponding to the target text. Simultaneously, to reduce the risk of incomplete emotional expression in a single sentence or excessive fluctuations in emotion recognition affecting the reliability of emotion determination, this embodiment can also perform smoothing correction and optimization calibration on the initially acquired current emotion. This weakens the interference of accidental and fragmented emotions, improves the stability and reliability of the determined interactive emotions, and thus helps to improve the completeness of restoring the user's true emotional state during instant messaging interactions.

[0056] The following provides a detailed explanation of the principles behind smoothing correction processing.

[0057] The current emotion can be corrected by incorporating textual factors. And / or, it can be corrected by incorporating auditory features. That is, smooth correction can adopt a single correction method or a multi-dimensional composite correction method. It can complete emotion correction based on the text's own correlation features, or it can combine the acoustic features of the original speech to assist in emotion correction. The two correction methods can be implemented independently or used in combination, and it can adapt to target texts from different source types.

[0058] In detail, the sentiment type represented by the textual factors of the historical input text and the input text can be analyzed to obtain text correction factors. These textual factors include at least one of the following: the time interval between the input text and the historical input text, the trend of historical sentiment notes, semantic transition structures, and the trend of text content changes. The current sentiment is then corrected using these text correction factors.

[0059] In this embodiment, historical input text corresponding to the current text interaction is retrieved and compared with the historical text, comprehensively considering the emotional change patterns reflected by multiple text factors. Specifically, the interaction time interval reflects the duration of the user's emotions, the trend of historical emotion tag changes reflects the user's long-term emotional tendencies, semantic transition structures are used to identify sudden emotional shifts caused by sentence transitions, and the trend of text content changes reflects emotional fluctuations caused by changes in interaction requests. Through comprehensive analysis and quantitative calculation of various text factors, a text correction factor adapted to the current interaction scenario is generated. Based on this correction factor, the initial output of the model's current emotion is weighted and smoothed, weakening occasional extreme emotional expressions in single sentences, which helps improve the fit between the emotion recognition results and the user's overall interaction state.

[0060] This method can respond to input text converted from speech messages and analyze the emotion type represented by the sound features of the speech message to obtain a speech correction factor. The sound features include at least one of speech rate features, pause features, and pitch features. The speech correction factor is then used to correct the current emotion.

[0061] In this embodiment, when the input text originates from the transcription of a voice message, the original voice data can be traced back to extract multi-dimensional sound features such as speech rate, pause rhythm, and pitch fluctuations. These features are then combined with the emotional expression patterns corresponding to various acoustic features to determine the true emotional type carried at the speech level, and a voice correction factor is calculated accordingly. While text recognition only reflects the literal emotion, the voice correction factor can supplement the emotional differences brought about by tone and intonation. In this embodiment, the voice correction factor is applied to the current emotion for secondary calibration, which can compensate for the limitations of pure text emotion recognition and further improve the comprehensiveness and realism of interactive emotion recognition.

[0062] Generate intent tags that match the interaction intent, and generate emotion tags that match the interaction emotion.

[0063] Interaction intent and / or interaction emotion can be used as intent tags and / or emotion tags themselves, or they can be obtained through secondary processing such as formatting. No limitation is made here.

[0064] The training principle of a pre-trained semantic analysis model will be illustrated below with examples.

[0065] Optionally, training samples labeled with industry keywords for at least one interaction stage can be obtained to train a semantic analysis model. Industry keywords include at least one of product keywords, industry terminology keywords, and business keywords; interaction stages include consultation stages, transaction stages, after-sales stages, and other stages.

[0066] In other words, actual interaction data can be collected and organized in advance, and training samples can be selected to form multiple interaction stages, and industry keywords can be labeled for them. It's easy to understand that the text expression habits and content emphasis differ significantly across different interaction stages. Coupled with refined labeling of product keywords, industry terminology keywords, and business keywords, the learning dimensions of the model can be enriched. Inputting well-labeled training samples into the model training process allows the semantic analysis model to fully learn the text semantic rules, keyword association logic, and contextual expression features of different interaction stages in the target industry scenario. This strengthens the model's ability to understand industry-specific content and improves its performance in recognizing industry keywords, judging semantic continuity, and distinguishing redundant text.

[0067] Optionally, at least one type of perturbation sample can be obtained as validation samples to be used for model validation and iterative optimization of the trained semantic analysis model. The perturbation sample types include sample confusion category types, industry-specific near-synonymous expression sample types for the target industry scenario, sample classification bias types, and questionable sample types, where the questionable sample type indicates that the sample confidence level is below a confidence threshold.

[0068] In other words, after completing the basic training, multiple types of validation sample sets can be further constructed, including validation samples of at least one type of perturbation sample. Perturbation samples with high difficulty and susceptibility to interference are specifically introduced. Among them, confusion category samples can easily cause confusion in the model's intent judgment; industry-specific synonymous expression samples can test the model's ability to distinguish between synonymous but different expressions; classification bias samples are used to identify common recognition vulnerabilities in the model; and questionable samples with insufficient confidence can cover special text scenarios with ambiguous boundaries. By using the above-mentioned multi-dimensional perturbation validation samples to test and verify the trained semantic analysis model, it is beneficial to discover the defects and shortcomings of the semantic analysis system / model in complex contexts, similar expressions, and boundary text recognition, and to iteratively update and optimize them. Adjusting model parameters and optimizing semantic discrimination rules based on the validation feedback results can enhance the semantic analysis model's anti-interference ability and generalization ability in complex real-world interaction scenarios, and also improve the long-term stability and accuracy of the semantic analysis model and system in completing text semantic parsing and redundant content recognition.

[0069] The training principle of a pre-trained sentiment analysis model will be illustrated below with examples.

[0070] We can acquire text corpora carrying pre-defined emotion labels as emotion samples. We then convert these emotion samples into word vectors and extract local emotion features from these word vectors.

[0071] Local emotion features are pooled to obtain discriminative features for emotion classification using predefined emotion labels. A fully connected layer evaluates the probability distribution of these discriminative features belonging to each predefined emotion, and the predefined emotion to which the emotion sample belongs is determined by adapting the probability distribution to the training emotion. The emotion analysis model is updated using the training loss corresponding to the training emotion and the predefined emotion labels.

[0072] In layman's terms, this approach allows for the batch collection of massive amounts of text corpora from instant messaging interactions and target industry scenarios. Standardized sentiment annotation is then applied to these collected text corpora, assigning each piece of text a unique or composite pre-defined sentiment label. This constructs a rich and well-annotated dataset of sentiment samples, serving as a supervised training data source for the sentiment analysis model. The selected sentiment samples undergo text digitization, and a pre-trained word embedding algorithm maps the natural language text content into uniformly dimensional word vectors to quantify the semantic information of words and sentences. Subsequently, the sentiment analysis model can analyze the continuously arranged word vectors layer by layer, extracting key information such as emotional tendencies and tone expressions contained in word combinations and short sentence contexts, thereby improving the accuracy of extracting local sentiment features scattered throughout text fragments.

[0073] For the extracted fragmented local emotion features, pooling operations are used to aggregate and denoise the features, which helps to remove redundant feature information and compress feature dimensions. This facilitates the integration of semantically complete and feature-focused discriminative features, making them suitable for subsequent multi-category emotion classification. The integrated discriminative features are then input into a fully connected layer for feature mapping and weight calculation, quantifying the probability distribution of the discriminative features matching various preset emotions. Based on the numerical proportion of the probability distribution and the matching priority, the preset emotion with the highest confidence is selected as the training emotion for the model's inference output.

[0074] Furthermore, the training emotions inferred by the sentiment analysis model are compared with the pre-labeled sentiment tags of the emotion samples. The deviation between the two is calculated using loss functions such as cross-entropy loss, generating the corresponding training loss. Using the training loss as the basis for backpropagation, the model parameters of the sentiment analysis model are updated. This helps to reduce the error between the model's predictions and the standard labeled data, thereby strengthening the model's ability to capture text sentiment features and improve classification accuracy. Ultimately, this enhances the stability and generalization performance of the sentiment analysis model in complex interactive text scenarios.

[0075] Please see Figure 3 , Figure 3 This is a schematic flowchart illustrating an embodiment of obtaining input text for this application.

[0076] S201: Initialize the monitoring unit and load its capture area plugin to obtain the coordinates of the monitoring area.

[0077] S202: Periodically take screenshots of the area corresponding to the coordinates of the monitored area at preset intervals to obtain the original image of the interactive area.

[0078] S203: Calculate the hash value of the original image as the current hash value.

[0079] S204: Compare the current hash value with the hash value of the adjacent previous screenshot.

[0080] In this embodiment, when it is determined that the current hash value matches the hash value of the adjacent previous screenshot, step S202 is executed; when it is determined that the current hash value does not match the hash value of the adjacent previous screenshot, step S205 is executed.

[0081] S205: New interactive data has been determined.

[0082] S206: Denoise the original image to obtain the image to be identified.

[0083] The specific noise reduction principle will be explained in the following embodiments.

[0084] S207: Identify the status of preloaded engines in the engine pool and obtain an idle engine to perform input text recognition.

[0085] S208: Detect the instant messaging platform to which the image to be identified belongs as the target interaction environment.

[0086] In this embodiment, multiple instant messaging platforms can be used. These platforms may include existing market-ready communication software, SMS services, etc., and may also include self-developed instant messaging platforms; no limitation is made here. Figure 6 As illustrated in the example, this embodiment can be compatible with both the first communication platform and the second communication platform. When the first communication platform is the target interaction environment, step S209 can be executed; when the second communication platform is the target interaction environment, step S211 can be executed.

[0087] S209: When a user language cache exists, the user language model is invoked; when no user language cache exists, the text language in the image to be recognized is recognized, the recognized text language is taken as the user language preference, and the corresponding language model is taken as the user language model and invoked.

[0088] S210: Use a pre-trained language model and a user language model to recognize text in parallel on the image to be recognized, merge the text recognition results, deduplicate the merged results, and score the quality.

[0089] S211: When character detection is available, character detection is performed on the image to be recognized, and the detected characters are quality verified. If the detected characters pass the quality verification, the quality score of the detected characters is evaluated. If the detected characters fail the quality verification, it is determined that a text classifier should be used for text detection. When character detection is not available, it is determined that a text classifier should be used for text detection. In response to the determination that a text classifier should be used for text detection, a preset text language model is called to perform text recognition on the image to be recognized, and the quality of the recognized text is verified. If the recognized text passes the verification, its quality score is calculated; otherwise, the reliability of the recognized text is intelligently downgraded, and a new recognition result is obtained using the default Chinese model. The quality score of the new recognition result is then evaluated.

[0090] S212: Determine if the quality score has reached the scoring threshold. If the quality score reaches the scoring threshold, the recognition is considered successful, and the initial text is obtained. If the quality score does not reach the scoring threshold, the original image is re-captured. If the number of retries reaches the retry threshold, the result is returned as the initial text and marked as a quality anomaly.

[0091] S213: Perform message parsing on the initial text, message grouping based on the session object, and space correction to obtain the input text.

[0092] In this embodiment, the input text can be displayed on the front end and recorded as a recognition log. It can also be used for intent recognition and emotion recognition as described above.

[0093] The following example illustrates the detailed noise reduction principle of obtaining the image to be recognized from the original image through noise reduction processing. Please refer to [link / reference]. Figure 4 , Figure 4 This is a schematic flowchart illustrating an embodiment of obtaining an image to be recognized according to this application.

[0094] S301: Obtain the original image and perform grayscale conversion on the original image to obtain a grayscale image.

[0095] In this embodiment, an original image containing the text content to be extracted can be acquired. The original image can be a color image containing multi-channel color information or a grayscale image.

[0096] When the original image is a color image, a grayscale conversion algorithm can be used to reduce the channel dimension and simplify the color of the original image, remove redundant color interference information, unify the pixel grayscale measurement standard, convert the original color image into a single-channel grayscale image, reduce the amount of data for subsequent image processing, weaken the interference of color differences on text detection, and provide regular basic image data for subsequent image segmentation and feature extraction.

[0097] S302: Binarize the grayscale image based on the local window brightness distribution to obtain a normalized image.

[0098] In this embodiment, local sliding windows can be defined to traverse the pixel regions of the grayscale image and statistically analyze the pixel brightness distribution within each local window. A dynamic binarization threshold is adaptively set based on the brightness differences in different regions. The pixels of the grayscale image are then divided according to this threshold, uniformly mapping each pixel to either pure black or pure white, thus completing the image binarization operation. This reduces the impact of uneven overall illumination and local brightness deviations, improving the uniformity of global image contrast. Consequently, it enhances the image quality regularity and contrast balance of the normalized image, thereby improving the accuracy of distinguishing text areas from background areas.

[0099] S303: Identify text feature indicators of text regions within a normalized image, delete text regions corresponding to text feature indicators that match preset noise features, and obtain a filtered image. The text feature indicators include at least one of the following: character stroke width, connected region area, size ratio, positional distribution, and color layering information.

[0100] In this embodiment, region detection and contour extraction can be performed on the normalized image to accurately locate all target regions of suspected text in the image, and calculate multiple text feature indicators corresponding to each region. Noise feature standards are preset based on the characteristics of the target scene image, and the measured character stroke width, connected component area, aspect ratio, region location distribution, color layering, and other indicators are compared with the preset noise features one by one. If the feature indicators of a certain region meet the noise feature judgment conditions, the region is determined to be an invalid interference region such as stains, noise, or messy textures. This type of invalid text region is automatically removed and erased, retaining the target text region, thus completing image noise filtering to generate a filtered image free of miscellaneous interference.

[0101] S304: Perform text enhancement processing on the filtered image to obtain the image to be recognized. The text enhancement processing includes at least one of image opening / closing operations and edge-preserving smoothing processing.

[0102] In this embodiment, targeted text enhancement optimization can be performed on the filtered image after noise filtering. This can be achieved by using image opening / closing operations and edge-preserving smoothing alone, or by combining both methods for synergistic optimization. Image opening / closing operations fill in small gaps in text strokes and eliminate minor burrs around the text, optimizing the integrity of the text structure. Edge-preserving smoothing weakens interference from minor textures in the image background while fully preserving the details of the text outline edges, reducing blurring of text edges. This effectively enhances the clarity of text outlines and the integrity of strokes, improving the distinction between text and background, thereby improving the image quality and text feature prominence of the image to be recognized, and ensuring the accuracy and stability of subsequent text recognition.

[0103] In other words, the original image is denoised using a multi-threshold denoising algorithm to obtain the image to be recognized. The multi-threshold denoising algorithm does not only use a single grayscale threshold for filtering, but also includes grayscale conversion, adaptive binarization, connected component analysis, morphological denoising, and edge-preserving smoothing.

[0104] In layman's terms, the chat area image is first converted to grayscale, and adaptive binarization is performed based on the local window brightness distribution to eliminate the impact of differences in interface backgrounds and screenshot quality. Then, based on character stroke width, connected component area, aspect ratio, positional distribution, and color layering information, suspected advertising badges, watermarks, decorative icons, emoji fragments, and abnormal noise are initially removed. Next, opening and closing operations are used to remove isolated noise and connect fragmented target characters. Edge-preserving smoothing is employed to retain text outlines, avoiding the loss of stroke information due to excessive smoothing. For the identification of advertising logos and meaningless characters, this invention further combines prior interface regions, character confidence, dictionary matching results, and contextual semantic consistency for joint judgment, thereby reducing the risk of mistakenly deleting target text due to relying solely on pixel thresholds.

[0105] Please see Figure 5 , Figure 5 This is a flowchart illustrating an embodiment of intent recognition of key text in this application.

[0106] S401: Input the text into the word segmenter and use the word segmenter to obtain text segments.

[0107] In this embodiment, for example, the input text could be "What is the price of this product?", and the segmented text could include "CLS marker", "please", "this", "product", "of", "price", "is", "how much", "question mark", and "SEP marker". The CLS marker represents the beginning position marker of the sequence and can be used to form a sequence beginning position vector; the SEP marker represents the end position marker of the sequence.

[0108] S402: Input the text segmentation into the embedding layer to obtain the segmentation vector.

[0109] In this embodiment, it can be converted into a 768-dimensional vector through a basic embedding layer (Token Embedding), a position encoding embedding layer (Position Embedding), and a sentence differentiation embedding layer (Segment Embedding).

[0110] S403: The word segmentation vectors are summed and then input into the semantic analysis model for intent recognition.

[0111] In this embodiment, the semantic analysis model can be composed of 12 layers of Transformer (an encoder structure), where the first layer is used to capture relationships, the second layer is used to perform sublinear transformations, and the third to twelfth layers are used for repeated stacking of deep feature extraction.

[0112] S404: Extracts the sentence-level representation of the beginning position vector of the sequence, passes it through the input fully connected layer, activates the result of the fully connected layer using an activation function, performs regularization, passes it through the input fully connected layer, activates the result of the fully connected layer using an activation function, performs regularization, and then outputs the original value belonging to the preset intention through the output layer.

[0113] S405: Input the original values ​​into the normalization layer to obtain the probability distribution belonging to the preset intent, so as to determine the interaction intent.

[0114] In this embodiment, for example, when the normalization layer outputs "Inquiry intent: 0.92", "Consultation intent: 0.05", "Complaint intent: 0.01", "Order placement intent: 0.01", and "Casual chat intent: 0.01", the interaction intent can be determined to be an inquiry intent, and the probability of the inquiry intent, 0.92, can be used as its confidence level.

[0115] Please see Figure 6 , Figure 6 This is a flowchart illustrating an embodiment of emotion recognition of target text according to this application.

[0116] In one embodiment, the target text can be input into a sentiment analysis model. The text vector matrix is ​​obtained by passing the word embedding layer and word vector matrix of the sentiment analysis model. The text vector matrix is ​​then input into multiple convolutional layers to capture multiple feature maps. The filter dimensions of the multiple convolutional layers can be different. The multiple feature maps are then input into a max-pooling layer, and the output of the max-pooling layer is input into a concatenation layer to obtain a feature vector.

[0117] Next, the text is passed sequentially through a first fully connected layer, the result of which is then activated using an activation function, and subjected to a first regularization process. It is then passed through a second fully connected layer, the result of which is activated using an activation function, and subjected to a second regularization process to obtain the original values ​​of the target text belonging to each preset emotion. A normalized activation function is then used to normalize the original values ​​belonging to each preset emotion, resulting in a probability distribution for each preset emotion, thus determining the interactive emotion. The interactive emotion can be a single emotion or a combination of multiple emotions. Figure 6 The example demonstrates how interactive emotions can encompass multiple emotions.

[0118] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0119] The embodiments of this application also provide a message interaction method, and the message interaction method is described in detail in conjunction with the execution flow of the message interaction method.

[0120] Please see Figure 7 , Figure 7 This is a flowchart illustrating an embodiment of the message interaction method of this application.

[0121] S501: Obtain the input text formed by the interaction data of the current round with the session object.

[0122] S501: Use content analysis methods to analyze the input text to obtain its intent tags and sentiment tags.

[0123] In this embodiment, the content analysis method can be as described in any of the above embodiments, and will not be repeated here.

[0124] S503: Adapt intention tags and emotion tags to generate candidate responses to assist in responding to interaction data.

[0125] Furthermore, in this embodiment, intent tags, sentiment tags, industry keywords within the input text, confidence scores of the input text, and time information can be integrated to obtain fusion analysis information. The fusion analysis information is then used to update the user profile of the conversation object. Specifically, when the current and / or historical intent tags of the conversation object contradict historical tags, the weight of historical tags is reduced when updating the user profile. Candidate responses adapted to the user profile are then generated.

[0126] In other words, in this embodiment, during message interaction, the user engaging in the interaction can be considered the conversation object. Emotional and intent tags can be identified based on their input text, and the user profile of the conversation object can be updated accordingly to generate candidate responses. If so, the candidate responses can be evaluated to determine the actual interaction response used, or the user can select and / or modify the candidate responses to obtain the interaction response; this is not limited here. Furthermore, as explained above, this embodiment is also compatible with multiple instant messaging platforms to facilitate cross-platform message interaction.

[0127] The identification of emotion tags and intent tags has been illustrated in detail above, so it will not be repeated here. The following section will illustrate the detailed principles of message interaction methods with examples.

[0128] The following provides a detailed explanation of the principles behind updating user profiles.

[0129] S601, identify the interaction data between the user and the current round, and obtain the single-round preset words and single-round tags for the current round, wherein the single-round preset words are used to represent the semantic units extracted from the interaction data.

[0130] This involves acquiring real-time chat data between users and staff based on communication platforms, such as social media or instant messaging software. The system can also obtain raw chat logs generated on the platform, i.e., interaction data, which includes text and images. Images can be converted into analyzable text using Optical Character Recognition (OCR). The interaction data for the current round with the user represents the information generated between the user and the trade support tool in this dialogue, including: the content entered by the user, such as text, instructions, or selected options; and the content of responses to the user, such as answers, hints, follow-up questions, or guiding statements. This interaction data serves as the foundation for subsequent backend analysis. The specific communication platform can be determined based on the actual usage scenario or user habits.

[0131] The pre-set words for the current round are used to represent the basic semantic units extracted from the interaction data with the user in the current round. They can be the recognition results obtained after recognizing pre-set keywords, fixed feature words, and rule words during the interaction with the user in the current round. The single-round label is used to represent the feature identifier for classifying users. It can be temporary user labels identified based on the current single-round interaction data.

[0132] Specifically, if keywords such as "excavator" and "overseas promotion" appear multiple times in the user's interaction data in the current round, it can be determined that the preset words for the single round include "excavator" and "overseas promotion". If the preset words for the single round (excavator, overseas promotion) have a strong semantic association with the export trade tags for construction machinery products in the tag knowledge graph, then the user's single round tags include the export trade tags for construction machinery products.

[0133] S602, based on single-turn preset words, single-turn tags and historical interaction data with the user, determines the state data of the dialogue state machine. The dialogue state machine is determined based on a finite state machine model, and the state data is used to represent the state switching logic.

[0134] The user's historical interaction data represents past dialogues or interactions with that user, including historical keywords, historical tags, historical state records, and historical profile data. The dialogue state machine is determined based on a Finite State Machine (FSM) model and includes multiple states, with pre-defined state transition conditions between each state. Specifically, the dialogue state machine can be configured to include an initial state, intermediate states, and a termination state. The initial state represents the state at the beginning of the session. The intermediate states represent the state from the beginning of the session until its end. The termination state represents the state at the end of the session. Pre-defined single-turn words, single-turn tags, and historical interaction data can be matched with the state transition conditions of the dialogue state machine, and the state switching logic of the dialogue state machine is determined based on the matching results. The state data of the dialogue state machine includes: the current state of the state machine, the historical state transition trajectory, and the state transition trigger conditions.

[0135] In S602, determining single-turn tags solely based on the user's interaction data in the current turn is susceptible to user input errors or single-turn ambiguities. Relying solely on historical interaction data may fail to reflect changes in user intent. A better approach is to merge the user's interaction data from the current turn with historical interaction data. Based on this merged data, it's possible to determine whether the single-turn tag continues the previous dialogue topic, whether the core requirement has changed, or whether previously unspoken information has been supplemented. The determination result is then matched against the state transition rules of the dialogue state machine to determine the state switching logic for the current turn of the dialogue.

[0136] Specifically, the current conversation state can be determined based on pre-set single-turn words, single-turn tags, and historical interaction data with the user. Based on the historical and current conversation states, the state data of the dialogue state machine can then be determined. For example, if a user first asks, "Hello, I'd like to learn about excavator promotions," the state data of the dialogue state machine is determined to be in the initial state. If the user then asks again, "Promotions for a certain excavator," the state data of the dialogue state machine is determined to be in the initial state, transitioning to an intermediate state. If the user asks, "Okay, I'll contact you again if I need anything later," the state data of the dialogue state machine is determined to be in the intermediate state, transitioning to the terminated state.

[0137] S603, identify single-wheel labels with semantic conflicts and / or single-wheel labels that do not conform to the state switching logic represented by the state data, and treat them as abnormal labels.

[0138] Semantic conflict is used to characterize logically mutually exclusive combinations between single-round labels, such as a refund intention label and a satisfaction label, or a high purchase intention label and a abandonment of cooperation label. Single-round labels that do not conform to the state transition logic represented by the state data are used to characterize labels that contradict the state transition logic of the dialogue state machine. Anomaly labels are used to characterize temporary labels within a single round that contain internal semantic contradictions or contradict the state transition logic of the state machine.

[0139] In S603, it is possible to determine whether there are semantically conflicting tags, tags that contradict the state transition logic of the dialogue state machine, or tags that are both semantically conflicting and contradict the state transition logic of the dialogue state machine. If there are tags that are semantically conflicting or contradict the state transition logic of the dialogue state machine, these tags are determined to be abnormal tags.

[0140] Specifically, if the user sends "Hello" for the first time, the state data of the dialogue state machine is determined to be the initial state. If there is a session end label in the single-round label of the current round, the session end label does not conform to the state switching logic represented by the state data, and the session end label is regarded as an abnormal label.

[0141] S604: Based on historical interaction data, correct abnormal labels to obtain corrected labels, and based on single-round preset words and corrected labels, update the user profile and the state of the dialogue state machine.

[0142] Among them, the corrected label is used to represent the compliant label obtained after adjusting or replacing the confidence level of abnormal labels based on historical interaction data. The user profile is used to represent the user feature model including labels, keywords, and weights.

[0143] In S604, for anomalous tags, confidence correction, conflicting tag replacement, and invalid tag removal can be performed based on historical interaction data to resolve misjudgments and contradictions in single-round recognition. Based on reliable single-round preset words and corrected tags, user profile tags, intention weights, and behavioral preferences can be iterated synchronously. Simultaneously, based on single-round preset words and corrected tags, the dialogue state machine is driven to update its state, awaiting the next round of interaction recognition.

[0144] The user profile update method provided in this embodiment determines keywords and tags to be determined based on single-round interactions, determines the state constraints of the dialogue state machine based on single-round and historical interaction data, filters abnormal tags based on tag semantic verification and state machine state constraints, corrects abnormal tags based on historical interaction data, and updates the user profile and dialogue state machine state data based on keywords and corrected tags. Using each round of user interaction data as a trigger condition, it identifies preset words and tags for each round in real time, no longer relying on long-term fixed static tags. Each round of user dialogue initiates a completely new round of semantic capture, responding to real-time expressions such as budget adjustments, interest switching, and intent changes, solving the problem of untimely user profile updates. This reduces contradictory tags in single-round recognition, lowers intent misjudgment, and improves the accuracy of tag recognition. Simultaneously, based on the state constraints of the dialogue state machine, it ensures that user tags are consistent with the conversation evolution logic, conforming to the real interaction process, and enabling intelligent interaction strategies to dynamically adapt to user needs, improving the user experience.

[0145] In some optional implementations, obtaining the single-round preset words and single-round tags for the current round includes: identifying at least one preset word contained in the user's interaction data for the current round as the single-round preset word; querying all target tags corresponding to the preset words in the tag knowledge graph and linking the preset words with the target tags; extracting a first semantic vector based on the preset words and a second semantic vector based on the target tags, and determining the similarity between the first semantic vector and the second semantic vector; if the similarity is higher than a preset similarity threshold, adding the target tags to the single-round tags, wherein the number of target tags contained in the single-round tags is at least one.

[0146] The tag knowledge graph can be a pre-constructed knowledge system containing hierarchical tags and semantic relationships, used to map identified preset words (keywords) to tags in user profiles. Entities represent semantic objects with clear business meanings corresponding to preset words. Entity links match and bind the identified preset words (keywords) with corresponding standard tag nodes in the tag knowledge graph, unifying diverse colloquial user expressions to semantic entities within the tag knowledge graph and avoiding tag matching errors caused by different meanings of the same word or different words with the same meaning. The first semantic vector represents the vector representation obtained after semantically vectorizing the preset words. The second semantic vector represents the vector representation obtained after semantically vectorizing the corresponding target tag in the tag knowledge graph. Similarity represents the semantic closeness between word vectors and tag vectors. The preset similarity threshold can be a pre-set minimum score for judging whether a preset word matches a tag. The target tag represents the tag in the tag knowledge graph that semantically matches the preset words.

[0147] In this implementation, a tag knowledge graph can be created based on a pre-defined multi-dimensional tag system. User tags can be hierarchically linked according to core tags, sub-tags, associated attributes, and business entities, and the functional semantic edges of synonyms, near-synonyms, hierarchical relationships, causal relationships, and subordinate relationships between user tags can be labeled. Pre-defined words are mapped to the standard tags already defined in the tag knowledge graph, completing the link from the pre-defined words to the tag system. Here, the pre-defined words are keywords, which are the core basis for generating tags, and the tags are the abstraction and classification of the semantic meaning of the keywords. Subsequently, through the repeated occurrence of keywords and semantic association verification, the accurate labeling of user profiles is completed.

[0148] Specifically, if the user's interaction data in the current round is "I want to inquire about the device's delivery time," the identified preset words are "device," "delivery," and "delivery time." The retrieved target tags in the tag knowledge graph are: for "device," "product inquiry" and "goods intention"; for "delivery," "logistics inquiry" and "delivery timeliness inquiry"; and for "delivery time," "timeliness inquiry." The device is then linked to the device entity in the tag knowledge graph. The delivery time is linked to the delivery timeliness entity in the tag knowledge graph.

[0149] Both the preset words and their corresponding target tags are converted into semantic vectors. The preset words are then projected onto tag knowledge graph nodes, and their similarity is calculated to determine whether their semantics are truly consistent. Tag nodes with a semantic relevance higher than a preset similarity threshold are identified as target tags, thus completing the accurate matching between the preset words and existing user tags.

[0150] The current round of user interaction data can also be input into the intent analysis model to obtain single-round tags. The intent analysis model matches the corresponding category in a multi-dimensional tagging system based on the semantics of the chat text, outputting tags related to the user's current needs, emotions, and behaviors. The intent analysis model can use a Bidirectional Encoder Representations from Transformers (BERT) model, an optimized version of the original BERT model, pre-trained and fine-tuned for specialized vocabulary in trade scenarios (such as overseas promotion and cross-border logistics) and industry terminology to improve the accuracy of intent recognition and keyword extraction. Alternatively, an improved pre-trained language model can be used, such as the Robustly Optimized BERT Pretraining Approach (RoBERTa) or a lightweight BERT model for self-supervised learning of language representations (ALBERT). In this way, through pre-defined word extraction, tag knowledge graph entity linking, and semantic vector similarity verification, accurate and automated generation of standard user tags from user interaction text can be achieved. Compared to related technologies that directly map keywords, user tags are more standardized, more accurate in identification, and more resistant to interference, providing a high-quality tag source for dynamic user profiles in real time and stably.

[0151] In some optional implementations, the dialogue state machine includes an initial state, an intermediate state, and a termination state. Single-turn tags include intent tags and / or emotion tags. Identifying single-turn tags with semantic conflicts and / or those that do not conform to the state-switching logic represented by the state data as anomalous tags includes: if a single-turn tag does not conform to the state-switching logic represented by the state data, determining that the single-turn tag is an anomalous tag, wherein the state-switching logic includes switching from the initial state to the intermediate state, and switching from the intermediate state to the termination state. The initial state is used to represent the state of the first establishment of a conversation with the user, the intermediate state is used to represent the state from the establishment of the conversation to the end of the conversation, and the termination state is used to represent the state of the end of the conversation. Intent tags and emotion tags in single-turn tags can be combined to obtain at least one combination. If the semantic similarity between the intent tags and emotion tags in the target combination is lower than a first similarity threshold, it is determined that the intent tags and emotion tags in the target combination have a semantic conflict, and the intent tags and emotion tags in the target combination are identified as anomalous tags.

[0152] Specifically, if a conversation with a user has just begun, and the user has not clearly expressed a valid need, nor exhibited a fixed intention or stable emotion, then the dialogue state machine is in the initial state. If the conversation is ongoing, and the user continues to inquire, their intention or emotion may iteratively change, then the dialogue state machine is in an intermediate state. If the conversation ends, such as when a need is confirmed, a request is fulfilled, or communication concludes and the intention no longer changes, then the dialogue state machine is in the terminated state. The state transition logic is used to represent the preset, legal state transition paths.

[0153] In this implementation, the states of the dialogue state machine are defined as an initial state, an intermediate state, and a termination state. The switching path of the dialogue state machine is set: from the start of the interaction process to its end. Based on a specific tag in the current single round, the existing states of the dialogue state machine are compared with the allowed transition logic. If the intent corresponding to that tag does not conform to the content that can occur in the current stage (e.g., a conversation end tag appearing in the initial state), the tag is determined to be an abnormal tag.

[0154] The intent tags and emotion tags identified in this round are paired, and the semantic vectors of the intent tags and emotion tags within each pair are extracted. The semantic correlation between the intent tag vector and the emotion tag vector within the pair is calculated using a cosine similarity algorithm to obtain their semantic similarity values. A first similarity threshold is pre-configured. If the semantic similarity between the intent tag vector and the emotion tag vector in the target pair is lower than this threshold, the intent tag and emotion tag in the target pair are determined to be abnormal tags.

[0155] In this way, abnormal tags with temporal anomalies or logical conflicts can be accurately identified, ensuring that the user profile updated based on tags always matches the user's real and latest needs, which facilitates the execution of subsequent intelligent recommendation and interactive response strategies.

[0156] In some optional implementations, intermediate states may include a main intermediate state and sub-intermediate states. The main intermediate state characterizes the global session process state, maintaining a forward flow logic with the initial and final states. Sub-intermediate states can be determined based on business intent. For example, sub-intermediate states may include consultation states, intention states, and decision states. Consultation states may be product consultation states, price consultation states, order consultation states, or logistics consultation states. Intention states may be order placement intention states or negotiation states. Decision states may be order confirmation states, refund request states, or order cancellation states.

[0157] If a single-round label includes multiple labels, the switching or parallel execution of the corresponding sub-intermediate states is triggered based on these multiple labels. Specifically, if a single-round label includes multiple labels, the sub-intermediate states corresponding to these multiple labels can be triggered in parallel. For example, if a single-round label includes a "Consult Excavator Export Price" label and a "Inquire about Refund Policy" label, the "Price Inquiry" sub-state corresponding to the "Consult Excavator Export Price" label and the "Refund Inquiry" sub-state corresponding to the "Inquire about Refund Policy" label can be triggered simultaneously. The aforementioned state switching logic also includes switching from the first sub-intermediate state to the second sub-intermediate state, or from the second sub-intermediate state to the first sub-intermediate state. Sub-intermediate state switching does not affect the main intermediate state. Sub-intermediate states support free switching and do not need to follow a fixed order.

[0158] If the dialogue state machine is in the main intermediate state, and if the single-round label is a normal label, combine the intent label and emotion label in the single-round label. If there is a semantic conflict in the combination result, determine that the intent label and emotion label in the combination result are abnormal labels.

[0159] Specifically, if the main intermediate state of the dialogue state machine is "Engineering Machinery Interaction," and the sub-intermediate state is "Procurement Consultation," the single-round labels include: "Refund Intent" label, "Inquiry about Export Customs Clearance Process" label, and "Concern" label. If the "Refund Consultation" sub-state corresponding to the "Refund Intent" label and the "Customs Clearance Consultation" sub-state corresponding to the "Inquiry about Export Customs Clearance Process" label are triggered, then the sub-intermediate states of the dialogue state machine will be updated to include: "Procurement Consultation," "Refund Consultation," and "Customs Clearance Consultation."

[0160] In this way, by using a hierarchical design of main intermediate states and sub-intermediate states, the rigid constraints of the original single intermediate state are broken, allowing users to express multiple intentions in parallel and switch between intentions freely when the dialogue state machine is in an intermediate state. This aligns with users' real communication habits and reduces the probability of interaction interruption caused by system judgment anomalies.

[0161] In some optional implementations, correcting abnormal labels based on historical interaction data to obtain corrected labels includes: evaluating a set of confidence weights for abnormal labels. The set of confidence weights includes at least one of historical label confidence weights, dialogue round confidence weights, and semantic matching weights. Historical label confidence weights are determined based on the average confidence of labels of the same type as the abnormal label in historical interaction data. Within the maximum range of dialogue round confidence weights, the dialogue round confidence weight increases with the number of dialogue rounds. Semantic matching weights are determined based on the semantic similarity between the abnormal label and historical labels. The current confidence of the abnormal label is determined based on the semantic similarity between the abnormal label and the corresponding single-round preset words. The corrected confidence is obtained by multiplying the weighted sum of the historical label confidence weights, dialogue round confidence weights, and semantic matching weights with the current confidence. The abnormal label with the corrected confidence is then used as the corrected label.

[0162] The current confidence score (ranging from 0 to 1) characterizes the current confidence score of the anomalous label, reflecting the initial reliability of the single-round identification result. It can be determined based on the semantic similarity between the anomalous label and the corresponding pre-defined words in the single round. The confidence weight set is used to adjust the initial confidence score of the anomalous label and calculate the weighted parameters for the corrected confidence score. It can optimize label confidence by combining historical data, ensuring that the corrected result aligns with the user's true intent.

[0163] In this embodiment, the initial confidence level of the abnormal label can be used as a basis, combined with at least one confidence level weight (historical label confidence level weight, dialogue round confidence level weight, semantic matching degree weight), and a preset weighting algorithm can be used to calculate the corrected confidence level by calculating the weighted sum of the corrected confidence level = initial confidence level × confidence level weight, thereby completing the optimization and adjustment of the credibility of the abnormal label.

[0164] Specifically, you can retrieve tags of the same type as the current abnormal tag from the user's historical interaction data and calculate the average confidence score of these historical tags. For example, if the confidence scores of three historical intent tags of the same type are 0.8, 0.75, and 0.85 respectively, and the average is 0.8, this average is the historical tag confidence score weight, which ranges from 0 to 1. The higher the average, the higher the credibility of the user's historical tags of the same type, and the greater the reference value for correcting the current abnormal tag.

[0165] The maximum value of this weight can be preset, such as 0.5. Following the rule of increasing weight with each round, the weight increases as the current dialogue round progresses, but the weight value never exceeds the preset maximum value. In this way, the user's intent becomes clearer as the dialogue round progresses, and the reliability of tag recognition increases.

[0166] Semantic vectorization algorithms can be used to convert abnormal tags and users' historical tags of the same type into semantic vectors, and then calculate the semantic similarity between the two. This similarity is the semantic matching weight, with a value ranging from 0 to 1. The higher the similarity, the more closely the abnormal tag matches the user's historical intent and behavioral habits, and the more likely the tag will be retained during correction.

[0167] In this way, by using historical tag confidence weights and semantic matching weights, the correction of abnormal tags is deeply linked to users' long-term interaction habits, avoiding correction biases caused by relying solely on single-round recognition results and ensuring that the corrected tags conform to the user's past behavioral logic. Simultaneously, the confidence weights for each dialogue round follow the logic of higher weights for later rounds, aligning with the pattern in real interactions where user intent gradually becomes clearer with each round. This avoids incorrectly correcting tags from later rounds with clear intents, improving the temporal rationality of the correction results.

[0168] In some optional implementations, the user profile is updated based on a single round of preset words and corrected labels, including: if the corrected confidence level is greater than or equal to a preset confidence threshold, adjusting the confidence level of the labels in the user profile corresponding to the corrected confidence level to the corrected confidence level; if the corrected confidence level is less than the preset confidence threshold, deleting the abnormal labels from the user profile.

[0169] In this embodiment, a preset confidence threshold is used to characterize the preset label confidence judgment standard, such as 0.6. When an abnormal label, after correction, has a corrected confidence level that reaches or exceeds this threshold, it indicates that the corrected label has high credibility and matches the user's true intent. At this time, based on this corrected confidence level, the corresponding type of label and its weight in the user profile are updated synchronously. Thus, the higher the corrected confidence level, the higher the weight of the corresponding label in the user profile, strengthening the label's influence on the user profile and achieving accurate iteration of the profile.

[0170] When the corrected confidence level of an anomaly label falls below the preset confidence threshold, it indicates that even after correction, the label's confidence level is insufficient and it cannot be used to update the user profile. The anomaly label can be deleted.

[0171] In this way, by setting a pre-set confidence threshold, the corrected tags are filtered a second time. Only high-confidence tags are used to update the tags in the profile, while low-confidence tags are deleted. This reduces the number of abnormal or low-confidence tags entering the user profile, avoids profile distortion, and ensures that the profile always matches the user's true intentions.

[0172] User profiling in related technologies does not consider the chat time dimension and ignores the impact of the silent period on customer interest, which can lead to inaccurate timing of follow-up.

[0173] In some optional implementations, the aforementioned user profile update method further includes: obtaining the last interaction time with the user, and determining the user's interaction termination duration based on the last interaction time. Relevant tags are determined based on tags whose tag frequency is greater than or equal to a preset frequency threshold and / or whose tag weight is greater than or equal to a weight threshold in a preset number of rounds prior to the last interaction time. If the interaction termination duration exceeds a preset feedback cycle threshold, the weight of the relevant tags is reduced and / or a "to be contacted" tag is added to the user.

[0174] In this implementation, the time of the last valid interaction with the user, recorded in the trade support tool, can be obtained, such as the timestamp of the last conversation sent by the user that triggered the interaction. The time difference between the current system time and the last interaction time is then calculated; this time difference is the duration of the user's interaction interruption, used to measure the duration of the user's silent interaction.

[0175] The preset rounds are a pre-defined range of historical interaction rounds used to filter relevant tags, such as the five rounds of dialogue prior to the last interaction. User tag data within this preset round is retrieved, and relevant tags are determined using at least one of the following methods: First, the frequency of each tag is statistically analyzed; tags with higher frequencies are more relevant to the user's core needs, for example, tags with a frequency greater than or equal to a preset tag threshold. Second, the weight of each tag is considered; tags with higher weights better reflect the user's core intent, for example, tags with a weight greater than or equal to a weight threshold. The tags ultimately selected that are related to the user's core needs or intent are the relevant tags that need adjustment.

[0176] If the interaction pause duration exceeds a preset feedback cycle threshold, the weight of relevant tags is reduced, or a "to be contacted" tag is added to the user, or both are done simultaneously. The preset feedback cycle threshold is a pre-defined critical duration for determining user inactivity, such as 7 days. When a user's interaction pause duration exceeds this threshold, it indicates a decrease in user engagement and a potential change in needs. At this point, at least one of two adjustment operations is performed: First, the weight of relevant tags is reduced to weaken their impact on the user profile, such as lowering the tag weight from 0.8 to 0.4, preventing outdated tags from dominating the user profile. Second, a "to be contacted" tag is added to the user, such as a "silent user" tag or a "needs confirmation pending" tag, to mark the user's current status and provide a clear indicator for subsequent interaction strategy adjustments. For example, if a user's inactivity exceeds 48 hours, sales personnel are automatically alerted to the risk of customer churn.

[0177] Specifically, when a customer does not respond to messages for 48 consecutive hours, the system lowers the weight of their high-interest tag based on a silence warning mechanism and adds a "decreased interest, please contact" tag to the customer profile. Upon seeing this tag, sales personnel can resend appropriate follow-up messages. If the customer subsequently replies, the system readjusts the tag weight based on the new intent and sentiment.

[0178] In this way, for scenarios where users haven't responded for a long time, adjusting the weight of relevant tags or adding tags for users to be contacted prevents the original core tags from retaining high weight after the user becomes silent, thus avoiding a disconnect between the user profile and the user's current real needs. This compensates for the deficiency in related technologies where user profiles are only updated during interactions, ensuring that the user profile always reflects the user's latest status. At the same time, it can predict potential customer churn in advance, providing sales staff with follow-up strategies, demonstrating good predictability.

[0179] In some optional implementations, if the interaction pause duration exceeds a preset feedback cycle threshold, the weight of the relevant tag is reduced and / or a "to be contacted" tag is added to the user. This includes: if the interaction pause duration is greater than or equal to a first preset feedback cycle threshold and less than a second preset feedback cycle threshold, the weight of the relevant tag is reduced based on the first tag weight. If the interaction pause duration is greater than or equal to the second preset feedback cycle threshold and less than a third preset feedback cycle threshold, the weight of the relevant tag is reduced based on the second tag weight, wherein the first preset feedback cycle threshold is less than the second preset feedback cycle threshold, the second preset feedback cycle threshold is less than the third preset feedback cycle threshold, and the first tag weight is greater than the second tag weight. If the interaction pause duration is greater than or equal to the third preset feedback cycle threshold, the weight of the relevant tag is reduced based on the third tag weight, wherein the second tag weight is greater than the third tag weight.

[0180] In this embodiment, a user silence warning can also be provided. The specific principle is illustrated below with examples.

[0181] S6101 executes a user silence warning task based on a preset time.

[0182] S6102, obtain the user's last interaction time. For example, the user's last interaction time can be configured as the last_contact field.

[0183] S6103 iterates through the users in sequence based on the user list.

[0184] S6104, for the currently traversed user, determine the interaction suspension duration. The interaction suspension duration, days, can be calculated as follows: days = today - last_contact, where today represents the time spent executing the user silence warning task.

[0185] S6105, determine the threshold range of the interaction termination duration. If the interaction termination duration is less than the first preset feedback cycle threshold, proceed to S6106. If the interaction termination duration is greater than or equal to the first preset feedback cycle threshold and less than the second preset feedback cycle threshold, proceed to S6107. If the interaction termination duration is greater than or equal to the second preset feedback cycle threshold and less than the third preset feedback cycle threshold, proceed to S6108. If the interaction termination duration is greater than or equal to the third preset feedback cycle threshold, proceed to S6109.

[0186] Specifically, the first preset feedback period threshold can be configured to seven days, the second preset feedback period threshold can be configured to fourteen days, and the third preset feedback period threshold can be configured to thirty days.

[0187] S6106: The user whose interaction was interrupted for a certain period of time is in a normal state. No warning is needed. Do not adjust the weight of related tags, do not add tags to be contacted, and proceed to S6110.

[0188] S6107 sends a reminder and warning to users whose interaction has been interrupted for a certain period of time. If the user's churn risk is deemed low, the weight of related tags or all tags is reduced based on the weight of the first tag. A "to be contacted" tag is added to the user, and it is recommended to follow up on the user. Then proceed to S6110. Specifically, the weight of the first tag can be configured to 0.8.

[0189] S6108 issues a general warning for users whose interaction duration has ceased, determines the user's churn risk to be medium, reduces the weight of related or all tags based on the second tag weight, adds a "to be contacted" tag to the user, suggests following up with the user, and proceeds to S6111. Specifically, the second tag weight can be configured to 0.6.

[0190] S6109: Issue a severe warning for users whose interaction has been interrupted for a long time, determining that the user has a high risk of churn. Based on the weight of the third tag, reduce the weight of related tags or all tags, add a "to be contacted" tag to the user, indicating that the user needs to be followed up urgently, and proceed to S6112. Specifically, the weight of the second tag can be configured to 0.3.

[0191] S6110, record log, then transfer to S6113.

[0192] S6111, based on system message push notification, transitions to S6113.

[0193] S6112, based on system messages and email notifications, transitioned to S6113.

[0194] S6113 updates the database, then proceeds to S6114. The database can be a Structured Query Language database like MySQL or PostgreSQL. After the database update, the cache (remote dictionary server, or Redis for short) can be updated.

[0195] S6114: Determine if there are any users who have not been traversed. If they exist, proceed to S6103; otherwise, proceed to S6115.

[0196] S6115, Mission complete.

[0197] In this way, different weight reduction strategies are adopted based on the length of user inactivity. The longer the inactivity, the greater the reduction in tag weight. This accurately matches the changing patterns of user needs with the duration of inactivity, avoiding the problem of excessively weakening tags for short inactivity periods or insufficiently weakening tags for long inactivity periods. This ensures that the user profile always reflects the user's current state. At the same time, the different weight adjustments tied to the inactivity duration allow the system to accurately determine the degree of user inactivity and then formulate targeted interaction strategies, avoiding resource waste and user annoyance caused by a uniform strategy.

[0198] The principle behind updating user profiles can also be explained as follows.

[0199] S611, Obtain user information, including: user identification information (customer_id), the company to which the user belongs, the communication medium used by the user, or the time of the user's first contact (first_contact), etc.

[0200] S612, based on user identification information and the communication medium used by the user, obtains the interaction data with the user in the current round. The communication medium used by the user can be WeChat Work or WhatsApp, etc. Matching different communication mediums based on user habits can increase the coverage scenarios of this solution, ensure that user chat data can be effectively collected, and improve the applicability of this solution.

[0201] S613 identifies keywords based on the current round of user interaction data, inputs this data into the intent analysis model, and extracts tags. Tags include: intent tags, sentiment tags, industry category tags, price sensitivity tags, geographic region tags, and product preference tags. Intent tags can include: inquiry, consultation, complaint, and order placement. Sentiment tags can include: positive, neutral, negative, and urgency.

[0202] S614 inputs keywords and tags into the tag engine. Based on the tag engine and tag knowledge graph, it generates new tags for users, matches existing tags, and adjusts tag weights, thus updating the user profile.

[0203] The updated user profile can also be synchronized to the interaction module. Based on the interaction module, personalized responses can be provided to users, and marketing strategies corresponding to users can be executed. It can also integrate basic customer information from the customer relationship management system, store user profile data, and single-round preset words and single-round tags determined based on the current round of interaction data with users, based on the tag engine.

[0204] In some optional implementations, the aforementioned user profile update method further includes: determining the occurrence frequency of preset words and the time interval between two adjacent occurrences; binding the preset words to their corresponding target tags; normalizing the occurrence frequency of the preset words to obtain a first coefficient; exponentially decaying the time interval of the preset words to obtain a second coefficient; weighting and fusing the first coefficient and the second coefficient; and determining the target weight of the target tag based on the fusion result and the initial weight of the target tag.

[0205] In this way, by adjusting the weight of the target tags corresponding to the preset words based on their frequency of occurrence and time intervals, changes in user attention can be reflected.

[0206] The following is an illustrative example of the user profile update method involved in this application. In a communication scenario involving foreign trade in construction machinery, a user repeatedly mentioned keywords such as "excavator" and "overseas promotion" in chats. Based on the tag knowledge graph built above, entity linking, semantic vectorization, and similarity matching were performed on the keywords "excavator" and "overseas promotion," determining that they have a strong semantic association with the "export trade intention of construction machinery products" tag under the "industry category" dimension in the multi-dimensional tag system. Therefore, this user is marked as a "customer with export trade intention of construction machinery products," that is, the corresponding industry tag is added to the customer, not simply the "foreign trade" tag.

[0207] Meanwhile, the tag weight gradually increases as the frequency of occurrence of the keywords "excavator" and "overseas promotion" increases. In addition, the emotion recognition module (combined with dialogue state machine verification) shows that the customer repeatedly exhibits excitement, and the system further adds the "high interest" tag under the "emotional characteristics" dimension to the customer profile, completing the dynamic update of the customer profile.

[0208] This allows for the generation and updating of tags without manual intervention, reducing labor costs, avoiding human error, and achieving a high degree of automation. Furthermore, it is applicable to various cross-border trade communication scenarios and can be integrated with intelligent response and recommendation systems to provide users with personalized services.

[0209] The following is an example of a user profile data structure. The user profile data structure includes: a root node. The root node includes: user information, a multi-dimensional tag system, historical interaction data, and statistical data. Specifically, user information includes: user identification information, user communication medium, and first contact time. The multi-dimensional tag system includes: industry tags, intent tags, sentiment tags, product preferences, and risk tags. Historical interaction data includes: changes in language preferences and interaction records. Statistical data includes: number of interactions, average interaction duration, and last interaction time. Industry tags include: manufacturing (e.g., tag weight 0.8), foreign trade (e.g., tag weight 0.6). Intent tags include: inquiry (e.g., tag weight 0.9, timestamp 2025-10-16), consultation (e.g., tag weight 0.5, timestamp 2025-10-15). Sentiment tags include: positive (e.g., tag weight 0.7), urgency (e.g., tag weight 0.4). Product preferences include: machinery and equipment (e.g., a tag weight of 0.9); electronic components (e.g., a tag weight of 0.3); and risk tags, including: churn risk (e.g., a tag weight of 0); and high-value customers (e.g., a tag weight of 0.8).

[0210] This embodiment also provides a user profile updating device, which is used to implement the above embodiments and preferred embodiments, and will not be repeated as already described. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0211] This embodiment can also provide a user profile update device. The user profile update device may include an initial identification module for identifying the interaction data with the user in the current round, obtaining single-round preset words and single-round tags for the current round, wherein the single-round preset words are used to represent semantic units extracted from the interaction data. A state identification module is used to determine the state data of the dialogue state machine based on the single-round preset words, single-round tags, and historical interaction data with the user, wherein the dialogue state machine is determined based on a finite state machine model, and the state data is used to represent state switching logic. A target identification module is used to identify single-round tags with semantic conflicts and / or single-round tags that do not conform to the state switching logic represented by the state data, and treat them as abnormal tags. An update module is used to correct the abnormal tags based on historical interaction data to obtain corrected tags, and update the user profile and the state of the dialogue state machine based on the single-round preset words and corrected tags.

[0212] In some optional implementations, the initial identification module includes: a first unit for identifying at least one preset word contained in the user's interaction data in the current round, as a single-round preset word; querying all target tags corresponding to the preset words in the tag knowledge graph, and linking the preset words with the target tags as entities; extracting a first semantic vector based on the preset words, extracting a second semantic vector based on the target tags, and determining the similarity between the first semantic vector and the second semantic vector; if the similarity is higher than a preset similarity threshold, adding the target tag to the single-round tags, wherein the number of target tags contained in the single-round tags is at least one.

[0213] In some optional implementations, the update module includes an update module first unit, configured to determine that a single-round label is an anomalous label if it does not conform to the state switching logic represented by the state data. The state switching logic includes switching from an initial state to an intermediate state, and from an intermediate state to a terminated state. The initial state represents the state of the first session established with the user, the intermediate state represents the state from the establishment of the session to its end, and the terminated state represents the state of the end of the session. The update module also combines intent labels and emotion labels from the single-round labels to obtain at least one combination. If the semantic similarity between the intent labels and emotion labels in the target combination is lower than a first similarity threshold, it is determined that there is a semantic conflict between the intent labels and emotion labels in the target combination, and the intent labels and emotion labels in the target combination are identified as anomalous labels.

[0214] In some optional implementations, the update module further includes a second update module unit for evaluating a set of confidence weights for anomaly tags. The set of confidence weights includes at least one of historical tag confidence weights, dialogue round confidence weights, and semantic matching weights. Historical tag confidence weights are determined based on the average confidence of tags of the same type as the anomaly tag in historical interaction data. Within the maximum range of dialogue round confidence weights, the dialogue round confidence weights increase with each dialogue round. Semantic matching weights are determined based on the semantic similarity between the anomaly tag and historical tags. The current confidence of the anomaly tag is determined based on the semantic similarity between the anomaly tag and the corresponding single-round preset words. A corrected confidence is obtained by multiplying the weighted sum of historical tag confidence weights, dialogue round confidence weights, and semantic matching weights with the current confidence. Anomaly tags with corrected confidence are then used as corrected tags.

[0215] In some optional implementations, the update module further includes a third update module unit, configured to adjust the confidence level of the label corresponding to the corrected confidence level in the user profile to the corrected confidence level if the corrected confidence level is greater than or equal to a preset confidence threshold. If the corrected confidence level is less than the preset confidence threshold, the abnormal label is deleted from the user profile.

[0216] In some optional implementations, the aforementioned user profile update device further includes: an early warning module, used to obtain the last interaction time with the user and determine the duration of the user's interaction termination based on the last interaction time. Based on tags whose tag frequency is greater than or equal to a preset frequency threshold and / or whose tag weight is greater than or equal to a weight threshold in a preset number of rounds prior to the last interaction time, relevant tags are identified. If the duration of the interaction termination exceeds a preset feedback cycle threshold, the weight of the relevant tags is reduced and / or a "to be contacted" tag is added to the user.

[0217] In some optional implementations, the warning module includes: a first warning module unit, configured to: reduce the weight of relevant tags based on a first tag weight if the interaction termination duration is greater than or equal to a first preset feedback period threshold and the interaction termination duration is less than a second preset feedback period threshold; reduce the weight of relevant tags based on a second tag weight if the interaction termination duration is greater than or equal to the second preset feedback period threshold and the interaction termination duration is less than a third preset feedback period threshold, wherein the first preset feedback period threshold is less than the second preset feedback period threshold, the second preset feedback period threshold is less than the third preset feedback period threshold, and the first tag weight is greater than the second tag weight; reduce the weight of relevant tags based on a third tag weight if the interaction termination duration is greater than or equal to the third preset feedback period threshold, wherein the second tag weight is greater than the third tag weight.

[0218] The user profile updating apparatus provided in this application can execute the user profile updating method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.

[0219] The following provides a detailed explanation of the principles behind generating candidate responses and selecting an interactive response from them.

[0220] S701 acquires and analyzes user input text to obtain intent information, sentiment information, and product keywords.

[0221] User input text can be obtained through the chat window of communication tools (such as WhatsApp, WeChat Work, etc.).

[0222] To ensure the accuracy and integrity of the text, the screen can be periodically captured, and the captured images can be used for text recognition to obtain the user's input text. For example, the screen image of the chat area can be captured at a preset period (such as 5 seconds), and irrelevant characters in the image (such as meaningless text generated by input errors, advertising logos, etc.) can be filtered out through a multi-threshold noise reduction algorithm. Then, a high-precision text recognition engine can be used to extract the user's input text.

[0223] After acquiring user input text, the language model is used to determine product keywords and intent information. Then, a convolutional neural network is used to perform emotion recognition, yielding emotional information.

[0224] For example, the language model could be the BERT model, specifically bert-base-chinese. The language model includes embedding layers, encoding layers, classification layers, and sequence labeling layers. This model can contain a 12-layer Transformer encoder, 768 hidden layers, 12 attention heads, and approximately 110 million parameters. Based on pre-training on general Chinese corpora (such as Chinese Wikipedia), it can be further fine-tuned using business data from trade communication scenarios to adapt to the intent classification task in this field.

[0225] User input text can be fed into the input embedding layer of the BERT model. The model first segments the user input text, converting each word into a corresponding word embedding vector with a dimension of 768. Simultaneously, a positional embedding vector is added to each word to represent its position within the input sequence, preventing the self-attention mechanism from losing sequence order. The positional embeddings are learned during model pre-training and have the same dimension as the word embeddings. A segmental embedding vector is then added to each word to distinguish different segments in the input sequence; for single-sentence input scenarios, all words share the same segmental embedding. The word embedding vectors, positional embedding vectors, and segmental embedding vectors are element-wise summed to form the model's input vector, with a dimension of [sequence length × 768], which serves as the input to the subsequent Transformer encoder.

[0226] The input vector is sequentially passed through a 12-layer Transformer encoder. Each encoder layer contains a multi-head self-attention mechanism and a feedforward neural network. The multi-head self-attention mechanism uses 12 attention heads to compute the association weights between words in the text in parallel, enabling the model to capture long-distance dependencies. The feedforward neural network performs a non-linear transformation on the attention output to extract higher-level semantic features. After layer-by-layer computation through the 12 encoder layers, the model outputs a contextual semantic representation vector of the text, with dimensions of [sequence length × 768].

[0227] The vector corresponding to the [CLS] marker in the context semantic representation vector output by the encoder (this vector aggregates the semantic information of the entire sequence) is used as the overall representation of the text and input into the classification layer. The classification layer consists of a fully connected layer and a softmax function, mapping the 768-dimensional semantic representation to a multi-dimensional intent category space and outputting the probability distribution of each intent category. The category with the highest probability is selected as the final intent information output. For example, when a user inputs "I want to buy an excavator", the model calculates that the probability of the "inquiry" category is 0.92, so the output intent information is "inquiry".

[0228] The contextual semantic representation vector can be input into the sequence labeling layer, which outputs a label for each word position in the input sequence. The label identifies whether the word is part of a product keyword. Continuously labeled entity words are extracted as product keywords. Specifically, the model outputs information for each word in the input sequence, with information types including B-product, I-product, B-model, I-model, B-price, I-price, and O (irrelevant). By extracting continuously labeled entity words, a list of product keywords is obtained. For example, from "I want to buy a SY215C excavator," the model labels "SY215C" as "B-model" and "excavator" as "B-product," extracting the product keywords as "SY215C" (model) and "excavator" (product category).

[0229] Convolutional neural networks (CNNs) can be used to perform emotion recognition on user-input text to obtain emotional information. For example, a TextCNN model (a deep learning model that applies CNNs to text classification tasks) can be used. Its embedding dimension can be 300 (using Word2Vec pre-trained word vectors), the convolutional kernel size can be [2,3,4,5]-gram, the number of each type of convolutional kernel is 100, the total number of features is 400, the dropout rates are 0.5 and 0.3 respectively, the hidden layer activation function can be ReLU, the output layer activation function can be Sigmoid, and the loss function can be BinaryCrossEntropy.

[0230] The user input text can be segmented into a word sequence [w1, w2, ..., wn]. Each word is mapped to a low-dimensional, dense vector representation using a pre-trained word embedding layer (e.g., 300-dimensional word vectors trained on a large corpus using Word2Vec). After processing, the text of length n is transformed into an input matrix of dimension n × 300, where each row corresponds to the semantic vector of a word.

[0231] The obtained input matrix is ​​fed into the convolutional layer. To capture local semantic patterns of different lengths (granularities), convolutional kernels of various sizes can be used for parallel convolution operations. Specifically, convolutional kernels of sizes 2, 3, 4, and 5 are selected to extract 2-gram, 3-gram, 4-gram, and 5-gram continuous word sequence features, respectively. For example, a convolutional kernel of size 3 covers the word vectors of three consecutive words at a time, and the semantics of the combination of these three words are represented through convolution operations. To fully capture diverse emotional expressions, 100 convolutional kernels of each size are set. Each convolutional kernel performs sliding window calculation on the input matrix to extract local n-gram features (local semantic features). For example, a 3-gram convolutional kernel covers the word vectors of three consecutive words at a time, and the local semantic features of the combination of these three words are extracted through convolution operations. After the convolution operation, each kernel size produces 100 feature maps. Each feature map represents a specific local pattern in the text that is related to a certain emotion (such as very good, not so good, eagerly want, etc.). The dimension of each feature map is the sequence length minus the kernel size plus 1.

[0232] To extract the most critical signals from each feature map and address the issue of inconsistent input text lengths, max pooling is performed on each feature map, which involves taking the maximum value from all values ​​in that feature map. This maximum value represents the strongest emotional feature captured by the convolutional kernel throughout the entire text. After pooling, the 400 feature maps become 400 pooling values. Concatenating these values ​​forms a 400-dimensional global feature vector, which represents the sentiment representation of the entire input text.

[0233] Before inputting the feature vector into the fully connected layer, a Dropout layer can be used to randomly discard some neurons with a certain probability (e.g., 0.5 and 0.3). This effectively prevents the model from over-relying on certain specific features and improves generalization ability. The 400-dimensional feature vector is then input into the fully connected layer and, with the help of activation functions such as ReLU, undergoes a non-linear transformation to map it to a predefined sentiment category space.

[0234] For multi-label emotion recognition tasks (where a text may contain both excitement and urgency), the output layer uses the sigmoid activation function to output an independent probability value P, ∈ [0, 1], for each emotion category, representing the confidence level of that emotion. During training, the convolutional neural network model can use binary cross-entropy as the loss function to optimize the model parameters. Since this task involves multi-label classification, binary cross-entropy can independently measure the prediction error of each emotion category, making it more suitable than multi-class cross-entropy.

[0235] For example, the output of the Sigmoid layer can be binarized according to a preset threshold (such as 0.5), and at least one emotion category with a probability higher than the threshold can be used as the output emotion information. For instance, when a user inputs "I want to buy an excavator!!", the model outputs "excitement" with a probability of 0.85, "eagerness" with a probability of 0.72, and "neutrality" with a probability of 0.12, so the output emotion information is "excitement" and "eagerness".

[0236] It is understood that intent information may include awareness tags obtained from user input text and / or intent text contained within user input text, and emotion information may also include emotion tags obtained from user input text and / or emotion text contained within user input text, without limitation.

[0237] In one embodiment, the response generation method provided in this application further includes: determining whether a user profile exists in the cache; if a user profile exists in the cache, loading the user profile from the cache; if a user profile does not exist in the cache, loading the user profile from the database and writing the user profile into the cache; and determining a response strategy that matches the user profile.

[0238] Specifically, when retrieving a user's profile, the system first checks if the user's profile data exists in the Redis cache. If it doesn't exist (i.e., it's the first time accessing the database or the cache has expired), it queries the user's profile information from the MySQL database, writes the query result to the Redis cache, and sets the TTL to 24 hours. Within the next 24 hours, when accessing the user's profile again, it is read directly from the Redis cache without needing to query the database again.

[0239] The determination of response strategies matching user profiles includes: responding to user profiles including historical intent, determining the activity level and dispersion of various historical intents, determining the tone of the response based on the activity level of historical intents, determining the guidance method of the response based on the dispersion of historical intents, and incorporating tone and guidance method into the response strategy. And / or, responding to user profiles including product preferences, determining the preferred product types based on the distribution characteristics of product preferences, and incorporating the preferred product types into the response strategy. Responding to user profiles including language preferences, determining the language style of the response based on the type of language preference, and incorporating the language style into the response strategy. And / or, responding to user profiles including interaction frequency, determining the guidance strength and information density of the response based on the interaction frequency index, and incorporating the guidance strength and information density into the response strategy. And / or, responding to user profiles including user levels, determining the priority of response generation methods based on user levels, and incorporating the generation method priority into the response strategy; the generation method priority is the order in which different generation methods are selected when generating a response.

[0240] User profiles can be obtained by analyzing users' historical interaction behavior. User profiles include information from multiple dimensions such as historical intent, product preferences, language preferences, interaction frequency, and user value level.

[0241] Among them, historical intent is a record of the types of intents that users have shown in past interactions, including inquiries, technical consultations, complaints, order guidance, casual conversations, etc., with an accompanying time decay weight.

[0242] Product preferences are the product categories and their weight distribution that a user focuses on in their historical interactions, reflecting the degree of interest a user has in specific product types. Product preferences can be obtained by extracting entities from a user's historical chat logs.

[0243] Language preference refers to the tendency of a user's language expression in their historical interactions, reflecting their preferred language style and expression methods. Language preferences can be obtained by analyzing the language style of a user's historical messages. Specifically, language preferences can include concise (users prefer short sentences and direct expression), detailed (users prefer long sentences and complete expressions), technical (users prefer technical jargon and technical details), and colloquial (users prefer everyday expressions and conversational language).

[0244] Interaction frequency refers to the number of times a user interacts with the system and the speed of their response within a certain time window, reflecting the user's activity level and responsiveness. The interaction frequency index can be obtained by statistically analyzing user interaction behavior within a preset window (such as the last 30 days).

[0245] User value rating refers to a user's overall rating based on their historical value, interactive behavior, and potential value. It is used to guide the selection of response strategies and can be specifically divided into high-value users, ordinary users, and new users.

[0246] By selecting historical intent records from the most recent N sessions (e.g., the most recent 10 sessions) or the most recent M days (e.g., the most recent 30 days), and traversing each interaction within the statistics window in chronological order (from most recent to oldest), the decay factor for each interaction can be calculated. The longer the time elapsed, the smaller the decay factor. For each type of intent, the corresponding decay factor at the time of its occurrence is summed to obtain the activity level of that type of intent.

[0247] Intent activity is used to measure the weighted activity of a specific intent category over a time series, with more recently occurring intents given higher weights and earlier intents given lower weights.

[0248] The specific formula for calculating intent activity is as follows:

[0249] Among them, Active(I j) represents the activity score of the j-th intent, N represents the total number of interactions within the statistics window, and w t This represents the weight of this type of intent in the t-th interaction (if the intent of this interaction is I). j Then w t =1, otherwise w t =0), indicating an attenuation coefficient (e.g., 0.8), 0 < α < 1, d t This represents the difference in days or order between the t-th interaction and the current time.

[0250] Tone of voice refers to the emotional tone to be used in a response, including reassuring, efficient, professional, and exploratory tones. For example, if complaints, order reminders, or after-sales service intentions are more active in the historical intent statistics, it indicates that the user is exhibiting significant negative emotions. In this case, the tone of voice in response should be reassuring, expressing apology, understanding, and commitment to resolution. Similarly, when inquiry or comparison intents are high, the tone of voice should be efficient, providing information directly and concisely. When technical consultation intents are high, the tone of voice should be professional, using technical terminology and data-driven expressions. When historical intents are more dispersed, the tone of voice should be exploratory, using open and friendly expressions to guide users to clarify their needs.

[0251] Intent dispersion is an index of the degree of dispersion in the distribution of intents obtained by statistically analyzing historical intents, reflecting the concentration or dispersion of user intents. Entropy calculations or variance analyses can be performed on the distribution of historical intents. If the proportions of different types of intents are similar, the intent dispersion is high. If one type of intent dominates, the intent dispersion is low.

[0252] The specific formula for calculating intent dispersion is as follows:

[0253] Where H represents the intent dispersion (entropy value), k represents the total number of intent categories, and p i This represents the frequency (percentage of occurrences) of the i-th type of intent within the statistical window.

[0254] Guidance methods refer to the ways in which users are guided to further interaction during responses. These include quick processing guidance, direct answer guidance, and need confirmation guidance. When the historical intent is relatively dispersed (i.e., a dominant intent exists), the guidance method is determined to match the dominant intent. For example, a complaint intent corresponds to quick processing guidance (promising a solution and giving a timeframe), and an inquiry intent corresponds to direct answer guidance (directly providing a price or information). When the historical intent is relatively dispersed (i.e., the user's intent is ambiguous), the guidance method is determined to be need confirmation guidance (multiple rounds of follow-up questions and clarification of needs).

[0255] Entity extraction can be performed on users' historical chat logs to identify and extract product-related entity information, including product name, model, tonnage, brand, budget range, and applicable working conditions. The frequency of users mentioning various products within a preset window is counted, and product preference scores are calculated by combining time decay weights to obtain product preference distribution characteristics, such as "excavator: 0.8, loader: 0.3, crane: 0.1".

[0256] Product preferences reflect a user's level of interest in specific product types, and their distribution characteristics include concentration and weight distribution. Product preferences are used to determine the preferred product types for recommendation. When the preference weight of a product category is higher than a preset threshold, that product category is determined to be the preferred product type, and products of that category are recommended in subsequent responses. When the preference weights of all product categories are lower than the preset threshold, popular products are prioritized for recommendation, or users are guided to explicitly state their preferences.

[0257] Language style analysis can be used to identify language preference types in user profiles. Specifically, language style analysis can be performed on user historical messages to identify features such as sentence structure, word choice habits, and level of detail in expression, thereby analyzing the user's expressive tendencies. Language preference types include concise, detailed, technical, and colloquial.

[0258] Language preference is used to determine the language style of a response. Language style encompasses sentence structure, vocabulary preferences, and level of detail, including concise, detailed, technical, and colloquial styles. When the language preference is concise, the style is determined by short sentences and minimal modifiers, prioritizing short sentence templates. When the language preference is detailed, the style is determined by long sentences and inclusion of background information, prioritizing detailed explanation templates. When the language preference is technical, the style is determined by rich technical terminology and complete parameters, prioritizing technical terminology templates. When the language preference is colloquial, the style is determined by everyday expressions and analogies, prioritizing colloquial templates.

[0259] Interaction frequency index can be obtained from user profiles through interaction behavior statistics. Specifically, the number of user interactions and average response time within a preset window (e.g., the last 30 days) can be counted. The number of interactions reflects the user's activity level, and the average response time reflects the user's responsiveness. Based on the above statistics, the interaction frequency index is calculated to determine the guidance strength and information density of the response, which measures the user's activity level and responsiveness.

[0260] The guidance intensity refers to the degree to which guiding statements are used in responses, categorized into high, medium, and low levels. When the interaction frequency index is higher than a preset threshold, the user is identified as a high-frequency user, and the guidance intensity is set to low, reducing repetitive greetings and guiding phrases. When the interaction frequency index is lower than the preset threshold, the user is identified as a low-frequency user, and the guidance intensity is set to high, increasing caring phrases and relationship-maintaining content. Information density is the amount of information contained in a unit of response, also categorized into high, medium, and low levels. When the interaction frequency index is higher than the preset threshold, the information density is set to high, directly providing high-density information. When the interaction frequency index is lower than the preset threshold, the information density is set to low, providing information in stages to avoid information overload. Furthermore, when the average response time is lower than a preset threshold, the user is identified as a response time-sensitive user, and template generation is prioritized to accelerate response speed.

[0261] User value levels within a user profile can be determined through a weighted comprehensive score. Specifically, a comprehensive user value score is calculated based on dimensions such as historical value (e.g., historical purchase amount, purchase frequency), interactive behavior (e.g., interaction frequency, response speed), and potential value (e.g., attention to high-value products, inquiry depth). Based on this comprehensive score, users are categorized into high-value users, ordinary users, and new users.

[0262] User value level is used to determine the priority of response generation methods. Generation method priority determines the order in which different generation methods are selected when generating responses. Specifically, for high-value users, the priority is AI (Artificial Intelligence) generation > template filling > greeting / guided response, prioritizing the use of more personalized AI generation methods to provide customized services. For ordinary users, the priority is template filling > AI generation > greeting / guided response, prioritizing a generation method that combines standardized templates with rule-based filling to achieve a balance between personalization and efficiency. For new users, the priority is greeting / guided response > template filling > AI generation, prioritizing a generation method that combines greetings and guidance to establish trust and guide the expression of needs.

[0263] In this way, the various pieces of information included in the user profile are processed and combined to form a complete response strategy, which guides subsequent response generation. The response strategy specifically includes tone, guidance method, priority product types recommended, language style, guidance intensity, information density, and priority of generation methods. These collectively define the strategic direction of response generation, ensuring that the response content matches the user characteristics in terms of tone, style, information content, and generation method.

[0264] For example, for a high-value user whose historical intent is primarily price inquiries and is focused, whose language preference is concise, and whose interaction frequency is high, the determined response strategy is: a highly efficient tone, direct guidance, priority for recommending user-preferred products, concise language style, low guidance intensity, high information density, and AI-generated priority. Responses generated based on these strategy parameters will be concise, efficient, and direct, with AI generation prioritized to ensure personalization.

[0265] S702, retrieve response composition information from a preset knowledge base based on intent information and product keywords.

[0266] Obtain a preset mapping table, and select a preset knowledge base that matches the intent information as the target knowledge base based on the preset mapping table. The preset mapping table stores the mapping relationship between intent information and preset knowledge base types. The preset knowledge base includes at least one of the following: product information base, industry knowledge base, and frequently asked questions base. Retrieve the answer composition information from the target knowledge base based on product keywords.

[0267] A pre-built knowledge base can be a pre-constructed collection of structured or semi-structured knowledge used to store various types of business information for retrieval and retrieval. Specific pre-built knowledge bases may include product information bases, industry knowledge bases, frequently asked questions bases, and answer template bases.

[0268] The product information database stores structured information related to products, typically in the form of a relational database (such as MySQL). Basic product information (product ID, product name), product specifications (product model, brand, technical parameters), product pricing information, and product status information (product inventory status, applicable operating conditions, image links, etc.) can be retrieved from the product information database.

[0269] For example, the product ID is P10001, the product name is excavator, the model is SY215C-9, the brand is Sany, the technical parameters are weight 21.5 tons, power 118 kilowatts, the price is FOB Shanghai 38,000 USD, the inventory status is in stock, and the applicable working conditions are earthwork engineering and mining.

[0270] An industry knowledge base is used to store industry-related professional knowledge, and can be stored in graph databases (such as Neo4j) or in document format. The industry knowledge base includes product-related trade terms, payment methods, quality standards, processes, after-sales service, and other information.

[0271] For example, the trade term FOB means Free On Board, where the seller is responsible for loading the goods onto the ship, and the buyer bears the subsequent freight and insurance costs. The payment method T / T refers to wire transfer, which is fast but more expensive. The quality standard ISO9001 is an international quality management system certification. The process includes casting, machining, assembly, testing, and packaging, with a standard product production cycle of 15 days. The after-sales service warranty period is 2 years or 3000 hours, whichever comes first.

[0272] The FAQ database stores standard answers to frequently asked questions by users. It is usually stored in a cache (such as Redis) as key-value pairs to improve retrieval efficiency. It can retrieve question identifiers (question ID, question keywords, question description), standard answers to questions, and related products that match the user's input text from the FAQ database.

[0273] For example, the question ID is FAQ001, the question keywords are excavator and warranty, the question description is "How long is the warranty for an excavator?", the standard answer is "The standard warranty period is 2 years or 3000 hours, whichever comes first", the associated products are SY215C, SY60U, and SY375H, and the weight is 0.9.

[0274] The response template library (JSON file) includes tone templates (enthusiastic, relaxed, formal and rigorous, empathetic and patient), intent templates (inquiry scripts, complaint handling, order placement guidance), and scenario templates (greetings, closing remarks, follow-up scripts).

[0275] The target knowledge base is a preset knowledge base used for this retrieval, matched with the intent information. A mapping table of preset intents and knowledge base types is obtained. This mapping table pre-stores multiple intent entries, each corresponding to a knowledge base type. The intent information is matched against the intent entries in the mapping table, and the knowledge base type corresponding to the successful match is selected as the target knowledge base. The target knowledge base is thus the preset knowledge base matched with the intent information used for this retrieval. For example, when the intent information is a price inquiry, the product information database is selected for retrieval. When the intent information is a technical consultation, the industry knowledge base is selected for retrieval. When the intent information is a complaint, the frequently asked questions database is selected for retrieval.

[0276] After determining the target knowledge base, a matching search is performed within the target knowledge base based on product keywords to obtain specific response information. Specifically, the search methods can include exact matching and fuzzy matching. When product keywords are specific product models, standard terms, or other explicit information, exact matching is used, directly locating the corresponding precise record in the target knowledge base. When product keywords are product categories, contain typos, or are incomplete, fuzzy matching is used, employing fuzzy matching algorithms or synonym expansion techniques to retrieve relevant product records or knowledge entries. For example, when the intent is an inquiry and the product keyword is "SY215C," exact matching retrieves the technical parameters (weight 21.5 tons, power 118 kW) and price information (FOB Shanghai $38,000) for that model in the product information base. When the intent is an inquiry and the product keyword is "excavator," fuzzy matching retrieves a list of all excavator models in the product information base, sorted by popularity. The retrieved information is then integrated into a structured response.

[0277] This application supports collaborative retrieval of multiple preset knowledge bases. When the target knowledge base corresponding to the intent information fails to retrieve valid information, other preset knowledge bases can be searched sequentially until the answer composition information is obtained or it is determined that there are no matching results. Simultaneously, it also supports parallel retrieval of multiple preset knowledge bases, merging search results from different sources to form more complete answer composition information. For example, when a user enters "How long is the excavator warranty?", the intent information is technical consultation. First, the industry knowledge base is searched to obtain relevant knowledge about the warranty period (2 years or 3000 hours). Simultaneously, the FAQ database is searched in parallel to obtain standard answers from the FAQ for supplementary verification. Finally, the search results from the two knowledge bases are integrated to form more complete answer composition information including professional explanations and standard answers. In this way, richer and more accurate answer composition information can be obtained, providing sufficient answer material support for subsequent answer generation.

[0278] S703, determine the information organization method of the response based on the matching results of product keywords and preset product information database.

[0279] Specifically, the system determines whether the product keywords match product records in a pre-defined product information database. If the product keywords match, the system populates the response template with the required information. If the product keywords do not match, the system can either use pre-defined generic scripts to generate a guiding response to help the user supplement their product needs, or skip generating a response and transfer the current conversation to a live customer service representative.

[0280] The system can match product keywords with product records in a pre-defined product information database. Matching methods include exact matching, fuzzy matching, and multi-entity matching. When the product keyword is a specific product model, exact matching is used. The database searches precisely for the model number; if a matching record exists, the match is successful; otherwise, it fails. When the product keyword is a product category or contains misspellings, fuzzy matching is used. Algorithms such as synonym expansion, pinyin matching, and edit distance calculation are employed. If the similarity exceeds a pre-defined threshold, the match is successful; otherwise, it fails. When the product keyword contains multiple information units, multi-entity matching is used. Each information unit is matched separately and the results are combined. If the model number matches successfully, the match is successful; if the model number fails to match but the product category matches successfully, it is considered a partial match.

[0281] Based on the matching results, an appropriate organization method is selected. Specifically, if a match is successful, a matching response template is selected from the response template library according to the language style and tone tendency in the response strategy. The response template is a pre-built response content framework containing fixed text and populated variable placeholders. Then, the retrieved response composition information is filled into the variable placeholders of the selected template. The filled content includes product name, model, technical parameters, price, applicable operating conditions, etc. Finally, a complete personalized response is generated.

[0282] If a match fails, a suitable guiding script template is selected from the general script library based on the guiding method and tone in the response strategy. Then, depending on the specific circumstances of the match failure, the content direction of the guiding response is determined. The guiding response is used to confirm the budget range, intended use, desired model range, or specific operating conditions with the user. Finally, the guiding response is generated.

[0283] In practice, the two organizational methods can be used in conjunction. When product keywords are determined to be a partial match, a hybrid organizational approach can be adopted. First, the matched product information is listed using a personalized organizational method, and then the user is guided to further clarify their preferences using a general organizational method. In this way, by selecting the most appropriate response organization method based on the specific user input, accurate information can be provided when the needs are clear, and effective guidance can be provided when the needs are ambiguous, thereby improving the relevance of the response and the efficiency of the interaction.

[0284] S704: Obtain user preferences and determine the response template style based on sentiment information and user preferences.

[0285] By analyzing users' historical chat logs, at least one of the following user preferences—product preference, language preference, or communication preference—can be identified as user preferences. The emotional type of the response can be determined based on emotional information. This emotional type characterizes the category of emotional expression used in the response, which can include at least one of the following: reassuring, enthusiastic, efficient, professional, or exploratory. Based on user preferences, the preferred expression style of the response can be determined. Combining the emotional type and expression style preferences, the response template style can be determined.

[0286] Specifically, multidimensional analysis can be performed on the user's historical chat records within a preset window (such as the last 30 days or the last 50 interactions) to obtain user preferences, which include at least one of product preferences, language preferences, and communication preferences.

[0287] By extracting entities from historical chat logs, information such as product categories, tonnage, budget, and intended use mentioned repeatedly by users can be identified and extracted. The frequency of mentions for each product type can be statistically analyzed, and a product preference score can be calculated by combining this with a time decay weight. For example, if a user repeatedly mentions "excavator," "mini excavator," or "SY215C," then the preference score for excavator-related products is relatively high, indicating that the user's current product preference is for excavator-related products.

[0288] Language preferences reflect a user's preferred language type, formal or colloquial expression style, and sentence length preference, including concise, detailed, technical, and colloquial styles. By analyzing the language style of historical messages, characteristics such as sentence structure, word choice habits, and level of detail can be identified, revealing the user's expressive tendencies.

[0289] Historical interaction behavior can be statistically analyzed to understand how users respond to different types of responses. Specifically, the system can analyze user responsiveness to parameter-based responses (such as technical specifications), pricing-based responses (such as price information), and guiding responses (such as questions confirming needs) to determine which type of response the user prefers.

[0290] The emotional type and intensity of the response are determined based on emotional information. Emotional information may include emotional tags and emotional scores, where emotional tags represent the emotional category to which the user's current input belongs, and emotional scores represent the intensity of that emotional category (ranging from 0 to 1).

[0291] Based on the mapping rules between emotion labels and sentiment types, the sentiment type of the response is determined. Sentiment type is used to characterize the category of emotional expression used in the response, including reassuring, enthusiastic, efficient, professional, or exploratory.

[0292] For example, when the emotion label is dissatisfaction, anger, disappointment, or anxiety, the emotion type is determined to be reassuring, used to express apology, understanding, and commitment in the response. When the emotion label is excitement, pleasure, or gratitude, the emotion type is determined to be enthusiastic, used to express a positive and friendly attitude in the response. When the emotion label is urgency, tension, or eagerness, the emotion type is determined to be efficient, used to provide information directly and concisely. When the emotion label is neutral and the intended information is technical consultation, the emotion type is determined to be professional, used to express information using professional terminology and data support. When the emotion label is neutral and the intended information is ambiguous or casual, the emotion type is determined to be exploratory, used to guide the user to clarify their needs using open and friendly expression.

[0293] The emotional intensity of a response is determined based on an emotion score. Emotional intensity controls the degree of emotional expression, and multiple intensity thresholds can be preset to divide the emotion score into different intensity ranges. For example, an emotion score greater than or equal to 0.7 is classified as high intensity, indicating that the user's emotions are very strong, requiring a more intense emotional expression in the response. An emotion score greater than or equal to 0.3 and less than 0.7 is classified as medium intensity, indicating that the user's emotions are moderate, requiring a moderate emotional expression in the response. An emotion score less than 0.3 is classified as low intensity, indicating that the user's emotions are weak, requiring a mild emotional expression in the response.

[0294] Based on the acquired user preferences, the preferred way of expressing responses is determined. This preference controls the sentence structure, word choice, and level of detail in the responses.

[0295] When the language preference is concise, the preferred expression style is short sentences with minimal modifiers, prioritizing short sentence templates. When the language preference is detailed, the preferred expression style is long sentences with background information, prioritizing detailed explanation templates. When the language preference is technical, the preferred expression style is rich in technical terminology and complete parameters, prioritizing technical terminology templates. When the language preference is colloquial, the preferred expression style is everyday language and analogies, prioritizing colloquial templates.

[0296] Furthermore, the expression style preference can be adjusted based on communication preferences. If the user responds positively to parameter-based responses, the expression style preference will lean towards data-driven expression, adding technical parameters and performance data to the response. If the user responds positively to price-based responses, the expression style preference will lean towards price-priority expression, prioritizing price information in the response. If the user responds positively to guided responses, the expression style preference will lean towards open-ended questions, adding guiding statements to the response.

[0297] The response template style is determined by combining the identified emotion type, emotion intensity, and expression preference. The response template style is a comprehensive reflection of these factors, guiding the selection and generation of response templates in subsequent steps. For example, when the emotion type is reassuring, the emotion intensity is strong, and the expression preference is detailed, the determined response template style is a deeply reassuring style with detailed explanations, suitable for scenarios where the user is strongly dissatisfied. When the emotion type is efficient, the emotion intensity is moderate, and the expression preference is concise, the determined response template style is a concise and clear quick response style, suitable for scenarios where the user urgently inquires about prices. When the emotion type is professional, the emotion intensity is low, and the expression preference is technical, the determined response template style is an objective and rigorous technical explanation style, suitable for technical consultation scenarios. When the emotion type is enthusiastic, the emotion intensity is high, and the expression preference is accessible, the determined response template style is a friendly and guiding style, suitable for scenarios involving new users' first interaction.

[0298] By following the steps above, a response template style that matches the user's historical preferences and current emotional state can be generated, laying the foundation for subsequent personalized response generation.

[0299] S705, generate multiple candidate responses for the user's input text according to the response composition information, information organization method, and response template style, and select at least one candidate response as the interactive response.

[0300] Response strategies, response structure, information organization, and response template style can be used as preset dimensions. Multiple preset generation methods are obtained, and candidate responses are generated according to each method. The preset dimensions selected for generating candidate responses differ depending on the preset generation method.

[0301] Specifically, the preset generation methods can include the first type, the second type, and the third type, which correspond to the template filling generation method, the AI ​​model generation method, and the hybrid generation method, respectively.

[0302] When the preset generation method is Type 1, a template-filling generation method is adopted. First, based on the tone, language style, and response template style in the response strategy, a matching target response template is selected from the response template library. The target response template is a pre-built response content framework containing fixed text and fillable variable placeholders. Then, according to the determined information organization method of the response composition information, the variable placeholders in the target response template are identified. Variable placeholders are used to indicate the positions that need to be dynamically filled, and their names correspond to the field names in the response composition information. For example, variable placeholders can adopt a preset identifier format, such as {{field name}}, {field name}, or [field name], etc. Fields with the same name as variable placeholders are extracted from the response composition information as fill content. Specifically, the name of the variable placeholder is parsed, the field with the same name is searched in the response composition information, and the value corresponding to that field is read. The extracted fill content is used to replace the corresponding variable placeholder in the target response template to generate the first candidate response. The fill content is not limited to product name, model, technical parameters, price, applicable working conditions, etc. This generation method is suitable for scenarios that require standardized terminology and complete fields, such as quotation descriptions and parameter displays, and can ensure the accuracy and standardization of the response content.

[0303] When the preset generation method is type two, an AI model generation method is used. The contextual information, intent information, and sentiment information of the user's input text, the response strategy, the response template style, and the retrieved response composition information are all used as input to the target model. The target model refers to a generative model used to generate natural language responses, specifically a GPT series model. The contextual information includes at least the user's input text and corresponding responses from at least one round prior to the current user input text round, used to maintain the coherence and consistency of the dialogue. The target model uses a generative language model to generate a natural language response based on the input information, outputting a second candidate response. This method is suitable for scenarios where user expression is colloquial and context-dependent, and can generate natural-sounding and flexible responses.

[0304] Specifically, the system maintains a conversation cache queue, storing user input text and system-generated responses for each round in chronological order. When a new round of dialogue begins, the system retrieves the most recent p-round dialogue records (p > 1) from the cache queue, concatenating them chronologically as context information. If the current conversation has fewer than p rounds, all existing dialogue records are retrieved, and a preset prompt word template is used to replace each variable with specific content values ​​to generate a complete model input. The preset prompt word template is a pre-designed text framework containing several variable placeholders. Context information, current user input text, intent information, sentiment information, response strategy, response template style, and response composition information retrieved from the knowledge base are filled into the corresponding variable placeholders in the template to form the complete model input text. The model input text is sent to the target model, which can be a GPT series large language model, using a word-by-word iterative autoregressive generation method. Specifically, the constructed model input text is used as the initial sequence. Based on the current sequence, the model calculates the probability distribution of each word in the vocabulary through a softmax layer, selecting the word with the highest probability as the next word. The generated word is appended to the end of the sequence to form a new sequence. The model continues to generate the next word based on the new sequence, iterating repeatedly. Generation stops when the model generates a preset end marker or when the number of generated words reaches the set maximum length. All generated words are then concatenated in the order they were generated to obtain the second candidate response.

[0305] When the preset generation method is type three, a hybrid generation method is adopted. First, based on the information organization of the response's constituent information, key information is extracted from the response's constituent information to construct a template skeleton. The template skeleton is a structured text framework containing key information but not a complete expression, such as "[Product Model] Price is [Price], Parameters are [Parameters]". Then, under the semantic constraints of the template skeleton, the target model generates extended language with contextual semantic relationships to the template skeleton. The extended language can include connectives, reassuring phrases, or guiding phrases, used to string together the key information in the template skeleton into a complete natural language expression. Finally, the template skeleton and the extended language are combined to form the third candidate response. This method combines the accuracy of template filling with the naturalness of AI model generation, ensuring both the accurate presentation of key information and improving the fluency of language expression.

[0306] Thus, this application can generate multiple different types of candidate responses, including template-filled versions, AI-generated versions, and hybrid generated versions. These candidate responses each have their own emphasis in terms of accuracy, naturalness, and flexibility, providing users with a diverse range of choices. Subsequently, the best response is selected for display through a scoring and ranking process.

[0307] In one implementation, scores can be calculated for multiple candidate responses, and at least one candidate response can be selected as the interactive response based on the scores.

[0308] First, a multi-dimensional score is calculated for each candidate response. The multi-dimensional score includes relevance score, sentiment matching score, appropriate length score, and professionalism score.

[0309] The relevance score measures the degree of match between the candidate response and the user's current needs. The relevance score can be calculated based on the semantic similarity between the candidate response and the user's input text; the greater the semantic similarity, the higher the relevance score.

[0310] The specific formula for calculating the relevance score is as follows:

[0311] Score rel =sim(R,Q)×100 Among them, Score rel The relevance score ranges from 0 to 100, where R represents the candidate response text, Q represents the user input text, sim(R,Q) represents the semantic similarity function, and V represents the semantic similarity score. R V represents the semantic vector of the candidate response text. Q This represents the semantic vector of the user-input text. The semantic vector can be obtained by extracting the output vector at the [CLS] position from a language model (such as BERT).

[0312] Emotion matching score is used to measure the degree of fit between the emotional expression of the candidate response and the user's emotional state. The emotion matching score can be calculated based on the degree of matching between the candidate response and the response template style.

[0313] The specific formula for calculating the emotion matching score is as follows:

[0314] Among them, Score emo The emotion matching score ranges from 0 to 100, where n represents the number of features related to the response template style, and w represents the number of features related to the response template style. l The m represents the weight of the l-th feature term. l This indicates the matching degree (0 or 1) of the l-th feature term.

[0315] When the response template style is reassuring, a higher emotion matching score is achieved if the response includes expressions of apology, understanding statements, or commitments to action. When the response template style is efficient, a higher emotion matching score is achieved if the response is direct, concise, and action-oriented. When the response template style is professional, a higher emotion matching score is achieved if the response includes technical parameters, data support, or technical terminology. When the response template style is exploratory, a higher emotion matching score is achieved if the response includes open-ended questions or guiding statements.

[0316] The "Appropriate Length" score measures whether the length of the candidate response text meets the requirements of the current interaction scenario. The target length range is determined based on intent information and language preferences in the user profile. When the intent is an inquiry and the language preference is concise, the target length range can be set to a shorter range. When the intent is a technical consultation and the language preference is detailed, the target length range can be set to a longer range. The deviation of the candidate response text length from the target length range is calculated; the smaller the deviation, the higher the "Appropriate Length" score. If the candidate response text length is within the target length range, it receives full marks; if it exceeds or falls short, points are deducted according to the degree of deviation.

[0317] The specific formula for calculating the appropriate length score is as follows:

[0318] Among them, Score len The score indicates a moderate length, ranging from 0 to 100. L represents the actual length (number of characters) of the candidate response text. opt This represents the optimal length of the target length interval, and the penalty coefficient (e.g., 50).

[0319] The professionalism score measures the completeness of professional information and the standardization of terminology in the candidate responses. The score is calculated by examining the completeness of professional information and the standardization of terminology in the candidate responses. Completeness of professional information is assessed by checking whether the candidate responses contain product models, technical parameters, prices, operating conditions, or service information corresponding to the current intent; the more complete the information, the higher the score. Standardization of terminology is assessed by checking whether the use of professional terminology in the candidate responses is accurate and standardized; conforming to industry standards results in a higher score.

[0320] After scoring each dimension, the relevance score, sentiment matching score, appropriate length score, and professionalism score are weighted and merged to obtain a comprehensive score for each candidate response. The weight of each scoring dimension can be dynamically configured according to the business scenario. For example, in a technical consultation scenario, the weight of the professionalism score can be increased, and in a complaint handling scenario, the weight of the sentiment matching score can be increased.

[0321] Multiple candidate responses are sorted from highest to lowest based on their overall score. The response with the highest overall score is then selected as the interactive response and displayed. The display can be presented as a list, allowing the user to choose or directly use the highest-scoring response. This scoring mechanism selects the response that best matches the user's needs, best reflects their emotional expression, is most appropriate in length, and demonstrates the highest level of professionalism, thus improving response quality and user experience.

[0322] The following provides a detailed explanation of the principles behind the response generation method using examples.

[0323] S711: Acquire and analyze user input text to obtain analysis results, including intent information, sentiment information, and product keywords.

[0324] S712: Load user profiles. User profile data includes historical intent, product preferences, language preferences, and interaction frequency.

[0325] When retrieving a user's profile, the system first checks if the user's profile data exists in the Redis cache. If it doesn't exist (i.e., it's the first time accessing the database or the cache has expired), it queries the MySQL database for the user's profile information, writes the query result to the Redis cache, and sets the TTL to 24 hours. Within the next 24 hours, subsequent accesses to the user's profile will retrieve it directly from the Redis cache without needing to query the database again.

[0326] The cache expiration time starts from when the data is written to Redis. After 24 hours, the cached key-value pair automatically expires and is deleted. User profile data is valid in the cache for 24 hours; after 24 hours, it needs to be reloaded from the database.

[0327] When user profile data changes (e.g., when a user makes a new interaction), the system needs to synchronously update the MySQL database and Redis cache, and reset the TTL to 24 hours to ensure that the profile data in the cache remains up-to-date.

[0328] S713: Determine the response strategy based on user profiles.

[0329] S714: Query from the knowledge base, which includes a product information database (MySQL), a frequently asked questions (FAQs) database (Redis), and a response template library (JSON files). The FFAs database stores standard answers to frequently asked user questions to improve retrieval efficiency. Based on product keywords or intent information, the system performs a matching search within the FFAs database. When a user's input question matches a keyword in the FFAs database, the system directly returns the corresponding standard answer as part of the response's structure. The response template library stores various response templates for use in subsequent response generation. The product information database stores structured information related to products and performs matching searches based on product keywords.

[0330] The knowledge base in this application supports full-text search and can call data from the Redis cache layer through the knowledge base API to achieve fast front-end response.

[0331] S715: If a matching product keyword is found, construct the response content; if no matching product keyword is found, use a generic response and then construct the response content.

[0332] S716: Determine the content of the response template based on emotional information and user preferences.

[0333] S717: Determine whether to use an AI model to generate a response.

[0334] If used, GPT / local LLM is invoked to generate personalized content. If not used, template variables are populated based on rules to generate a templated response. That is, it determines whether to use an AI model to generate a response and determines the response generation method type, which includes at least one of AI generation, template generation, and hybrid generation.

[0335] S718: Generate multiple candidate responses (e.g., AI-generated responses, template-generated responses, and responses generated using a hybrid approach).

[0336] S719: Perform quality checks on the generated responses.

[0337] Specifically, this can include length checks (determining the length of the content text, ensuring it does not exceed 500 characters, and truncating it to 500 characters if it does).

[0338] Sensitive word check: Determine if sensitive words are included, and filter / replace sensitive words.

[0339] Syntax check: Determine if there are any grammatical errors, and correct them if they are found.

[0340] S7110: Calculate the score of the candidate response and select at least one candidate response as the interactive response based on the score.

[0341] S7111: Provides a one-click copy button and a customizable edit box, allowing users to flexibly select, edit, and send replies. After a user sends a reply, the system logs the information, performs anonymization processing, updates the user profile, and synchronously saves the updated data to the MySQL database and Redis cache.

[0342] Taking the procurement of construction machinery as an example, this paper provides a detailed explanation of the method for generating a response to this application.

[0343] A user inquired via WhatsApp, "I want to buy an excavator," and the data processing layer identified the intent as "excavator procurement." The system retrieved various excavator models from the construction machinery knowledge base, such as SY215C-9, SY60U, and SY375H, along with their corresponding tonnage, power, and FOB price. The system provided two types of responses to this intent: A professional-style response: Referencing parameters from the knowledge base, it generated, "We have several excavator models available (e.g., SY215C-9: 21.5t / 118kW / FOB Shanghai $38,000; SY60U: 6t / 40.9kW / FOB Guangzhou $15,200; SY375H: 37.5t / 213kW / FOB Qingdao $72,500). Which type of work are you more interested in?" A friendly-style response: It generated, "Which excavator configuration and price would you like to know? I can compile it for you immediately," emphasizing a willingness to assist the user. The candidate responses are displayed in the user interface. Users can click the one-click copy button to paste them into the response box and make appropriate modifications according to the actual situation before sending.

[0344] When a user requests a quote, "With a limited budget, could you recommend a suitable mini excavator?", the system identifies the intent as "inquiry + mini excavator purchase" and the sentiment label as "cautious." The system retrieves information on lower-priced mini excavators from its knowledge base, generates a professional-style response listing specific models and prices, and a friendly-style response inquiring about the user's power or intended use preferences. Due to the cautious sentiment, the system automatically selects a more friendly response template. Users can customize a third response template on the interface, such as a more humorous or concise style, and save it for later use. This application provides multiple response styles based on intent and sentiment, reflecting both professionalism and friendliness, thus improving user satisfaction. It can automatically populate knowledge base information, reducing manual search and editing time. Furthermore, it supports user-defined response templates to adapt to different business scenarios. Simultaneously, it can work in conjunction with intent analysis and user profile update modules to achieve a closed loop from understanding to response.

[0345] This embodiment may also provide a response display interface. The front-end interface includes a top toolbar (switching platforms, settings, help), a main interface area, a left-side chat window, and a right-side AI assistant panel. The left-side chat window displays the intelligent recognition results, i.e., the extracted information, which may include the user's text and the system's response text. The right-side AI assistant panel includes three categories of tags (intelligent response, user profile, and history). The intelligent response tag displays the intent recognition results, sentiment analysis results, and the specific content of at least one response. Users can flexibly select, edit, and send responses using a one-click copy button and a custom edit box. After a user sends a response, the system logs and performs anonymization processing, updates the user profile, and synchronously saves the updated data to a MySQL database and a Redis cache.

[0346] User profile tags can include basic user information, which can be displayed in the form of a user profile. It also includes a dynamic weight display of user tag clouds, such as reviews, foreign trade, and high-value churn risk, and can show whether each dynamic weight is trending upwards or downwards. It also includes interaction history (first contact time, last interaction time, total number of interactions). The history tag displays the chat history.

[0347] The response generation device may include an analysis module, a determination module, and a generation module. The analysis module acquires and analyzes user input text to obtain intent information, sentiment information, and product keywords. The determination module retrieves response composition information from a preset knowledge base based on the intent information and product keywords. It determines the information organization method of the response composition information based on the matching results between product keywords and the preset product information base. It acquires user preferences and determines the response template style based on sentiment information and user preferences. The generation module generates multiple candidate responses to the user input text according to the response composition information, information organization method, and response template style, and selects at least one candidate response as the interactive response.

[0348] Specific limitations regarding the response generation device can be found in the limitations regarding the response generation method described above, and will not be repeated here. Each module in the aforementioned response generation device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0349] The following provides a detailed explanation of the principles behind this application's cross-platform interaction.

[0350] The following provides an example of the application environment for the message interaction method. The message interaction client is deployed on a terminal device and carries the target interaction environment, which serves as the message display interface, message input interface, and message sending interface. The message auxiliary reply client can be deployed on the same terminal device as the message interaction client, or on another terminal device or server device. The message interaction client and the message auxiliary reply client communicate via a network or internal data transmission link. In this application environment, the message auxiliary reply client can obtain the original message data in the target interaction environment according to the message acquisition rules corresponding to the target interaction environment. When the message auxiliary reply client and the message interaction client are deployed on the same terminal device, the message auxiliary reply client can directly obtain the original message data and corresponding environmental feature data from the target interaction environment carried by the message interaction client. When the message auxiliary reply client and the message interaction client are deployed separately, the user can send the original message data from the target interaction environment to the message auxiliary reply client, or the message interaction client can send the original message data and corresponding environmental feature data to the message auxiliary reply client. The message auxiliary reply client generates standard message data based on the original message data and determines the message interaction operation mapping relationship adapted to the target interaction environment by combining the environmental feature data. Furthermore, the message-assisted reply terminal can determine the corresponding message generation branch in the pre-trained message generation agent based on the business scenario corresponding to the standard message data, thereby generating reply message data and converting it into an interactive response adapted to the target interaction environment. Then, the message interaction terminal, based on the message interaction operation mapping relationship, locates the corresponding interaction area in the target interaction environment, writes the interactive response to the appropriate location, and triggers a sending operation, thus realizing message acquisition, unified processing, reply generation, and message sending within the target interaction environment. The terminal device can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices.

[0351] In some embodiments, the business scenario can be understood as the industry. Users can pre-select their industry and communication platform type on the login or initialization interface. The system automatically matches the corresponding intelligent interaction strategy based on the dual-dimensional configuration rules of "industry dimension + platform dimension". Industries can include at least foreign trade, cross-border e-commerce, recruitment, corporate office, customer service, or logistics. Communication platforms can include at least heterogeneous platforms such as WeChat Work and WhatsApp. Specifically, the system can load the corresponding platform plugin based on the user's selection, and further load the industry-specific prompt template, domain rule library, and terminology constraint set. Simultaneously, it calls the fine-tuning model branch or model adaptation parameters corresponding to that industry, so that the subsequent message understanding and response generation process has both platform and industry adaptation capabilities. Preferably, in the generation stage, a collaborative reasoning mechanism can be executed according to a preset priority: "strong industry constraint rules first, platform format rules second, and general generation logic supplemented".

[0352] In some embodiments, within a foreign trade business scenario, the system can access a training corpus for foreign trade scenarios, constructed from data such as historical foreign trade chat logs, inquiry and quotation corpora, product information, logistics and customs declaration information, payment terms texts, multilingual communication corpora, customer order tracking records, and industry terminology dictionaries. This corpus undergoes data cleaning, noise reduction, anonymization, semantic segmentation, tagging, terminology normalization, multilingual alignment, and scenario classification. The system then performs efficient parameter fine-tuning or phased domain-specific enhancement training on a basic pre-trained model to develop specialized generation and understanding capabilities for foreign trade communication scenarios. Preferably, these specialized generation and understanding capabilities include at least: cross-border trade terminology recognition, inquiry and quotation intent recognition, logistics and customs clearance intent recognition, long-cycle order tracking context maintenance, multilingual business expression generation, and customer-style adapted response generation.

[0353] In some embodiments, after the initial platform adaptation is completed, the system can also save the platform type, coordinate information, plugin configuration, and related adaptation parameters to the local storage area. When the user logs in again, the saved adaptation configuration can be directly called, thereby reducing repeated initialization and adaptation operations. Preferably, a new round of adaptation process is triggered to update the adaptation configuration when a platform version update, window layout change, or failure of historical adaptation configuration is detected.

[0354] The message interaction method can be implemented through a computer program within a message generation device. This computer program can be an artificial intelligence assistant, and includes the following steps: First, based on message acquisition rules corresponding to the target interaction environment, acquire raw message data from the target interaction environment and convert the raw message data into standard message data. Second, based on the interface area features and interaction operation positioning features of the target interaction environment, determine the message interaction operation mapping relationship. Third, acquire the business scenario corresponding to the standard message data, determine the message generation branch corresponding to the business scenario in the pre-trained message generation agent, and generate reply message data corresponding to the standard message data through the message generation branch. Fourth, generate an interactive response adapted to the target interaction environment based on the reply message data, and send the interactive response to the target interaction environment based on the message interaction operation mapping relationship.

[0355] The aforementioned message interaction method unifies the conversion and processing of message content across different message interaction environments, enabling message data from different sources and with varying formats to enter a more suitable processing flow, thus reducing the impact of environmental differences on message recognition and processing. Furthermore, by combining the interface state and interaction position relationships of the target interaction environment, the output position and interaction path of the reply message are adapted, ensuring that the reply content can be accurately sent in the corresponding environment. Additionally, by generating corresponding reply content based on the business scenario to which the message belongs, the matching degree between the reply result and the actual message semantics and application requirements is improved. This achieves the technical effects of enhancing cross-environment message processing compatibility, improving reply sending accuracy and interaction execution stability, and enhancing the relevance and accuracy of reply content, thereby solving the problems of poor cross-environment compatibility, high adaptation costs, and insufficient interaction stability in existing technologies.

[0356] In one embodiment, before acquiring the original message data in the target interactive environment, the method further includes: in response to receiving an interactive environment selection instruction, determining the interactive environment corresponding to the interactive environment selection instruction as the target interactive environment from a plurality of pre-stored interactive environments.

[0357] In one embodiment, the message acquisition module is used to acquire raw message data in the target interaction environment based on message acquisition rules corresponding to the target interaction environment, including: Based on the target interaction environment's environment type, data interface open status, and message access permissions, determine the message retrieval rules corresponding to the target interaction environment.

[0358] The target interaction environment can refer to the application interface, web page, embedded session page, message window in a remote desktop, message module in an enterprise office system, or other interactive environment capable of displaying and inputting messages, which carries out the message sending and receiving process. Environment types can include local application environments, web application environments, hybrid application environments, virtualized runtime environments, or remote mapping environments. The data interface openness status can be used to characterize whether the target interaction environment provides callable data interfaces, cache interfaces, system auxiliary interfaces, page object interfaces, or underlying storage access interfaces. Message access permissions can refer to whether the current device, current user account, or current auxiliary program has the authorized ability to read message content, session records, cached data, or interface information.

[0359] Based on the message retrieval rules, determine the available message retrieval methods corresponding to the target interaction environment.

[0360] Message retrieval rules can be understood as a set of retrieval constraints and execution strategies pre-configured or dynamically determined for the target interaction environment. Preferably, message retrieval rules can include at least: retrieval priority, accessible data source type, access path, field reading method, exception fallback method, and interface recognition method. Message retrieval rules can be pre-stored in a rule configuration table or rule base and determined based on environment type, application identifier, application version number, operating system type, and permission status. For example, for desktop applications that provide local database access capabilities, the storage area reading method can be prioritized. For web chat pages that do not expose underlying data interfaces, the interface image recognition method can be prioritized.

[0361] Available message acquisition methods may include one or more of the following: acquiring via data interface calls, acquiring via local database access, acquiring via cached files, acquiring via log files, acquiring via page object model access, acquiring via system auxiliary function tree information, and acquiring via interactive interface image recognition. Preferably, available message acquisition methods can be determined by cross-judging the allowed acquisition methods in the message acquisition rules with the actual accessibility of the current environment. Specifically, it can first be checked whether there is an accessible data interface or storage area in the target environment. If so, it is further verified whether the current permissions meet the reading conditions. If so, the corresponding data reading method is determined as an available message acquisition method. If not, the interface image recognition method is determined as an available message acquisition method.

[0362] In response to the available message acquisition method indicating that access to the data storage area is permitted, the system accesses the data storage area corresponding to the target interaction environment, reads the interaction message-related data, and generates the original message data based on the read message-related data.

[0363] The data storage area may include a local database corresponding to the target interactive environment, a cache directory, message log files, browser local storage area, session cache area, message node collection in the page object model, or other data carriers used to store message content. Message-related data may include, but is not limited to: message identifier, session identifier, sender identifier, receiver identifier, message body, timestamp, attachment identifier, message status, session sequence number, and referenced message relationship. Preferably, when generating raw message data based on the read message-related data, multiple read message fields can be assembled into a raw message data structure corresponding to a single message or multiple message records according to a preset field combination method. For example, "sender account," "message text," "sending time," "message type," and "session number" can be combined into a single raw message record.

[0364] In response to an indication that access to the data storage area is not permitted by the available message acquisition method, the interactive interface image of the target interactive environment is acquired, interactive message-related data is identified based on the interactive interface image, and raw message data is generated based on the identified interactive message-related data.

[0365] The interactive interface image can be obtained by capturing the current display window of the target interactive environment, capturing a specified session area, obtaining a screenshot of the current interface of the mobile device, or capturing the content of the graphics display buffer. Preferably, the interactive interface image can be a static single-frame image or a series of consecutive multi-frame interface images. Recognition of the interactive interface image can yield recognition results including text recognition results, component detection results, region segmentation results, and layout relationship recognition results. Specifically, when recognizing the interactive interface image, the message bubble area, sender identifier area, time display area, and message body area can be identified first. Then, based on the vertical position relationship, left-right belonging relationship, or time proximity relationship between the areas, information belonging to the same message is aggregated to generate the original message data. Preferably, for consecutive multi-frame interface images, duplicate messages in adjacent frames can be deduplicated to reduce redundant data caused by repeated recognition.

[0366] The raw message data may also include text actively entered by the user.

[0367] Specifically, in this embodiment, by selecting a suitable message acquisition method based on the environment type, data interface openness, and message access permissions of different target interaction environments, the message data acquisition process can be adjusted according to the actual openness and access conditions of the target environment. When data access conditions are available, the original message data can be directly constructed based on the underlying message-related data. When data access conditions are not available, the original message data can be obtained by recognizing the interactive interface image. Therefore, message data acquisition can be achieved in message interaction environments with different levels of openness and access conditions, improving the applicability and environmental compatibility of the message acquisition process, thereby solving the technical problem in the prior art where message data is difficult to acquire stably due to platform interface differences and access restrictions.

[0368] It is worth noting that, in scenarios where access to the data storage area is not permitted in response to an available message acquisition method, and the original message data is obtained through interactive interface image recognition, the acquired interactive interface image, in addition to containing the target message content, may also contain contact names, account identifiers, historical dialogue fragments, time information, business data, window title information, and other interface content unrelated to the current message to be replied to. If such interface images or the plaintext message content directly identified by them are directly input into the subsequent intelligent processing chain, it is easy for privacy information unrelated to the target message to be processed as well, thereby increasing the risk of sensitive information exposure. Especially when existing solutions already include OCR (Optical Character Recognition), interface element localization, standardized structured output, and subsequent reply generation processing, if a privacy protection mechanism is not further introduced into the image acquisition branch, although message recognition and automatic reply can be achieved, there is still a possibility of excessive exposure of plaintext messages, truly sensitive fields, or real location information during the processes involving partial screen capture, text recognition, and write-back localization.

[0369] In a further embodiment, the message acquisition module is further configured to set a local privacy protection domain between the message agent and the target interaction environment; in response to an indication by an available message acquisition method that access to the data storage area is not permitted, the module acquires an interactive interface image of the target interaction environment and generates raw message data based on the recognition result of the interactive interface image; the module also includes: By using a local privacy protection domain, local cropping and image recognition are performed on the target message area in the interactive interface image to obtain the recognized content corresponding to the target message.

[0370] The local privacy protection domain refers to a local processing area set up on the terminal device for performing sensitive information isolation processing. Preferably, the local privacy protection domain is used to perform partial image cropping, sensitive field desensitization, mapping relationship saving, reply frame backfilling, and message writing back.

[0371] Based on preset local privacy protection rules, sensitive fields in the identified content are de-identified and replaced to generate de-identified content, and a local mapping relationship is established between sensitive fields and corresponding placeholders.

[0372] The target message area can refer to a local area in the interactive interface image that corresponds to the message to be processed. Preferably, the target message area can be the message area selected by the user, the latest message area in the current session, or the candidate message area determined after message bubble recognition. By only capturing the target message area, irrelevant interface information can be reduced from being processed together.

[0373] Among them, local privacy protection rules can refer to a set of local rules used to identify sensitive fields, perform de-identification and replacement, and control the scope of mapping relationship storage. Preferably, local privacy protection rules can be pre-configured in a local rule base and invoked according to business scenarios. For example, in foreign trade business scenarios, local privacy protection rules can prioritize identifying customer names, company names, product models, quotation amounts, and delivery date information.

[0374] The local mapping relationship refers to the correspondence between placeholder markers and the original sensitive field content. Preferably, the local mapping relationship is bound to the current session and is stored only in the local privacy protection domain.

[0375] Semantic skeleton information is extracted from the de-identified content and written into the de-identified semantic field corresponding to the standard message data.

[0376] Sensitive fields may include one or more of the following: name, company name, contact information, product model, price information, delivery date information, or order information. De-identification and replacement can refer to replacing sensitive fields with placeholder markers that do not contain actual content. Preferably, the placeholders can be generated using the format "field category + sequence number," such as [Name 1], [Product 1], [Amount 1].

[0377] Semantic skeleton information refers to information that still represents the core semantics of the target message after removing the actual sensitive fields. Preferably, the semantic skeleton information includes at least the interaction intent, logical relationship, and key business slots. For example, after de-sensitizing the message "Mr. Li, please confirm whether the ZX300 price of 480,000 includes shipping and how long the delivery time is," it can be extracted as "Confirm / Inquire—Product Quotation—Whether Shipping is Included—Inquire about Delivery Time." De-sensitized semantic fields can refer to the fields in standard message data used to store the de-sensitized semantic content. The message content generated by the intelligent agent from subsequent input messages is the content in the de-sensitized semantic fields, not the original plaintext field content.

[0378] Standard message data containing semantic skeleton information is input into a pre-trained message generation agent, enabling the agent to determine the corresponding message generation branch based on the business scenario corresponding to the standard message data, and generate response framework information through the message generation branch.

[0379] The response framework information can refer to the response skeleton, response template, or response candidate content generated by the message generation branch that has not yet been filled with the actual sensitive fields. Preferably, the response framework information retains placeholder markers corresponding to the local mapping relationship for subsequent local filling.

[0380] In response to receiving the reply framework information, placeholder backfilling is performed on the reply framework information based on the local mapping relationship to generate reply message data.

[0381] Based on locally saved input area positioning rules or focus anchoring rules, the reply message data is written to the input area corresponding to the target interaction environment.

[0382] The input region localization rule can refer to the local rules used to determine the location of the input region in the target interactive environment. Preferably, the input region localization rule can be generated through an initial calibration operation, or it can be determined through existing interface recognition and OCR anchor point localization processes. The focus anchoring rule can refer to the write-back rule that performs content writing based on the current input focus.

[0383] After the write operation is completed, the local mapping relationship corresponding to this session is deleted, destroyed, or invalidated.

[0384] Among them, deletion, destruction or invalidation processing can refer to the processing that makes the local mapping relationship corresponding to this session unusable after the reply message data is written. Preferably, the processing can be triggered after the user sends the message, after the session ends, or after the preset timeout period is reached.

[0385] Specifically, in this embodiment, by setting a local privacy protection domain between the message-generating agent and the target interaction environment, the processing of partial cropping of the interactive interface image, image recognition, sensitive field desensitization, semantic skeleton extraction, placeholder mapping establishment, reply framework backfilling, and write-back positioning is preferably completed locally. Only the desensitized semantic content is included in the standard message data and input into the message-generating agent. On the one hand, this allows the original interactive interface image, original plaintext message, sensitive field mapping relationship, and real input positioning information to be preferably retained locally, reducing the exposure scope of sensitive data in the processing chain. On the other hand, it can continue to reuse the unified processing framework of standard message data, business scenario identification, message generation branch selection, and reply generation in the existing solution. This ensures the accuracy of reply generation and cross-platform adaptability while improving data security, privacy protection capabilities, and system practicality in message acquisition scenarios based on image recognition.

[0386] In one embodiment, the message acquisition module is further configured to convert the raw message data into standard message data, including: Parse the preset general message format to obtain standard fields and extended fields, and determine the standardized processing rules corresponding to the original message data. The standardized processing rules include at least: field extraction rules, standard field mapping rules, and extended field encapsulation rules.

[0387] The general message format can refer to a data organization template used to uniformly describe message data from different sources. Preferably, the general message format can be represented in the form of structured objects, such as key-value pairs, table records, or object instance structures. Standard fields are used to carry fields that are common in different message interaction environments and provide basic support for subsequent processing. Extended fields are used to carry additional fields that are unique to different platforms but may participate in subsequent analysis. Preferably, standard fields can include one or more of the following: message identifier, session identifier, sender identifier, receiver identifier, message text content, message type, sending time, attachment information, context identifier, and referencing relationships. Extended fields can include platform-specific fields such as emoji codes, platform-specific status codes, interface display style tags, original component attributes, and business tags.

[0388] The standardized processing rules can be pre-configured based on the source type, field naming conventions, data hierarchy, and known message templates of the target interaction environment, or they can be automatically generated after statistical analysis of historical sample data. Preferably, the standardized processing rules can be stored in a rule mapping table and indexed by environment type, application identifier, message data version number, or field pattern characteristics. Field extraction rules indicate the path, location, or parsing method for extracting message fields from the raw message data. Standard field mapping rules indicate the mapping relationship between candidate message fields and standard fields. Extended field encapsulation rules indicate how remaining fields not mapped to standard fields should be saved as extended fields.

[0389] Based on the field extraction rules, the original message data is parsed to obtain multiple candidate message fields.

[0390] The field extraction rules can include field name matching rules, hierarchical path extraction rules, regular expression extraction rules, page node attribute extraction rules, or field recognition rules based on semantic annotation. Preferably, when the original message data is structured data, it can be extracted directly through field paths or field names. When the original message data is semi-structured data, it can be extracted through key-value pattern matching and regular expression parsing. When the original message data is an image recognition conversion result, it can be extracted through region labels, text block categories, and positional relationships. Multiple candidate message fields can be understood as a set of fields initially identified from the original message data that may correspond to semantics such as message content, sender, time, and status.

[0391] Based on the standard field mapping rules, determine whether the candidate message field matches the standard field. If so, map the candidate message field to the corresponding field position of the standard field. Otherwise, according to the extended field encapsulation rules, encapsulate the candidate message field to the field position of the extended field.

[0392] The standard field mapping rules can be determined through one or more of the following methods: field name matching, field data type matching, field value pattern matching, and field semantic similarity matching. Specifically, it can first be determined whether the candidate message field name matches or is similar to the standard field name. If they do not match, it can be further determined whether the data type, value characteristics, and contextual semantics of the candidate message field match the expected characteristics of a certain standard field. If the match is successful, the candidate message field is mapped to the corresponding standard field. Preferably, for candidate message fields that cannot be matched to standard fields but have retention value, they can be written into the corresponding field position of the extended field in the form of key-value pairs, sub-objects, or field sets according to the extended field encapsulation rules.

[0393] Based on the candidate message fields mapped to the corresponding field bits of the standard fields and / or the candidate message fields encapsulated to the corresponding field bits of the extended fields, standard message data corresponding to the original message data is generated.

[0394] Specifically, when generating standard message data based on candidate message fields mapped to corresponding field positions of standard fields and / or candidate message fields encapsulated to corresponding field positions of extended fields, a standard message data template can be constructed first. Then, the mapped candidate message fields are written into the corresponding standard field positions, and the unmapped but retained candidate message fields are uniformly written into the extended field positions, thereby forming standard message data with a unified structure. Preferably, for field positions that were not successfully extracted but belong to the required standard fields, null values, default values, or pending completion flags can be filled in to maintain the integrity of the standard message data structure. For example, default values ​​can include empty strings, empty arrays, empty objects, system default timestamps, or preset default flags.

[0395] Specifically, in this embodiment, a pre-defined general message format is used, and based on corresponding field extraction, field mapping, and extended encapsulation mechanisms, raw message data from different sources and with different structures are uniformly organized. This enables heterogeneous message content in different message interaction environments to be converted into standard message data with a matching organizational form. This reduces the impact of differences in field naming, data structure, and content organization of raw message data on subsequent processing, improves the matching and reusability of message data processing, and thus solves the technical problem in existing technologies where message data from different sources is difficult to parse uniformly and cannot be directly entered into the same processing flow.

[0396] In one embodiment, the location mapping module is further configured to determine the message interaction operation mapping relationship based on the interface area features and interaction operation location features of the target interaction environment, including: The system acquires environmental feature data of the target interactive environment, including window display information, interface layout information, interface text information, and interface component information. The interface component information includes various components and component layout information describing the layout relationships between these components.

[0397] Based on environmental feature data, determine the interface area features and interactive operation positioning features of the target interactive environment.

[0398] Based on the characteristics of the interface area and the positioning characteristics of the interactive operation, a correspondence is established between the standard message operation type and the corresponding target operation location and / or target operation range to obtain the message interaction operation mapping relationship.

[0399] The environmental feature data can be obtained through one or more of the following methods: calling the operating system window management interface to obtain window information; calling the accessibility or accessibility interface to obtain interface control tree information; reading the page object model to obtain page layout and component attributes; obtaining the current interface image and performing image recognition; or combining and analyzing multiple methods mentioned above. Window display information may include window size, window position, window hierarchy, whether the window is active, and scaling ratio. Interface layout information may include area distribution, control arrangement direction, column structure, container nesting relationship, and scroll area position. Interface text information may include interface label text, button text, placeholder text, title text, and conversation content text. Interface component information may include input boxes, buttons, send controls, attachment controls, emoticon controls, list containers, and their attribute information.

[0400] In one embodiment, the location mapping module is further configured to determine the interface area features and interactive operation location features of the target interactive environment based on environmental feature data, including: Based on the window display information, determine the display range and coordinate reference corresponding to the target interactive environment.

[0401] The display range refers to the visible area of ​​the target interactive environment in the current device's display coordinate system, preferably represented as a rectangular or polygonal boundary. The coordinate reference refers to a reference coordinate system used to uniformly describe the positions of various interface elements. Preferably, the coordinates of the top-left corner of the target window can be determined as the origin, or the coordinates of the top-left corner of the entire display screen can be determined as the origin. In some embodiments, a normalized coordinate method can also be used, with the window width and height as the normalization reference.

[0402] Based on the display range, coordinate reference, and interface layout information, multiple interface message areas in the target interactive environment are initially located to obtain multiple initial area positions.

[0403] The initial positioning of multiple interface message areas can be obtained through a coarse positioning method based on layout priors. Specifically, it can be determined whether the page adopts a layout form of vertical partitioning, horizontal columning, or list plus editing area based on the interface layout information. Then, according to the common regional distribution patterns of message interfaces in various layouts, the message display area, message input area, and message operation area are initially defined. For example, in common chat interfaces, the message display area is usually located in the middle or upper continuous scrolling area, the message input area is usually located in the area where the bottom input controls are located, and the message operation area is usually located near the input area or in the toolbar position of the message display area.

[0404] Based on the interface text information, extract multiple text anchors related to message interaction and multiple anchor positions that correspond one-to-one with the text anchors.

[0405] Here, text anchors refer to key text identifiers used to assist in identifying functional areas of the message interface. Preferably, text anchors can include words such as "send," "enter message," "reply," "chat history," "search," "emoticon," "attachment," and "new message," or text with equivalent semantics. The anchor position can be obtained through the coordinates of the corresponding text box after text recognition. Preferably, each text anchor and its position can be obtained by performing text recognition, keyword retrieval, and text region positioning on the interface text information.

[0406] Based on multiple initial area positions, multiple anchor point positions, and component layout information, the positions of multiple interface message areas are calibrated to determine multiple target areas and their corresponding target area positions. The target areas include at least one or more of the following: message display area, message input area, and message operation area.

[0407] Component layout relationships refer to the relative spatial relationships, containment relationships, alignment relationships, adjacency relationships, and hierarchical relationships between interface components. Specifically, when calibrating the positions of multiple interface message areas based on multiple initial area positions, multiple anchor point positions, and component layout information, the initial area positions can be used as candidate areas first. Then, the semantics of the areas can be verified based on the text anchor points. For example, if an area is adjacent to a "send" text button and an input box component, the confidence level of identifying that area as a message input area or a message operation area can be increased. Furthermore, the area boundaries can be fine-tuned by combining component layout information, such as including the input box component and its adjacent send button in the message input-related area, ultimately determining multiple target areas and their positions.

[0408] Based on the region category and region boundary corresponding to the locations of multiple target regions, interface region features are generated.

[0409] Among them, the region category is used to characterize the functional attributes of the target region, such as a message display area, a message input area, or a message operation area. The region boundary is used to characterize the spatial extent of the target region, and can preferably be represented by the coordinates of the upper left corner, the coordinates of the lower right corner, width and height parameters, or a set of vertices. Interface region features can include at least multiple target region region categories, region boundaries, relative positional relationships, and hierarchical relationships.

[0410] Based on the characteristics of the interface area and the information of the interface components, interactive objects in multiple target areas are identified, and the interactive operation items and the interaction range of each interactive object are determined.

[0411] Interactive objects refer to interface objects on which users or the system can perform operations such as clicking, inputting, long-pressing, pasting, dragging, and confirming. Preferably, these include input boxes, send buttons, confirm buttons, conversation entry points, message card operation buttons, attachment buttons, and quick reply entry points. Interactive operation items refer to the operation types corresponding to interactive objects, such as clicking, inputting text, pasting content, triggering sending, or switching conversations. The object interaction range refers to the interface range within which valid operations are allowed to be performed on a particular interactive object. Preferably, this range can be directly determined by the component boundaries, or it can be obtained by adding a preset safety margin outside the component boundaries. The preset safety margin can be set according to the control size, for example, it can be set to 2% to 10% of the control's width and height.

[0412] Based on the object interaction range, target area location, and coordinate reference, determine the object operation position corresponding to each interactive object.

[0413] The object operation position can be understood as the preferred target location for performing the interactive operation within the object's interaction range. Specifically, the object operation position can be obtained as follows: First, determine the geometric center of the object's interaction range. If the interactive object has a hotspot offset, for example, the send icon is located to the right of the button, then the center of the hotspot area is taken as the object operation position. If the interactive object is an input box, then a safe input point inside the input box, avoiding the boundary, can be selected as the object operation position.

[0414] Based on the interactive operation items, operation positions, and interaction ranges of each interactive object, interactive operation positioning features are generated to at least characterize the operation position and / or operation range corresponding to the message interaction operation executed in the target interactive environment.

[0415] Based on the characteristics of the interface area and the positioning characteristics of the interactive operation, a correspondence is established between the standard message operation type and the corresponding target operation location and / or target operation range to obtain the message interaction operation mapping relationship.

[0416] The interactive operation location features can include at least: an interactive object identifier, an interactive operation item, an object operation location, an object interaction range, a region affiliation, and execution order information. Standard message operation types can refer to platform-independent unified operation semantics, such as "locating the message input area," "writing reply content," "triggering a sending operation," and "expanding the additional operation bar." After establishing a correspondence between interface region features and interactive operation location features, a message interaction operation mapping relationship can be obtained. Preferably, the message interaction operation mapping relationship can be stored in the form of a mapping table, rule objects, or operation scripts, where each standard message operation type corresponds to one or more target operation locations, target operation ranges, and necessary execution conditions.

[0417] Specifically, in this embodiment, by comprehensively analyzing the window display, interface layout, text information, and component information in the target interactive environment, the actual positional relationship between message-related areas and interactive objects is determined. Furthermore, a correspondence is established between standard message operation types and target operation positions and / or target operation ranges. This allows message interaction operations to no longer rely on fixed interface coordinates or a single operation entry point, but can adaptively position themselves based on the current environment's interface structure. Therefore, the positioning accuracy and execution stability of message input, sending, and other interactive operations under different interface layouts can be improved, thereby solving the technical problem in the prior art where positioning deviations and execution failures easily occur during message interaction due to differences in interface structure, layout changes, or component position adjustments.

[0418] In some embodiments, environmental feature data may further include display topology information, screen resolution information, and interface scaling information corresponding to the target application window. When the target interactive environment is in a multi-screen or cross-screen display state, the coordinates of the chat window, contact area, message display area, reply input area, and send control area can be uniformly converted by combining window handle tracking results, display topology relationships, and resolution recognition results to improve the positioning accuracy in cross-screen scenarios.

[0419] In some embodiments, a relocation mechanism may be automatically triggered when one of the following occurs on the interface: window position shifts; resolution or scaling changes; chat window is displayed across screens; platform interface version is updated; OCR anchor point recognition confidence is lower than a preset threshold; or the deviation between the reply box coordinates and the expected area exceeds a preset threshold. After relocation is triggered, the system can re-execute the automated process of "window detection—region division—OCR anchor point recognition—feature point calibration—coordinate refresh" to achieve automatic re-recognition and automatic relocation of the reply box, message area, and contact area, thereby avoiding positioning failure, accidental clicks, or inability to send messages due to interface changes.

[0420] In one embodiment, when the target interaction environment is the WeChat platform, acquiring and parsing the environmental feature data of the target interaction environment to determine the message interaction operation mapping relationship can employ a three-layer progressive automatic detection and localization strategy, including: By using window handle retrieval, window title recognition, border feature extraction, and active window filtering mechanisms, the boundaries of the main window of WeChat for Enterprise are determined, and interference from other foreground applications or obscuring windows is eliminated.

[0421] Based on the pre-built interface template of WeChat Work, the layout of the main window is analyzed to determine the relative positions of the contact list area, the current chat area, the message display area, the reply input area, and the toolbar area, thereby achieving coarse-grained division of the core area.

[0422] By combining OCR anchor point recognition, edge contour extraction, feature point matching, and local coordinate regression algorithms, the system can accurately locate key controls such as reply boxes, send buttons, and message containers, and output the corresponding coordinate results.

[0423] Preferably, a quick re-verification of the target control can be performed before each reply is sent. When window offset, input box deviation, abnormal interface scaling, or decreased confidence in OCR anchor point recognition is detected, a new round of coordinate recalibration process is automatically triggered to ensure that the target control is always in an operable state.

[0424] In one embodiment, when the target interaction environment is the WhatsApp platform and the business scenario is a foreign trade business scenario, a two-stage collaborative recognition architecture can be used to enhance the recognition of standard message data, including: The basic semantic recognition model is invoked to perform general semantic parsing on standard message data, and output basic intent labels, keyword sets, sentiment tendencies and language recognition results.

[0425] The foreign trade domain enhancement model is invoked to perform domain enhancement recognition on the basic semantic recognition results, original message content, historical context and industry dictionary matching results, and output industry term labels, business scenario labels and response constraints.

[0426] According to preset fusion rules, the outputs of the basic semantic recognition model and the foreign trade-related enhanced model are fused to obtain the enhanced scene recognition result. Specifically, for foreign trade business scenarios, the output weights of the foreign trade-related enhanced model can be appropriately increased to improve the accuracy of professional recognition.

[0427] In one embodiment, the location mapping module is further configured to, before sending the interaction response to the target interaction environment based on the message interaction operation mapping relationship, include the following method: The interface area features and interaction operation positioning features determined when establishing the message interaction operation mapping relationship are respectively determined as the baseline interface area features and baseline interaction operation positioning features.

[0428] Obtain the current interface area features and current interaction operation location features of the target interactive environment.

[0429] The baseline interface region features and baseline interactive operation location features can be understood as the set of reference features used when establishing the mapping relationship of the current valid message interactive operation. The current interface region features and current interactive operation location features can be re-acquired in the same or equivalent way as when establishing the baseline features to ensure the comparability of the comparison results. Preferably, the current features can be acquired in real time before the sending action is executed to reflect the latest interface state of the target interactive environment.

[0430] The current interface region features are compared with the baseline interface region features to determine whether the region categories of multiple target regions match and whether the deviation of the region boundaries of multiple target regions exceeds a preset boundary threshold.

[0431] The deviation of the region boundary is used to characterize the degree of difference between the current target region and the reference target region in terms of spatial location and size. Specifically, the deviation can be obtained as follows: for the current region boundary and the reference region boundary corresponding to the same region category, calculate the left boundary coordinate difference, the upper boundary coordinate difference, the width difference, and the height difference, respectively. Normalize each difference according to the width and height of the display range, and then perform a weighted sum or average of the normalized differences to obtain the region boundary deviation of the target region. Preferably, the deviation can also be characterized by the inverse of the region overlap, the normalized value of the center point distance, or the degree of change in the intersection-union ratio of the bounding boxes.

[0432] If the region category of multiple target regions is matched and the deviation of the region boundaries of multiple target regions is less than the preset boundary threshold, then the current interface region feature is determined to match the baseline interface region feature.

[0433] The preset boundary threshold can be set based on historical interface change samples, regional drift under different application versions, or validation set test results. Preferably, the preset boundary threshold can be set to a normalized value between 0.05 and 0.20, and more preferably, it can be set to 0.08, 0.10, or 0.12. A smaller threshold results in more stringent mapping relationship verification. A larger threshold provides greater tolerance for slight interface changes. In practical applications, the threshold can be adjusted according to the stability of the target interaction environment.

[0434] If the region category of at least one target region does not match, or the deviation of the region boundary of at least one target region is greater than or equal to a preset boundary threshold, the message interaction operation mapping relationship is determined to be invalid.

[0435] When determining whether the region categories of multiple target regions match, the category labels of each target region in the current interface region features can be compared one by one with the corresponding category labels in the baseline interface region features. If a region that should have been identified as a message input region is identified as another region in the current state, the region category mismatch can be directly determined. When determining whether the region boundary deviation exceeds the threshold, each region can be compared individually, and if any region exceeds the threshold, the baseline interface region features and the current interface region features can be determined to be mismatched.

[0436] In response to the matching of the current interface area features with the baseline interface area features, the current interactive operation location features are compared with the baseline interactive operation location features to at least determine whether there are any new interactive objects and / or interactive operation items related to the message interactive operation in the target interactive environment, and whether the operation position and / or operation range corresponding to the message interactive operation match.

[0437] When comparing the current interactive operation location features with the baseline interactive operation location features, the following aspects can be considered: First, compare whether the set of interactive objects has changed, such as whether a button has been added or the sending entry has been hidden. Second, compare whether the set of interactive operation items has changed, such as whether the original "click to send" operation has been changed to "click to confirm and then send". Third, compare whether the object operation position and object interaction range corresponding to the same operation item have changed. Specifically, whether the operation position matches can be determined by calculating the normalized distance between the current operation position and the baseline operation position. Whether the object interaction range matches can be determined by comparing their boundary deviation or overlap. Preferably, the position normalized distance threshold can be set to 1% to 10% of the display range width or height.

[0438] If a new interactive object and / or interactive operation item related to a message interaction operation is added to the target interactive environment, or if the operation position and / or operation range corresponding to the message interaction operation do not match, the message interaction operation mapping relationship is determined to be invalid.

[0439] If the message interaction operation mapping relationship is invalid, the message interaction operation mapping relationship is updated according to the comparison deviation between the current interface area features and the reference interface area features, and / or according to the comparison deviation between the current interaction operation positioning features and the reference interaction operation positioning features.

[0440] The comparison deviation term can refer to the specific difference that causes the current feature to mismatch with the baseline feature, such as region boundary offset, region category change, missing interactive objects, addition of operation entry points, object operation position offset, or change in interaction range. In response to an invalid message interaction operation mapping relationship, region identification and operation positioning can be re-executed only for the local region where the deviation occurred to update the message interaction operation mapping relationship. Alternatively, complete environmental feature data can be reacquired and the message interaction operation mapping relationship reconstructed. Preferably, when the deviation term involves only a slight change in a single region boundary, a partial update can be performed. When the deviation term involves a change in region category or a change in the core sending entry point, a full update can be performed.

[0441] Based on the updated message interaction operation mapping relationship, the interaction response is sent to the target interaction environment.

[0442] Specifically, in this embodiment, before sending a message, the current interface features are compared with the baseline features used when the pre-established mapping relationship was established. This determines whether the current target interaction environment still meets the applicable conditions of the original message interaction operation mapping relationship. When the mapping relationship is determined to be invalid, it is updated based on the detected deviation, enabling the message sending process to dynamically correct itself according to real-time changes in the target environment. This allows for timely detection of mapping mismatch problems caused by changes in interface areas, interactive objects, or operation positions, improving the timeliness and reliability of the message interaction operation mapping relationship. This solves the technical problem in the prior art where the original operation path becomes invalid after an interface update, leading to message sending errors or failures.

[0443] In one embodiment, the message generation module is further configured to determine the corresponding message generation branch in the pre-trained message generation agent based on the business scenario corresponding to the standard message data, including: Extract scene recognition features corresponding to standard message data. Scene recognition features include at least one or more of the following: keyword features, semantic features, intent features, and context features.

[0444] Keyword features can include industry terms, business entity words, action words, and high-frequency phrases extracted from standard message data. Preferably, keyword features can be obtained through word segmentation statistics, keyword extraction, named entity recognition, industry dictionary matching, or terminology rule matching. For example, in foreign trade business scenarios, words such as "MOQ," "FOB," "quotation," "leadtime," "sample," and "shipment" can serve as strong industry identification clues. Semantic features can refer to vectorized features representing the overall meaning of the message. Preferably, they can be obtained by encoding the message text in the standard message data through text embedding models, pre-trained language models, or semantic encoding models. Intent features can refer to the main interactive intent expressed in the current message, such as inquiry, confirmation, urging, reply, negotiation, refusal, or thanks. Intent features can be obtained based on intent information. Intent information can also include awareness tags obtained from the input text and / or intent text contained within the input text. Intent information can also be the interactive intent and / or intent tags described above, without limitation. Contextual features can include information such as historical dialogue content, current turn position, the role relationship between the sender and receiver, conversation topic, temporal context, and citation relationships.

[0445] Based on keyword features and semantic features, scene classification features corresponding to standard message data are generated, and based on intent features and context features, context discrimination features corresponding to standard message data are generated.

[0446] Among them, the context discrimination features can be further generated by combining emotional tendencies. Emotional tendencies can be obtained based on emotional information, which may include emotional tags obtained from the input text and / or emotional text contained in the input text, without limitation.

[0447] Among them, scenario classification features are used to characterize the business scenario characteristics to which the standard message data belongs, i.e., the business scenario. Contextual discrimination features are used to characterize the specific communication context characteristics to which the standard message data belongs within that business scenario. Specifically, scenario classification features can be obtained by fusing keyword features and semantic features, for example, by concatenating or weighting industry keyword hit rates with message semantic vectors to form industry identification features. Contextual discrimination features can be obtained by fusing intent features and context features to form a representation of the current communication stage and interaction purpose. Preferably, for business scenario identification, the weight of industry terms in keyword features and semantic features can be increased. For contextual scenario identification, the weights of round relationships, role relationships, and dependencies on preceding messages in intent features and context features can be increased.

[0448] Based on multiple business scenario features in a pre-defined scenario matching corpus, the feature similarity between scenario classification features and multiple business scenario features is determined, so as to determine the business scenario matching degree between standard message data and multiple business scenario features.

[0449] The pre-defined scenario matching corpus can be constructed by pre-collecting and labeling historical message samples under different business scenarios. Preferably, sample sets can be established for multiple industries such as foreign trade, recruitment, office work, and customer service, and each sample can be labeled with its business scenario and corresponding contextual scenario. Based on the sample sets, business scenario features corresponding to each business scenario, as well as contextual scenario features corresponding to different contextual scenarios under each business scenario, can be further extracted. Preferably, the business scenario features can be pre-converted into corresponding business scenario feature vectors. Preferably, the contextual scenario features can be pre-converted into corresponding contextual scenario feature vectors.

[0450] Multiple business scenario features with a business scenario matching degree greater than or equal to a preset business scenario matching degree threshold are identified as candidate business scenarios, and the candidate business scenario with the highest business scenario matching degree is identified as the target business scenario.

[0451] Multiple contextual scenarios corresponding to the target business scenario are identified as candidate contextual scenarios.

[0452] Based on the contextual scene features corresponding to multiple candidate contextual scenes, the feature similarity between the contextual discrimination features and the multiple contextual scene features is determined, so as to determine the contextual scene matching degree between the standard message data and the multiple candidate contextual scenes.

[0453] Feature similarity can be obtained through one or more of the following methods: cosine similarity, vector distance transformation value, or probability output by the classification model. Furthermore, contextual scene matching degree can be obtained directly using feature similarity, or it can be obtained by modifying feature similarity based on conversation turn stability, context continuation probability, or role relationship matching. Preferably, the preset contextual scene matching degree threshold can be set between 0.55 and 0.90, and more preferably, it can be set to 0.65 or 0.70.

[0454] One or more candidate context scenarios with a context matching degree greater than or equal to a preset context matching degree threshold are identified as reference context scenarios.

[0455] Based on the target business scenario and one or more reference context scenarios, the corresponding message generation branch is determined in the message generation agent.

[0456] The message generation agent can refer to an intelligent processing module used to generate response messages based on business scenarios and specific contexts. Preferably, the message generation agent can include a scenario recognition module, an industry routing module, a context discrimination module, a rule constraint module, and a text generation module. The message generation branch can refer to the generation path, response template set, constraint parameter set, prompt word set, or sub-model call chain within the message generation agent that corresponds to a specific business scenario and a specific contextual scenario within that business scenario.

[0457] By determining the corresponding message generation branch based on the target business scenario and one or more reference context scenarios, the response generation process can better align with the industry's expression requirements and the actual needs of the current communication stage. For example, first, the main branch for business scenario generation within the message generation agent is determined based on the target business scenario. Then, context generation sub-branches are determined under the main branch based on one or more reference context scenarios, thus obtaining the target message generation branch used to generate response message data.

[0458] It is worth noting that in this embodiment, "business scenario" can refer to the business context or industry-specific business context to which the message belongs. In other words, "business scenario" does not simply refer to general communication purposes, but rather characterizes the industry background to which the current message is attached. Preferably, the business scenario can include one or more of the following: foreign trade business scenario, cross-border e-commerce business scenario, domestic e-commerce business scenario, recruitment business scenario, corporate office business scenario, customer service business scenario, logistics business scenario, etc. The terminology, response focus, and expression habits typically differ across different business scenarios; therefore, it is necessary to first determine the business scenario to which the message belongs before generating a subsequent response.

[0459] Similarly, a contextual scenario can refer to a specific communication situation further subdivided within a particular business scenario. Preferably, in a foreign trade business scenario, a contextual scenario can include inquiry responses, product introductions, quotation communication, sample confirmation, order follow-up, payment reminders, delivery date confirmation, logistics notifications, and after-sales processing. In a recruitment business scenario, a contextual scenario can include job inquiries, resume invitations, interview confirmations, onboarding notifications, and candidate follow-ups. In a corporate office business scenario, a contextual scenario can include task assignment, progress feedback, meeting notifications, approval reminders, and result confirmation. In other words, a business scenario represents industry affiliation, while a contextual scenario represents the specific communication state within that business scenario.

[0460] Based on the above, multiple contextual scenarios corresponding to the target business scenario are identified as candidate contextual scenarios. This can be understood as follows: after the business scenario has been identified, the specific communication contexts are further filtered within that business scenario. For example, after the foreign trade business scenario is identified, the candidate contextual scenarios are no longer selected across industries, but are judged from multiple contextual scenarios such as inquiry response, quotation communication, order confirmation, delivery confirmation, and logistics follow-up in the foreign trade industry.

[0461] Specifically, in this embodiment, by extracting keywords, semantics, intent, and context information from standard message data, the business scenario to which the message belongs and its corresponding context are identified hierarchically. Based on the identification results, a matching message generation branch is determined in the pre-trained message generation agent, enabling the response generation process to be tailored to the specific business scenario and context of the message. This improves the matching degree between the message generation strategy and actual message needs, enhances the scenario identification and context adaptation capabilities of the response generation process, and solves the technical problems of existing response generation processes lacking scenario differentiation and difficulty in effectively adapting to different semantic environments.

[0462] In one embodiment, the message generation module is further configured to generate reply message data corresponding to the standard message data through a message generation branch, including: Based on the target business scenario corresponding to the message generation branch, the corresponding business scenario reply rules are determined in the preset scenario reply rule library.

[0463] The pre-defined scenario response rule library can be understood as a set of response rules pre-established for different business scenarios and their sub-contextual scenarios. Preferably, the pre-defined scenario response rule library can be constructed in one or more of the following ways: manually configured by business experts according to industry communication standards; extracted from historical high-quality response samples from various industries; generated based on industry knowledge bases, terminology databases, and standard dialogue databases; or jointly constructed through rule templates and machine learning statistical methods. The pre-defined scenario response rule library can organize response rules according to a two-level structure of "business scenario—contextual scenario." For example, in a foreign trade business scenario, pre-defined rules can be set for inquiry response, quotation communication, delivery confirmation, and logistics notification. In a recruitment business scenario, pre-defined rules can be set for invitation communication, interview confirmation, and onboarding notification.

[0464] Among them, business scenario response rules are used to characterize the industry-wide requirements that response content should meet in a specific business scenario. Preferably, in foreign trade business scenarios, business scenario response rules may require response content to conform to international trade communication habits, prioritize product information or transaction elements, maintain a professional and polite expression, and use common industry terminology as much as possible. In recruitment business scenarios, business scenario response rules may require response content to highlight job information, interview arrangements, process nodes, and polite invitations. In corporate office business scenarios, business scenario response rules may require response content to highlight task information, time nodes, and execution items.

[0465] Based on one or more reference context scenarios corresponding to the message generation branch, the corresponding context scenario reply rules are determined in the preset scenario reply rule base.

[0466] Among them, contextual scenario response rules are used to characterize detailed response requirements under specific communication situations within a business scenario. For example, in the "inquiry response" context of foreign trade business, priority can be given to responding to product parameters, price ranges, minimum order quantities, and sample availability that customers are concerned about. In the "delivery confirmation" context, priority can be given to explaining the estimated delivery time, production progress, and potential influencing factors. In the "logistics follow-up" context, priority can be given to explaining the shipping status, tracking number, and estimated arrival time.

[0467] Based on business scenario reply rules and context scenario reply rules, message generation constraint information corresponding to standard message data is generated. The message generation constraint information includes at least one or more of the following: reply intent, reply content elements, reply expression method, and reply output format.

[0468] Among these, message generation constraints can be understood as the combined result of industry and contextual constraints imposed on the response generation process. Response intent refers to the main communication purpose of this response, such as answering inquiries, promoting transactions, confirming arrangements, following up on progress, providing reassurance or explanation, or ending communication. Response content elements refer to the key information items that should be included in the response. Preferably, in foreign trade scenarios, response content elements may include product name, specifications, price terms, minimum order quantity, sample information, payment method, delivery date, and shipping method. Response expression style refers to the language style that should be used in the response, such as formal, business-like, polite, concise, professional, reassuring, or persuasive expression. Response output format refers to the organizational form of the response text, such as single-paragraph text, bullet-point listing, tabular field output, or templated structure output.

[0469] Based on message generation constraints, semantic organization and text generation are performed to obtain candidate content for reply messages.

[0470] Semantic organization and text generation can be achieved through pre-trained large language models or multi-stage text generation models. Specifically, a response framework can be determined first based on message generation constraints. This framework can include a salutation or opening response, a core business response, and a closing prompt. Then, key information from standard message data and industry-related content are filled into the response framework, and a text generation model is invoked to generate candidate response messages. Preferably, in foreign trade scenarios, the response framework can include a customer salutation, response to needs, quotation or parameter description, and guidance for subsequent actions.

[0471] The candidate response content can be one or more candidate response texts. Preferably, when generating multiple candidate response texts, the candidate content can be sorted based on industry matching degree, contextual compliance, key information completeness, language fluency, and length suitability, and the one or more with the highest scores can be selected as subsequent optimization targets. Specifically, industry matching degree can be used to characterize whether the candidate response conforms to the terminology and expression style of the target business scenario. Contextual compliance degree can be used to characterize whether the candidate response conforms to the current specific communication context. Key information completeness can be used to characterize whether the candidate response covers the response content elements required by the message generation constraints.

[0472] Semantic adaptation and text optimization are performed on the candidate content of the reply message to generate reply message data that corresponds to the standard message data.

[0473] Semantic adaptation and text optimization may include one or more of the following processes: industry terminology adaptation, filtering of sensitive or inappropriate expressions, removal of redundant expressions, grammatical error correction, length control, format standardization, style consistency, and context matching verification. Preferably, industry terminology adaptation is used to convert generalized expressions into more commonly used terms in the target industry. For example, in foreign trade scenarios, the general expression "price" is optimized into more trade-communication-friendly expressions such as "quotation," "price terms," ​​or relevant trade terms. Context matching verification is used to determine whether the candidate response matches the customer's needs, confirmed matters, or commitments made in the preceding dialogue. Length control can be used to ensure that the response text conforms to a preset word count range, such as 20 to 300 words.

[0474] Specifically, when generating message generation constraint information based on business scenario response rules and context scenario response rules, the general constraints corresponding to the business scenario can be extracted first, followed by the detailed constraints corresponding to the context scenario, and then the two types of constraints can be merged. Preferably, when both types of constraints act on the same generation dimension simultaneously, they can be processed according to the principle that context scenario response rules take precedence over business scenario response rules, or conflicts can be resolved according to a preset priority table. For example, in a foreign trade business scenario, the business scenario response rules require that "the expression should be professional, business-like, and polite," while in the context of "quotation communication," it further requires that "the quotation content should clearly list the price terms, quantity conditions, and validity period." Therefore, the final message generation constraint information includes both industry-wide business expression requirements and key element requirements specific to the quotation context.

[0475] Specifically, in this embodiment, by combining the business scenario response rules corresponding to the target business scenario and the context scenario response rules corresponding to the reference context scenario, constraints are imposed on the generation conditions such as response intent, content elements, expression methods, and output formats. Based on this, semantic organization, text generation, and subsequent optimization processing are completed, ensuring that the generated response content not only meets the business requirements of the corresponding scenario but also maintains a high degree of matching with the current context. This improves the performance of response messages in terms of content completeness, expression accuracy, and output standardization, enhancing the relevance and usability of the generated results, thereby solving the technical problems of high generalization of automatic response content, insufficient semantic fit, and unstable output format in existing technologies.

[0476] For example, upon receiving a selection instruction, the target interaction environment is first determined, and then the message acquisition link and response delivery link are executed sequentially based on this environment. In the message acquisition link, the corresponding information acquisition rules are determined, and it is determined whether access to the data storage area is permitted. If permitted, the data storage area is accessed to obtain the raw message data; otherwise, the interactive interface image is acquired, and the raw message data is extracted based on the image recognition results. The raw message data is then standardized to generate standard message data, and the corresponding business scenario is determined based on the standard message data. This determines the message generation branch corresponding to the message generation agent, thus generating the interactive response. In the response delivery link, the interface area features and interactive operation location features of the target interaction environment are acquired to determine the message interaction operation mapping relationship. Finally, based on the message interaction operation mapping relationship, the interactive response is sent to the target interaction environment, thereby achieving message extraction, standardized understanding, scenario-based response generation, and automatic response sending for different interaction environments.

[0477] For example, the selected communication platform is first detected, and the corresponding platform plugin is loaded based on the detection results. The corresponding message interaction operation mapping relationship is determined based on the detection results, and standard message data is processed to generate an interactive response and return it. Specifically, taking the detection of the WeChat Work platform as an example, the three-layer detection and positioning logic for the graphical interface is illustrated. It establishes the message interaction operation mapping relationship for WeChat Work through a three-layer progressive detection and positioning process. This process includes determining the main window boundary, coarsely dividing the core area based on a preset interface template, and finely positioning key controls such as the reply box, send button, and message container. This, combined with standard message data, forms a scene recognition result, which is then used to generate an interactive response. Specifically, taking the WhatsApp platform as an example, the scene recognition enhancement logic for business scenarios is illustrated. It inputs standard message data into a two-stage collaborative enhancement recognition process. This process includes general semantic parsing, enhanced recognition combined with foreign trade domain knowledge, and result fusion to form a scene recognition result, which is then used to generate an interactive response.

[0478] In one embodiment, this application also provides a message interaction method applied to the interaction environment side deployed in instant messaging software, comprising the following steps: acquiring raw message data; sending the raw message data to one of the aforementioned message interaction devices based on the message acquisition rules corresponding to the instant messaging software; acquiring the interaction response generated by the message interaction device in response to the raw message data, and outputting the interaction response.

[0479] It is worth noting that, when applied to the exchange environment side, this message interaction method further includes: determining the message acquisition rules corresponding to the current interaction environment within the instant messaging software. In response to the message acquisition rule indicating permission to read the data interface, the method reads the interaction message-related data from the data interface corresponding to the current interaction environment and generates raw message data based on the interaction message-related data. The raw message data is sent to one of the aforementioned message interaction devices, which converts the raw message data into standard message data and generates an interaction response based on the standard message data. The method receives the interaction response returned by the message interaction device and outputs the interaction response in the current interaction environment.

[0480] The instant messaging software can be desktop instant messaging software, mobile instant messaging software, web-based instant messaging pages, or a conversation module integrated into a business system. The current interaction environment can be the currently active one-on-one chat interface, group chat interface, customer communication interface, or other interfaces used for message display and input. Message retrieval rules can be used to characterize whether the current interaction environment allows the retrieval of message-related data via a data interface. Preferably, the message retrieval rules can at least include the data interface open status, interface access permissions, message field reading paths, and exception handling strategies.

[0481] Specifically, in this embodiment, the instant messaging software is primarily responsible for obtaining message-related data from the data interface corresponding to the current interaction environment when the interface reading conditions are met, and then forming raw message data based on this data before sending it to the message interaction device. The generation of standard message data, business scenario identification, message generation branch determination, and interactive response generation are all performed by the message interaction device. Correspondingly, after receiving the interactive response from the message interaction device, the instant messaging software can display the interactive response in the input area, candidate response area, or other response display area of ​​the current interaction interface for the user to view, confirm, or send.

[0482] Furthermore, when the instant messaging software and the messaging device are deployed on the same terminal device, the instant messaging software can send raw message data and receive interactive responses through a local interface, inter-process communication mechanism, or shared memory. When the instant messaging software and the messaging device are deployed separately, the instant messaging software can also send raw message data to the messaging device via a network link and receive interactive responses from the messaging device.

[0483] Optionally, outputting an interactive response may include one or more of the following methods: displaying the interactive response in the response input box; displaying the interactive response as candidate response content; or displaying the interactive response in a preview area for user confirmation before proceeding with the subsequent sending operation. Preferably, the instant messaging software is only responsible for receiving and outputting interactive responses to the interface, and does not participate in the generation and processing of interactive responses.

[0484] The following section provides a detailed explanation of the overall implementation framework of the message interaction method in this application.

[0485] S801: Obtain and analyze the session data corresponding to the session object in the target interaction environment to obtain session analysis information; wherein, the session data includes the interaction data of the session object in the current round; S802: Obtain the user profile of the session object; S803: Update user profiles using conversation analysis information and previous response processing data; S804: Generate candidate responses that adapt and update the user profile and conversation analysis information; among them, candidate responses are used to assist in generating interactive responses that generate response interaction data.

[0486] In this context, a session object refers to an object participating in message interaction within the target interaction environment; a session object can specifically be a user. A user profile refers to user characteristic descriptions formed based on the session object's historical interaction history, feature information, or preference information. Previous response processing data refers to the processing results data formed before the current round, based on generated, modified, or actually sent responses. Pending responses refer to selectable response content generated based on session analysis information and the updated user profile. Interactive responses refer to the content actually generated and used to respond to the current round's interaction data.

[0487] Specifically, the process involves acquiring and analyzing session data corresponding to the session object within the target interaction environment to obtain session analysis information that reflects the session characteristics embodied in the current round of interaction data. Subsequently, a user profile of the session object is acquired as the foundational information describing its existing characteristics. Combining the currently acquired session analysis information with previous response processing data, the user profile is updated to reflect changes in the session object during continuous interaction. Then, candidate responses are generated based on the updated user profile and session analysis information, and these candidate responses are used to assist in generating interactive responses. This process integrates the current round of interaction content, the existing characteristics of the session object, and the results of previous response processing, allowing the user profile to continuously adjust during interaction, thereby improving its ability to reflect the current needs and interaction characteristics of the session object. Generating candidate responses based on the updated user profile and session analysis information ensures that subsequent interactive responses are more closely aligned with the current round of interaction content and the characteristics of the session object, thus improving the targeting and adaptability of message interaction and enhancing the continuity, targeting, and relevance of subsequent response generation.

[0488] In one embodiment, obtaining and analyzing session data corresponding to the session object in the target interaction environment to obtain session analysis information includes: Extract the interaction data of the current round and the historical interaction data from the session data; The interaction data and historical interaction data are arranged and combined according to the time sequence of the conversation to obtain the content of the conversation to be analyzed; Semantic parsing is performed on the content of the conversation to be analyzed to determine one or more of the intent information, sentiment information, and conversation topic information of the content of the conversation to be analyzed; Based on one or more of the intent information, emotion information, and conversation topic information, determine the corresponding intent information, emotion information, and product keywords, and use them as conversation analysis information.

[0489] Among these, intent information refers to information used to characterize the purpose or need expressed by the conversation participants in the current conversation. Emotional information refers to information used to characterize the emotional state exhibited by the conversation participants in the current conversation. Product keywords refer to keyword information extracted from the conversation content that can characterize the product content that the conversation participants are interested in.

[0490] Specifically, by extracting current and historical interaction data from the conversation data, and then arranging and combining them according to the conversation's chronological order, the conversation content to be analyzed is formed, creating a continuous semantic link between the current expression and the historical context. Subsequently, semantic parsing is performed on the conversation content to identify one or more of the intent, emotion, and conversation topic information. Based on this, the corresponding intent, emotion, and product keywords are further determined and used as conversation analysis information. This process avoids the problem of incomplete information caused by analyzing only a single interaction from the current round. The resulting conversation analysis information not only reflects the current needs and emotions of the conversation participants but also accurately identifies the conversation topic and focus by combining historical interaction content. Furthermore, extracting product keywords after identifying the conversation topic information helps make the conversation analysis information more relevant to the current communication content, thereby improving the completeness of conversation understanding, the accuracy of semantic recognition, and the targeted nature of subsequent message processing.

[0491] In one embodiment, generating candidate responses that adapt and update the user profile and conversation analysis information includes: Based on intent information, emotional information, and product keywords, determine the style of the response template, the composition of the response, and the organization of the information for the current round; Based on the style of the response template and the information organization method, at least two matching response expression structures are determined from the preset response expression structures; Obtain the product keywords corresponding to the information that constitutes the response, extract the content elements corresponding to the product keywords from each conversation analysis information, and organize and fill the content elements according to at least two determined response expression structures to generate at least two candidate responses. Among them, at least two candidate responses differ in one or more aspects such as response length, semantic focus, and guiding expression.

[0492] Specifically, based on intent information, sentiment information, and product keywords, the style of the response template, the structure of the response, and the organization of information for the current round are determined to clarify the expressive characteristics, key elements, and organizational logic of the response in this round. Then, based on the response template style and information organization, at least two matching response expression structures are determined from the preset response expression structures to provide different expression frameworks for generating candidate responses. On this basis, product keywords corresponding to the response structure information are obtained, and content elements corresponding to the product keywords are extracted from the conversation analysis information. These content elements are then organized and filled according to the determined at least two response expression structures to generate at least two candidate responses. These candidate responses differ in one or more aspects, such as response length, semantic focus, and guiding expression. Through this process, multiple candidate responses with differentiated expressive characteristics can be generated based on the intent information, sentiment information, and product keywords corresponding to the current round. This avoids the problem of insufficient adaptation caused by generating only a single form of response, making the candidate responses more aligned with the current conversation analysis information in terms of expression and semantic presentation, and improving the relevance, flexibility, and selectivity of response generation.

[0493] In one embodiment, the candidate responses used to assist in generating response interaction data include: If there are multiple candidate responses, select one of them as the target candidate response. In response to the modification operation of the target candidate response, record the target candidate response, the modified response after modification, and the modification content; In response to the completion of sending the target candidate response or modified response, the actual target candidate response or modified response sent is recorded as an interactive response. Generate response processing data for the current round based on one or more of the target candidate responses, modified content, and interactive responses.

[0494] Here, "target candidate response" refers to the selected response from multiple candidate responses. "Modified response" refers to the response content formed after the target candidate response has been modified. "Modified content" refers to the content changes that have occurred relative to the target candidate response. "Response processing data" refers to the data generated during the selection, modification, and transmission of responses in the current round.

[0495] Specifically, when using candidate responses to assist in generating interactive response data, if there are multiple candidate responses, a target candidate response is first selected. When modifying the target candidate response, the target candidate response, the modified response, and the modified content are recorded. After the target candidate response or modified response is sent, the actually sent target candidate response or modified response is recorded as an interactive response. Based on one or more of the target candidate response, modified content, and interactive responses, the response processing data for the current round is generated. This system can correlate and record the selection, modification, and actual sending of responses in the current round, forming a complete data link in the response processing process. This provides a basis for subsequent analysis of the adoption, modification, and final output of responses in the current round, improving the traceability and data integrity of the response processing process, and facilitating more accurate data support for subsequent user profile updates or response optimization.

[0496] In one embodiment, updating the user profile using session analysis information and previous response processing data includes: Get the conversation analysis information for the current round, and get the previous response processing data corresponding to the conversation object; Based on the object identifier and session identifier of the session object, the session analysis information of the current round is associated with the previous response processing data to obtain profile update data; Based on the profile update data, update at least one of the following in the user profile: user intent preference, emotional tendency, and product attention preference.

[0497] Among these, object identifier refers to information used to identify the identity of a conversation object. Conversation identifier refers to information used to identify the current conversation. Profile update data refers to data used to update the user profile after associating the current round of conversation analysis information with the previous response processing data. User intent preference refers to information in the user profile reflecting the relatively stable or continuous intent tendencies of the conversation object during the interaction. Emotional tendency refers to information in the user profile reflecting the emotional expression trends exhibited by the conversation object during the interaction. Product attention preference refers to information in the user profile reflecting the degree or direction of attention the conversation object pays to different product content.

[0498] Specifically, the process involves acquiring conversation analysis information for the current round and obtaining previous response processing data for the corresponding conversation object. Then, based on the object identifier and conversation identifier of the conversation object, the conversation analysis information for the current round is correlated with the previous response processing data to obtain profile update data. Based on this, at least one of the user intent preferences, emotional tendencies, and product attention preferences in the user profile is updated according to the profile update data. This allows for the mapping of conversation characteristics reflected in the current round with the previous response processing, enabling targeted adjustments to the user profile based on existing response processing, thereby improving the user profile's ability to reflect changes in the interaction characteristics of the conversation object. By updating at least one of the user intent preferences, emotional tendencies, and product attention preferences, the user profile can more closely reflect the actual performance of the conversation object in continuous interaction, improving the accuracy and dynamic adaptability of the user profile.

[0499] In one embodiment, after generating candidate responses that adapt and update the user profile and conversation analysis information, the method further includes: Extract one or more of the user preference tags, communication style tags, and product interest tags from the updated user profile that correspond to the current round of conversation analysis information; Based on one or more of the user preference tags, communication style tags, and product focus tags, determine the filtering criteria for multiple candidate responses. The filtering criteria include one or more of the following: response length, tone and style, product information presentation order, and guidance expression method. The multiple candidate responses are matched with the filtering criteria to obtain the matching degree of each candidate response; At least one candidate response that meets the preset matching criteria is selected as the recommended candidate response.

[0500] Among them, user preference tags refer to label information used to characterize the preferred characteristics of conversation participants in message interaction. Communication style tags refer to label information used to characterize the preferred communication methods or expression methods of conversation participants. Product interest tags refer to label information used to characterize the focus of conversation participants on different product content. Filtering conditions refer to the conditions used to determine the degree of fit between multiple candidate responses and the user characteristics of the current round. Matching degree refers to the degree of conformity between the candidate responses and the filtering conditions. Recommended candidate responses refer to the candidate responses that are more suitable for use in the current round after filtering from multiple candidate responses.

[0501] Specifically, after generating multiple candidate responses, the system first extracts user preference tags, communication style tags, and product interest tags corresponding to the current round from the updated user profile, and uses these to form filtering conditions. This allows the selection of candidate responses to be combined with current user characteristics, thereby improving the targeting of the filtering direction. Then, each candidate response is matched with the filtering conditions to differentiate the suitability of each candidate response to the current round. This helps identify more suitable responses from multiple results. Finally, candidate responses that meet preset matching conditions are determined as recommended candidate responses. This ensures that the final recommendation result not only originates from the response generation process but also further aligns with the updated user profile, thereby improving the accuracy and suitability of the recommended candidate responses.

[0502] In one embodiment, before acquiring session data in the target interactive environment, the method further includes: Obtain platform characteristic information of the target interaction environment; The platform feature information is matched with the preset platform feature template, and the platform adaptation parameters corresponding to the target interaction environment are determined based on the matching results. Based on platform adaptation parameters, the system controls the reading of session data, input of reply content, and control of message sending in the target interactive environment.

[0503] Among them, platform feature information refers to information used to characterize the characteristics of the target interaction environment in terms of session data structure, interaction method, interface form or message control rules; platform feature template refers to pre-set template information used to describe the corresponding feature patterns of different types of interaction environments; platform adaptation parameters refer to parameters such as data reading rules, content input rules and message control rules determined according to the matching results of platform feature information and platform feature template, used to adapt to the target interaction environment. Specifically, before acquiring and analyzing session data, the platform characteristic information of the target interaction environment is first obtained and matched with a preset platform characteristic template to determine the platform adaptation parameters corresponding to the target interaction environment. This ensures that subsequent processing is based on compatibility with the current platform. Then, based on the platform adaptation parameters, session data reading, reply content input, and message sending control are executed, enabling the session processing to adapt to the interaction methods of different target interaction environments. This improves the adaptability of session data acquisition and message interaction control. Before entering session analysis, platform-side adaptation of the target interaction environment is completed, which helps improve the accuracy and stability of subsequent session processing.

[0504] In one embodiment, obtaining the user profile of the session object includes: In response to a user profile that does not have a session object, retrieve the historical interaction data of the session object; In response to the existence of historical interaction data, an initial user profile of the session object is generated based on the historical interaction data and the preset profile initialization template, and the initial user profile is used as the user profile. In response to the absence of historical interaction data, an initial user profile of the session object is generated based on the interaction data of the current round and the preset profile initialization template, and the initial user profile is used as the user profile.

[0505] The profile initialization template refers to the pre-set template information used to generate the initial user profile. The initial user profile refers to the basic user profile generated when the session object does not yet have a corresponding user profile.

[0506] Specifically, when acquiring user profiles for conversation objects, if no user profile exists, the system first checks for historical interaction data. If historical interaction data exists, an initial user profile is generated based on this data and a pre-defined profile initialization template. This ensures the generated user profile reflects the conversation object's past interaction characteristics more effectively, improving the completeness of the user profile initialization result. If historical interaction data is unavailable, an initial user profile is generated based on the interaction data of the current round and the pre-defined profile initialization template. This allows the system to complete user profile initialization even when historical data is lacking, ensuring the continuity of the user profile generation process. Through this approach, the appropriate initialization path can be selected based on different data foundations, enabling user profiles to be established in various scenarios and improving the flexibility and applicability of user profile initialization.

[0507] In one embodiment, for example, the system employs a combination of a unified adaptation interface specification and a plug-in extension architecture to achieve compatible integration with WhatsApp (an instant messaging platform). The system predefines a unified adaptation interface specification, which includes message reading interfaces, message sending interfaces, interface element location interfaces, event listening interfaces, and exception feedback interfaces. The WhatsApp plugin is developed according to the unified adaptation interface specification and encapsulates the platform's corresponding message reading logic, input invocation logic, sending trigger logic, and exception handling logic. After system startup, the plugin registration information is loaded, and the WhatsApp plugin is initialized, making it callable.

[0508] During the adaptation process, the system first acquires features from the WhatsApp Web page, including the conversation list area, message display area, input editing area, send icon, and page event response characteristics. These page features are then matched against preset platform feature templates. After matching, a platform adaptation configuration corresponding to WhatsApp is generated. This configuration includes DOM (Document Object Model) element positioning parameters, message extraction rules, input call parameters, send control parameters, and exception fallback parameters. The WhatsApp plugin then uses this platform adaptation configuration to read messages, locate interfaces, call input, and control send, thus adapting the message interaction process.

[0509] When a WhatsApp Web page version update is detected, causing existing element paths to become invalid, the system re-extracts page structure features and updates the corresponding parameter mapping relationships to regenerate the platform adaptation configuration. This allows plugins to regain their adaptability without rewriting the overall logic. The system can identify, match, and generate adaptation configurations for the target interaction environment under a unified interface specification, enabling upper-layer session processing logic to call the corresponding plugins to complete message interactions. This improves platform access efficiency and the stability of the adaptation process.

[0510] In the communication scenario of foreign trade in the construction machinery industry, users communicate with customers via WeChat or WhatsApp. The platform adaptation module loads the corresponding plugins according to the current interaction environment and completes the adaptation of conversation reading, reply input, and message sending based on the platform interface features. The data acquisition module acquires chat content, organizes and filters it, and sends the processing results to the intent analysis module. The intent analysis module performs semantic analysis on the conversation text to identify the customer's current purchasing needs and emotional tendencies. The first reply generation module calls the knowledge base in the construction machinery field based on the analysis results to generate candidate replies that match the current communication content. After selecting a candidate reply, the user can edit and send it according to the actual communication needs. The profile management module updates the customer profile by combining keyword information, reply processing data, and subsequent feedback content. The updated customer profile continues to participate in subsequent rounds of intent analysis and reply generation to improve the recognition accuracy and reply matching effect in subsequent communications.

[0511] In one embodiment, within a financial services scenario, users communicate with customers through a target interactive environment. The platform adaptation module acquires current platform characteristics and loads corresponding plugins, completing message reading, content input, and sending control adaptation. The data acquisition module acquires the chat content sent by the customer, cleans and structures the conversation data, and then sends the processing results to the intent analysis module. The intent analysis module analyzes the conversation content, identifying the types of financial products the customer is interested in, their risk preferences, and their current consultation focus. Based on the analysis results, the first response generation module extracts corresponding information from the financial product database and preset response templates, generating candidate responses that match the customer's needs; users can edit these responses before sending. The profile management module dynamically updates the customer profile based on keyword information and feedback from multiple rounds of communication. The updated user profile participates in subsequent rounds of intent recognition and response generation, enabling the system to continuously adapt to changes in customer needs and improve the relevance and continuity of financial service communication.

[0512] In one embodiment, the system receives conversation data from WeChat Work, WhatsApp (an instant messaging platform), and other interactive environments, and first enters the platform access layer. The platform access layer performs platform identification, anomaly monitoring, plugin loading, protocol translation, field mapping, interface positioning, and sending control on the target platform, enabling message reading, input calls, and sending operations from different platforms to be converted into a unified processing form. The data processed by the platform access layer enters the standardization interface layer, which organizes data and control information from different sources into a unified event structure, a unified control command structure, a unified anomaly feedback structure, and a unified message structure. After standardization, the data enters the data acquisition and preprocessing layer, where behavior acquisition, text acquisition, and voice acquisition units acquire corresponding types of data, and combine this with time series processing, encoding standardization, round-context concatenation, and structured message generation to form analyzable structured conversation content. Subsequently, the structured conversation content enters the intelligent analysis layer, where text recognition, intent extraction, topic recognition, emotion recognition, customer stage judgment, and risk signal recognition units complete the analysis and processing. The analysis results are transmitted to the knowledge and generation layer, where units such as knowledge base retrieval, terminology constraints, multi-style generation, candidate response sorting, and response result output generate potential answers. Simultaneously, they are transmitted to the profiling and feedback layer, where processing units such as preference change detection, silence time analysis, profiling tag updating, response strategy correction, and identification strategy correction update customer profiling and feedback optimization. The generated potential answers are finally output to the interactive display layer, where units such as response suggestion display, user editing, user selection and sending, and result recording complete the human-computer interaction, thus forming a complete closed-loop processing chain covering platform access, data analysis, response generation, profiling updates, and feedback optimization.

[0513] In one embodiment, after the system initiates the platform adaptation process, it first receives the platform type selected by the user and loads the corresponding platform recognition mechanism. Subsequently, the system collects environmental information of the target platform, including window features, window orientation features, message area layout features, input area position features, control hierarchy features, message extraction method features, interaction response features, and resolution and scaling ratio features. Based on the collected environmental information, the system forms a target platform feature dataset and matches it with pre-saved platform templates. Upon successful matching, the system generates a platform recognition result and further generates a platform adaptation configuration. The platform adaptation configuration includes field mapping rules, chat area positioning parameters, contact area positioning parameters, input box positioning parameters, send control trigger parameters, exception fallback parameters, and version compatibility parameters. Based on the platform adaptation configuration, the system establishes a message reading module, a send control module, an interface positioning module, and an input call module, and obtains the contact area recognition result, send control area recognition result, chat message area recognition result, and input box area recognition result to form a comprehensive platform adaptation result. During operation, the system continues to monitor changes in the platform interface. When it detects control malfunction, field malfunction, resolution change, version change, or layout change, it triggers an exception rollback and re-identification process. This process re-acquires platform feature data, updates platform adaptation configuration, restores the control positioning and message reading structure, and continues to perform adaptation operations. Through this process, compatible integration across different platforms, versions, interface layouts, and resolutions can be achieved without rewriting the overall plugin logic.

[0514] In one embodiment, after the system activates the data acquisition module, it triggers a data acquisition task according to a preset cycle to capture raw data in the chat area. The raw data includes text data, voice data, behavioral data, timestamp data, and session switching records. After acquisition, the system performs data preprocessing, including noise reduction, invalid segment filtering, encoding standardization, message segmentation, multi-turn context concatenation, and temporal alignment. The preprocessed data enters the text recognition and structured conversion stage. The system performs speech-to-text processing on the voice content, standardization processing on the text content, and further completes message role recognition, session object recognition, and structured message generation. Afterward, the system loads an industry corpus fine-tuning model and performs intent analysis and sentiment recognition on the structured messages. Intent analysis includes identifying inquiry intent, logistics consultation intent, after-sales communication intent, general consultation intent, and purchasing intent; sentiment recognition includes identifying positive, neutral, urgent, hesitant, and negative emotional states. Simultaneously, the system also performs keyword and topic extraction and customer stage judgment, and summarizes the various recognition results to form a comprehensive analysis result. The comprehensive analysis results further generate intent information, sentiment information, topic tags, and stage tags, which are then output to the response generation module and the profile management module, respectively. After each round of analysis, the system records the analysis results; when the initial data collection and analysis is completed, subsequent analysis processes are automatically triggered, thereby achieving continuous analysis and dynamic tracking of conversation content.

[0515] In one embodiment, after receiving the analysis results, the system extracts sentiment information, customer stage tags, intent information, and topic tags. These are then combined with industry prefe...

Claims

1. A content analysis method, characterized in that, The content analysis methods include: Get the input text; The semantic analysis system is used to identify and filter redundant text in the input text to obtain key text, and the key text is used to determine the interaction intent; wherein, the redundant text represents text content that has semantic discontinuities with the target industry scenario; The interaction emotion is obtained by using a sentiment analysis model to identify the emotion of the target text; wherein, the target text includes the input text and / or the key text; Generate intent tags that match the interaction intent, and generate emotion tags that match the interaction emotion.

2. The content analysis method according to claim 1, characterized in that, The semantic analysis system includes a semantic analysis model; the step of using the semantic analysis system to identify and filter redundant text within the input text to obtain key text includes: The input text is input into the semantic analysis model; The semantic analysis model is used to identify industry keywords of the target industry scenario in the input text. Semantic analysis is performed on the input text to determine whether its context has semantic continuity. Text content that has semantic discontinuity with the industry keywords is regarded as redundant text. The redundant text in the input text is deleted to obtain the key text.

3. The content analysis method according to claim 2, characterized in that, Before using a semantic analysis system to identify and filter redundant text within the input text to obtain the key text, the following steps are included: Obtain training samples labeled with industry keywords for at least one interaction stage, and use them to train the semantic analysis model; wherein the industry keywords include at least one of product keywords, industry terminology keywords, and business keywords, and the interaction stages include consultation stages, transaction stages, after-sales stages, and other stages; and / or, Validation samples of at least one type of perturbation sample are obtained to validate and iteratively optimize the trained semantic analysis model. The perturbation sample types include sample confusion category types, industry synonym expression sample types of the target industry scenario, sample classification bias types, and questionable sample types, wherein the questionable sample type indicates that the sample confidence is lower than the confidence threshold.

4. The content analysis method according to claim 1, characterized in that, The semantic analysis system includes an intent output layer and a joint discriminator; the process of determining the interactive intent from the key text includes: The key text is transmitted to the intent output layer and the joint discriminator; By combining the intent output layer with the industry keywords within the key text, the probability distribution of the key text belonging to each preset intent is evaluated and output. The joint discriminator is used to extract the industry keywords within the key text, so as to match the keyword information associated with the industry keywords in the target industry scenario; The preset intent is selected as the interaction intent based on the combined keyword information and the probability distribution.

5. The content analysis method according to claim 4, characterized in that, The preset intent selected as the interaction intent by combining the keyword information and the probability distribution includes: Identify the interaction category represented by the keyword information, and combine the interaction category to evaluate the category confidence of the key text belonging to each of the preset intentions; wherein, the interaction category includes at least one of the following: purchase category, inquiry category, and order constraint category; Based on the probability distribution and the category confidence level, the preset intent is selected as the interaction intent.

6. The content analysis method according to claim 1, characterized in that, After obtaining the input text, the following is included: The semantic analysis system is used to identify whether the input text contains redundant text. In response to the semantic analysis system identifying the redundant text, the system determines to filter the redundant text; in response to the semantic analysis system not identifying the redundant text, the system uses the semantic analysis system to perform intent discrimination on the input text to obtain the interaction intent.

7. The content analysis method according to claim 1, characterized in that, The method of using a sentiment analysis model to identify the sentiment of the target text and obtain interactive sentiment includes: Input the target text into the sentiment analysis model; The emotion analysis model is used to identify the emotion features of the target text in order to obtain the current emotion represented by the target text. The interactive emotion is obtained by smoothing and correcting the current emotion.

8. The content analysis method according to claim 7, characterized in that, The process of smoothing and correcting the current emotion to obtain the interactive emotion includes: Analyze the sentiment type represented by the textual factors of the historical input text and the input text to obtain a text correction factor; wherein, the textual factors include at least one of the time interval between the input text and the historical input text, the trend of historical sentiment notes, semantic transition structures, and the trend of text content changes; use the text correction factor to correct the current sentiment; and / or, In response to the input text being converted from a speech message, a speech correction factor is obtained by analyzing the emotion type represented by the sound features of the speech message; wherein, the sound features include at least one of speech rate features, pause features, and pitch features; the speech correction factor is used to correct the current emotion.

9. The content analysis method according to claim 7, characterized in that, The process of inputting the target text into the sentiment analysis model also includes: Obtain text content corpus carrying pre-defined emotion labels as emotion samples; The emotion sample is converted into a word vector, and the local emotion features of the word vector are extracted. The local emotion features are pooled to obtain the discrimination features when the emotion preset labels are used for emotion discrimination. The probability distribution of the discrimination features belonging to each preset emotion is evaluated by a fully connected layer, so as to adapt the preset emotion to which the emotion sample belongs as the training emotion. The emotion analysis model is updated using the training loss corresponding to the training emotion and the preset emotion label.

10. The content analysis method according to claim 1, characterized in that, The acquisition of input text includes: Obtain the image to be recognized containing the input text; Detect text regions within the image to be identified that match region features; wherein, the region features include at least one of text box features, font features, language arrangement features, and background features; The initial text is obtained by using a preset corpus of the target industry scenario to assist in the text generation area; wherein, the preset corpus includes at least one of industry terminology, product information, and multilingual mixed text; The initial text is evaluated using text metrics, and the initial text is then filtered using the text metrics to obtain the input text; wherein the text metrics include at least one of the following: matching degree with the target industry scenario, semantic continuity of the initial text, and character confidence.

11. The content analysis method according to claim 10, characterized in that, The process of obtaining the image to be recognized containing the input text includes: Obtain the original image, and perform grayscale conversion on the original image to obtain a grayscale image; The grayscale image is binarized based on the local window brightness distribution to obtain a normalized image; Identify the text feature indicators of the text region within the normalized image, delete the text region corresponding to the text feature indicator that matches the preset noise feature, and obtain a filtered image; wherein, the text feature indicator includes at least one of character stroke width, connected region area, size ratio, position distribution, and color layering information. The filtered image is subjected to text enhancement processing to obtain the image to be recognized; wherein, the text enhancement processing includes at least one of image opening / closing operation and edge preservation smoothing processing.

12. A message interaction method, characterized in that, The message interaction method includes: Retrieves the input text formed from the interaction data of the current round with the conversation object; The input text is analyzed using the content analysis method as described in any one of claims 1 to 11 to obtain its intent tag and sentiment tag; The intent tags and emotion tags are adapted to generate alternative responses to assist in responding to the interaction data.

13. The message interaction method according to claim 12, characterized in that, The process of adapting the intent tag and the emotion tag to generate candidate responses to assist in responding to the interaction data includes: By integrating the intent label, the sentiment label, the industry keywords in the input text, the confidence score of the input text, and the time information, fusion analysis information is obtained; The user profile of the session object is updated using the fusion analysis information; wherein, when the current label of the intent label and / or the emotion label of the session object contradicts the historical label, the weight of the historical label is reduced when updating the user profile; Generate the candidate responses that are adapted to the user profile.

14. A computer device, characterized in that, The computer device includes: Memory, used to store computer programs; A processor, configured to implement the steps of the content analysis method as described in any one of claims 1 to 11 when executing the computer program; or, to implement the steps of the message interaction method as described in claim 12 or 13.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the content analysis method as described in any one of claims 1 to 11; or, implements the steps of the message interaction method as described in claim 12 or 13.

16. A computer program product, comprising a computer program, characterized in that, When the computer program product is executed by a processor, it implements the steps of the content analysis method according to any one of claims 1 to 11; or, implements the steps of the message interaction method according to claim 12 or 13.