Method, device, computer program product and storage medium for determining conversation context

By training the conversation context segmentation model and applying it to the target conversation text, it solves the problem of scattered conversation topics and difficult to determine context in intelligent assistants, achieves reasonable segmentation of context and auxiliary recognition of user intentions, and improves the response of intelligent assistants. Accuracy and user experience.

CN114036959BActive Publication Date: 2025-01-24KE COM (BEIJING) TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111414855.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-25
Publication Date
2025-01-24
Estimated Expiration
2041-11-25

AI Technical Summary

Technical Problem

In smart assistant applications, conversation topics are scattered and difficult to determine context, especially when transitions between topics are uncertain.

Method used

Through training the discourse context segmentation model, use multiple themes and context tags in the sample session text, obtain the target session text and perform context, determine multiple context, and calculate the transfer between the context of the theme distribution information. Probability.

Benefits of technology

It achieves a reasonable determination of the conversation context when the topics are scattered, assists in the identification of user intentions, and improves the response accuracy and user experience of the intelligent assistant.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114036959B_ABST
    Figure CN114036959B_ABST
Patent Text Reader

Abstract

The disclosed embodiment discloses a method, device, computer program product and storage medium for determining a conversation context, wherein the determination method comprises: obtaining a target conversation text; performing context segmentation on the target conversation text by using a conversation context segmentation model to obtain multiple contexts of the target conversation text. The disclosed embodiment can quickly and reasonably determine the context in the target conversation text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to a method, device, computer program product, and storage medium for determining a conversation context. Background Art

[0002] In the application of intelligent assistants, the form of one question and one answer is usually adopted. Among them, the form of one question and one answer means that when the user asks a question, the intelligent assistant gives a corresponding answer. When the user asks a new question again, the intelligent assistant answers according to the new question. During the entire chat process between the two parties in the conversation, the topics of the chat are usually scattered throughout the conversation, and the transition between topics is also uncertain.

[0003] Smart assistants usually use a question-and-answer format. When the conversation topics are scattered, it is difficult to reasonably determine the conversation context. For example, when a user interacts with a smart assistant, the conversation topics in the educational context may be scattered throughout the conversation. For example, the user first asks a question about a primary school topic in the educational context, then asks other questions unrelated to the educational context, and then asks a question about a middle school topic in the educational context. How to reasonably determine the conversation context when the topics are not fixed is an urgent problem to be solved. Summary of the invention

[0004] The embodiments of the present disclosure provide a method, an apparatus, a computer program product, and a storage medium for determining a conversation context, which can reasonably determine a conversation context when topics are not fixed.

[0005] According to a first aspect of an embodiment of the present disclosure, a method for determining a conversation context is provided, comprising:

[0006] Get the target conversation text;

[0007] The target conversation text is context-segmented by a conversation context segmentation model to obtain multiple contexts of the target conversation text, wherein the conversation context segmentation model is trained based on sample conversation text, and the sample conversation text includes multiple topics and multiple context labels for the multiple topics.

[0008] According to an embodiment of the present disclosure, before acquiring the target conversation text, the method further includes:

[0009] Obtaining the sample conversation text;

[0010] Determining the multiple topics corresponding to the multiple sentences in the sample conversation text;

[0011] Obtaining the plurality of context tags for the plurality of topics;

[0012] Model training is performed on the sample conversation text based on the multiple topics and the multiple context label training to obtain the conversation context segmentation model.

[0013] According to an embodiment of the present disclosure, determining the multiple topics corresponding to the multiple sentences in the sample conversation text includes:

[0014] the location where the target object appears in the sample conversation text;

[0015] Removing the text content before the position where the target object appears in the sample conversation text to obtain a training text;

[0016] The multiple topics corresponding to the multiple sentences in the training text are determined.

[0017] According to an embodiment of the present disclosure, after performing context segmentation on the target conversation text by using the conversation context segmentation model to obtain multiple contexts of the target conversation text, the method further includes:

[0018] Obtaining topic distribution information of the multiple contexts;

[0019] Based on the topic distribution information of the plurality of contexts, transition probabilities between contexts of the plurality of contexts are determined.

[0020] According to an embodiment of the present disclosure, determining the transition probability between the contexts of the multiple contexts based on the topic distribution information of the multiple contexts includes:

