Session data processing method and session data processing device
The important values of session data are analyzed through the word embedding model, and resources are allocated reasonably to handle intelligent session tasks, solving the resource competition problem of session tasks under limited computing power, and achieving rapid response to core services and improvement of equipment performance.
Patent Information
- Application Number
- CN202510350042.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2025-07-11
AI Technical Summary
In smart conversation tasks, when the computing power of the equipment is limited, it is difficult for the existing technology to accurately identify conversation tasks related to core services, resulting in unreasonable resource competition and affecting business response efficiency.
By obtaining session data and its historical data, using word embedding model to analyze and process, determine the important values of session data, and determine the response method based on the important values, reasonably allocate resources to prioritize important session tasks.
It improves the semantic mining accuracy of session data and the accuracy of important values, optimizes the allocation of device resources, and ensures the rapid response of core business sessions and improves device performance.
Smart Images

Figure CN120297408A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of session data processing, and particularly relates to a session data processing method and a session data processing device. Background Art
[0002] In intelligent session tasks, multiple session task processing requests may be received simultaneously. When the computing power of the device is limited, session tasks unrelated to the core business do not need to be responded to in a timely manner, or even supported and guaranteed. It is possible to dynamically analyze the session content of the session task to determine whether the current problem is related to the core business, rather than limiting the concurrency and resource competition conditions based on some fixed attributes (such as the network protocol address IP, user, etc.). This process highly depends on the session content and requires precise semantic mining of the session content. Summary of the Invention
[0003] The technical solution of the present application is implemented as follows:
[0004] An embodiment of the present application provides a session data processing method, which includes:
[0005] Obtain session data and historical session data corresponding to the session data;
[0006] Use a word embedding model to analyze and process the session data and the historical session data to determine the importance value of the session data;
[0007] Based on the importance value, determine the response method corresponding to the session data; wherein, the importance value represents the importance degree of the inquiry content corresponding to the session data.
[0008] An embodiment of the present application provides a session data processing device, including:
[0009] A first acquisition module, configured to obtain session data and historical session data corresponding to the session data;
[0010] A first analysis and processing module, configured to use a word embedding model to analyze and process the session data and the historical session data to determine the importance value of the session data;
[0011] A first determination module, configured to determine the response method corresponding to the session data based on the importance value; wherein, the importance value represents the importance degree of the inquiry content corresponding to the session data. Description of the Drawings
[0012] Figure 1 It is a schematic flowchart of a session data processing method provided by an embodiment of the present application;
[0013] Figure 2Schematic diagram of the processing flow of a method for ensuring core services in a session agent provided by an embodiment of this application;
[0014] Figure 3 Schematic diagram of the composition structure of a session data processing device provided by an embodiment of this application;
[0015] Figure 4 Schematic diagram of the composition structure of a session data processing device provided by an embodiment of this application. Detailed implementation manners
[0016] Next, the technical solutions in the embodiments of this application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of this application.
[0017] In order to make the purpose, technical solutions, and advantages of this application clearer, the present application will be further described in conjunction with the accompanying drawings. The described embodiments should not be regarded as limitations of this application. All other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of this application.
[0018] In the following description, reference is made to "some embodiments / other embodiments", which describe subsets of all possible embodiments. However, it can be understood that "some embodiments / other embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.
[0019] In the following description, the terms "first / second / " are only used to distinguish similar objects and do not represent a specific order for the objects. It can be understood that "first / second" can be interchanged with a specific order or sequence when allowed, so that the embodiments of this application described here can be implemented in an order other than that illustrated or described here.
[0020] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0021] Artificial Intelligence (AI) technology has quietly integrated into all aspects of our lives like a gentle spring breeze, bringing unprecedented changes and improvements to all walks of life. From high-tech fields to daily necessities, clothing, housing, and transportation, AI technology, with its powerful session data processing capabilities and intelligent decision-making systems, is injecting new vitality into various industries and enhancing the competitiveness of the industries.
[0022] Powerful AI technology relies on the powerful computing power of the (Graphics Processing Unit, GPU). By parallelly processing a large number of computing tasks, the GPU can significantly improve the computing speed and efficiency of AI algorithms; the parallel computing ability of the GPU enables the AI model to converge faster during training, thus increasing the training speed; the computing power of the GPU also helps to improve the accuracy and generalization ability of deep learning models. However, the high cost of the GPU also poses huge challenges to enterprises, which requires us to make reasonable use of the GPU to achieve the goal of cost reduction and efficiency improvement.
[0023] Based on the above background, the computing power allocated by the large model team to the Portal team can only support up to 50 concurrencies. In the intelligent conversation agent project of Portal, the core purpose is to provide timely and effective intelligent conversation empowerment for channel users and sales users. However, there are a large number of conversations every day that are not related to the core business. Under the premise of limited concurrency, these conversations are not necessarily supported and guaranteed by the Portal intelligent agent. This requires the Portal conversation intelligent agent to conduct semantic mining on the conversation content, identify the core business conversations, and reasonably use 50 concurrencies through core force concurrency control.
[0024] The semantic mining methods in related technologies mainly include traditional word matching, word frequency statistics method, word embedding model method, and generative large model method.
[0025] Word matching determines whether there is a match by traversing each word in the text and comparing it with the target word. Common ones include the maximum matching algorithm, Trie tree, KMP algorithm, BBPE, etc. The word frequency statistics method determines the important semantic information in the text by counting the number of occurrences of each word or symbol in the text. Common ones include: N-gram, hidden Markov model, etc. Traditional word matching and word frequency statistics methods are only based on literal understanding, resulting in a large amount of information loss and being unable to accurately understand the deep semantic information in the text.
[0026] The word embedding model method is a technology widely used in Natural Language Processing (NLP). It captures the semantic and syntactic relationships between words by mapping words into a low-dimensional real vector space. The word embedding algorithm includes various methods, such as Word2Vec, GloVe, FastText, etc. Although the word embedding model can express semantic information, its accuracy highly depends on the training of business data and its general ability is weak. In addition, the traditional word embedding model can only obtain the static semantic expression of the current text and cannot perceive the user's historical conversation information, making it difficult to solve conversation tasks with historical information dependence.
[0027] The emergence of generative large language models (LLM) has brought new development directions and opportunities to text mining. LLM trains and integrates knowledge and data from different disciplines and social groups. It has strong generation, memory and expansion capabilities and can handle different types of NLP tasks. Common ones include: GPT-4, Qwen, Llama, etc. Large models have a large number of parameters and are expensive to use; large models have slow inference speeds and are difficult to meet the real-time requirements of the business; in addition, in the semantic mining process, it is important to maximize the reasonable use of large model resources. If the strategy itself relies on large models, it loses its original meaning.
[0028] Based on the problems existing in the related art, the embodiment of the present application provides a session data processing method, such as Figure 1 FIG. 1 is a flow chart of a method for processing session data provided by an embodiment of the present application, the method comprising the following steps:
[0029] S101. Acquire session data and historical session data corresponding to the session data.
[0030] It should be noted that the conversation data may be one or more conversation contents input by the user in the intelligent conversation task, and the type of the conversation data may be a question or an answer. The historical data corresponding to the conversation data may be the previous conversation content of the conversation data, or the previous conversation contents, or the multiple rounds of conversation contents before the conversation data.
[0031] In some embodiments, the session data may be acquired in real time, for example, when a user inputs a question to be asked in the intelligent session interaction interface, the session data is acquired based on the question.
[0032] In some embodiments, during the intelligent conversation process, the content of multiple rounds of conversations can be stored in the storage area corresponding to the intelligent conversation software in the local device. Therefore, the historical conversation data corresponding to the conversation data can be obtained from the storage area corresponding to the intelligent conversation software; the content of multiple rounds of conversations can also be sent to a third-party device for storage, such as a cloud service. In this case, the historical conversation data corresponding to the conversation data can also be obtained from the third-party device. The storage and acquisition location of the historical conversation data corresponding to the conversation data here is only an exemplary description, and this application does not limit this.
[0033] S102: Analyze and process the conversation data and historical conversation data using a word embedding model to determine the importance of the conversation data.
[0034] Here, the word embedding model can be Word2Vec, GloVe, FastText, etc. The importance value can represent the importance degree of the query content corresponding to the session data. The importance value can be the importance degree value of the topic category corresponding to the session data. The topic category can include the business category corresponding to the session data. The importance degree values of different topic categories are different. The importance degree value corresponding to the topic category can be pre-established by those skilled in the art according to experience. The embodiments of the present application are described by taking the business category as an example.
[0035] In some embodiments, the word embedding model can deeply understand the session content of the session data based on the correlation between the session data and the corresponding historical session data, so as to determine the semantics of the session data, and determine the importance value of the session data according to the semantics of the session data.
[0036] In some embodiments, in the process of determining the importance value of the session data according to the semantics of the session data, the business category corresponding to the session data can be determined first according to the semantics of the session data. In the case where the corresponding relationship between the pre-established business category and the importance value can be obtained, the importance value of the business category corresponding to the session data can be directly determined according to the preset corresponding relationship; or the probability that the session data belongs to different business categories can be determined according to the semantics of the session data, and the importance value of the session data can be determined based on each probability.
[0037] S103. Based on the importance value, determine the response mode corresponding to the session data.
[0038] Here, the response mode can include quick response, slow response, no response, etc. Different response modes correspond to different response speeds, and different response speeds can indicate different computing powers used in the response process of the session data.
[0039] In some embodiments, different importance values correspond to different response modes. The greater the importance value of the session data, the more important the corresponding business category, and the faster the response speed of the session data. The preset corresponding relationship between the importance value of the session data and the response mode can be pre-established, so that after the importance value of the real-time session data is determined, the response mode corresponding to the real-time session data can be directly determined based on the preset corresponding relationship and the importance value.
[0040] Exemplarily, if the value range of the importance value of the session data is [0, 1], the response method corresponding to the importance value in the range of (0.75, 1] can be determined as a quick response; the response method corresponding to the importance value in the range of (0.4, 0.75] can be determined as a slow response; the response method corresponding to the importance value in the range of [0, 0.4] can be determined as no response. Therefore, a preset correspondence between the importance value and the response method can be established according to the value range of the importance value of the session data and the corresponding response method. Here, the value range of the importance value of the session data and the correspondence between the value range of the importance value and the corresponding response method are only exemplary descriptions, and this application does not limit this.
[0041] In some embodiments, when the business category corresponding to the session data is not important or has a low level of importance, but the question corresponding to the session data is important, the response method for the session data can also be determined as a quick response or a high response priority.
[0042] In the embodiments of the present application, session data and the historical session data corresponding to the session data are obtained; the word embedding model is used to analyze and process the session data and the historical session data to determine the importance value of the session data; based on the importance value, the response method corresponding to the session data is determined; where the importance value represents the importance degree of the inquiry content corresponding to the session data. In this way, by inputting the historical session data corresponding to the session data into the word embedding model, the word embedding model can understand the content associated with the session data in the historical session data, so that the semantics of the session data can be more accurately mined, the accuracy of the determined importance value of the session data can be improved, and the response speed of the session data with a high importance degree of the inquiry content can be increased.
[0043] In some embodiments of the present application, the response methods in step S103 include a first response method and a second response method, and the computing power used by the first response method and the computing power used by the second response method are different. When the response speed of the first response method is faster than the response speed of the second response method, the computing power used by the first response method can be greater than the computing power used by the second response method; when the response speed of the first response method is slower than the response speed of the second response method, the computing power used by the first response method can be less than the computing power used by the second response method.
[0044] In some implementations, the response priority of the first response method corresponding to the session data can be higher than the response priority of the second response method corresponding to the session data, or can be lower than the priority of the second response method corresponding to the session data. The higher the response priority, the faster the corresponding response speed.
[0045] It can be understood that, since the computing power used in the first response method and the second response method is different, a device for responding to session data can use different computing powers to respond to multiple session data, which can improve the performance of the device when the device computing power is limited.
[0046] In some embodiments of the present application, the session data includes multiple first keywords, and the word embedding model includes a keyword vector determination unit and a session category determination unit; the trained word embedding model is used to analyze and process the session data and historical session data to determine the importance value of the session data, that is, the above step S102 can be implemented by the following steps S1021 to S1024, and each step will be described separately below.
[0047] S1021. Determine the first historical keyword corresponding to the historical session data and the first user category information corresponding to the session data.
[0048] Here, the first keyword can be a keyword that helps to understand the semantics of the session data, and the first historical keyword can be a keyword that helps to understand the semantics of the historical session data. Both the first keyword and the first historical keyword can include characters, words, and sentences.
[0049] In some embodiments, models such as BERT can be used to extract the first keywords in the session data and the first historical keywords in the historical session data.
[0050] In some embodiments, the first user category information can be an identifier of the category of the user corresponding to the session data. The user can be an enterprise or an individual. For example, the user categories can be divided into large customers who have registered the intelligent session software, small customers who have registered the intelligent session software, and other users who have not registered the intelligent session software. The corresponding identifiers of the user categories can be represented by B, b, and C respectively. Among them, the division of large customers and small customers can be made according to factors such as the scale, popularity, and establishment duration of the enterprise. The description of the user categories and the identifiers of the user categories here is only exemplary, and the present application does not limit this.
[0051] In some embodiments, the first user category information can be determined according to the request source of the session data (such as the information of the device that sends the session data). If it is recognized that the user has previously registered information through the device corresponding to the session data request, the first user category corresponding to the session data can be further determined as a large customer or a small customer according to the registration information; alternatively, the first user category information corresponding to the session data can also be determined according to the user account logged in to the intelligent session software, etc. By matching the previously registered user accounts of the user account, detailed user registration information can be further obtained, so that the first user category can be determined as a large customer or a small customer according to the user registration information.
[0052] S1022. Input multiple first keywords, first historical keywords, and first user category information into the keyword vector determination unit to obtain the expression vectors of each first keyword.
[0053] In some embodiments, the expression vectors of each first keyword can be determined sequentially. The keyword vector determination unit can extract features from a specific first keyword, the first historical keywords related to the specific first keyword, and the first user category information to obtain the expression vector of the specific first keyword, and the specific first keyword can be any one of the multiple keywords.
[0054] S1023. Use the session category determination unit to analyze and process the expression vectors to obtain the target information corresponding to each first keyword.
[0055] Here, the target information can represent the main topic corresponding to the first keyword or the probability of the business category to which the first keyword belongs.
[0056] In some embodiments, the session category unit can analyze the information relevance inside the expression vector of the first keyword, that is, deeply understand the relevance between the session data, the historical session data, and the first user category information, so as to determine the target information corresponding to each first keyword in the session data.
[0057] S1024. Determine the importance value of the session data based on the target information.
[0058] In some embodiments, when the target information represents the main topic corresponding to the first keyword, the importance value of the session data can be determined according to the importance degree of the main topics corresponding to each first keyword; when the target information represents the probability of the business category to which the first keyword belongs, the importance value of the session data can be determined according to the probabilities of the business categories to which each first keyword belongs.
[0059] It can be understood that by inputting multiple first keywords of the session data, the first historical keywords of the historical session data corresponding to the session data, and the first user category information into the word vector determination unit to obtain the expression vectors corresponding to each first keyword, the session category determination unit can perceive the association information between the first historical keywords and the first user category information in the expression vectors and the corresponding first keyword, so as to more accurately determine the target information corresponding to the first keyword and improve the accuracy of the determined importance value of the session data.
[0060] In some embodiments of the present application, the target information includes the probability of the first keyword belonging to the first topic category; based on the target information, the importance value of the conversation data is determined, that is, the above step S1024 can be implemented by the following steps S10241 to step S10242, and each step will be described separately below.
[0061] S10241. Determine the importance value of each first keyword.
[0062] In some embodiments, the importance value of each first keyword can be determined in sequence, and the importance value of the first keyword can be determined according to the probability of the first keyword belonging to the first topic category.
[0063] In some embodiments, when there are multiple first topic categories (the number of first topic categories and the importance levels corresponding to different topics can be determined in advance), the probability of the first keyword belonging to the first topic category includes multiple, and the importance value of the first keyword can be determined based on the importance level of the first topic category corresponding to the maximum probability among the multiple probabilities.
[0064] S10242. Based on the importance value of each first keyword and the probability of each first topic category, determine the importance value corresponding to the conversation data.
[0065] In some embodiments, the importance value corresponding to the conversation data can be determined based on the importance value of each first keyword and the average value of the importance values of the first topic categories to which each first keyword belongs.
[0066] It can be understood that through the first keywords in the conversation data and the probability of the first keyword belonging to the first topic category, a refined analysis of the first topic category to which the conversation data belongs can be performed, thereby improving the accuracy of the determined importance value corresponding to the conversation data.
[0067] In some embodiments of the present application, the method may further include the following steps S104 to step S107, and each step will be described separately below.
[0068] S104. Determine the importance value of the similar conversation data corresponding to each of the multiple pieces of conversation data.
[0069] Here, the similar conversation data corresponding to the conversation data may be the conversation data whose similarity degree with the conversation data is greater than the similarity threshold, and the semantics expressed by the conversation data and the similar conversation data are the same.
[0070] In some embodiments, similar conversation data can be obtained through traditional manual means. For example, based on those skilled in the art's understanding of the semantics of the conversation data, the expression mode of the conversation data is changed, or some words in the conversation data are replaced with similar words to obtain similar conversation data. Similar conversation data can also be generated by an artificial intelligence model. For example, the similar conversation data corresponding to the conversation data automatically generated by models such as NLP.
[0071] In some embodiments, the method for determining the importance value of similar conversation data can be the same as that for determining the importance value of conversation data in the foregoing embodiments, and will not be elaborated here.
[0072] S105. Sort the importance values of the similar conversation data to obtain a first sorting result; and sort the importance values of multiple pieces of conversation data to obtain a second sorting result.
[0073] Here, in implementation, the importance values of the similar conversation data and the importance values of the conversation data can be sorted according to the magnitude of the importance values.
[0074] In some embodiments, there can be multiple pieces of similar conversation data corresponding to one piece of conversation data. The importance values of the similar conversation data corresponding to each piece of conversation data can be sorted to obtain candidate sorting results for the importance values of the similar conversation data corresponding to each piece of conversation data, and then the multiple candidate sortings are further sorted to obtain the first sorting result. It is also possible to directly sort the importance values of all the similar conversation data corresponding to multiple pieces of conversation data to directly obtain the first sorting result.
[0075] S106. Determine the target sorting result of the importance values of multiple pieces of conversation data according to the first sorting result and the second sorting result.
[0076] In some embodiments, the importance values of the conversation data can be further sorted according to the magnitudes of the importance values of the first sorting result and the second sorting result to determine the final sorting positions corresponding to each piece of conversation data, so as to obtain the target sorting result. For example, if conversation data A is in the second position in the second sorting result, then in combination with the importance value in the first sorting result, it is determined that conversation data A is finally in the fifth position in the target sorting result.
[0077] S107. Based on the target sorting result, determine the response mode corresponding to each piece of conversation data.
[0078] In some embodiments, the higher the response level, the faster the response speed, and the greater the computing power used for the conversation data corresponding to the importance value ranked higher. The response mode of the conversation data corresponding to each importance value in the target sorting result can be determined according to the type of the response mode.
[0079] Exemplarily, when the response modes include fast response, slow response, and no response, the response mode of the session data corresponding to the top 1 / 3 important values in the target sorting result can be determined as fast response, the response mode of the session data corresponding to the bottom 1 / 3 important values in the target sorting result can be determined as no response, and the response mode of the session data corresponding to the remaining important values in the target sorting result can be determined as slow response.
[0080] It can be understood that determining the target sorting result of the important values of the target session based on the first sorting result of the important values of the session data corresponding to the similar session data and the second sorting result of the important values of the session data can reduce the influence brought by random noise and the instability of the word embedding model, and improve the accuracy and robustness of the sorting result of the important values of the session data.
[0081] In some embodiments of the present application, the training method of the word embedding model can be implemented through the following steps S201 to S204, and each step will be described separately below.
[0082] S201. Obtain session data training samples.
[0083] Here, the session data training samples include session sample data and session sample labels. Among them, the session sample labels include the actual topic category to which the session sample data belongs, the actual user category to which the session sample data belongs, and the actual historical word vector corresponding to the session sample data.
[0084] In some embodiments, the session sample data may include the historical session data of the user obtained from the intelligent session software, or may include the session data obtained by replacing, deleting, correcting, etc. the historical session data through manual or intelligent models. The source of the session sample data here is only an exemplary illustration, and the present application does not make any limitations in this regard.
[0085] S202. Determine the second keyword of the session sample data, the initial user category information corresponding to the session sample data, and the initial historical keyword.
[0086] In some embodiments, the second keyword of the session sample data can be extracted through models such as BERT. The second keyword can be words, phrases, or sentences that help understand the semantics of the session sample data, and both the initial user category information and the initial historical keyword can be randomly generated.
[0087] S203. Input the second keyword, the initial user category information, and the initial historical keyword into the initial word embedding model to obtain the information of the second topic category, the second user category information, and the second historical keyword corresponding to the session sample data.
[0088] In some embodiments, the initial word embedding model can be an untrained or pre-trained word embedding model. The initial word embedding model can deeply understand the association relationship between the initial user category information and the initial historical keywords input to it and the second keywords in the conversation sample data, so as to determine the information of the second topic category corresponding to the conversation sample data, predict the initial user category to obtain the second user category information, and predict the initial historical keywords to obtain the second historical keywords.
[0089] S204. Based on the conversation sample label, the information of the second topic category, the second user category information, and the second historical keywords, perform backpropagation training on the initial word embedding model until the convergence condition is met, and obtain the trained word embedding model.
[0090] In some embodiments, the convergence condition being met can be that the prediction loss value of the initial word embedding model is less than the preset loss value. In implementation, we can compare the actual topic category of the conversation sample data in the conversation sample label with the information of the second topic type, compare the actual user category to which the conversation sample data belongs in the sample label with the second user category information, and compare the actual historical word vector corresponding to the conversation sample data in the sample label with the second historical keywords to determine the prediction loss value of the initial word embedding model. In the case where the prediction loss value is greater than or equal to the preset loss value, continue the training until the calculated prediction loss is greater than the preset loss value.
[0091] It can be understood that by performing backpropagation training on the initial word embedding model based on the conversation sample label, as well as the information of the second topic category, the second user category information, and the second historical keywords predicted by the initial word embedding model, the initial word embedding model can continuously learn the internal relationship between the user category, historical keywords, and topic category corresponding to the conversation data, thereby continuously improving the prediction accuracy of the initial word embedding model.
[0092] In some embodiments of the present application, the conversation sample label includes the actual topic category information, the actual user category information, and the actual historical keywords corresponding to the conversation sample data; based on the conversation sample label, the information of the second topic category, the second user category information, and the second historical keywords, perform backpropagation training on the initial word embedding model until the convergence condition is met, and obtain the trained word embedding model, that is, the above step S204 can be implemented through the following steps S2041 to S2043. The following will explain each step separately.
[0093] S2041. Establish a first loss function based on the actual topic category information and the information of the second topic category, a second loss function based on the actual user category information and the second user category information, and a third loss function based on the actual historical keywords and the second historical keywords.
[0094] In some embodiments, the first loss function may be a cross-entropy loss function determined based on the cross-entropy between the information of the actual topic category and the information of the second topic category, the second loss function may be a cross-entropy loss function determined based on the cross-entropy between the actual user category information and the second user category information, and the third loss function may be a mean squared error loss function determined based on the mean squared error between the actual historical keyword and the second historical keyword.
[0095] S2042. Establish a target loss function based on the first loss function, the second loss function, and the third loss function.
[0096] In some embodiments, the sum of the first loss function, the second loss function, and the third loss function may be determined as the target loss function, or the weights corresponding to the first loss function, the second loss function, and the third loss function may be determined first, and then the weighted sum of each loss function may be determined as the target loss function. For example, the weight of the first loss function A may be set to 0.5, and the weights corresponding to the second loss function B and the third loss function C may be set to 0.35 and 0.15 respectively. Then the target loss function D may be expressed as: D = 0.5A + 0.35B + 0.15C.
[0097] S2043. Perform backpropagation training on the initial word embedding model using the target loss function until the loss function value corresponding to the target loss function satisfies the first threshold condition, and obtain the trained word embedding model.
[0098] In some embodiments, the loss function value corresponding to the target loss function may be compared with a preset loss value to determine whether the loss function value is less than the preset loss value. If the loss function value is greater than or equal to the preset loss value, the initial word embedding model may be continuously trained based on the target loss function until the determined loss function value is less than the preset loss value. It can be considered that the target loss function value satisfies the first threshold condition, and the training process may be ended to obtain the trained word embedding model.
[0099] It can be understood that by establishing the first loss function based on the actual first topic category information and the second topic category information, the second loss function based on the actual user category information and the second user category information, and the third loss function based on the actual historical keyword and the second historical keyword, and training the initial word vector using the determined target loss function, the initial word vector can fully learn the user to which each session belongs and the historical session content of that user, thereby improving the accuracy of the meaning expression of the trained word embedding model.
[0100] In some embodiments of the present application, the second keyword for determining the session sample data in step S202 can be implemented through the following steps S2021 to S2024, and each step is described separately below.
[0101] S2021. Obtain the session data set corresponding to the session sample data.
[0102] Here, the session data set corresponding to the session sample data includes a set of multi-round conversation data corresponding to the session sample data. One round of conversation data may include a set of Q&A data or multiple sets of Q&A data.
[0103] In some embodiments, the session data set corresponding to each session sample data can be determined, thereby obtaining multiple session data sets. The session data sets corresponding to multiple session sample data may be completely different, that is, each session sample data belongs to the session data in different multi-round conversations; there may also be session sample data with the same session data set among multiple session sample data, that is, the session sample data with the same session data set belongs to different session data in the same multi-round conversation.
[0104] S2022. Determine the number of times the i-th reference keyword in the session sample data appears in the corresponding session data set, the number of session data sets where the i-th reference keyword is located, and the number of keywords in the session data set.
[0105] Here, the i-th reference keyword may be the i-th keyword in the session data sample, where i is greater than 0 and less than or equal to the total number of reference keywords. The number of session data sets where the i-th reference keyword is located may be the total number of times the i-th reference keyword appears in all session data sets (corresponding to the session sample), and the number of keywords in the session data set may be the total number of keywords included in all session data sets.
[0106] S2023. Based on the number of times the i-th reference keyword appears in the corresponding session data set, the number of session data sets where the i-th reference keyword is located, and the number of reference keywords in the session data set, determine the importance value of the i-th reference keyword.
[0107] In some embodiments, the first ratio of the number of times the i-th reference keyword appears in the corresponding session data set to the number of reference keywords in the session data set, and the second ratio of the number of session data sets to the number of times the i-th reference keyword appears in the corresponding session data set can be determined, and the importance value of the i-th reference keyword is determined based on the first ratio and the second ratio.
[0108] S2024. If the importance value meets the second threshold condition, determine the i-th reference keyword as the second keyword of the session sample data.
[0109] In some embodiments, the importance degree value satisfying the second threshold condition may be that the importance degree value is greater than or equal to a preset threshold. The preset threshold may be any value within the range of [0, 1] set in advance. For example, it may be 0.6, 0.7, 0.8, etc. When the importance degree value of the i-th keyword is greater than the preset threshold, the i-th keyword can be determined as the second keyword of the conversation sample data.
[0110] It can be understood that by determining the importance degree value of the i-th reference keyword based on the number of times the i-th reference keyword appears in the session dataset where it is located, the number of session datasets where the i-th reference keyword is located, and the number of reference keywords in the session dataset, and determining whether to determine the i-th reference keyword as the second keyword in the conversation sample data based on whether the importance degree value satisfies the second threshold condition, useless keywords can be filtered out and redundant information can be reduced, thereby improving the accuracy of the obtained second keywords.
[0111] In some embodiments of the present application, the method further includes the following steps S108 to S110, and each step will be described separately below.
[0112] S108. Determine the maximum importance degree value and the minimum importance degree value corresponding to each second keyword in the conversation sample data.
[0113] In some embodiments, the maximum value of the importance degree values of each second keyword in the conversation sample data can be determined as the maximum importance degree value, and the minimum value of the importance degree values of each second keyword in the conversation sample data can be determined as the minimum importance degree value.
[0114] S109. Based on the importance degree value, the maximum importance degree value, and the minimum importance degree value of the j-th second keyword in the conversation sample data, determine the importance degree coefficient of the j-th second keyword.
[0115] Here, j is greater than 0 and less than or equal to the total number of second keywords.
[0116] In some embodiments, the first difference between the importance degree value and the minimum importance degree value of the j-th second keyword in the conversation sample data, and the second difference between the maximum importance degree value and the minimum importance degree value can be determined, and the ratio of the first difference to the second difference can be determined as the importance degree coefficient of the j-th keyword.
[0117] S110. Use the importance degree coefficient to perform weighted processing on the vector of the j-th second keyword and the vector of the initial historical keyword to obtain a new vector of the j-th second keyword and a new initial historical keyword.
[0118] Here, the vector of the j-th second keyword can be the feature vector after feature extraction of the j-th keyword, and the vector of the initial historical keyword can be the feature vector after feature extraction of the initial historical keyword.
[0119] In some embodiments, the product of the importance coefficient and the vector of the j-th second keyword can be determined as the new vector of the j-th keyword, and the importance coefficient and the vector of the initial historical keyword can be determined as the new initial word vector.
[0120] S111. Use the new vector of the j-th second keyword and the new vector of the initial historical keyword to train the initial word embedding model until the convergence condition is met, and obtain the trained word embedding model.
[0121] In some embodiments, the initial word embedding model can understand the new j-th second keyword based on the vector of the initial historical keyword, so as to predict the information of the second topic category corresponding to the j-th second keyword.
[0122] It can be understood that by using the importance coefficient to weight the vector of the j-th second keyword and the vector of the initial historical keyword, the new vector of the j-th second keyword and the new vector of the initial historical keyword are obtained, so that both the weighted second keyword and the initial historical keyword include frequently occurring keywords. Therefore, in the process of training the initial word embedding model based on the weighted second keyword and the initial historical keyword, the robustness of the word embedding model can be improved.
[0123] In the embodiments of the present application, session data and the corresponding historical session data are obtained; the word embedding model is used to analyze and process the session data and the historical session data to determine the importance value of the session data; based on the importance value, the response method corresponding to the session data is determined; where the importance value represents the importance degree of the inquiry content corresponding to the session data. In this way, by inputting the historical session data corresponding to the session data into the word embedding model, the word embedding model can understand the content associated with the session data in the historical session data, so that the semantics of the session data can be more accurately mined, the accuracy of the determined importance value of the session data can be improved, and the response speed of the session data with a high importance degree of the inquiry content can be improved.
[0124] Next, the implementation process of the application embodiments in the actual application scenario will be introduced.
[0125] The present application provides a method for guaranteeing core services in a session intelligent agent, and this method is applied to the Portal session intelligent agent, as Figure 2 shown, this method includes:
[0126] S21. Configure parameters for different types of services, obtain service configuration information, and cache the service configuration information.
[0127] Here, parameter configuration includes the importance ranking of service types. For example, in seasonal configuration, the marketing season emphasizes registration services, the signing season emphasizes commitment services, the performance season emphasizes order services, and the empowerment season emphasizes training services. Parameter configuration can also include customer types and service types. Customer types include, for example, large customer B, small customer b, and non-registered user C, and can also include tourists (not logged in) and user types who are logged in but not bound to a service unit; service types can include the service types REL corresponding to service units for government and enterprise, the service types SMB corresponding to service units for small and medium-sized enterprises, and the service types CON corresponding to consumer service units.
[0128] S22. The core force calculation agent calculates the core force value (equivalent to the "importance value" in other embodiments) based on the service configuration information, historical service data, and real-time service data, and caches the calculated core force value and the corresponding service.
[0129] The core force value can indicate the importance or priority degree of the consulted service when the thread competes for resources, combined with the real-time service background. This value ranges from 0 to 1, with 0 being the lowest and 1 being the highest.
[0130] S23. Initialize the core force value of the configured service.
[0131] S24. Obtain multiple service sessions from the request reception desk.
[0132] Here, service sessions include core service sessions and other sessions.
[0133] S25. The core force calculation agent obtains multiple service sessions and determines the session types and corresponding core force values of different service sessions.
[0134] When a session request arrives, the session content is passed into the core force calculation agent, which can intelligently identify information such as the type of the session and the confidence level (the probability of the session belonging to a certain type).
[0135] S26. The Portal session agent determines the concurrent target service sessions and the response order of the target service sessions based on multiple core force values for intelligent scheduling.
[0136] S27. The LLM model processes the input target service session.
[0137] The intelligent scheduling module can sort all session contents, determine whether a session can obtain competing resources based on the sorting results. If resources are obtained, the target business session is input into the LLM model for an AI session; otherwise, the next round of competition is carried out until resources are obtained or a timeout occurs and a return is made. Through the intelligent sorting resource competition, requests that can obtain resources can get a streaming response immediately when the sorting is high.
[0138] S28. The LLM returns the processed intelligent session to the request reception desk.
[0139] After processing the requests with high scores in the intelligent sorting, a streaming response is returned to the requester, and requests that fail in the competition are prompted with user-friendly information.
[0140] The method for guaranteeing core services in the session agent provided by this application overcomes and solves the problem that when computing power is limited in a high-concurrency scenario, all computing power is applied to ensuring the current core session to empower the service, enabling the core business session to compete for GPU resources to the greatest extent.
[0141] This application provides an integrated prediction algorithm based on a hybrid loss function, which performs priority sorting on sessions by calculating the core strength. The algorithm is divided into the following three stages: information extraction and processing, word embedding model training, and core strength value calculation and sorting. The specific process is as follows: First, use the NER model to extract the key information of the session, and filter the key information based on the TF-IDF algorithm technology; then, design a hybrid loss function based on keywords, users, and historical dialogue information to train the word embedding model; finally, for each session information, use the generative model to generate k groups of similar sessions, obtain the session word vectors through the trained word embedding, and use an integrated method to determine the category, confidence, and integrated score of the original session and the similar sessions, and give the priority sorting of the session by calculating the core strength value.
[0142] Next, the implementation methods of information extraction and processing, word embedding model training, and core strength value calculation and sorting will be described separately:
[0143] I. Information Extraction and Processing
[0144] This application adopts the BERT-CRF method to utilize the information extraction and summarization capabilities of the bert model to obtain the keywords in the session. Due to the certain instability of the model, there may be some information redundancy in the information extracted by the NER model. Therefore, filtering the keywords by the Term Frequency-Inverse Document Frequency (TF-IDF) method (obtaining the word importance and normalizing the importance) can calculate the importance degree value V of the i-th keyword through formula (1)tf-idf :
[0145]
[0146] Among them, refers to the number of times the i-th reference keyword appears in the corresponding document (session dataset), refers to the total number of words in the document, N D refers to the total number of documents, refers to the number of documents containing the i-th keyword.
[0147] Furthermore, it is determined whether the calculated V tf-idf is greater than a preset threshold θ, and the keyword score W is calculated through the following formula (2):
[0148]
[0149] Among them, represents the weight of V tf-idf >θ, min(V tf-idf ) represents the minimum value among the importance values of all keywords, and max(V tf-idf ) represents the maximum value among the importance values of all keywords.
[0150] This method can find high-frequency words in a single document and assign higher weights, and can find general words such as modal particles and prepositions and assign lower weights. When V tf-idf is less than the threshold θ, the word is filtered out; when V tf-idf is greater than the threshold, the word is retained and the score is returned for subsequent model training. Through this method, useless keywords can be filtered out, information redundancy can be reduced, and the importance of each keyword can be obtained.
[0151] II. Word Embedding Model Training
[0152] A hybrid loss function is designed to train the word embedding Embedding model. Among them, the inputs include the current session content, user ID (a type of user, actually the user classification ID, and the user ID hereafter all refers to the user classification ID), and the user's historical keywords; the labels include the current session category, the user category to which the session belongs, and the user's historical word vectors.
[0153] For each session, first extract keywords, and then initialize the user ID, the current session keywords, and the historical keywords as input vectors, as shown in formula (3):
[0154]
[0155] Among them, C refers to vector concatenation, V ID refers to the user ID vector, Vw(E) Refers to the current session keyword vector after being weighted by V tf-idf Refers to the current session keyword vector after being weighted by V tf-idf Refers to the historical keyword vector after being weighted by V
[0156] After obtaining the model input, we use the MLP multi-layer perception structure and construct the loss of the user category to which the session belongs, User_loss, shown in Formula (4), the session category loss, Class_loss, shown in Formula (5), and the historical keyword vector loss, History_loss, shown in Formula (6):
[0157] User_loss = L Cross_Entropy (P ID , L ID ) (4);
[0158] Class_loss = L Cross_Entropy (P class , L class ) (5);
[0159] History_loss = L MSE (P i (E), L i (E)) (6);
[0160] Among them, P ID , L ID respectively represent the user ID predicted by Embedding and the true user ID, and P class , L class respectively represent the session category predicted by the Embedding model and the true session category, and P i (E), L i (E) respectively represent the historical keyword vector predicted by the Embedding model and the true user historical word vector.
[0161] Furthermore, through User_loss, Class_loss, and History_loss, the objective loss function Loss shown in Formula (7) is constructed to train the model:
[0162] Loss = λ1User_loss + λ2Class_loss + λ3History_loss (7);
[0163] Among them, λ1, λ2, and λ3 are the weights of User_loss, Class_loss, and History_loss respectively. λ1, λ2, and λ3 can be freely set according to the importance of the three loss functions. For example, λ1, λ2, and λ3 can be set to 0.4, 0.5, and 0.1 respectively.
[0164] In this embodiment, by using the training method combining cross-entropy loss and mean squared error, the Embedding model can not only express static semantic information, but also fully consider the user to which each session belongs, and combine the historical session content of the user to give a more accurate semantic expression.
[0165] III. Core Force Value Calculation and Sorting
[0166] To prevent the instability of single prediction, we obtain the final inference result through the method of multi-experiment integration. Assume there are n sessions. For each session, first use the hypertrophic model generative model to generate k similar sessions (equivalent to the "similar session data" in other embodiments). In this way, k + 1 experimental groups can be obtained, with n samples in each group. k is a hyperparameter (the default value of k is 3), which can be set according to the business scenario. When the calculation cost of the generative model is high or the real-time requirement of the business is high, it can be set to a smaller value; when the calculation accuracy requirement is high, it can be increased.
[0167] For each experimental group, we first calculate the core force value of each sample. The calculation process is as follows: Extract the keywords of each session, obtain the vector expression of each keyword through the Embedding model, determine the probability of the category to which it belongs, and give the core force value according to the category. Assume there are m keywords in the session. At this time, m groups of categories (C) and probabilities (P) can be obtained. Then, use formula (8) to calculate the core force value V of this conversation core :
[0168]
[0169] Among them, refers to the core force value of the category to which the i-th keyword belongs. This value is specified in advance according to the business and can be obtained by looking up a table. P represents the probability of the category to which the i-th keyword belongs. Through the above method, we can obtain n core force values from an experimental group, sort them, and obtain a set of sorting results. After that, use the same method to obtain the sorting results of other experimental groups.
[0170] Finally, integrate the sorting results of multiple groups (k + 1 groups, with n samples in each group) to obtain the final sorting result. The integration formula is as shown in formula (9):
[0171]
[0172] Here, Loc n refers to the position of the nth session after integration. The larger the value, the lower the priority of the session. S O refers to the nth original session, refers to k groups of similar sessions generated by the nth original session. L core (S i ) refers to the position of the similar sessions of the nth session in the i-th experimental group.
[0173] It can be understood that by sorting the core force values corresponding to the session data in an integrated manner, the influence brought by random noise and model instability can be reduced, and the accuracy and robustness of the sorting result can be greatly improved.
[0174] The embodiment of the present application uses an adaptive dynamic semantic expression to dynamically predict the core force value of a session according to the historical information of the session; incorporates the memory ability of the generative model to solve the long-distance dependence relationship of the text processing task; and integrates the sorting results by generating similar sessions, improving the accuracy and robustness of the model.
[0175] The present application also provides a session data processing device, Figure 3 which is a schematic diagram of the composition structure of a session data processing device provided by an embodiment of the present application. As Figure 3 shown, the session data processing device 30 includes:
[0176] A first acquisition module 31, configured to acquire session data and the corresponding historical session data of the session data;
[0177] A first analysis and processing module 32, configured to analyze and process the session data and the historical session data by using a word embedding model to determine the importance value of the session data;
[0178] A first determination module 33, configured to determine the response mode corresponding to the session data based on the importance value; wherein, the importance value represents the importance degree of the inquiry content corresponding to the session data.
[0179] In some embodiments, the session data includes a plurality of first keywords, and the word embedding model includes a keyword vector determination unit and a session category determination unit; the analysis and processing module is further configured to:
[0180] Determine the first historical keywords corresponding to the historical session data and the first user category information corresponding to the session data; input the multiple first keywords, the first historical keywords, and the first user category information into the keyword vector determination unit to obtain the expression vectors of the respective first keywords; use the session category determination unit to analyze and process the expression vectors to obtain the target information corresponding to each of the first keywords; based on the target information, determine the importance value of the session data.
[0181] In some embodiments, the target information includes the probability of the first topic category to which the corresponding first keyword belongs; the sub-processing module 32 is further configured to: determine the importance values of the respective first keywords; based on the importance values of the respective first keywords and the probabilities of the respective first topic categories, determine the importance value corresponding to the session data.
[0182] In some embodiments, the session data processing device 30 further includes:
[0183] A second determination module, configured to determine the importance values of the similar session data corresponding to the respective session data;
[0184] A sorting module, configured to sort the importance values of the similar session data to obtain a first sorting result; and sort the importance values of the respective session data to obtain a second sorting result;
[0185] A third determination module, configured to determine a target sorting result of the importance values of the respective session data according to the first sorting result and the second sorting result;
[0186] A fourth determination module, configured to determine the response mode corresponding to each session data based on the target sorting result.
[0187] In some embodiments, the response mode includes a first response mode and a second response mode, and the computing power used by the first response mode and the computing power used by the second response mode are different.
[0188] In some embodiments, the session data processing device 30 further includes:
[0189] A second acquisition module, configured to acquire a session data training sample; the session data training sample includes session sample data and session sample labels;
[0190] A fifth determination module, configured to determine the second keywords of the session sample data, the initial user category information and the initial historical keywords corresponding to the session sample data;
[0191] An information prediction module, configured to input the second keyword, the initial user category information, and the initial historical keyword into an initial word embedding model to obtain information of a second topic category, second user category information, and second historical keyword corresponding to the session sample data;
[0192] A first training module, configured to perform backpropagation training on the initial word embedding model based on the session sample label, the information of the second topic category, the second user category information, and the second historical keyword until a convergence condition is satisfied, to obtain the trained word embedding model.
[0193] In some embodiments, the session sample label includes actual topic category information, actual user category information, and actual historical keyword corresponding to the session sample data; the first training module is further configured to:
[0194] Establish a first loss function based on the actual first topic category information and the information of the second topic category, a second loss function based on the actual user category information and the second user category information, and a third loss function based on the actual historical keyword and the second historical keyword; establish an objective loss function based on the first loss function, the second loss function, and the third loss function; perform backpropagation training on the initial word embedding model using the objective loss function until the loss function value corresponding to the objective loss function satisfies a first threshold condition, to obtain the trained word embedding model.
[0195] In some embodiments, the fifth determination module is further configured to: obtain a session data set corresponding to the session sample data; determine the number of times the i-th reference keyword in the session sample data appears in the session data set where it is located, the number of session data sets where the i-th reference keyword is located, and the number of keywords in the session data set; i is greater than 0 and less than or equal to the total number of reference keywords; determine an importance degree value of the i-th reference keyword based on the number of times the i-th reference keyword appears in the session data set where it is located, the number of session data sets where the i-th reference keyword is located, and the number of reference keywords in the session data set; if the importance degree value satisfies a second threshold condition, determine the i-th reference keyword as the second keyword of the session sample data.
[0196] In some embodiments, the session data processing device 30 further includes:
[0197] A sixth determination module, configured to determine a maximum importance degree value and a minimum importance degree value corresponding to each second keyword in the session sample data;
[0198] A seventh determination module, configured to determine an importance coefficient of the j-th second keyword based on the importance value of the j-th second keyword in the session sample data, the maximum importance value, and the minimum importance value; j is greater than 0 and less than or equal to the total number of second keywords;
[0199] A weighted processing module, configured to perform weighted processing on the vector of the j-th second keyword and the vector of the initial historical keyword by using the importance coefficient to obtain a new vector of the j-th second keyword and a new vector of the initial historical keyword;
[0200] A second training module, configured to train the initial word embedding model by using the new vector of the j-th second keyword and the new vector of the initial historical keyword until the convergence condition is satisfied, to obtain the trained word embedding model.
[0201] It should be noted that the description of the session data processing device in the embodiments of the present application is similar to the description of the above method embodiments, and has similar beneficial effects to the method embodiments, so details are not described herein. For the technical details not disclosed in the embodiments of the present device, please refer to the description of the method embodiments of the present application for understanding.
[0202] It should be noted that in the embodiments of the present application, if the above session data processing method is implemented in the form of software function modules and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present application, in essence, or the part that contributes to the related solutions, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the methods of the various embodiments of the present application. The foregoing storage medium includes: various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disc that can store program codes. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.
[0203] Correspondingly, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the session data processing method provided in the above embodiments is implemented.
[0204] An embodiment of the present application further provides a session data processing device. Figure 4 The composition structure diagram of a session data processing device provided in an embodiment of the present application is as Figure 4As shown in the figure, the session data processing device 40 includes: a memory 41, a processor 42, a communication interface 43, and a communication bus 44. Among them, the memory 41 is used to store executable session data processing instructions; the processor 42 is used to execute the executable session data processing instructions stored in the memory to implement the session data processing method provided in the above embodiments.
[0205] The descriptions of the above embodiments of the session data processing device and the storage medium are similar to those of the above method embodiments, and have similar beneficial effects to those of the method embodiments. For the technical details not disclosed in the embodiments of the session data processing device and the storage medium of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0206] It should be noted that in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including at least one..." does not exclude the existence of additional identical elements in the process, method, article or device including that element.
[0207] In several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed with each other can be through some interfaces. The indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0208] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units; they can be located in one place or distributed to multiple network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0209] In addition, each functional unit in the embodiments of this application can be all integrated in one processing unit, or each unit can be separately used as a unit, or two or more units can be integrated in one unit; the above integrated units can be implemented in the form of hardware, or in the form of a combination of hardware and software functional units.
[0210] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps including those of the above method embodiments; and the foregoing storage medium includes: various media such as removable storage devices, ROMs, magnetic disks, or optical discs that can store program codes.
[0211] Alternatively, if the above integrated units of the present application are implemented in the form of software function modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solutions of the embodiments of the present application, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a product to execute all or part of the methods of the various embodiments of the present application. And the foregoing storage medium includes: various media such as removable storage devices, ROMs, magnetic disks, or optical discs that can store program codes.
[0212] The above are only the implementation manners of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, and all should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for processing session data, comprising: Obtaining session data and historical session data corresponding to the session data; Analyzing and processing the session data and the historical session data by using a word embedding model to determine an importance value of the session data; Determining a response mode corresponding to the session data based on the importance value; wherein the importance value represents the importance degree of an inquiry content corresponding to the session data.
2. The method according to claim 1, wherein the session data includes a plurality of first keywords, and the word embedding model includes a keyword vector determination unit and a session category determination unit; The analyzing and processing the session data and the historical session data by using the trained word embedding model to determine the importance value of the session data includes: Determining a first historical keyword corresponding to the historical session data and first user category information corresponding to the session data; Inputting the plurality of first keywords, the first historical keyword, and the first user category information into the keyword vector determination unit to obtain an expression vector of each first keyword; Analyzing and processing the expression vector by using the session category determination unit to obtain target information corresponding to each first keyword; Determining the importance value of the session data based on the target information.
3. The method according to claim 2, wherein the target information includes a probability of a first topic category to which a corresponding first keyword belongs; The determining the importance value of the session data based on the target information includes: Determining the importance value of each first keyword; Determining the importance value corresponding to the session data based on the importance value of each first keyword and the probability of each first topic category.
4. The method according to claim 1, further comprising: Determining the importance value of similar session data corresponding to each of a plurality of session data; Sorting the importance values of the similar session data to obtain a first sorting result; And sorting the importance values of the plurality of session data to obtain a second sorting result; Determining a target sorting result of the importance values of the plurality of session data according to the first sorting result and the second sorting result; Determining a response mode corresponding to each of the plurality of session data based on the target sorting result.
5. The method according to claim 1, wherein the response mode includes a first response mode and a second response mode, and the computing power used by the first response mode is different from the computing power used by the second response mode.
6. The training method of the word embedding model according to claim 1, comprising: Obtaining a session data training sample; the session data training sample includes session sample data and session sample labels; Determining a second keyword of the session sample data, initial user category information corresponding to the session sample data, and an initial historical keyword; Inputting the second keyword, the initial user category information, and the initial historical keyword into an initial word embedding model to obtain information of a second topic category, second user category information, and a second historical keyword corresponding to the session sample data; Based on the session sample tags, the information of the second topic category, the second user category information, and the second historical keywords, perform backpropagation training on the initial word embedding model until the convergence condition is met, and obtain the trained word embedding model.
7. The method according to claim 6, wherein the session sample tags include the actual topic category information, the actual user category information, and the actual historical keywords corresponding to the session sample data; The performing backpropagation training on the initial word embedding model based on the session sample tags, the information of the second topic category, the second user category information, and the second historical keywords until the convergence condition is met, and obtaining the trained word embedding model includes: Establish a first loss function based on the actual first topic category information and the information of the second topic category, a second loss function based on the actual user category information and the second user category information, and a third loss function based on the actual historical keywords and the second historical keywords; Based on the first loss function, the second loss function, and the third loss function, establish an objective loss function; Use the objective loss function to perform backpropagation training on the initial word embedding model until the loss function value corresponding to the objective loss function meets the first threshold condition, and obtain the trained word embedding model.
8. The method according to claim 6, wherein the determining the second keyword of the session sample data includes: Obtain the session data set corresponding to the session sample data; Determine the number of times the i-th reference keyword in the session sample data appears in the session data set where it is located, the number of session data sets where the i-th reference keyword is located, and the number of keywords in the session data set; i is greater than 0 and less than or equal to the total number of reference keywords; Based on the number of times the i-th reference keyword appears in the session data set where it is located, the number of session data sets where the i-th reference keyword is located, and the number of reference keywords in the session data set, determine the importance value of the i-th reference keyword; If the importance value meets the second threshold condition, determine the i-th reference keyword as the second keyword of the session sample data.
9. The method according to claim 8, further comprising: Determine the maximum importance value and the minimum importance value corresponding to each second keyword in the session sample data; Based on the importance value of the j-th second keyword in the session sample data, the maximum importance value, and the minimum importance value, determine the importance coefficient of the j-th second keyword; j is greater than 0 and less than or equal to the total number of second keywords; Use the importance coefficient to perform weighted processing on the vector of the j-th second keyword and the vector of the initial historical keyword, and obtain a new vector of the j-th second keyword and a new vector of the initial historical keyword; The initial word embedding model is trained using the vector of the new j-th second keyword and the vector of the new initial historical keyword until the convergence condition is satisfied, and the trained word embedding model is obtained.
10. A session data processing device, comprising: A first acquisition module, configured to acquire session data and historical session data corresponding to the session data; A first analysis and processing module, configured to analyze and process the session data and the historical session data by using a word embedding model to determine an importance value of the session data; A first determination module, configured to determine a response mode corresponding to the session data based on the importance value; wherein the importance value represents the importance degree of an inquiry content corresponding to the session data.