Interaction methods, devices, and media for chat interfaces based on large-scale corpora
By integrating multiple chat tools and building a big data corpus, combined with pre-trained language models and dynamic business data, the problems of complex operation of multiple tools and static script templates in customer service systems have been solved, achieving efficient and accurate chat interface interaction, and improving the operational efficiency and user experience of customer service systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2026-04-03
AI Technical Summary
In existing technologies, customer service personnel need to use multiple chat tools simultaneously, which leads to complicated operations, message omissions, or response delays. Traditional script templates cannot meet the needs of personalization and timeliness, have limited semantic matching capabilities, and cannot effectively combine dynamic business data, resulting in insufficient interaction efficiency and accuracy.
By integrating multiple chat tools, constructing a big data corpus, using pre-trained language models for semantic analysis, combining dynamic business data for multi-objective optimization, recommending optimal dialogue, and supporting mixed text and image layout and user-edited secondary text.
It enables seamless message management across multiple chat tools, improving operational efficiency and accuracy, ensuring that recommendation results align with user needs, and optimizing user interaction experience and business processing efficiency.
Smart Images

Figure CN119886353B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence and customer service system technology, specifically to interactive methods, devices, and media for chat interfaces based on big data corpora. Background Technology
[0002] With the rapid development of e-commerce, social networking, and enterprise collaboration scenarios, chat tools have gradually become the core means of customer service communication. However, in the current technology, customer service personnel often need to use multiple chat tools (such as WeChat, DingTalk, WeChat Work, QQ, etc.) to communicate with customers simultaneously. Switching between different platforms and the operations are complicated, which not only increases the workload of customer service personnel, but also easily leads to message omissions or response delays, seriously affecting work efficiency and customer experience.
[0003] Furthermore, to improve response speed and quality, customer service representatives often use pre-set script templates. However, traditional template management systems mostly store and retrieve script content statically, making it difficult to dynamically generate recommended results based on real-time business needs. In complex scenarios (such as after-sales service, order inquiries, or logistics issues), these fixed scripts cannot meet customers' personalized and time-sensitive needs. Simultaneously, existing technologies have limited semantic matching capabilities, relying solely on simple keyword searches or coarse semantic analysis, failing to fully understand the user's true intent, resulting in script recommendations that do not match the actual customer needs.
[0004] Furthermore, customer service systems often lack effective integration with dynamic business data (such as order status and logistics information) when recommending responses, failing to generate optimal responses based on the customer's current specific problem. In addition, the recommendations typically ignore factors such as response time and historical satisfaction levels, resulting in unreasonable prioritization of recommended content and impacting the overall efficiency and accuracy of the interaction.
[0005] Therefore, existing technologies have significant shortcomings in areas such as integration of multiple chat tools, intelligent script recommendation, dynamic business data integration, and multi-objective optimization, making it difficult to meet the demands for high efficiency and accuracy in modern customer service scenarios. Therefore, there is an urgent need for a system and method that can integrate multiple chat tools, combine intelligent corpus matching technology with dynamic business data analysis, and provide real-time, accurate, and optimized script recommendations to solve the aforementioned technical problems. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention provides an interactive method, device, and medium for chat interfaces based on a big data corpus, which solves the limitations of integrating and managing multiple chat tools, recommending static dialogue templates, and the inability to accurately match dialogue with dynamic business data.
[0007] To achieve the above objectives, the present invention provides the following technical solution: an interaction method for a chat interface based on a large data corpus, comprising the following steps:
[0008] It integrates multiple chat tools and enables the attachment, message reception, and sending of multiple chat tools through a unified management interface;
[0009] Construct a large-scale corpus, preprocess the data in the corpus, and classify them according to semantic features;
[0010] Obtain user input messages, perform semantic analysis on user input messages using a pre-trained language model, and generate semantic feature vectors of user input;
[0011] The cost of semantic matching is calculated based on the semantic feature vector of user input and the semantic vector of the discourse template stored in the corpus.
[0012] Based on semantic matching, multi-objective optimization is performed to recommend the optimal wording;
[0013] The system presents users with recommended best-effort phrases and enables them to quickly send messages through the integrated chat tool interface.
[0014] Preferably, the step of integrating multiple chat tools includes:
[0015] For chat tools that support open interfaces, message reception, sending, and window snapping are achieved by calling their official open APIs; for chat tools that do not support open interfaces, message reading and sending are accomplished by simulating user operations, including simulating key presses, window event capture, and screen coordinate positioning.
[0016] Each chat tool window is dynamically snapped together and arranged to form a unified message management interface.
[0017] Preferably, the step of constructing the big data corpus includes:
[0018] Collect historical chat logs from multiple chat tools, industry FAQ documents, and user-uploaded templates;
[0019] The corpus is segmented into words to remove invalid data, and the content is cleaned and standardized.
[0020] The corpus is semantically vectorized using a pre-trained language model to generate high-dimensional semantic feature vectors, and the discourse templates in the corpus are clustered and classified according to the semantic features.
[0021] Preferably, the step of generating the semantic feature vector of user input includes:
[0022] The pre-trained language model is used to transform user input messages into semantic vectors, and the overall semantics of the message are represented in high-dimensional vectorization.
[0023] Named entity recognition technology is used to extract specific keywords or phrases from user input, including product names, time information, price information, and other entities;
[0024] Based on the contextual messages of user input, the semantic representation of the current input is dynamically adjusted to include contextual information.
[0025] Preferably, the step of calculating the cost value of comprehensive matching based on the semantic feature vector of user input and the semantic vector of the discourse template stored in the corpus, combined with dynamic business data, includes:
[0026] The similarity between the semantic vector of the user input message and the semantic vector of each utterance template in the corpus is calculated.
[0027] The semantic matching cost between user input and each utterance template is determined by measuring the similarity between semantic vectors.
[0028] The logical consistency of the dialogue template based on dynamic business data is used to form a business consistency score.
[0029] The comprehensive matching cost is calculated based on semantic matching cost and business consistency score, where semantic matching cost is calculated based on the cosine similarity between vectors or the distance between vectors.
[0030] Preferably, the step of performing multi-objective optimization based on semantic matching includes:
[0031] Based on the semantic matching cost value input by the user, and combined with dynamic business data, a business consistency score is generated for the script template.
[0032] Further considering the response time cost of the script templates, optimization was carried out according to the priority of response time.
[0033] By combining historical usage data of the script templates, the weighting of historical satisfaction scores is adjusted based on user feedback scores.
[0034] Based on a comprehensive evaluation of semantic matching cost, business consistency score, response time cost, and historical satisfaction score, the optimal script template is recommended.
[0035] Preferably, the step of presenting the recommended optimal message to the user and completing the rapid message sending through the integrated chat tool interface includes:
[0036] The recommended sales pitches are sorted according to their overall cost priority and displayed in a list format in the user interface.
[0037] It supports users to edit recommended messages, including modifying text content, adjusting image and text format, and adding hyperlinks; it provides a one-click sending function, which can send the selected message directly to the corresponding chat tool window by calling the adaptation interface of multiple chat tools or simulating operation.
[0038] For text messages containing images or other rich media content, it supports displaying and sending text and images in a mixed format.
[0039] Preferably, the recommended optimal script supports multiple presentation methods, including:
[0040] Text format;
[0041] Text and image mixed layout;
[0042] Hyperlink embedding format.
[0043] The present invention also provides an interactive device for a chat interface based on a large data corpus, comprising:
[0044] The multi-tool integration module is used to combine multiple chat tool windows to achieve unified message reception and sending;
[0045] The corpus management module is used to collect and process corpora from multiple sources, semantically vectorize them, and classify and store them.
[0046] The semantic analysis module is used to perform semantic vectorization processing on user input messages;
[0047] The dialogue recommendation module is used to recommend the optimal dialogue based on semantic matching and multi-objective optimization between user input messages and dialogue templates in the corpus;
[0048] The output module is used to display recommended phrases and send messages through the integrated chat tools.
[0049] The present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements the method described above.
[0050] The present invention also provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described above.
[0051] This invention provides an interactive method, apparatus, and medium for a chat interface based on a large data corpus. It has the following beneficial effects:
[0052] 1. This invention enables the integration and message management of multiple chat tools such as WeChat, DingTalk, WeChat Work, and QQ through a unified management interface. It not only supports centralized message receiving and sending but also solves the problem of frequent switching between multiple platforms through multi-instance functionality and tool adaptation modules. The integrated interface simplifies the customer service operation process and greatly improves work efficiency.
[0053] 2. This invention combines corpus-based semantic matching with dynamic business data to achieve dynamic matching and recommendation of speech templates. By introducing dynamic business data (such as order status and logistics information), the accuracy of recommendations is improved, ensuring that the recommendation results are highly consistent with the user's actual needs, thus overcoming the problem that traditional static templates cannot meet real-time business requirements.
[0054] 3. This invention employs a multi-objective optimization model, comprehensively considering factors such as semantic matching, business consistency, response time, and historical satisfaction, to construct a flexible and adjustable comprehensive cost model. This model can dynamically adjust weight parameters according to scenario requirements, thereby achieving intelligent recommendation of optimal dialogue and meeting the complex needs of different business scenarios.
[0055] 4. This invention supports mixed text and image display, dynamic data binding, and user-edited secondary editing functions when recommending scripts, improving the flexibility and operability of the recommendation results. Simultaneously, through designs such as highlighting key fields and priority prompts, it helps users quickly identify and select appropriate scripts, optimizing the user interaction experience.
[0056] 5. This invention achieves seamless message sending across different chat tools by calling open interfaces or simulating user operations. For tools that do not support open interfaces, automated operation technology is used to quickly send messages, ensuring multi-platform compatibility. Simultaneously, the built-in message verification and retry mechanism improves the reliability of message sending.
[0057] 6. This invention significantly reduces repetitive work for customer service staff and optimizes operational processes by efficiently integrating multiple tools, intelligent script recommendations, and rapid message sending. Simultaneously, intelligent recommendations and high-precision responses enhance user experience, increasing user satisfaction and business processing efficiency. Attached Figure Description
[0058] Figure 1 This is one of the schematic diagrams of the method flow of the present invention;
[0059] Figure 2 This is a second schematic diagram of the method flow of the present invention;
[0060] Figure 3 This is a schematic diagram of the computer device structure of the present invention.
[0061] Among them, 100 is the multi-tool integration module; 200 is the corpus management module; 300 is the semantic analysis module; 400 is the speech recommendation module; 500 is the output module; 40 is the computer equipment; 41 is the processor; 42 is the memory; and 43 is the storage medium. Detailed Implementation
[0062] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0063] Please see the appendix Figure 1 This invention provides an interactive method for chat interfaces based on a large-scale corpus. It aims to improve the efficiency of e-commerce customer service and other application scenarios by integrating multiple chat tools and providing intelligent dialogue recommendations through corpus construction and semantic analysis technologies. The following will detail the implementation principles and specific technical content of the method proposed in this invention, step by step.
[0064] like Figure 1 As shown, the interaction method of this chat interface based on a big data corpus may include the following steps;
[0065] S1. Integrates multiple chat tools, enabling the attachment, message reception, and sending of multiple chat tools through a unified management interface;
[0066] S2. Construct a large-scale corpus, preprocess the data in the corpus, and classify them according to semantic features;
[0067] S3. Obtain the user's input message, use a pre-trained language model to perform semantic analysis on the user's input message, and generate the semantic feature vector of the user input;
[0068] S4. Based on the semantic feature vector of user input and the semantic vector of the discourse template stored in the corpus, combined with dynamic business data, calculate the cost value of comprehensive matching.
[0069] S5. Based on semantic matching, perform multi-objective optimization to recommend the optimal wording;
[0070] S6. Present the recommended best scripts to the user and enable quick message sending through the integrated chat tool interface.
[0071] For step S1, this embodiment proposes a method for integrating multiple mainstream chat tools (such as WeChat, WeChat Work, DingTalk, QQ, Lark, etc.) based on the actual usage needs of these tools. This method uses a unified management interface to enable window snapping, message reception, and sending for multiple chat tools. The technical implementation of this invention in step S1 is described in detail below, focusing on tool snapping, message reception and sending, interface adaptation, and multi-instance support.
[0072] In this embodiment, the first step in integrating multiple chat tools is to enable the snapping operation of each chat tool window so that these tools can be centrally operated through a unified management interface.
[0073] Specifically, as an implementation method, for chat tools that support open APIs or SDKs (such as DingTalk, Lark, and WeChat Work), this invention prioritizes calling the official API interfaces to manage chat windows. The window handle information of the tool is obtained through the API interface, and system calls (such as WinAPI on the Windows platform) are used to achieve window snapping and uniform arrangement.
[0074] In another possible implementation, for chat tools that do not provide official APIs (such as WeChat and QQ), this embodiment achieves the window snapping function by capturing screen events and simulating operations. For example:
[0075] Use system window monitoring technologies (such as macOS's Accessibility API or Windows' window event capture tools) to detect the active window information of the chat tool in real time;
[0076] By detecting features such as window title and window handle, the window of the target chat tool can be located, and window management tools (such as AutoIt or PyWin32) can be used to snap, arrange and adjust the window.
[0077] It should be noted that in this embodiment, a unique window identifier can be assigned to different chat tool windows for subsequent message management and tool invocation. This design ensures that operation will not be confused due to window conflicts when multiple tools are running simultaneously.
[0078] In this embodiment, a unified management interface is used to receive and send messages from multiple chat tools, ensuring unified message processing and rapid response.
[0079] Specifically, for chat tools that support open interfaces, this invention directly calls the interfaces to complete message sending and receiving. For example:
[0080] Call the message listening interface provided by DingTalk or WeChat Work to capture message content from the chat window in real time;
[0081] Call the message sending interface to send preset or manually entered content to the target chat object.
[0082] As an alternative, for chat tools that do not support open interfaces, this embodiment uses a method of simulating user operations to complete message reception and sending. Specific technical implementations include:
[0083] Use screen capture technology to read the text content in the chat window in real time;
[0084] The text is extracted from the captured message area using OCR (Optical Character Recognition) technology, and message data is generated based on the extraction results.
[0085] By simulating key input (such as using tools like PyAutoGUI or Sikuli), the generated message or preset script can be sent to the corresponding chat window.
[0086] It should be noted that in some embodiments, message receiving and sending are synchronized with the window snapping logic. For example, after the window snapping is completed, the system will immediately initialize the message listening and sending module to ensure that users can receive messages and reply in real time.
[0087] In this embodiment, the unified management interface interacts with various chat tools through an adaptation module, ensuring that the operation interfaces of different chat tools can be uniformly encapsulated, which facilitates subsequent function expansion and maintenance.
[0088] In one possible implementation, the interface adaptation module is divided into two categories based on the characteristics of the tool:
[0089] For open interface tools (such as Lark and DingTalk), directly adapt to their API interfaces and call functions such as message processing and window management through the encapsulated modules;
[0090] For tools that do not have open interfaces (such as WeChat and QQ), the adaptation module uses script tools (such as AutoHotKey and PyWin32) to simulate user operations and achieve message sending and window management.
[0091] For example, for WeChat tools, the adaptation module will simulate the following operation process:
[0092] Detect the focus position of the chat window and switch it to the target chat window;
[0093] Using key simulation technology, the message content is entered character by character into the chat input box;
[0094] Simulate sending a message using a shortcut key (such as the Enter key).
[0095] Understandably, the design of the adaptation module can be further expanded to support the compatibility needs of future chat tools or different platforms (such as Windows and macOS).
[0096] In this embodiment, to meet the need to run multiple accounts simultaneously, a multi-instance support function is provided. By creating multiple independent chat tool instances, users can manage multiple accounts in a unified interface.
[0097] Specifically, as an option, this embodiment implements multi-instance functionality using sandbox technology (such as Sandboxie or Docker). Each chat tool instance runs in an independent sandbox environment, ensuring complete isolation between data and runtime environments across different instances. The logic for creating the sandbox environment includes:
[0098] Allocate a separate temporary runtime directory for each instance to store account-related caches and configurations;
[0099] Launch multiple instances of the chat tool, each instance bound to a unique window identifier.
[0100] In another implementation, this embodiment uses virtual machine technology (such as VMware or VirtualBox) to create an independent virtual environment for each chat tool account, ensuring that different accounts do not interfere with each other.
[0101] It should be noted that in implementing the multi-instance function, this embodiment can also dynamically adjust the snapping and arrangement of windows. For example:
[0102] Based on user operating habits, multiple instance windows of the same tool are arranged in a unified group;
[0103] Different tools are displayed in separate windows to ensure that users can quickly switch between target windows.
[0104] As a running example, the running process of this embodiment can be described as follows:
[0105] First, the user launches the unified management interface of this invention, which loads the list of chat tools configured by the user through the adaptation module.
[0106] The system automatically detects the running status of each chat tool and selects either API call or simulated operation method to complete window snapping based on the tool type.
[0107] After the adsorption is complete, the system initializes the message listening module to receive message content from various chat tools in real time.
[0108] Users can directly select the target chat tool in the unified interface, enter or select preset content, and then complete the message sending operation through the adaptation module.
[0109] If a user needs to log in to multiple accounts at the same time, the system will start the multi-instance module, create an independent running instance for each account, and attach the instance window to the unified interface.
[0110] This embodiment integrates the snapping, message receiving, and sending of multiple chat tools through a unified management interface, solving the problem of low efficiency caused by tool switching in the prior art.
[0111] For step S2, in this embodiment, to meet the need for building a large-scale corpus, a series of data collection, cleaning, vectorization processing, and classification steps are used to form a structured corpus that meets the requirements of intelligent speech recommendation. This step mainly includes the source of the corpus, the preprocessing method, and the specific implementation of semantic classification, which will be described in detail below.
[0112] In this embodiment, the data sources of the big data corpus are diversified to ensure that the data coverage is extensive and meets the needs of different chat scenarios.
[0113] As an option, the main sources of corpora include the following categories:
[0114] Extracting corpus from historical chat records of multiple chat tools (such as WeChat, DingTalk, QQ, etc.);
[0115] Collect industry standard FAQ documents, such as common questions and standard answers in e-commerce platforms;
[0116] User-uploaded templates and scripts can be adapted to specific scenarios or industry needs.
[0117] Specifically, historical chat logs are collected by calling the message export function of various chat tools or through screen capture technology. In one possible implementation, the system obtains standardized question-and-answer datasets from FAQ documents or e-commerce platforms through distributed crawling tools or data interfaces.
[0118] It should be noted that in the management of user-defined speech templates, this embodiment supports users to upload templates through a unified interface. These templates will be automatically added to the corpus and integrated with the existing corpus.
[0119] In this embodiment, to ensure the high quality and consistency of the corpus data, the collected raw corpus is preprocessed, including data cleaning, word segmentation, and standardization.
[0120] During the data cleaning process, as an option, the system performs the following operations on the raw corpus:
[0121] Remove blank messages, invalid characters (such as redundant punctuation marks), duplicate statements, and other meaningless data;
[0122] For multilingual scenarios, standardize the language format of the corpus (such as simplified / traditional Chinese conversion and English case conversion);
[0123] Filter special symbols (such as "#" or "@") or noisy data (such as incorrect codes).
[0124] Specifically, word segmentation is performed on the text using Chinese word segmentation tools (such as Jieba or Spacy). In one possible implementation, this embodiment introduces a domain-specific dictionary for e-commerce customer service, including high-frequency words such as "order number," "express logistics," and "invoice," to improve segmentation accuracy.
[0125] It should be noted that during the data standardization process, this embodiment performed a unified format conversion on the text content. For example, time-related statements (such as "tomorrow" and "the day after tomorrow") were standardized to specific dates; numerical expressions (such as "ten yuan" and "¥10") were uniformly converted to numerical format.
[0126] In this embodiment, the preprocessed corpus is transformed into a high-dimensional semantic feature representation using semantic vectorization technology, so that it can be used for semantic matching and recommendation in subsequent steps.
[0127] Specifically, semantic vectorization employs a pre-trained language model (such as BERT or GPT) to embed high-dimensional vectors into each corpus. For example, corpus t... i The embedding process can be represented as:
[0128]
[0129] in, For corpus t i The high-dimensional semantic vector, where d is the dimension of the embedding space.
[0130] As an alternative, to improve the efficiency and accuracy of semantic vectorization, this embodiment incorporates the following techniques during the corpus embedding process:
[0131] Use word-level embedding to capture the basic semantic relationships between words;
[0132] By employing contextual modeling (such as the Transformer mechanism in BERT), the contextual information of words in the corpus is considered, thereby generating more accurate sentence-level semantic representations.
[0133] It should be noted that when processing long text corpora, this embodiment splits the text into multiple sentences through sentence segmentation and performs embedding processing on each sentence separately. The final semantic vectors are fused using a weighted average of sentence vectors.
[0134] In this embodiment, to facilitate subsequent semantic matching and recommendation, an unsupervised clustering algorithm is used to perform semantic classification on the corpus.
[0135] In one possible implementation, the classification process includes the following steps:
[0136] Using the semantic vectors of the corpus, cosine similarity is used to measure the semantic similarity between different corpora;
[0137] Based on the semantic similarity matrix, unsupervised clustering algorithms (such as K-means or DBSCAN) are applied to automatically classify the corpus.
[0138] Specifically, for the K-means algorithm, the goal of clustering is to group n corpora {V} in the corpus. t1 V t2 ,…,V tn The corpora are assigned to k categories to maximize the semantic similarity within the same category and minimize the semantic similarity between different categories. The objective function is:
[0139]
[0140] Where, μ i C is the center of the i-th cluster. i Let be the corpus set of the i-th cluster.
[0141] As an alternative, to improve the interpretability of the classification results, this embodiment generates keyword tags for each category. These tags are based on the category centroid μ. i Extract the most important feature words, such as "after-sales service" and "logistics inquiry".
[0142] It should be noted that after classification is completed, the system will dynamically maintain the classification results and allow the category boundaries to be automatically adjusted when new corpus is added.
[0143] As a running example, the running process of this embodiment includes the following:
[0144] The system extracted 1 million data points from historical chat logs on WeChat and DingTalk;
[0145] After cleaning these corpora and removing invalid data, 850,000 entries were retained.
[0146] The BERT model is used to perform semantic vectorization on each corpus, mapping it to a 768-dimensional embedding space.
[0147] The K-means algorithm was applied to divide the corpus into 10 categories, and keyword labels were generated.
[0148] The categorized corpus is stored in a distributed database for use by the subsequent semantic matching module.
[0149] This embodiment constructs a large-scale corpus that meets the requirements of this invention through preprocessing, vectorization, and semantic classification, ensuring that the quality and organization of the corpus data can support semantic matching and recommendation operations in subsequent steps.
[0150] For step S3, in this embodiment, the user-input message is transformed into a high-dimensional semantic vector by combining a pre-trained language model with semantic feature extraction technology, providing standardized input data for subsequent semantic matching steps. The following describes the technical aspects in detail, including message reception, semantic vector generation, named entity extraction, and context fusion.
[0151] In this embodiment, the user-inputted messages are received in real time through the unified management interface described in step S1. It should be noted that the user-inputted messages can originate from multiple chat tools, including WeChat, DingTalk, and WeChat Work.
[0152] Specifically, when a user enters and sends a message in the chat tool window, the system captures the input content through the message listening module and passes it as a string to the semantic analysis module.
[0153] As an option, if a user's message contains multiple paragraphs or sentences, the system will segment the message according to sentence segmentation rules in natural language processing (such as punctuation splitting rules) and perform subsequent processing on each segment separately.
[0154] In this embodiment, a pre-trained language model (such as BERT or GPT) is used to perform semantic vectorization on the user input message, generating a high-dimensional semantic feature vector. It should be noted that the main purpose of semantic vectorization is to map the input message to a high-dimensional embedding space for subsequent semantic matching.
[0155] Specifically, in one possible implementation, the semantic vector generation process for the user input message uuu includes the following steps:
[0156] First, the system decomposes message u into a word sequence {w1, w2, ..., w...} n}, where n is the number of words in the message;
[0157] Then, each word w is processed using a pre-trained language model.i Perform word embedding to generate word vectors v i ;
[0158] Finally, by leveraging the contextual modeling capabilities of language models (such as the Transformer structure in BERT) and combining the contextual information of all words in the message, a semantic vector V for the complete message is generated. u :
[0159] V u =f context ({v1,v2,…,v n})
[0160] Among them, f context The context encoding function represents the language model.
[0161] In one possible implementation, a 768-dimensional embedding space is used to represent semantic vectors, i.e.
[0162] It should be noted that the semantic vector generation process can select different language models depending on the specific application scenario. For example, in general scenarios, the BERT model can be selected; in e-commerce scenarios, a pre-trained model fine-tuned with e-commerce data (such as ERNIE or Roberta) can be selected.
[0163] In this embodiment, to further improve the accuracy of semantic representation, named entity recognition (NER) technology is combined to extract key entity information from the user input message and embed it into the semantic vector.
[0164] Specifically, the main goal of named entity extraction is to identify specific entities contained in a message, such as product names, time information, and price information. For example, given the input message "I want to check if the item I purchased yesterday has been shipped," the system can extract the following entities:
[0165] Time entity: "yesterday";
[0166] Action entity: "Query";
[0167] Target entity: "Goods".
[0168] As one implementation method, the implementation process of NER includes:
[0169] Perform word segmentation and part-of-speech tagging on user-input messages;
[0170] Use sequence labeling-based deep learning models (such as BiLSTM-CRF) to identify named entities and output entity categories and ranges;
[0171] The extracted entity information is encoded into a feature vector and then fused with the overall semantic vector of the message.
[0172] In one exemplary operation, for the message "Has order number 123456 been shipped?", the system extracts "order number 123456" as a key entity through NER and appends it to the semantic vector V. u In this process, an enhanced semantic vector is formed.
[0173] It should be noted that the goal of named entity extraction is to retain key information in the input message, thereby improving the accuracy of semantic matching, especially in scenarios involving products and orders, where its effect is particularly significant.
[0174] In this embodiment, when processing multi-turn dialogues or continuous input, the semantics of user input messages may depend on contextual information. Therefore, the system dynamically adjusts the semantic representation of the current input using context fusion technology.
[0175] In one possible implementation, the context fusion process includes the following:
[0176] First, the system maintains the historical input sequence {u} within a certain time window. t-1 ,u t-2 ,…,u t-n}, where t is the current time step; then, the semantic vector of the historical input... Perform weighted averaging or attention mechanism calculations to generate the context representation V. context ;
[0177] Finally, the context representation is compared with the semantic vector V of the current input message. u The final semantic representation V is generated through fusion. u ′ :
[0178] V u ′ =Concat(V u V context )
[0179] or
[0180] V u ′ =αV u +(1-α)V context
[0181] Here, α is the fusion coefficient, which can be obtained through data learning.
[0182] As an alternative, for scenarios with limited contextual information (such as single-turn question answering), the system can omit the context fusion step and directly use the semantic vector of the current input for subsequent processing.
[0183] In one operational instance, assuming the user inputs the message "When will the goods be shipped?", the system's processing procedure is as follows:
[0184] First, the system uses word segmentation to break the message down into the word sequence "when" and "ship".
[0185] Encode word sequences using a pre-trained language model to generate semantic vectors V. u ;
[0186] Combine named entity recognition technology to extract "shipment" as an action entity;
[0187] If the user previously entered "I placed the order yesterday", the system will fuse its contextual information with the current input to generate an enhanced semantic vector V. u ′ .
[0188] Ultimately, the system will V u ′ This output is used for subsequent steps.
[0189] This embodiment utilizes semantic vector generation, named entity extraction, and context fusion techniques to fully extract the semantic features of user input messages, ensuring that the generated semantic vectors have high accuracy and context relevance.
[0190] For step S4, in this embodiment, semantic matching technology combined with dynamic business data querying is used to calculate the matching cost between the semantic feature vector of the user input message and the semantic vector of the utterance template in the corpus. This ensures that the generated recommendation results not only reflect semantic relevance but also maintain consistency with business logic. The specific implementation is described in detail below from three aspects: the definition of matching cost, the combination of dynamic business data, and comprehensive cost optimization.
[0191] In this embodiment, the semantic feature vector of the user input message is represented by V. u This indicates that the semantic feature vector of each utterance template in the corpus is represented by V. ti This indicates that matching cost is a measure of V. u and V ti It is an indicator of semantic similarity between the two. The lower the matching cost, the higher the semantic relevance between the input message and the template.
[0192] Alternatively, matching cost can be defined using cosine similarity. Specifically, cosine similarity measures the similarity of two vectors along their directions; a higher value indicates that the two vectors are closer, and therefore it can be converted into matching cost.
[0193]
[0194] in, <V u V ti > indicates V u and V ti The dot product, ∥V u ∥ and ∥V ti ∥ denote the Euclidean norms of the two vectors respectively.
[0195] For ease of representation, matching cost is defined as:
[0196] c(V u V ti ) = 1 - CosineSim(V u V ti )
[0197] In another possible implementation, the matching cost can also be calculated using Euclidean distance, defined as:
[0198]
[0199] It should be noted that cosine similarity and Euclidean distance each have their advantages in different scenarios, and the appropriate method can be chosen based on actual needs.
[0200] In this embodiment, to improve the relevance of matching results to actual business needs, dynamic business data query and judgment logic is incorporated. The introduction of dynamic business data primarily addresses the issue that fixed templates cannot reflect real-time business status.
[0201] Specifically, when user input contains business-related content (such as orders, logistics, or after-sales service), the system extracts key information using Named Entity Recognition (NER) technology and retrieves the dynamic business status through a query interface or database. For example:
[0202] For the input "When will the order be shipped", the system can extract "order number" or "user account" as the key fields for querying;
[0203] Query the business system to obtain the current status information of the order (such as "shipped", "pending shipment" or "processing");
[0204] The returned dynamic business data will be combined with the semantic matching process to dynamically adjust the recommended matching results.
[0205] In one possible implementation, the logic for dynamic business data query is as follows:
[0206] 1. Construct a query request using entity information (such as order number, tracking number, etc.) input by the user;
[0207] 2. Query the backend database or call external interfaces to obtain dynamic status data;
[0208] 3. The returned status data is logically compared with the corpus template to generate a business consistency score B(t). i ).
[0209] It should be noted that the business consistency score is calculated based on the degree of matching between the template content and the dynamic business status. For example:
[0210] If the template contains "order shipped" and the dynamic status is "shipped", it will be given a high score;
[0211] If the template content does not match the status (e.g., the template says "order shipped" but the actual status is "pending shipment"), the score will be lowered or the template may be excluded.
[0212] In this embodiment, a business consistency score is introduced on top of the semantic matching cost to construct a new comprehensive matching cost model. The comprehensive cost is defined as follows:
[0213]
[0214] in:
[0215] Semantic matching cost measures the semantic relevance between the input and the template.
[0216] B(t i Business consistency score: measures the logical consistency between the template and the dynamic business status;
[0217] α, β: Weight parameters used to balance the priority of semantic matching and business logic.
[0218] As an option, business consistency score B(t) i The calculation can be based on predefined rules or machine learning models. For example:
[0219] If the template content directly matches the dynamic data (e.g., the "Order Shipped" template matches the "Shipped" status), then B(t) i Take the higher value;
[0220] If there is a logical conflict between the template content and the dynamic data, then B(t) i Take a lower value or even 0.
[0221] In one possible implementation, the system dynamically adjusts the weight parameters α and β based on the business scenario. For example, in an order query scenario, the weight of the business consistency score is increased to prioritize recommending templates that match the order status.
[0222] In one operational instance, assuming the user inputs the message: "When will the order be shipped?", the processing procedure is as follows:
[0223] 1. Semantic analysis:
[0224] The system converts the input message "When will the order be shipped?" into a semantic vector V. u .
[0225] 2. Dynamic business data query:
[0226] Extract the "order number" from the message as the key entity, and retrieve the order status through a database query.
[0227] The query result returned: "Order status: Shipped".
[0228] 3. Semantic matching:
[0229] According to semantic vector V u With corpus templates Calculate semantic matching cost
[0230] 4. Business Consistency Score:
[0231] Based on the dynamic status of the query, the template "Your order has been shipped" is assigned a high business consistency score B(t). i ).
[0232] 5. Overall cost optimization:
[0233] The overall cost C is calculated by combining semantic matching cost and business consistency score. total .
[0234] The recommended template after sorting is: "Your order has been shipped, tracking number is 123456, please check back later."
[0235] This embodiment combines semantic matching with dynamic business data querying to achieve both accuracy in template recommendation results and consistency in business logic. Especially in dynamically driven scenarios (such as order fulfillment and logistics tracking), it can generate responses that better meet user needs based on real-time data, significantly improving the system's intelligence and user satisfaction.
[0236] For step S5, in this embodiment, based on the semantic matching cost value between user input and the speech templates in the corpus, a multi-objective optimization strategy is introduced. By combining factors such as dynamic business data ratings, historical satisfaction rates, and response times, the optimal speech template is comprehensively calculated and recommended. The specific implementation method will be described in detail below.
[0237] In this embodiment, to achieve multi-objective optimization, semantic matching cost, logical consistency score of dynamic business data, and other factors (such as response time and historical satisfaction) are comprehensively considered, and a comprehensive cost function C is defined. total Specifically, the comprehensive cost function takes the following form:
[0238]
[0239] in:
[0240] Semantic matching cost measures the relevance between user input and template semantics;
[0241] B(t i Business consistency score: measures the consistency between template scripts and dynamic business data;
[0242] T(t i ): Response time cost, used to indicate the estimated processing time of the script template;
[0243] S(t i Historical satisfaction rating: This indicates customer satisfaction with the script template in its historical usage.
[0244] α, β, γ, δ: Weighting coefficients, which are dynamically adjusted according to the specific needs of the scenario.
[0245] It should be noted that the design of the comprehensive cost function can be adjusted according to the specific application scenario. For example, in scenarios with high real-time requirements, the weight of γ can be increased to prioritize the selection of templates with shorter response times.
[0246] In this embodiment, semantic matching cost It is the core part of the comprehensive cost function and directly affects the accuracy of the matching results.
[0247] As an alternative, to improve recommendation accuracy, the system normalizes the semantic matching cost. The normalization formula is:
[0248]
[0249] in, This represents the set of costs for matching user input with all templates.
[0250] It should be noted that the normalized semantic matching cost value Standardizing to the [0,1] interval helps to perform unified weighted calculations with other objectives.
[0251] In this embodiment, the service consistency score B(t) iThis is used to measure whether the template content is consistent with the dynamic business data logic. Its calculation logic is based on the degree of matching between the template and real-time data.
[0252] Specifically, in one possible implementation, the business consistency score depends on the following rules:
[0253] If the template content perfectly matches the dynamic business data, for example, if the template "order shipped" matches the queried order status "shipped", then assign the value B(t). i ) = 1;
[0254] If the template content matches the dynamic business data, for example, the template "Order Processing" matches the status "Shipping Soon", then assign the value B(t). i )∈(0,1);
[0255] If the template content does not match the dynamic business data, then B(t) i ) = 0.
[0256] It should be noted that the business consistency score is generated by combining logical judgment and semantic analysis, which can effectively improve the business relevance of the recommended templates.
[0257] In this embodiment, the response time cost T(t) i This indicates the estimated delay time for the script template during transmission or processing. For example, templates with additional query operations (such as database retrieval or API calls) have higher response time costs.
[0258] As an alternative, the formula for calculating response time cost is:
[0259]
[0260] Wherein, T(t) i The value is normalized to the [0,1] interval, and the smaller the value, the shorter the response time.
[0261] Historical satisfaction rating S(t) i This indicates customer satisfaction with the template over historical usage; specific ratings are obtained through user feedback data or click-through rate statistics. For example:
[0262] Templates with high satisfaction rates (e.g., historical positive review rate exceeding 90%) are assigned the value S(t). i ) = 0.9;
[0263] Templates with low satisfaction (e.g., high complaint rate) are assigned the value S(t). i <0.5.
[0264] It should be noted that the satisfaction rating is used as a penalty factor in the overall cost function, through 1-S(t)i This is reflected in the form that the lower the satisfaction level of a template, the higher its overall cost value.
[0265] In this embodiment, the comprehensive cost value C of each template is calculated. total We select the k templates with the lowest overall cost as the recommendation results.
[0266] In one possible implementation, the recommendation process includes the following steps:
[0267] According to the comprehensive cost formula C total Calculate the cost value of all templates;
[0268] Sort by cost value from lowest to highest;
[0269] Select the top k templates as recommendation candidates and return them to the user.
[0270] For example, when a user enters "When will the order be shipped?" and the order status is "shipped", the system calculates the overall cost of the template as follows:
[0271] Template 1: "Your order has been shipped";
[0272] C total =0.2×0.1+0.5×1+0.2×0.3+0.1×0.1=0.36
[0273] Template 2: "Your order will be shipped soon";
[0274] C total =0.2×0.3+0.5×0.7+0.2×0.4+0.1×0.2=0.45
[0275] Final recommended template 1.
[0276] In one operational instance, the user enters the message: "When will the order be shipped?", and the process is as follows:
[0277] The system calculates the semantic matching cost c(V) according to step S4. u V ti );
[0278] When the order status is "shipped", a business consistency score B(t) is generated. i );
[0279] Calculate the overall cost C for each template by combining the template's response time and historical satisfaction level. total ;
[0280] Sort by total cost value, the template with the lowest total cost is recommended: "Your order has been shipped, tracking number is 123456".
[0281] This embodiment uses a multi-objective optimization strategy to comprehensively consider factors such as semantic relevance, business logic consistency, response time, and historical satisfaction to generate an optimal template that meets user needs.
[0282] In step S6, in this embodiment, after semantic matching and multi-objective optimization, the system presents the generated optimal message recommendation to the user and completes the rapid message sending through the integrated chat tool interface. This step focuses on describing the implementation process of displaying the recommended message, supporting user interaction, and finally sending the message.
[0283] In this embodiment, the recommended optimal scripts are presented to the user through a unified interface, and the display method supports list format and mixed text and image format.
[0284] As an option, the recommended best-effort phrases are displayed on the interface in order of overall cost. Specifically, each recommended phrase displayed on the interface includes:
[0285] The complete text content of the template;
[0286] Related dynamic business data (such as order status and logistics information);
[0287] The scoring details of the overall cost (such as semantic matching cost and business consistency score).
[0288] In one possible implementation, the system provides users with visual prompts for recommended dialogue, such as:
[0289] Highlight key fields in business data (such as tracking number and estimated delivery time);
[0290] Use colors or icons to indicate the priority of recommended phrases (e.g., green indicates high priority).
[0291] It should be noted that the recommended optimal wording is not limited to text display, but also supports integration with multimedia content, such as product images and hyperlinks, to meet the needs of different application scenarios.
[0292] In this embodiment, users can edit the recommended script or send it directly.
[0293] Specifically, the system supports the following user interaction functions:
[0294] Editing of script content: Users can modify the recommended script content according to their actual needs, including adding or deleting text, adjusting the format, etc.
[0295] Quick template selection: Users can select a recommended message as the final content to send by clicking on it;
[0296] Image and text layout adjustment: For recommended text that includes images or hyperlinks, users can preview and edit its layout.
[0297] As one possible implementation, the system updates the modified content to the send preview area in real time after the user completes the editing, and then proceeds to the message sending stage after the user confirms.
[0298] It should be noted that the user interaction design aims to improve the flexibility and adaptability of the recommended messages, while ensuring that the content sent meets actual needs.
[0299] In this embodiment, the recommended message is sent through the integrated chat tool interface. Specific implementation includes message interface calls and automated operation support.
[0300] As an alternative, for chat tools that support open interfaces (such as DingTalk and WeChat Work), the system achieves fast message sending by calling their message sending API. Specific parameters for the API call include:
[0301] Identifier of the target contact or group chat;
[0302] Confirmed content sent (including text, images, hyperlinks, etc.);
[0303] Sending status confirmation information.
[0304] In another possible implementation, for chat tools that do not support open interfaces (such as WeChat and QQ), the system simulates user actions to send messages. For example:
[0305] Use window event capture technology to locate the target chat window;
[0306] By simulating key presses, the content is entered character by character into the input box of the chat window;
[0307] Simulate sending a message using a shortcut key (such as the Enter key).
[0308] It should be noted that this embodiment protects user privacy and data security during the sending process, for example by storing and transmitting message content using local encryption to ensure that data is not accessed without authorization.
[0309] In this embodiment, an optimization strategy for the message sending process is designed to improve the efficiency and reliability of message sending.
[0310] Alternatively, the system can automatically verify the integrity and validity of the content before sending a message. For example:
[0311] Check if the content contains key fields (such as order number, tracking number);
[0312] Verify the validity of hyperlinks to avoid sending invalid or incorrect links.
[0313] In one possible implementation, the system also supports a retry mechanism for failed transmissions. For example:
[0314] If the transmission fails due to network issues, the system will record the failure message and automatically retry once the network is restored.
[0315] If the attempt fails after multiple attempts, the system will send a notification to the user and provide the option to manually resend the file.
[0316] It should be noted that the optimized design of the sending process not only improves the stability of the system, but also reduces the error rate for users during operation.
[0317] In one operational instance, after a user enters the message "When will my order be shipped?", the system recommends the optimal response as "Your order has been shipped, tracking number 123456, please check back later," and completes the message sending by following these steps:
[0318] The system displays recommended sales pitches in a highlighted format on the recommendation interface, along with the tracking number;
[0319] Users can preview the message content and choose to send it directly;
[0320] The system calls WeChat's simulation operation module to input the recommended script into the target chat window;
[0321] The system simulates key presses to send the message and returns a status message indicating successful transmission.
[0322] This embodiment achieves efficient management and flexible adjustment of sent content through the presentation of recommended phrases and user interaction design. The message sending method not only supports seamless integration with multiple chat tools but also provides high reliability and security. It should be noted that the display and sending process of recommended phrases can be customized according to specific application scenarios to further enhance the system's usability and user experience.
[0323] In summary, this invention achieves intelligent and real-time customer service interaction through steps such as integrating multiple chat tools, constructing a corpus and semantic vectorization, semantic matching based on dynamic data, recommending optimal dialogue based on multi-objective optimization, and efficiently presenting and sending the recommendation results. This invention uses a pre-trained language model as its core technology, combines dynamic business data and historical feedback to optimize recommendation results, and supports seamless integration with multiple chat tools through interface adaptation and automated operation, significantly improving the efficiency and accuracy of customer service systems. It has broad application scenarios and powerful scalability.
[0324] The interactive device for the chat interface based on a big data corpus described below and the interactive method for the chat interface based on a big data corpus described above can be referred to in correspondence.
[0325] Please see the appendix Figure 2 The present invention also provides an interactive device for a chat interface based on a large data corpus, comprising:
[0326] The multi-tool integration module 100 is used to snap together multiple chat tool windows to achieve unified message reception and sending;
[0327] The corpus management module 200 is used to collect and process corpora from multiple sources, semantically vectorize them, and classify and store them.
[0328] The semantic analysis module 300 is used to perform semantic vectorization processing on user input messages;
[0329] The dialogue recommendation module 400 is used to recommend the optimal dialogue based on semantic matching and multi-objective optimization between user input messages and dialogue templates in the corpus;
[0330] Output module 500 is used to display recommended phrases and send messages through the integrated chat tools.
[0331] The device in this embodiment can be used to execute the above method embodiments, and its principle and technical effects are similar, so they will not be described again here.
[0332] Please see the appendix Figure 3 The present invention also provides a computer device 40, including a processor 41 and a memory 42, wherein the memory 42 stores a computer program executable by the processor, and the computer program performs the method described above when executed by the processor.
[0333] The present invention also provides a storage medium 43 on which a computer program is stored, and the computer program is executed by a processor 41 to perform the method described above.
[0334] The storage medium 43 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0335] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. An interaction method for a chat interface based on a large data corpus, characterized in that, Includes the following steps: It integrates multiple chat tools and enables the attachment, message reception, and sending of multiple chat tools through a unified management interface; Construct a large-scale corpus, preprocess the data in the corpus, and classify them according to semantic features; Obtain user input messages, perform semantic analysis on user input messages using a pre-trained language model, and generate semantic feature vectors of user input; The similarity between the semantic vector of the user input message and the semantic vector of each utterance template in the corpus is calculated. The semantic matching cost between user input and each utterance template is determined by measuring the similarity between semantic vectors. The logical consistency of the dialogue template based on dynamic business data is used to form a business consistency score. The semantic matching cost is calculated based on the cosine similarity or the distance between vectors. Based on the semantic matching cost value input by the user, and combined with dynamic business data, a business consistency score is generated for the script template. Further considering the response time cost of the script templates, optimization was carried out according to the priority of response time. By combining historical usage data of the script templates, the weighting of historical satisfaction scores is adjusted based on user feedback scores. Based on a comprehensive evaluation of semantic matching cost, business consistency score, response time cost, and historical satisfaction score, the optimal script template is recommended. The system presents users with recommended best-effort phrases and enables them to quickly send messages through the integrated chat tool interface.
2. The interaction method for a chat interface based on a large data corpus according to claim 1, characterized in that, The steps for integrating multiple chat tools include: For chat tools that support open interfaces, message reception, sending, and window snapping are achieved by calling their official open APIs; For chat tools that do not support open interfaces, the reading and sending of messages are accomplished by simulating user operations, including simulating key presses, capturing window events, and locating screen coordinates. Each chat tool window is dynamically snapped together and arranged to form a unified message management interface.
3. The interaction method for a chat interface based on a large data corpus according to claim 1, characterized in that, The steps for constructing the big data corpus include: Collect historical chat logs from multiple chat tools, industry FAQ documents, and user-uploaded templates; The corpus is segmented into words to remove invalid data, and the content is cleaned and standardized. The corpus is semantically vectorized using a pre-trained language model to generate high-dimensional semantic feature vectors, and the discourse templates in the corpus are clustered and classified according to the semantic features.
4. The interaction method for a chat interface based on a large data corpus according to claim 1, characterized in that, The step of generating the semantic feature vector of user input includes: The pre-trained language model is used to transform user input messages into semantic vectors, and the overall semantics of the message are represented in high-dimensional vectorization. Named entity recognition technology is used to extract specific keywords or phrases from user input, including product names, time information, price information, and other entities; Based on the contextual messages of user input, the semantic representation of the current input is dynamically adjusted to include contextual information.
5. The interaction method for a chat interface based on a large data corpus according to claim 1, characterized in that, The steps of presenting the recommended optimal message to the user and quickly sending the message through the integrated chat tool interface include: The recommended sales pitches are sorted according to their overall cost priority and displayed in a list format in the user interface. Users can edit the recommended messages, including modifying the text content, adjusting the image and text format, and adding hyperlinks. It provides a one-click sending function, which can send the selected message directly to the corresponding chat tool window by calling the adaptation interface of multiple chat tools or simulating the operation; For text messages containing images or other rich media content, it supports displaying and sending text and images in a mixed format.
6. The interaction method for a chat interface based on a large data corpus according to claim 5, characterized in that, The recommended optimal script supports multiple presentation methods, including: Text format; Text and image mixed layout; Hyperlink embedding format.
7. An interactive device for a chat interface based on a large data corpus, applied to the method described in any one of claims 1-6, characterized in that, include: The multi-tool integration module is used to combine multiple chat tool windows to achieve unified message reception and sending; The corpus management module is used to collect and process corpora from multiple sources, semantically vectorize them, and classify and store them. The semantic analysis module is used to perform semantic vectorization processing on user input messages; The dialogue recommendation module is used to recommend the optimal dialogue based on semantic matching and multi-objective optimization between user input messages and dialogue templates in the corpus; The output module is used to display recommended phrases and send messages through the integrated chat tools.
8. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Method for aggregating platform chatting
CN117319334A
Customer demand docking method, device and equipment of intelligent robot and storage medium
CN118037157A