[0021] Acquire a first context including a target topic from among the plurality of contexts, and acquire a second context including the target topic from among the plurality of contexts;

[0022] Acquire topic distribution information of the target topic in the first context, and acquire topic distribution information of the target topic in the second context;

[0023] Based on topic distribution information of the target topic in the first context and topic distribution information of the target topic in the second context, a transition probability between the first context and the second context is determined.

[0024] According to an embodiment of the present disclosure, after determining the transition probability between the contexts of the multiple contexts based on the topic distribution information of the multiple contexts, the method further includes:

[0025] The transition probabilities between the multiple contexts are normalized.

[0026] According to an embodiment of the present disclosure, after determining the transition probability between the contexts of the multiple contexts based on the topic distribution information of the multiple contexts, the method further includes:

[0027] Based on the transition probabilities between the contexts of the plurality of contexts, a state transition table between the contexts of the plurality of contexts is generated.

[0028] According to a second aspect of an embodiment of the present disclosure, a device for determining a conversation context is provided, including:

[0029] An acquisition module, used to acquire the target conversation text;

[0030] A context determination module is used to perform context segmentation on the target conversation text through a conversation context segmentation model to obtain multiple contexts of the target conversation text, wherein the conversation context segmentation model is trained based on sample conversation text, and the sample conversation text includes multiple topics and multiple context labels for the multiple topics.

[0031] According to an embodiment of the present disclosure, the apparatus for determining the conversation context further includes:

[0032] A model training module is used to obtain the sample conversation text and determine the multiple topics corresponding to multiple sentences in the sample conversation text; the model training module is also used to obtain the multiple context labels for the multiple topics, and then perform model training on the sample conversation text based on the multiple topics and the multiple context label training to obtain the conversation context segmentation model.

[0033] According to one embodiment of the present disclosure, the model training module is used to obtain the position where the target object appears in the sample conversation text; the model training module is also used to remove the text content before the position where the target object appears in the sample conversation text to obtain a training text; the model training module is also used to determine the multiple topics corresponding to multiple sentences in the training text.

[0034] According to an embodiment of the present disclosure, the apparatus for determining the conversation context further includes:

[0035] The transition probability determination module is used to obtain the topic distribution information of the multiple contexts, and then determine the transition probability between the contexts of the multiple contexts based on the topic distribution information of the multiple contexts.

[0036] According to one embodiment of the present disclosure, the transition probability determination module is used to obtain a first context including a target topic among the multiple contexts, and to obtain a second context including the target topic among the multiple contexts; the transition probability determination module is also used to obtain topic distribution information of the target topic in the first context, and to obtain topic distribution information of the target topic in the second context; the transition probability determination module is also used to determine the transition probability between the first context and the second context based on the topic distribution information of the target topic in the first context and the topic distribution information of the target topic in the second context.

[0037] According to an embodiment of the present disclosure, the apparatus for determining the conversation context further includes:

[0038] The normalization processing module is used to perform normalization processing on the transition probabilities between the contexts of the multiple contexts.

[0039] According to an embodiment of the present disclosure, the apparatus for determining the conversation context further includes:

[0040] The state transition table determination module is used to generate a state transition table between contexts of the multiple contexts based on the transition probabilities between contexts of the multiple contexts.

[0041] According to a third aspect of the embodiments of the present disclosure, a computer program product is provided, including a computer program / instruction, which, when executed by a processor, implements the method for determining a conversation context according to the first aspect.

[0042] A fourth aspect of the embodiments of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for determining the conversation context described in the first aspect above is implemented.

[0043] According to a fifth aspect of the embodiments of the present disclosure, an electronic device is provided, including:

[0044] Memory for storing computer programs;

[0045] The processor is used to execute the computer program stored in the memory, and when the computer program is executed, the method for determining the conversation context of the first aspect of the present disclosure is implemented.

[0046] The method, device, computer program product and storage medium for determining the conversation context of the embodiments of the present disclosure train a conversation context segmentation model based on multiple topics in a sample conversation text and multiple context labels for the multiple topics. After obtaining the target conversation text, the conversation context segmentation model can be used to quickly and reasonably determine the context in the target conversation text, so as to assist in determining the user's specific intention in the target conversation text based on the determined context.

