Text data abstract extraction method and device, equipment and medium
By analyzing and classifying the user's online behavior data, generating a preset Prompt library, and processing the text data of the target user, it solves the problem of difficulty in exploring the potential needs of users in the existing technology, and achieves accurate mining of user needs and improving work efficiency.
Patent Information
- Application Number
- CN202411362779.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-02-28
AI Technical Summary
The existing technology is difficult to effectively tap the potential needs of users, making it difficult for enterprises to respond quickly to market changes.
By obtaining the user's online behavior data, preprocessing and classification, generating a preset Prompt library, and entering the target user's text data into the Prompt library for extraction and analysis to accurately mine user needs.
It has achieved accurate exploration of user needs, improved work efficiency, and helped enterprises better meet customer needs.
Smart Images

Figure CN119537578A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet text data processing, which is applied to dialogue scenarios such as finance or medical treatment, and in particular to a text data summary extraction method, device, equipment and storage medium. Background Art
[0002] In the current competitive market environment, the key to gaining a competitive advantage for enterprises lies in a deep understanding of customer needs and meeting their potential needs. Traditional market research methods, such as questionnaires and face-to-face interviews, are often limited by their time-consuming, high costs, and difficulty in collecting accurate and comprehensive information. These methods often fail to capture changes in customer needs in a fast-changing market, making it difficult for enterprises to respond quickly. Therefore, how to effectively tap into customers' potential needs has become an urgent problem for enterprises. Summary of the invention
[0003] The purpose of the embodiments of the present invention is to provide a method, device, equipment and storage medium for extracting a summary of text data, so as to solve the problem of how to accurately mine user needs in the prior art.
[0004] In order to solve the above technical problems, the embodiment of the present invention provides a method for extracting a summary of text data, which adopts the following technical solution:
[0005] A method for extracting a summary of text data comprises the following steps:
[0006] Acquire the user's online behavior data and pre-process the behavior data;
[0007] Classify the online behavior data according to preset classification rules to obtain user categories;
[0008] Generate a preset prompt library according to the user online behavior data and user category;
[0009] Acquire text data of a target user, and input the text data into a preset prompt library;
[0010] The preset Prompt library processes the text data and outputs an extraction result.
[0011] In one embodiment, classifying the online behavior data according to a preset classification rule to obtain a user category includes:
[0012] extracting key features of the user based on the online behavior data;
[0013] Determining the number of preset categories of users according to the key characteristics of the users;
[0014] The online behavior data is clustered and analyzed by a clustering algorithm to obtain a preset number of user categories.
[0015] In one embodiment, generating a preset prompt library according to the user online behavior data and user category includes:
[0016] Acquire the user's conversation data and convert the conversation data into text data;
[0017] extracting key information from the text data and online behavior data;
[0018] Analyze each category of users to obtain user characteristics;
[0019] A preset prompt library is generated according to the key information and user characteristics.
[0020] In one embodiment, the clustering analysis of the online behavior data by using a clustering algorithm to obtain a preset number of user categories includes:
[0021] Performing cluster analysis on the online behavior data based on a clustering algorithm to obtain a clustering result;
[0022] Analyze the clustering results to determine the user category represented by each clustering result;
[0023] A label is assigned to each clustering result according to the user category.
[0024] In one embodiment, obtaining text data of the target user and inputting the text data into a preset prompt includes:
[0025] Obtain target users’ online behavior data;
[0026] Determine the classification category of the target user according to the online behavior data of the target user;
[0027] Matching a preset prompt in a preset prompt library according to the classification category of the target user;
[0028] The user's conversation data is obtained, the conversation data is preprocessed, and the preprocessed conversation data is input into a preset prompt.
[0029] In one embodiment, the acquiring of the user's conversation data, preprocessing the conversation data, and inputting the preprocessed conversation data into a preset prompt includes:
[0030] Get the conversation data including the role ID;
[0031] Converting the conversation data into conversation text data, wherein the conversation text data is arranged in a conversation order;
[0032] The dialogue text data is preprocessed to generate text data, and the text data is input into a preset prompt.
[0033] In one embodiment, the preprocessing of the conversation text data to generate text data includes:
[0034] Inputting the conversation text data into a word segmentation model and outputting a word segmentation result, wherein the word segmentation result includes a plurality of word segments;
[0035] Each segmented word is searched and matched in the text library to detect whether the current segmented word is a wrong segmented word;
[0036] If the current word segmentation is an incorrect word segmentation, multiple distance matrices between the incorrect word segmentation and multiple target word segmentations are constructed based on the minimum edit distance algorithm model, and the operation cost between each target word segmentation and the incorrect word segmentation is calculated according to each distance matrix. The incorrect word segmentation is corrected according to the operation cost to generate text data.
[0037] In order to solve the above technical problems, the embodiment of the present invention also provides a summary extraction device for text data, which adopts the following technical solution:
[0038] A device for extracting a summary of text data, comprising:
[0039] A data collection module, used to obtain the user's online behavior data and pre-process the behavior data;
[0040] A user classification module, used to classify the online behavior data according to preset classification rules to obtain user categories;
[0041] A prompt library module, used to generate a preset prompt library according to the user online behavior data and user category;
[0042] A text data module, used to obtain text data of a target user and input the text data into a preset prompt;
[0043] The extraction result module is used for the preset prompt to process the text data and output the extraction result.
[0044] In order to solve the above technical problems, an embodiment of the present invention further provides a computer device, which adopts the following technical solution:
[0045] A computer device includes a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the above-mentioned text data summary extraction method when executing the computer-readable instructions.
[0046] In order to solve the above technical problems, an embodiment of the present invention further provides a computer-readable storage medium, which adopts the following technical solution:
[0047] A computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the text data summary extraction method as described above.
[0048] Compared with the prior art, the embodiments of the present invention mainly have the following beneficial effects:
[0049] The text data summary extraction method described in the embodiment of the present invention obtains the user's online behavior data and pre-processes the behavior data; classifies the online behavior data according to preset classification rules to obtain user categories; generates a preset prompt library according to the user's online behavior data and user categories; obtains the target user's text data, and inputs the text data into the preset prompt library; the preset prompt library processes the text data and outputs the extraction result. In the present invention, the user category is obtained by analyzing the user's online behavior data and generating a corresponding preset prompt, the user category of the target user is obtained, the preset prompt corresponding to the category is matched, the text data is extracted through the preset prompt, the user's needs are accurately mined, and work efficiency is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the scheme in the present invention, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0051] Figure 1 is an exemplary system architecture diagram in which the present invention can be applied;
[0052] Figure 2 is a flowchart of an embodiment of a method for extracting a summary of text data according to the present invention;
[0053] Figure 3 is a schematic structural diagram of an embodiment of a device for extracting a summary of text data according to the present invention;
[0054] Figure 4FIG. 1 is a schematic structural diagram of an embodiment of a computer device according to the present invention. DETAILED DESCRIPTION
[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present invention; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention; the terms "including" and "having" and any variations thereof in the specification and claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present invention or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0056] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0057] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings.
[0058] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0059] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0060] Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Group Audio Layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Group Audio Layer 4) players, laptop computers and desktop computers, etc.
[0061] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .
[0062] It should be noted that the text data abstract extraction method provided in the embodiment of the present invention is generally executed by a server / terminal device, and accordingly, the text data abstract extraction device is generally arranged in the server / terminal device.
[0063] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0064] Continue to refer Figure 2 , shows a flow chart of an embodiment of a method for extracting a summary of text data according to the present invention. The method for extracting a summary of text data comprises the following steps:
[0065] S1. Obtain the user's online behavior data and pre-process the behavior data.
[0066] In this embodiment, collecting online behavior data of users is a key step to gain insight into the behavior patterns of users on the network platform, and these data can reveal the interests, preferences and potential needs of users. Generally, online behavior data includes information such as user browsing history, click-through rate and dwell time.
[0067] Preprocessing these behavioral data is an important step to ensure data quality and availability, which makes subsequent analysis more accurate and effective. Preprocessing steps may involve operations such as data cleaning (to remove irrelevant or erroneous data), formatting (unifying data formats), and standardization (making data comparable).
[0068] Users’ browsing history records the pages and product information they visit on insurance-related web pages or platforms. By analyzing these browsing histories, companies can understand which insurance products or services users are interested in. For example, if users view health insurance pages multiple times, this may indicate that they have a high interest in health insurance.
[0069] Click-through rate shows the number of times users click on links to different insurance products or services. This metric helps identify which insurance products or services users have a stronger interest in. For example, if users frequently click on the introduction link to a certain car insurance, it may mean that they have a purchase intention for the product.
[0070] Dwell time reflects the length of time a user stays on each page or product information. This indicator can show the user's attention to a certain insurance product. If a user stays on the introduction page of a life insurance product for a long time, it may indicate that they have a deeper interest or demand for this type of product.
[0071] By comprehensively analyzing users’ online behavior data, companies can more accurately understand customers’ needs and preferences, thereby providing more personalized services and product recommendations. This step of building user portraits and formulating marketing strategies is crucial to improving customer satisfaction and business results.
[0072] S2. Classify the online behavior data according to preset classification rules to obtain user categories.
[0073] In this embodiment, when selecting a clustering algorithm, it is important to determine the most appropriate method based on the characteristics of the data and business requirements. For example, the K-Means algorithm is suitable for processing large data sets and is effective when the number of clusters is known. Hierarchical clustering algorithms are more suitable for situations where the data scale is small or the data hierarchy needs to be revealed.
[0074] Determining the number of clustering categories is a key step in cluster analysis, which is usually determined based on business needs and data distribution characteristics. The effect of different numbers of categories can be evaluated through experiments or using statistical methods such as the Elbow Method and the Silhouette Coefficient to determine the optimal number of categories.
[0075] In cluster analysis, the preprocessed online behavior data is input into the selected clustering algorithm, which automatically groups users into different categories based on the characteristics of the data. For example, the following types of customers can be identified:
[0076] 1. Highly focused and active customers: These customers have extensive browsing history on multiple insurance product pages, showing high click-through rates and longer dwell time, demonstrating a broad interest in insurance products.
[0077] 2. Customers with clear goals: This type of customer is mainly interested in a specific type of insurance product, such as auto insurance, and their browsing and clicking behaviors show clear goals and preferences.
[0078] 3. Potential demand customers: This type of customer occasionally browses insurance information and stays there for a moderate amount of time. They may have potential demand for certain insurance products but have not yet expressed it clearly.
[0079] Through this cluster analysis, insurance companies can gain a deeper understanding of customer behavior patterns and needs, thereby developing more effective marketing strategies and providing more personalized services. This approach enables companies to adopt customized communication and marketing strategies for different customer groups, thereby improving customer satisfaction and business results.
[0080] S3. Generate a preset prompt library according to the user online behavior data and user category.
[0081] In this embodiment, in order to better understand the specific needs and concerns of customers, it is crucial to extract key information from the conversation between customers and agents. By applying natural language processing techniques such as keyword extraction, phrase identification, and topic modeling, the conversation text can be deeply analyzed to identify important words, phrases, and topics. These technologies help reveal the core content of the conversation and provide a basis for further analysis.
[0082] Combining these extracted conversation key information with the characteristics of the user's category can more accurately reflect the needs of customers. For example, when analyzing the conversations of users classified as "high-attention and active customers", special attention should be paid to their possible interests in preferential policies and value-added services of insurance products.
[0083] In order to guide the large model to dig deeper into the customer's demands, specific prompts can be created. These prompts will be based on the user's category characteristics and key information of the conversation content. For example, for a customer who shows a strong interest in a variety of insurance products, the designed prompt may be: "This customer has shown a strong interest in a variety of insurance products, focusing on digging out his detailed demands in terms of insurance coverage, personalized customization, and after-sales service." Such prompts help guide the model to explore the customer's concerns about the details of insurance products.
[0084] For customers with clear goals, such as those who are interested in specific insurance products (such as auto insurance), the designed prompt may be: "This customer goal is clearly focused on auto insurance, and we have a deep understanding of their specific requirements for insurance amounts, claims procedures, and additional services." This helps the model focus on analyzing the customer's needs for specific details of auto insurance.
[0085] In actual applications, before applying these preset prompts to the big model, ensure that the model can accurately mine customer needs based on the customer category and conversation content. When the customer's conversation text information is available, the corresponding prompt is applied to the big model to guide the model's analysis and response. In this way, companies can use big models more effectively to understand and respond to customer needs and provide more personalized and accurate customer service. This approach not only improves the effectiveness of the dialogue system, but also makes customer service more efficient, thereby improving customer satisfaction.
[0086] S4, obtaining text data of the target user, and inputting the text data into a preset Prompt library;
[0087] S5. The preset Prompt library processes the text data and outputs an extraction result.
[0088] In this embodiment, in order to make the conversation text between the customer and the agent easy to process by the machine, it is first necessary to format the text into a machine-readable format. Expressing the conversation content in JSON format is an effective method, because JSON (JavaScript Object Notation) is a lightweight data exchange format that is easy for humans to read and write, and is also easy for machines to parse and generate. In the JSON format, the context information of the conversation can be explicitly included and represented.
[0089] Clarifying the tasks and goals of the AI assistant is key to ensuring that it can accurately understand the task requirements when processing conversations. To this end, define specific task instructions in the Prompt template to guide the AI assistant on how to understand and perform tasks. This includes improving the quality of text data to ensure that the model can accurately understand the content of the conversation, and adding text correction instructions to the Prompt template to guide the model to identify and correct typos and grammatical errors in the conversation.
[0090] In order to enable the model to distinguish between the speech content of customers and agents, it is necessary to add role differentiation instructions in the Prompt template to indicate the identification of "customer" and "agent" in the conversation. This helps the model correctly identify the conversation roles and guides the model on how to explore and refine the core needs of customers.
[0091] According to the category to which the customer belongs, a specific prompt is designed to guide the model to explore the specific demands of the customer. For example, for customers who are interested in multiple insurance products, the prompt will guide the model to focus on the customer's needs in terms of insurance coverage, personalization, and after-sales service. Finally, the results of the model analysis are output in a structured format, and an output format is defined, such as a JSON object, which contains a list of customer intents. Each intent is a refined description of the customer's needs, such as asking about the price of auto insurance, understanding auto insurance plans, and pursuing cost-effective plans.
[0092] Through this series of steps, the preset prompt library can effectively process the conversation text between customers and agents, extract key information, and output the customer's potential needs in a structured manner. This method not only improves the quality and efficiency of customer service, but also provides companies with valuable customer insights to help them better meet customer needs.
[0093] In one embodiment, classifying the online behavior data according to a preset classification rule to obtain a user category includes:
[0094] extracting key features of the user based on the online behavior data;
[0095] Determining the number of preset categories of users according to the key characteristics of the users;
[0096] The online behavior data is clustered and analyzed by a clustering algorithm to obtain a preset number of user categories.
[0097] In this embodiment, in order to deeply understand user needs and provide customized services, the enterprise first needs to extract key features from the user's online behavior data. These features may include the user's browsing history, click-through rate, dwell time, search query and purchase behavior, etc. Through careful analysis of these data, the user's interests, preferences and behavior patterns can be revealed. For example, users frequently browse a certain type of product page, which may indicate that they have a high interest in this type of product.
[0098] Next, based on the extracted key features, the enterprise needs to determine the number of preset categories for users. This number of categories should be set according to business needs and data analysis results, with the goal of dividing users into groups with similar characteristics. When determining the number of categories, the enterprise should consider business goals, market segmentation strategies, and the distribution characteristics of the data. For example, if the business goal is to identify different consumer groups to provide customized marketing strategies, the number of categories set will directly affect the effect of market segmentation.
[0099] Then, enterprises can use clustering algorithms (such as K-Means, hierarchical clustering, DBSCAN, etc.) to perform cluster analysis on users' online behavior data. Clustering algorithms can automatically group users according to their key characteristics to form different user categories. The purpose of cluster analysis is to classify users with similar behavioral characteristics into the same category, so as to conduct more targeted analysis and services.
[0100] After cluster analysis is completed, the enterprise will obtain user categories corresponding to the preset number of categories. Each category represents a group of users with similar online behavior characteristics. These user categories can be used for further marketing strategies, product recommendations and personalized services. For example, the enterprise can design specific marketing activities or product promotion plans based on the user characteristics of each category.
[0101] By combining key feature analysis and clustering algorithms of user online behavior data, enterprises can automatically classify users, which provides an effective tool for enterprises to understand and serve different user groups. This approach helps enterprises better meet user needs, improve user satisfaction and loyalty, and thus gain an advantage in the fiercely competitive market.
[0102] In one embodiment, generating a preset prompt library according to the user online behavior data and user category includes:
[0103] Acquire the user's conversation data and convert the conversation data into text data;
[0104] extracting key information from the text data and online behavior data;
[0105] Analyze each category of users to obtain user characteristics;
[0106] A preset prompt library is generated according to the key information and user characteristics.
[0107] In this embodiment, in order to improve the personalization and efficiency of customer service, it is first necessary to obtain the user's conversation data, which usually comes from the interaction records between the user and the customer service, chat robot or other systems. Next, the conversation data is converted into text format. This step may include extracting information from different data sources such as databases and log files, and uniformly formatting it into text for further analysis.
[0108] By analyzing the converted text data and the user's online behavior data, such as browsing history, click-through rate, dwell time, etc., key information can be extracted. Natural language processing (NLP) technologies, such as word segmentation, entity recognition, sentiment analysis, etc., can be used to extract useful information from the text, such as the user's needs, intentions, emotional state, etc. At the same time, based on the user's online behavior data, users can be divided into different categories, such as "highly active users", "users who prefer specific products", etc., and users in each category can be deeply analyzed to identify and understand the common characteristics of users in that category.
[0109] These features may cover user behavior patterns, preferences, needs, etc. Then, using the key information extracted from the conversation data and online behavior data, as well as the analysis results of user characteristics, a preset prompt library is generated. Preset prompts are designed templates or instructions to guide the model to perform specific tasks, such as demand mining, sentiment analysis, etc. Each prompt in the prompt library is designed for specific user categories and scenarios to improve the response quality and efficiency of the model.
[0110] For example, for "highly active users", prompts can be designed to gain a deeper understanding of their specific needs and preferences; for "users with specific product preferences", prompts can be designed to recommend related products or services. In this way, key information is extracted by combining user conversation data and online behavior data, and a preset prompt library is generated based on this information, providing targeted guidance for the model so that it can understand and respond to user needs more accurately. This not only improves the personalization level of customer service, but also improves service efficiency.
[0111] In one embodiment, the clustering analysis of the online behavior data by using a clustering algorithm to obtain a preset number of user categories includes:
[0112] Performing cluster analysis on the online behavior data based on a clustering algorithm to obtain a clustering result;
[0113] Analyze the clustering results to determine the user category represented by each clustering result;
[0114] A label is assigned to each clustering result according to the user category.
[0115] In this embodiment, cluster analysis is performed on the online behavior data based on a clustering algorithm. Clustering algorithms such as K-Means, hierarchical clustering, DBSCAN, etc. are powerful tools for analyzing user online behavior data. These algorithms can automatically divide users into different groups based on their behavioral characteristics, such as browsing history, click behavior, dwell time, and search queries. These behavioral data are a direct reflection of user interests and habits.
[0116] After being processed by the clustering algorithm, users are grouped into different clusters, and the users in each cluster have similar behavior characteristics. The clustering results are usually represented by cluster numbers or identifiers, so that users in the same cluster have a certain degree of consistency in behavior, while different clusters show great differences.
[0117] Further analysis of the characteristics and attributes of each cluster can help determine the category of users represented by each cluster. This may include in-depth statistical analysis of the user behavior data within the clusters to identify characteristics that are typical of the clusters. For example, one cluster may consist of users with a strong interest in a particular product category, while another cluster may contain highly active users.
[0118] Based on the characteristics of the clusters and business needs, you can define the user categories that each cluster represents. The division of user categories should help support business decisions and marketing strategies, such as identifying "price-sensitive users", "brand-loyal users" or "high-value potential users". Assign a descriptive label to each cluster, which should be concise and intuitive and accurately reflect the main characteristics of the clustered users. The assignment of labels is based on data analysis results and is combined with business knowledge and market research. For example, one cluster may be labeled "highly active users" while another may be labeled "occasional browsers."
[0119] By automatically grouping users through clustering algorithms, and combining the analysis of clustering results with label assignment, companies can gain a deeper understanding of the characteristics of different user groups, thereby developing more targeted marketing strategies and user service solutions. This approach enables companies to more effectively meet user needs, improve user experience, and ultimately drive business growth.
[0120] In one embodiment, obtaining text data of the target user and inputting the text data into a preset prompt includes:
[0121] Obtain online behavior data of target users;
[0122] Determine the classification category of the target user according to the online behavior data of the target user;
[0123] Matching a preset prompt in a preset prompt library according to the classification category of the target user;
[0124] The user's conversation data is obtained, the conversation data is preprocessed, and the preprocessed conversation data is input into a preset prompt.
[0125] In this embodiment, in order to provide more personalized services, it is first necessary to collect the online behavior data of the target user on the network platform, which includes the user's browsing history, click-through rate, dwell time, search history, etc. This information can reveal the user's interests and behavior patterns. By using data analysis and clustering algorithms, users can be divided into different categories according to their behavioral characteristics, such as "highly active users" or "users with a preference for specific products." Such classification helps to provide customized services to user groups with similar behavioral characteristics.
[0126] Next, according to the classification category to which the user belongs, a suitable prompt is matched from the preset prompt library. The prompt library contains templates designed for different user categories to guide the conversation or extract specific information. The matching process can be automated to ensure that the most appropriate prompt is selected from the library based on the user's classification results, thereby improving the pertinence and effectiveness of conversation processing.
[0127] After obtaining the conversation data between the target user and the system (such as customer service, chatbot, etc.), the data needs to be preprocessed for subsequent analysis and processing. The preprocessing steps may include text cleaning (removing irrelevant characters, punctuation, etc.), word segmentation, removing stop words, stemming or word form restoration, etc., with the purpose of improving the quality of text data and making it more suitable for analysis.
[0128] The preprocessed conversation data will be input into the matched preset prompt, so that the model can be guided to understand and process the user's needs more accurately by combining the user's actual conversation content and the specific processing template. This method can effectively extract the user's key information, identify the user's needs and intentions, and provide more accurate services or responses. This personalized processing of user conversation data improves the dialogue system's understanding ability and service effect.
[0129] In one embodiment, the acquiring of the user's conversation data, preprocessing the conversation data, and inputting the preprocessed conversation data into a preset prompt includes:
[0130] Get the conversation data including the role ID;
[0131] Converting the conversation data into conversation text data, wherein the conversation text data is arranged in a conversation order;
[0132] The dialogue text data is preprocessed to generate text data, and the text data is input into a preset prompt.
[0133] In this embodiment, obtaining the dialogue data containing the role identifiers is a key step in understanding and analyzing the interaction between the user and the service system (such as a customer service system, a chatbot, etc.). These dialogue data usually contain role identifiers that distinguish different participants, such as "customer" and "agent" or "user" and "system". These identifiers are crucial for clarifying the attribution of each part in the dialogue and provide the necessary context information for dialogue analysis.
[0134] First, the obtained dialogue data needs to be converted into text format, and this step may include extracting text information from different formats such as database records, log files, etc. Then, ensure that the dialogue text data is arranged in the actual order of the dialogue to maintain the coherence and chronological order of the dialogue, which is very crucial for understanding the dialogue content and context.
[0135] The preprocessing of the dialogue text data is an important step in improving the quality of the text data, making the data more suitable for subsequent analysis and processing. The preprocessing steps may include text cleaning (removing irrelevant characters, punctuation marks, special symbols, etc.), word segmentation (breaking continuous text into individual words or phrases), stop word removal (deleting common words that do not affect semantic understanding, such as "of", "is", "in", etc.), stemming or lemmatization (converting words to their basic forms), and part-of-speech tagging (identifying the part of speech of each word).
[0136] The preprocessed text data will be input into a preset Prompt. A Prompt is a template or instruction that guides the model to understand and process the input data, and it can be designed according to specific tasks or goals. The preset Prompt may contain specific instructions or questions for guiding the model to extract key information in the dialogue, such as the user's needs, intentions, or emotions, etc.
[0137] By inputting the text data into the preset Prompt, the capabilities of the model can be utilized to analyze the dialogue content, identify the user's needs and intentions, thereby providing support for subsequent services. This process improves the utilization efficiency and effect of the dialogue data by structuring and preprocessing the dialogue data and then using the preset Prompt to guide the model's analysis and processing.
[0138] In one embodiment, the preprocessing of the dialogue text data to generate text data includes:
[0139] Inputting the dialogue text data into a word segmentation model and outputting the word segmentation result, where the word segmentation result includes multiple segmented words;
[0140] Searching and matching each segmented word in a text library for word formation to detect whether the current segmented word is a misspelled word;
[0141] If the current word segmentation is an incorrect word segmentation, multiple distance matrices between the incorrect word segmentation and multiple target word segmentations are constructed based on the minimum edit distance algorithm model, and the operation cost between each target word segmentation and the incorrect word segmentation is calculated according to each distance matrix. The incorrect word segmentation is corrected according to the operation cost to generate text data.
[0142] In the present embodiment, word segmentation is a key step in text preprocessing. Word segmentation involves breaking down continuous text strings into meaningful units, which are usually words or phrases. This process is implemented by a word segmentation model, and the model splits the original text into multiple word segments. After the word segmentation is completed, the next step is to detect typos for each word segmentation. This process is completed by finding and matching each word segmentation in a text library, and the text library is a database containing correct vocabulary and its usage, which is used to compare with the word segmentation results to identify possible misspellings. When it is detected that a word segmentation may be a typo, a model based on the minimum edit distance algorithm will be used to construct a distance matrix between the typo word segmentation and multiple possible correct word segments. Edit distance is a method of measuring the difference between two strings, which is determined by calculating the number of minimum editing operations (such as inserting, deleting, and replacing characters) required to convert from one string to another.
[0143] For each distance matrix, the operation cost between the incorrect segmentation and the target segmentation is calculated, that is, the number of editing operations required to correct the incorrect segmentation to the target segmentation. Then, based on the calculated operation cost of each target segmentation, the segmentation with the lowest cost is selected as the correct replacement. Among all possible correct segmentations, the one with the smallest editing distance to the incorrect segmentation is most likely to be the correct word that the user wants to express.
[0144] After selecting the correct replacement word, use it to replace the wrong segmented word in the original text. After all the typos are corrected, all the correct segmented words are reassembled into text data to generate a typo-corrected text. This process improves the accuracy and readability of the text data and provides higher quality data for subsequent text analysis and processing.
[0145] The embodiments of the present invention can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0146] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, large model training technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0147] In an embodiment of the present invention, the encoder processes the input mel spectrum, outputs speaker embedding, content embedding and hidden code, and inputs the speaker embedding, content embedding and hidden code to the decoder; after receiving the speaker embedding, content embedding and hidden code, the decoder generates a reconstructed mel spectrum through feature fusion and upsampling operations; the total loss value is calculated through the target mel spectrum, speaker embedding, content embedding and reconstructed mel spectrum, and the model parameters are updated according to the total loss value to complete the model training. The present invention obtains the speaker embedding, content embedding and hidden code through the encoder, and the decoder reconstructs the mel spectrum. The model is trained by calculating the loss value according to the target mel spectrum, speaker embedding, content embedding and reconstructed mel spectrum, which effectively avoids the damage and loss of audio information, improves the model's ability to capture and imitate the speaker's voice features, and the naturalness of voice conversion.
[0148] Further references Figure 3 , as a response to the above Figure 3 The present invention provides an embodiment of a device for extracting a summary of text data. Figure 3 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0149] like Figure 3 As shown, the text data summary extraction device described in this embodiment includes: a data collection module 11, a user classification module 12, a prompt library module 13, a text data module 14 and an extraction result module 15. Among them:
[0150] The data collection module 11 is used to obtain the online behavior data of the user and pre-process the behavior data;
[0151] A user classification module 12, used to classify the online behavior data according to a preset classification rule to obtain a user category;
[0152] Prompt library module 13, used to generate a preset Prompt library according to the user online behavior data and user category;
[0153] A text data module 14 is used to obtain text data of a target user and input the text data into a preset prompt;
[0154] The extraction result module 15 is used for processing the text data according to the preset prompt and outputting the extraction result.
[0155] like Figure 3 As shown, the data collection module 11, the user classification module 12, the prompt library module 13, the text data module 14 and the extraction result module 15 are connected in sequence. The module referred to in the present invention refers to a series of computer program instruction segments that can complete specific functions, which is more suitable for describing the execution process of summary extraction of text data than a program. For the specific implementation of each module, please refer to the corresponding method embodiment above, which will not be repeated here.
[0156] In one embodiment, the user classification module 12 includes:
[0157] A key feature unit, used to extract key features of the user based on the online behavior data;
[0158] A classification quantity unit, used to determine the preset classification quantity of the user according to the key characteristics of the user;
[0159] The user classification unit is used to perform cluster analysis on the online behavior data by using a clustering algorithm to obtain a preset number of user categories.
[0160] In one embodiment, the Prompt library module 13 includes:
[0161] A text data unit, used to obtain the user's conversation data and convert the conversation data into text data;
[0162] A key information unit, used to extract key information from the text data and online behavior data;
[0163] A user feature unit, used to analyze each category of users to obtain user features;
[0164] The prompt library unit is used to generate a preset prompt library according to the key information and user characteristics.
[0165] In one embodiment, the user category unit includes:
[0166] Performing cluster analysis on the online behavior data based on a clustering algorithm to obtain a clustering result;
[0167] Analyze the clustering results to determine the user category represented by each clustering result;
[0168] A label is assigned to each clustering result according to the user category.
[0169] In one embodiment, the text data module 14 includes:
[0170] Target behavior data unit, used to obtain online behavior data of target users;
[0171] A target classification category unit, used to determine the classification category of the target user according to the online behavior data of the target user;
[0172] A target prompt matching unit, used for matching a preset prompt in a preset prompt library according to the classification category of the target user;
[0173] The target data processing unit is used to obtain the user's dialogue data, pre-process the dialogue data, and input the pre-processed dialogue data into a preset prompt.
[0174] In one embodiment, the target data processing unit includes:
[0175] Get the conversation data including the role ID;
[0176] Converting the conversation data into conversation text data, wherein the conversation text data is arranged in a conversation order;
[0177] The dialogue text data is preprocessed to generate text data, and the text data is input into a preset prompt.
[0178] In one embodiment, the target data processing unit further includes:
[0179] Inputting the conversation text data into a word segmentation model and outputting a word segmentation result, wherein the word segmentation result includes a plurality of word segments;
[0180] Each segmented word is searched and matched in the text library to detect whether the current segmented word is a wrong segmented word;
[0181] If the current word segmentation is an incorrect word segmentation, multiple distance matrices between the incorrect word segmentation and multiple target word segmentations are constructed based on the minimum edit distance algorithm model, and the operation cost between each target word segmentation and the incorrect word segmentation is calculated according to each distance matrix. The incorrect word segmentation is corrected according to the operation cost to generate text data.
[0182] In the above embodiment, the present invention discloses a summary extraction device for text data, which belongs to the field of speech data processing technology. The present invention obtains the online behavior data of the user and pre-processes the behavior data; classifies the online behavior data according to the preset classification rules to obtain the user category; generates a preset prompt library according to the user's online behavior data and the user category; obtains the text data of the target user, and inputs the text data into the preset prompt library; the preset prompt library processes the text data and outputs the extraction result. In the present invention, the user category is obtained by analyzing the user's online behavior data and generating the corresponding preset prompt, the user category of the target user is obtained, the preset prompt corresponding to the category is matched, the text data is extracted through the preset prompt, the user's needs are accurately mined, and the work efficiency is improved.
[0183] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0184] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0185] To solve the above technical problems, the embodiment of the present invention also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0186] The computer device 8 includes a memory 8a, a processor 8b, and a network interface 8c that are interconnected through a system bus. It should be noted that the figure only shows a computer device 8 with components 8a-8c, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital processors (DSPs), embedded devices, etc.
[0187] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0188] The memory 8a includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 8a can be an internal storage unit of the computer device 8, such as a hard disk or memory of the computer device 8. In other embodiments, the memory 8a can also be an external storage device of the computer device 8, such as a plug-in hard disk equipped on the computer device 8, a smart memory card (Smart Med ia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. Of course, the memory 8a can also include both the internal storage unit of the computer device 8 and its external storage device. In this embodiment, the memory 8a is generally used to store the operating system and various application software installed on the computer device 8, such as a computer-readable instruction of a method for extracting a summary of text data, etc. In addition, the memory 8a can also be used to temporarily store various types of data that have been output or are to be output.
[0189] The processor 8b may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other text data abstract extraction chip in some embodiments. The processor 8b is generally used to control the overall operation of the computer device 8. In this embodiment, the processor 8b is used to run the computer-readable instructions or process data stored in the memory 8a, such as computer-readable instructions for running the text data abstract extraction method.
[0190] The network interface 8c may include a wireless network interface or a wired network interface. The network interface 8c is generally used to establish a communication connection between the computer device 8 and other electronic devices.
[0191] The computer device proposed in this embodiment belongs to the field of voice data processing technology and is applied to dialogue scenarios such as finance or medical care. The present invention obtains the user's online behavior data and pre-processes the behavior data; classifies the online behavior data according to preset classification rules to obtain user categories; generates a preset prompt library according to the user's online behavior data and user categories; obtains the target user's text data and inputs the text data into the preset prompt library; the preset prompt library processes the text data and outputs the extraction result. In the present invention, the user category is obtained by analyzing the user's online behavior data and generating a corresponding preset prompt, the user category of the target user is obtained, the preset prompt corresponding to the category is matched, the text data is extracted through the preset prompt, the user's needs are accurately mined, and work efficiency is improved.
[0192] The present invention also provides another embodiment, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by a processor to enable the processor to perform the steps of the text data summary extraction method as described above.
[0193] The computer-readable storage medium proposed in this embodiment belongs to the field of voice data processing technology and is applied to dialogue scenarios such as finance or medical care. The present invention obtains the user's online behavior data and pre-processes the behavior data; classifies the online behavior data according to preset classification rules to obtain user categories; generates a preset prompt library according to the user's online behavior data and user categories; obtains the target user's text data and inputs the text data into the preset prompt library; the preset prompt library processes the text data and outputs the extraction result. In the present invention, the user category is obtained by analyzing the user's online behavior data and generating a corresponding preset prompt, the user category of the target user is obtained, the preset prompt corresponding to the category is matched, the text data is extracted through the preset prompt, the user's needs are accurately mined, and work efficiency is improved.
[0194] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0195] It should be noted that if software tools or components other than those of the company appear in the embodiments of the present application, they are only used for example introduction and do not represent actual use. The embodiments described above are only some embodiments of the present invention, not all embodiments. The preferred embodiments of the present invention are given in the accompanying drawings, but they do not limit the scope of the invention. The present invention can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present invention more thorough and comprehensive. Although the present invention is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific embodiments, or to replace some of the technical features therein with equivalents. Any equivalent structure made using the contents of the specification and drawings of the present invention, directly or indirectly used in other related technical fields, is also within the scope of patent protection of the present invention.
Claims
1. A method for extracting a summary of text data, characterized in that: The steps include: Acquire the user's online behavior data and pre-process the behavior data; Classify the online behavior data according to preset classification rules to obtain user categories; Generate a preset prompt library according to the user online behavior data and user category; Acquire text data of a target user, and input the text data into a preset prompt library; The preset Prompt library processes the text data and outputs an extraction result.
2. The method for extracting a summary of text data according to claim 1, characterized in that: The step of classifying the online behavior data according to a preset classification rule to obtain a user category includes: extracting key features of the user based on the online behavior data; Determining the number of preset categories of users according to the key characteristics of the users; The online behavior data is clustered and analyzed by a clustering algorithm to obtain a preset number of user categories.
3. The method for extracting a summary of text data according to claim 2, characterized in that: The generating a preset prompt library according to the user online behavior data and the user category includes: Acquire the user's conversation data and convert the conversation data into text data; extracting key information from the text data and online behavior data; Analyze each category of users to obtain user characteristics; A preset prompt library is generated according to the key information and user characteristics.
4. The method for extracting a summary of text data according to claim 3, characterized in that: The clustering analysis of the online behavior data by using a clustering algorithm to obtain a preset number of user categories includes: Performing cluster analysis on the online behavior data based on a clustering algorithm to obtain a clustering result; Analyze the clustering results to determine the user category represented by each clustering result; A label is assigned to each clustering result according to the user category.
5. The method for extracting a summary of text data according to claim 1, characterized in that: The step of obtaining text data of a target user and inputting the text data into a preset prompt includes: Obtain target users’ online behavior data; Determine the classification category of the target user according to the online behavior data of the target user; Matching a preset prompt in a preset prompt library according to the classification category of the target user; The user's conversation data is obtained, the conversation data is preprocessed, and the preprocessed conversation data is input into a preset prompt.
6. The method for extracting a summary of text data according to claim 5, characterized in that: The acquiring the user's conversation data, preprocessing the conversation data, and inputting the preprocessed conversation data into a preset prompt, includes: Get the conversation data including the role ID; Converting the conversation data into conversation text data, wherein the conversation text data is arranged in a conversation order; The dialogue text data is preprocessed to generate text data, and the text data is input into a preset prompt.
7. The method for extracting a summary of text data according to claim 6, characterized in that: The step of preprocessing the conversation text data to generate text data comprises: Inputting the conversation text data into a word segmentation model and outputting a word segmentation result, wherein the word segmentation result includes a plurality of word segments; Each segmented word is searched and matched in the text library to detect whether the current segmented word is a wrong segmented word; If the current word segmentation is an incorrect word segmentation, multiple distance matrices between the incorrect word segmentation and multiple target word segmentations are constructed based on the minimum edit distance algorithm model, and the operation cost between each target word segmentation and the incorrect word segmentation is calculated according to each distance matrix. The incorrect word segmentation is corrected according to the operation cost to generate text data.
8. A device for extracting a summary of text data, characterized in that: include: A data collection module, used to obtain the user's online behavior data and pre-process the behavior data; A user classification module, used to classify the online behavior data according to preset classification rules to obtain user categories; A prompt library module, used to generate a preset prompt library according to the user online behavior data and user category; A text data module, used to obtain text data of a target user and input the text data into a preset prompt; The extraction result module is used for the preset prompt to process the text data and output the extraction result.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the text data abstract extraction method according to any one of claims 1 to 7 when executing the computer-readable instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the method for extracting a summary of text data according to any one of claims 1 to 7 are implemented.