[0047] The technical solution of the present disclosure is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The accompanying drawings, which constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0049] The present disclosure may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:

[0050] Figure 1 A flowchart of a method for determining a conversation context according to an embodiment of the present disclosure;

[0051] Figure 2 A schematic diagram of a sample conversation text in an example of the present disclosure;

[0052] Figure 3 A schematic diagram of obtaining partial context and topic distribution information based on a conversation text in an example of the present disclosure;

[0053] Figure 4 A structural block diagram of a device for determining a conversation context according to an embodiment of the present disclosure;

[0054] Figure 5 The figure is a schematic diagram of the structure of an application embodiment of the electronic device disclosed in the present invention. DETAILED DESCRIPTION

[0055] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present disclosure unless otherwise specifically stated.

[0056] Those skilled in the art can understand that the terms "first" and "second" in the embodiments of the present disclosure are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate the necessary logical order between them.

[0057] It should also be understood that in the embodiments of the present disclosure, “plurality” may refer to two or more than two, and “at least one” may refer to one, two, or more than two.

[0058] It should also be understood that any component, data or structure mentioned in the embodiments of the present disclosure can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.

[0059] In addition, the term "and / or" in the present disclosure is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present disclosure generally indicates that the associated objects before and after are in an "or" relationship.

[0060] It should also be understood that the description of the various embodiments in the present disclosure focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.

[0061] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.

[0062] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.

[0063] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.

[0064] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0065] The embodiments of the present disclosure can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, servers, etc. include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, etc.

[0066] Electronic devices such as terminal devices, computer systems, servers, etc. can be described in the general context of computer system executable instructions (such as program modules) executed by computer systems. Generally, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in a distributed cloud computing environment, where tasks are performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.

[0067] Figure 1 FIG. 1 is a flow chart of a method for determining a conversation context according to an embodiment of the present disclosure. Figure 1 As shown, the method for determining the conversation context of the embodiment of the present disclosure includes:

[0068] S1: Get the target conversation text.

[0069] In an example of the present disclosure, the target conversation text is the text obtained by the online conversation between the user and the staff. For example, after the user sees a house of interest on a certain transaction website, the user conducts an online conversation with the staff through the online communication channel provided on the details page of the house (such as the online communication tool provided by the transaction or the staff ID specified in other online communication software), and the target conversation text is generated.

[0070] The acquisition method of the target conversation text used in the present disclosure includes but is not limited to the target conversation text provided by the user. In the embodiment of the present disclosure, the target conversation text and the sample conversation text are both text information authorized by the user and can be used to improve the service quality.

[0071] S2: Perform context segmentation on the target conversation text through the conversation context segmentation model to obtain multiple contexts of the target conversation text. The conversation context segmentation model is trained based on sample conversation texts, and the sample conversation texts include multiple topics and multiple context labels for the multiple topics.

[0072] Before step S2, a conversation context segmentation model for contextual division of conversation texts can be trained for sample conversation texts. There are multiple sample conversation texts, and each sample conversation text can include multiple topics. Each sample conversation text has at least one context label, and the sample conversation text is annotated by at least one context label. For example, the sample conversation text A includes 30 sentences, of which the first 10 sentences are primary school topics and the last 20 sentences are middle school topics. Since the sample conversation text A is only for the educational context, the 30 sentences of the sample conversation text A correspond to the labels for setting the educational context. In the embodiment of the present disclosure, the intention of the user to ask a question is taken as a topic. For example, when the user asks about the situation of primary school information, the topic is primary school. In addition, in the embodiment of the present disclosure, a context can include one or more topics. For example, in the school context: the topics included can include primary school, middle school, kindergarten and other topics, and the collection of these topics is constructed as a context.

[0073] Figure 2 A schematic diagram of a sample conversation text in an example of the present disclosure. Figure 2 In the figure, the numbers 1-15 in the circle represent the 1st to 15th topics in the sample conversation text. Among them, topics 1-4 are marked as context 1, topics 5-8 are marked as context 2, topics 9-11 are marked as context 3, and topics 12-15 are marked as context 4. Among them, the topics in each context have a corresponding relationship with the context, for example, context 1 is the surrounding supporting context, topic 1 is the shopping mall, topic 2 is the hospital, topic 3 is the school, and topic 4 is the cultural and sports venue.

[0074] In this embodiment, the sample conversation text can be divided into a training set and a test set. The conversation context segmentation model is trained by the training set, and the trained conversation context segmentation model is tested by the test set. The parameters of the conversation context segmentation model are adjusted according to the deviation between the test result and the correct result. When the preset number of iterations is reached or the test result meets the preset requirements, the final conversation context segmentation model is obtained.

[0075] Optionally, the trained conversation context segmentation model may be a Conditional Random Fields (CRF) model, which has high accuracy in context segmentation.

[0076] In step S2, the target conversation text is input into the conversation context segmentation model, and multiple contexts of the target conversation text can be obtained.

[0077] In this embodiment, a conversation context segmentation model is trained based on multiple topics in a sample conversation text and multiple context labels for the multiple topics. After obtaining the target conversation text, the conversation context segmentation model can be used to quickly and reasonably determine the context in the target conversation text, so as to assist in determining the user's specific intention in the target conversation text based on the determined context.

[0078] In one embodiment of the present disclosure, before step S2, the following steps may also be included:

[0079] A: Get a sample conversation text.

[0080] Exemplarily, part of the historical conversation texts authorized by the user and stored in a server of a transaction website may be selected as sample conversation texts. For example, conversation texts with more than X sentences and including multiple topics in the historical conversation texts may be selected as sample conversation texts.

[0081] B: Determine multiple topics corresponding to multiple sentences in the sample conversation text. For example, multiple topics included in the sample conversation text may be determined by natural language processing.

[0082] C: Obtain multiple context labels for multiple topics, where the context labels can be manually annotated.

[0083] D: The model is trained on sample conversation texts based on multiple topics and multiple context labels to obtain a conversation context segmentation model.

[0084] In this embodiment, a conversation context segmentation model is trained based on sample conversation texts to accurately divide the contexts of the conversation texts.

[0085] In one embodiment of the present disclosure, step B includes:

[0086] B-1: Get the position where the target object appears in the sample conversation text.

[0087] Exemplarily, the target object may be specific information of a certain item. For example, when a service staff communicates with a user online regarding a designated house, the target object may be the designated house. That is, when the designated house appears in the conversation between the user or the service staff, the location of the conversation content is the location where the target object appears.

[0088] B-2: Remove the text content before the position where the target object appears in the sample conversation text to obtain the training text. For example, determine the text content before the target object appears as irrelevant content and filter it out.

[0089] In one example of the present disclosure, the sample conversation text includes the following:

[0090] User A: Hello.

[0091] User B: Hello.

[0092] …….

[0093] User A: I would like to ask about the two-bedroom apartment in Community A,…

[0094] In this example, the two-bedroom apartment in community A is taken as the target object, and the text content before "User A: I want to ask about the two-bedroom apartment in community A, ..." in the sample conversation text is removed.

[0095] B-3: Determine multiple topics corresponding to multiple sentences in the training text.

[0096] In this embodiment, before performing the conversation context segmentation model, the sample conversation data is filtered to remove irrelevant data, thereby improving the model training efficiency.

[0097] In one embodiment of the present disclosure, after step S2, the method further includes:

[0098] S3: Obtain topic distribution information of multiple contexts, wherein the topic distribution information may include the number of each topic in the context in the corresponding context.

[0099] S4: Determine the transition probability between the contexts of the multiple contexts based on the topic distribution information of the multiple contexts.

[0100] Specifically, it is possible to determine between multiple contexts, based on the topics contained in the contexts, the transition probability of one context being transformed into another context.

[0101] In one example of the present disclosure, the target conversation text includes a school district context and an environmental context. The school district context includes primary school topics, and the environmental context also includes primary school topics. When the user talks about the primary school topic in the school district context, sometimes he or she will talk about the impact of nearby primary schools on the environment, such as whether nearby primary schools will affect residents' rest or transportation, thereby achieving context transfer.

[0102] In this embodiment, the number M of primary and secondary school topics in the school district context is extracted from the topic distribution information of the target conversation text in the school district context and the environmental context, and the number N of primary and secondary school topics in the environmental context is extracted. The transition probability between the school district context and the environmental context can be determined based on the number M of primary and secondary school topics in the school district context and the number N of primary and secondary school topics in the environmental context.

[0103] In this embodiment, the transition probability between the multiple contexts can be reasonably determined based on the topic distribution information of the multiple contexts in the target conversation text. After determining a certain context in the target conversation text, the context that the user's next question may involve can be determined based on the transition probability between the multiple contexts. This can help understand the user's intention, communicate effectively, and improve user satisfaction.

[0104] In one embodiment of the present disclosure, step S4 includes:

[0105] S4-1: Obtain a first context including a target topic from among multiple contexts, and obtain a second context including the target topic from among multiple contexts.

[0106] Figure 3 This is a schematic diagram of obtaining partial context and topic distribution information based on conversation text in an example of the present disclosure. Figure 3 As shown, context 1 can be identified as the first context, context 4 can be identified as the second context, and topic 4 can be identified as the target topic. Both context 1 and context 4 include topic 4.

[0107] S4-2: Obtain topic distribution information of the target topic in the first context, and obtain topic distribution information of the target topic in the second context.

[0108] Please continue to refer to Figure 3 , the topic distribution information of topic 4 in context 1 is n4, and the topic distribution information of topic 4 in context 4 is n5.

[0109] S4-3: Determine a transition probability between the first context and the second context based on the topic distribution information of the target topic in the first context and the topic distribution information of the target topic in the second context.

[0110] The transition probability p between context 1 and context 4 can be determined as follows 1,4 :

[0111]

[0112] In this embodiment, the transition probability between contexts can be quickly and reasonably calculated for different contexts covering the same topic, and the transition probability between contexts can be provided to the staff. In the scenario of real-time communication, the staff can understand other contexts that the user may talk about after talking about a certain context, thereby assisting the staff to communicate effectively with the user and improving the user experience.

[0113] In one embodiment of the present disclosure, after step S4, the method further includes:

[0114] S5-A: Normalize the transition probabilities between the multiple contexts, for example, by using the following formula:

[0115]

[0116] Among them, p i,j represents the transition probability from context i to context j, ∑ j p i,j Indicates that from p i,1 to p i,j To sum, q i,j represents the normalized probability of transferring from context i to context j.

[0117] In this embodiment, by normalizing the transition probabilities between multiple contexts, the normalized transition probabilities can be used to assist in further analysis of the target dialogue text.

[0118] In one embodiment of the present disclosure, after step S4, the method further includes:

[0119] S5-B: Generate a state transition table between the contexts of the multiple contexts based on the transition probabilities between the contexts of the multiple contexts.

[0120] In an example of the present disclosure, the target dialogue text may include five contexts, which are represented by A1, A2, A3, A4 and A5 respectively. Then, Table 1 may be used to show the transition probabilities between the five contexts.

[0121] context <![CDATA[A1]]> <![CDATA[A2]]> <![CDATA[A3]]> <![CDATA[A4]]> <![CDATA[A5]]> <![CDATA[A1]]> <![CDATA[P 1,1 ]]> <![CDATA[P 1,2 ]]> <![CDATA[P 1,3 ]]> <![CDATA[P 1,4 ]]> <![CDATA[P 1,5 ]]> <![CDATA[A2]]> <![CDATA[P 2,1 ]]> <![CDATA[P 2,2 ]]> <![CDATA[P 2,3 ]]> <![CDATA[P 2,4 ]]> <![CDATA[P 2,5 ]]> <![CDATA[A3]]> <![CDATA[P 31 ]]> <![CDATA[P 3,2 ]]> <![CDATA[P 3,3 ]]> <![CDATA[P 3,4 ]]> <![CDATA[P 3,5 ]]> <![CDATA[A4]]> <![CDATA[P 4,1 ]]> <![CDATA[P 4,2 ]]> <![CDATA[P 4,3 ]]> <![CDATA[P 4,4 ]]> <![CDATA[P 4,5 ]]> <![CDATA[A5]]> <![CDATA[P 5,1 ]]> <![CDATA[P 5,2 ]]> <![CDATA[P 5,3 ]]> <![CDATA[P 5,4 ]]> <![CDATA[P 5,5 ]]>

[0122] Table 1 State transition table

[0123] In this embodiment, based on the transition probabilities between the contexts of the multiple contexts, a state transition table between the contexts of the multiple contexts can be generated, and the state transition table can be provided to the staff to assist the staff in analyzing the target user.

[0124] Figure 4 FIG. 4 is a structural block diagram of a device for determining a conversation context according to an embodiment of the present disclosure. Figure 4 As shown, the apparatus for determining a conversation context according to an embodiment of the present disclosure includes: an acquisition module 100 and a context determination module 200 .

[0125] The acquisition module 100 is used to acquire the target conversation text. The context determination module 200 is used to perform context segmentation on the target conversation text through a conversation context segmentation model to obtain multiple contexts of the target conversation text. The conversation context segmentation model is trained based on sample conversation texts, and the sample conversation texts include multiple topics and one or more context labels for the multiple topics.

[0126] In one embodiment of the present disclosure, the apparatus for determining the conversation context further includes:

[0127] The model training module is used to obtain sample conversation text and determine multiple topics corresponding to multiple sentences in the sample conversation text; the model training module is also used to obtain one or more context labels for multiple topics, and then perform model training on the sample conversation text based on multiple topics and multiple context label training to obtain a conversation context segmentation model.

[0128] In one embodiment of the present disclosure, the model training module is used to obtain the position where the target object appears in the sample conversation text. The model training module is also used to remove the text content before the position where the target object appears in the sample conversation text to obtain the training text. The model training module is also used to determine multiple topics corresponding to multiple sentences in the training text.

[0129] In one embodiment of the present disclosure, the apparatus for determining the conversation context further includes:

[0130] The transition probability determination module is used to obtain topic distribution information of multiple contexts, and then determine the transition probability between contexts of the multiple contexts based on the topic distribution information of the multiple contexts.

[0131] In one embodiment of the present disclosure, a transition probability determination module is used to obtain a first context including a target topic from among multiple contexts, and to obtain a second context including the target topic from among multiple contexts. The transition probability determination module is also used to obtain topic distribution information of the target topic in the first context, and to obtain topic distribution information of the target topic in the second context. The transition probability determination module is also used to determine the transition probability between the first context and the second context based on the topic distribution information of the target topic in the first context and the topic distribution information of the target topic in the second context.

[0132] In one embodiment of the present disclosure, the apparatus for determining the conversation context further includes:

[0133] The normalization processing module is used to perform normalization processing on the transition probabilities between the contexts of multiple contexts.

[0134] According to one embodiment of the present disclosure, the apparatus for determining a conversation context further includes:

[0135] The state transition table determination module is used to generate a state transition table between contexts of multiple contexts based on the transition probabilities between contexts of multiple contexts.

[0136] It should be noted that the specific implementation of the apparatus for determining a conversation context in the embodiment of the present disclosure is similar to the specific implementation of the method for determining a conversation context in the embodiment of the present disclosure. Please refer to the description of the embodiment of the method for determining a conversation context for details. In order to reduce redundancy, it will not be described in detail.

[0137] In addition, an embodiment of the present disclosure further provides an electronic device, including:

[0138] Memory for storing computer programs;

[0139] The processor is used to execute the computer program stored in the memory, and when the computer program is executed, the method for determining the conversation context described in any of the above embodiments of the present disclosure is implemented.

[0140] Figure 5 FIG. 1 is a schematic diagram of a structure of an application embodiment of the electronic device disclosed in the present invention. Figure 5 As shown, the electronic device includes one or more processors and memory.

[0141] The processor may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.

[0142] The memory may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor may execute the program instructions to implement the method for determining the conversation context of the various embodiments of the present disclosure described above and / or other desired functions.

[0143] In one example, the electronic device may further include: an input device and an output device, and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).

[0144] In addition, the input device may also include, for example, a keyboard, a mouse, and the like.

[0145] The output device can output various information to the outside, including the determined distance information, direction information, etc. The output device can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.

[0146] Of course, to simplify, Figure 5 Only some of the components related to the present disclosure in the electronic device are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device may further include any other appropriate components.

[0147] In addition to the above-mentioned methods, apparatuses and devices, an embodiment of the present disclosure also discloses a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the method for determining the conversation context according to various embodiments of the present disclosure described in the above part of this specification.

[0148] The computer program product may be written in any combination of one or more programming languages ​​to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0149] In addition, an embodiment of the present disclosure also discloses a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps of the method for determining the conversation context according to various embodiments of the present disclosure described in the above part of this specification.

[0150] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0151] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, etc., various media that can store program codes.

[0152] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.

[0153] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0154] The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including," "comprising," "having," and the like are open words, referring to "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or," and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.

[0155] The method and apparatus of the present disclosure may be implemented in many ways. For example, the method and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.

[0156] It should also be noted that in the apparatus, device and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.

[0157] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

[0158] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.

Claims

1. A method for determining a conversation context, characterized in that: include: Obtaining a target conversation text, wherein the target conversation text is a text obtained according to the conversation content of the online conversation between the user and the staff; Performing context segmentation on the target conversation text by using a conversation context segmentation model to obtain multiple contexts of the target conversation text, wherein the conversation context segmentation model is trained based on sample conversation texts, and the sample conversation texts include multiple topics and one or more context labels for the multiple topics; Acquire topic distribution information of the multiple contexts, wherein the topic distribution information includes the number of each topic in the multiple contexts in the corresponding context; Based on the topic distribution information of the multiple contexts, determining the transition probability between the contexts of the multiple contexts, including: based on the topic distribution information of the target topic in the first context and the topic distribution information of the target topic in the second context, determining the transition probability between the first context and the second context; wherein the multiple contexts include the first context and the second context.

2. The method for determining a conversation context according to claim 1, characterized in that: Before obtaining the target conversation text, the method further includes: Obtaining the sample conversation text; Determining the multiple topics corresponding to the multiple sentences in the sample conversation text; obtaining the one or more context tags for the plurality of topics; Model training is performed on the sample conversation text based on the multiple topics and the multiple context label training to obtain the conversation context segmentation model.

3. The method for determining a conversation context according to claim 2, characterized in that: The determining the multiple topics corresponding to the multiple sentences in the sample conversation text includes: Obtaining the position where the target object appears in the sample conversation text; Removing the text content before the position where the target object appears in the sample conversation text to obtain a training text; The multiple topics corresponding to the multiple sentences in the training text are determined.

4. The method for determining a conversation context according to claim 1, characterized in that: Before determining the transition probability between the first context and the second context based on the topic distribution information of the target topic in the first context and the topic distribution information of the target topic in the second context, the method further includes: Acquire the first context including the target subject from among the multiple contexts, and acquire the second context including the target subject from among the multiple contexts; The topic distribution information of the target topic in the first context is obtained, and the topic distribution information of the target topic in the second context is obtained.

5. The method for determining a conversation context according to claim 1, characterized in that: After determining the transition probabilities between the contexts of the multiple contexts based on the topic distribution information of the multiple contexts, the method further includes: The transition probabilities between the multiple contexts are normalized.

6. The method for determining a conversation context according to claim 1, characterized in that: After determining the transition probabilities between the contexts of the multiple contexts based on the topic distribution information of the multiple contexts, the method further includes: Based on the transition probabilities between the contexts of the plurality of contexts, a state transition table between the contexts of the plurality of contexts is generated.

7. A device for determining a conversation context, characterized in that: include: An acquisition module, used for acquiring a target conversation text, wherein the target conversation text is a text obtained according to the conversation content of an online conversation between a user and a staff member; A context determination module, configured to perform context segmentation on the target conversation text by using a conversation context segmentation model to obtain multiple contexts of the target conversation text, wherein the conversation context segmentation model is trained based on sample conversation texts, and the sample conversation texts include multiple topics and one or more context labels for the multiple topics; a transition probability determination module, configured to obtain topic distribution information of the multiple contexts, and then determine the transition probability between the contexts of the multiple contexts based on the topic distribution information of the multiple contexts, wherein the topic distribution information includes the number of each topic in the multiple contexts in the corresponding context; Among them, the transition probability determination module is used to determine the transition probability between the first context and the second context based on the topic distribution information of the target topic in the first context and the topic distribution information of the target topic in the second context; the multiple contexts include the first context and the second context.

8. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the method for determining the conversation context described in any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for determining a conversation context described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Training method and system of text classification model for spoken language interaction

    CN110765270A

  • Session context division method and system, interaction method and interaction system

    CN112463945A