CN114036959A - Method, apparatus, computer program product and storage medium for determining a context of a conversation - Google Patents

Method, apparatus, computer program product and storage medium for determining a context of a conversation Download PDF

Info

Publication number
CN114036959A
CN114036959A CN202111414855.5A CN202111414855A CN114036959A CN 114036959 A CN114036959 A CN 114036959A CN 202111414855 A CN202111414855 A CN 202111414855A CN 114036959 A CN114036959 A CN 114036959A
Authority
CN
China
Prior art keywords
context
contexts
text
target
session
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111414855.5A
Other languages
Chinese (zh)
Inventor
武晓飞
冯伟
王文彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Fangjianghu Technology Co Ltd
Original Assignee
Beijing Fangjianghu Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Fangjianghu Technology Co Ltd filed Critical Beijing Fangjianghu Technology Co Ltd
Priority to CN202111414855.5A priority Critical patent/CN114036959A/en
Publication of CN114036959A publication Critical patent/CN114036959A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • G06F40/35Discourse or dialogue representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3346Query execution using probabilistic model
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/258Heading extraction; Automatic titling; Numbering

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Probability & Statistics with Applications (AREA)
  • Machine Translation (AREA)

Abstract

The embodiment of the disclosure discloses a method, a device, a computer program product and a storage medium for determining a session context, wherein the determining method comprises the following steps: acquiring a target session text; and performing context segmentation on the target session text through a session context segmentation model to obtain a plurality of contexts of the target session text. The embodiment of the disclosure can quickly and reasonably determine the context in the target conversation text.

Description

Method, apparatus, computer program product and storage medium for determining a context of a conversation
Technical Field
The disclosed embodiments relate to a method, an apparatus, a computer program product and a storage medium for determining a session context.
Background
In the application of intelligent assistants, the common situation is in the form of a question and answer. The form of asking one answer means that when a user asks a question, the intelligent assistant gives a corresponding answer, and when the user asks a new question again, the intelligent assistant answers according to the new question. During the whole chat process between the two parties of the conversation, the subjects of the chat are usually dispersed throughout the conversation, and the conversion between the subjects is uncertain.
The intelligent assistant usually adopts a question-and-answer mode, and when the conversation topics are scattered, the conversation context is difficult to reasonably determine. For example, when a user interacts with an intelligent assistant, the topic of the conversation in the educational context may be dispersed throughout the conversation, such as when the user first asks questions about the primary school topic in the educational context, then asks other questions not related to the educational context, and then asks questions about the secondary school topic in the educational context. How to reasonably determine the conversation context under the condition that the topics are not fixed is a problem to be solved urgently.
Disclosure of Invention
The embodiment of the disclosure provides a method, a device, a computer program product and a storage medium for determining a conversation context, which can reasonably determine the conversation context under the condition that themes are not fixed.
In a first aspect of the embodiments of the present disclosure, a method for determining a session context is provided, including:
acquiring a target session text;
and performing context segmentation on the target session text through a session context segmentation model to obtain a plurality of contexts of the target session text, wherein the session context segmentation model is obtained by training according to a sample session text, and the sample session text comprises a plurality of subjects and a plurality of context labels aiming at the plurality of subjects.
According to an embodiment of the present disclosure, before the obtaining the target session text, the method further includes:
acquiring the sample session text;
determining the plurality of topics corresponding to a plurality of sentences in the sample conversation text;
obtaining the plurality of context labels for the plurality of topics;
model training is carried out on the sample conversation text based on the multiple subjects and the multiple context label training, and the conversation context segmentation model is obtained.
According to an embodiment of the present disclosure, the determining the plurality of topics corresponding to the multiple sentences in the sample conversation text includes:
the position of the target object in the sample conversation text is detected;
removing text content before the position where the target object appears in the sample conversation text to obtain a training text;
and determining the plurality of topics corresponding to the plurality of sentences in the training text.
According to an embodiment of the present disclosure, after the performing context segmentation on the target conversational text through a conversational context segmentation model to obtain a plurality of contexts of the target conversational text, the method further includes:
obtaining topic distribution information of the plurality of contexts;
determining transition probabilities between contexts of the plurality of contexts based on the topic distribution information of the plurality of contexts.
According to an embodiment of the present disclosure, the determining a transition probability between contexts of the plurality of contexts based on the topic distribution information of the plurality of contexts includes:
acquiring a first context comprising a target subject in the plurality of contexts, and acquiring a second context comprising the target subject in the plurality of contexts;
obtaining topic distribution information of the target topic in the first context, and obtaining topic distribution information of the target topic in the second context;
determining a transition probability between the first context and the second context based on the topic distribution information for the target topic in the first context and the topic distribution information for the target topic in the second context.
According to an embodiment of the present disclosure, after the determining transition probabilities between the contexts of the plurality of contexts based on the topic distribution information of the plurality of contexts, the method further includes:
normalizing the transition probabilities between contexts of the plurality of contexts.
According to an embodiment of the present disclosure, after the determining transition probabilities between the contexts of the plurality of contexts based on the topic distribution information of the plurality of contexts, the method further includes:
generating a state transition table between contexts of the plurality of contexts based on transition probabilities between contexts of the plurality of contexts.
In a second aspect of the embodiments of the present disclosure, an apparatus for determining a session context is provided, including:
the acquisition module is used for acquiring a target session text;
the context determination module is used for performing context segmentation on the target session text through a session context segmentation model to obtain a plurality of contexts of the target session text, wherein the session context segmentation model is obtained by training according to a sample session text, and the sample session text comprises a plurality of themes and a plurality of context labels aiming at the themes.
According to an embodiment of the present disclosure, the apparatus for determining a session context further includes:
the model training module is used for acquiring the sample conversation text and determining the plurality of topics corresponding to the plurality of sentences in the sample conversation text; the model training module is further configured to obtain the plurality of context labels for the plurality of topics, and further perform model training on the sample session text based on the plurality of topics and the plurality of context label training to obtain the session context segmentation model.
According to one embodiment of the disclosure, the model training module is configured to obtain a position where a target object in the sample session text appears; the model training module is further used for removing 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 further used for determining the plurality of topics corresponding to the plurality of sentences in the training text.
According to an embodiment of the present disclosure, the apparatus for determining a session context further includes:
a transition probability determination module, configured to obtain the topic distribution information of the multiple contexts, and further determine transition probabilities between the contexts of the multiple contexts based on the topic distribution information of the multiple contexts.
According to one embodiment of the disclosure, the transition probability determination module is configured to obtain a first context including a target topic in the plurality of contexts, and obtain a second context including the target topic in the plurality of contexts; the transition probability determination module is further configured to 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; the transition probability determination module is further configured to 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.
According to an embodiment of the present disclosure, the apparatus for determining a session context further includes:
a normalization processing module for normalizing transition probabilities between contexts of the plurality of contexts.
According to an embodiment of the present disclosure, the apparatus for determining a session context further includes:
a state transition table determination module to generate a state transition table between contexts of the plurality of contexts based on transition probabilities between contexts of the plurality of contexts.
In a third aspect of embodiments of the present disclosure, a computer program product is provided, which includes a computer program/instruction, when executed by a processor, to implement the method for determining a session context according to the first aspect.
A fourth aspect of the embodiments of the present disclosure provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the method for determining a session context according to the first aspect.
In a fifth aspect of the embodiments of the present disclosure, there is provided an electronic device, including:
a memory for storing a computer program;
a processor for executing the computer program stored in the memory, and the computer program, when executed, implements the method for determining a session context of the first aspect of the disclosure.
According to the conversation context determining method, the conversation context determining device, the computer program product and the storage medium, the conversation context segmentation model is trained according to the multiple subjects and the multiple context labels aiming at the multiple subjects in the sample conversation text, after the target conversation text is obtained, the context in the target conversation text can be determined rapidly and reasonably through the conversation context segmentation model, and therefore the determination of the specific intention of the user in the target conversation text is assisted according to the determined context.
The technical solution of the present disclosure is further described in detail by the accompanying drawings and examples.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description, serve to explain the principles of the disclosure.
The present disclosure may be more clearly understood from the following detailed description, taken with reference to the accompanying drawings, in which:
fig. 1 is a flowchart illustrating a method for determining a session context according to an embodiment of the disclosure;
FIG. 2 is a diagram of a sample conversation text in one example of the present disclosure;
FIG. 3 is a schematic diagram of obtaining partial context and topic distribution information based on a conversation text in one example of the present disclosure;
fig. 4 is a block diagram of a device for determining a context of a conversation according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an embodiment of an electronic device according to the present disclosure.
Detailed Description
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 the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.
It will be understood by those of skill in the art that the terms "first," "second," and the like in the embodiments of the present disclosure are used merely to distinguish one element from another, and are not intended to imply any particular technical meaning, nor is the necessary logical order between them.
It is also understood that in embodiments of the present disclosure, "a plurality" may refer to two or more and "at least one" may refer to one, two or more.
It is also to be understood that any reference to any component, data, or structure in the embodiments of the disclosure, may be generally understood as one or more, unless explicitly defined otherwise or stated otherwise.
In addition, the term "and/or" in the present disclosure is only one kind of association relationship describing an associated object, and means that three kinds of relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" in the present disclosure generally indicates that the former and latter associated objects are in an "or" relationship.
It should also be understood that the description of the various embodiments of the present disclosure emphasizes the differences between the various embodiments, and the same or similar parts may be referred to each other, so that the descriptions thereof are omitted for brevity.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
The disclosed embodiments may be applied to electronic devices such as terminal devices, computer systems, servers, etc., which are operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well known terminal devices, computing systems, environments, and/or configurations that may be suitable for use with electronic devices, such as terminal devices, computer systems, servers, and the like, include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, networked personal computers, minicomputer systems, mainframe computer systems, distributed cloud computing environments that include any of the above, and the like.
Electronic devices such as terminal devices, computer systems, servers, etc. may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer system/server may be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.
Fig. 1 is a flowchart illustrating a method for determining a session context according to an embodiment of the disclosure. As shown in fig. 1, a method for determining a session context according to an embodiment of the present disclosure includes:
s1: and acquiring a target session text.
In an example of the present disclosure, the target conversation text is a text obtained by performing an online conversation between the user and the staff and performing conversation content. For example, after a user sees a set of interested houses on a certain transaction website, the user performs online conversation with a worker through an online communication channel provided by a detail page of the house (for example, a worker ID is specified in an online communication tool or other online communication software provided by the transaction), and then generates a target conversation text.
The target session text used in the present disclosure is obtained by a method including, but not limited to, a target session text provided by a user. In the disclosed embodiment, the target session text and the sample session text are both text information that is authorized by the user and that can be used to improve the quality of service.
S2: and performing context segmentation on the target session text through the session context segmentation model to obtain a plurality of contexts of the target session text. The conversation context segmentation model is obtained by training according to a sample conversation text, and the sample conversation text comprises a plurality of subjects and a plurality of context labels aiming at the subjects.
Prior to step S2, a session context segmentation model for context partitioning of the session text may be trained on the sample session text. The sample conversation text is multiple, and each sample conversation text can comprise multiple subjects. Each sample conversation text has at least one context label by which the sample conversation text is labeled. For example, the sample conversation text a includes 30 sentences, of which the first 10 sentences are subjects of primary school and the last 20 sentences are subjects of middle school. Since the sample session text a is directed only to the education context, 30 sentences of the sample session text a correspond to the tags of the education context. In the disclosed embodiment, the intention of the user to ask a question is taken as a subject, for example, when the user asks a situation of elementary school information, the subject is elementary school. Further, in embodiments of the present disclosure, a context may include one or more topics, such as in a school context: the theme can be the theme of primary school, middle school, kindergarten, etc., and the collection of these themes is constructed as a context.
Fig. 2 is a diagram of a sample session text in one example of the present disclosure. In fig. 2, the numbers 1-15 within the circles represent the 1 st-15 th topics in the sample conversation text. Where topics 1-4 are labeled context 1, topics 5-8 are labeled context 2, topics 9-11 are labeled context 3, and topics 12-15 are labeled context 4. The theme under each context has a corresponding relationship with the context, for example, the context 1 is a surrounding supporting context, the theme 1 is a market, the theme 2 is a hospital, the theme 3 is a school, and the theme 4 is a cultural relic venue.
In this embodiment, the sample session text may be divided into a training set and a test set, the session context segmentation model is trained through the training set, the session context segmentation model is trained through the test set to be tested, parameters of the session context segmentation model are adjusted according to a deviation between a test result and a correct result, and when a preset iteration number is reached or the test result meets a preset requirement, a final session context segmentation model is obtained.
Optionally, the trained session context segmentation model may be a Conditional Random Field (CRF) model, and the precision of context segmentation is high.
In step S2, the target session text is input into the speaking context segmentation model, and a plurality of contexts of the target session text can be obtained.
In this embodiment, the conversation context segmentation model is trained according to a plurality of topics in the sample conversation text and a plurality of context labels for the plurality of topics, and after the target conversation text is obtained, the context in the target conversation text can be determined quickly and reasonably through the conversation context segmentation model, so that the determination of the specific intention of the user in the target conversation text is assisted according to the determined context.
In an embodiment of the present disclosure, before step S2, the method may further include:
a: sample session text is obtained.
For example, a part of the historical conversation text authorized by the user and stored in the server of a certain transaction website may be selected as the sample conversation text, for example, the conversation text which exceeds X sentences and includes a plurality of topics in the historical conversation text may be selected as the sample conversation text.
B: and determining a plurality of topics corresponding to the multiple sentences in the sample conversation text. For example, a plurality of topics included in the sample conversation text may be determined by means of natural language processing.
C: a plurality of context labels for a plurality of topics is obtained. Where context tags may be manually labeled.
D: model training is carried out on the sample conversation text based on the training of the multiple subjects and the multiple context labels, and a conversation context segmentation model is obtained.
In the embodiment, a conversation context segmentation model capable of accurately performing context division on the conversation text is trained on the sample conversation text.
In one embodiment of the present disclosure, step B comprises:
b-1: and acquiring the position of the target object in the sample conversation text.
For example, when the service person and the user communicate online for a specified house, the target object may be the specified house, that is, when the specified house appears in the conversation of the user or the service person, the location of the conversation content is the location where the target object appears.
B-2: and removing text content before the position where the target object appears in the sample conversation text to obtain a training text, for example, determining the text content before the target object appears as irrelevant content and filtering.
In one example of the present disclosure, the sample conversation text includes the following:
the user A: you are good.
And a user B: you are good.
……。
The user A: one wants to ask about the two rooms of cell a, … ….
In this example, the two rooms in cell a are targeted, and the sample conversation text located at "user a: one wants to ask about the two rooms of cell a, … …. "previous text content.
B-3: and determining a plurality of topics corresponding to the multiple sentences in the training text.
In the embodiment, before the session context segmentation model is performed, data filtering is performed on sample session data, and irrelevant data is removed, so that the model training efficiency is improved.
In an embodiment of the present disclosure, after step S2, the method further includes:
s3: topic distribution information for a plurality of contexts is obtained. Wherein the topic distribution information can include a number of each topic in the context in the corresponding context.
S4: transition probabilities between contexts of the plurality of contexts are determined based on the topic distribution information of the plurality of contexts.
In particular, between a plurality of contexts, transition probabilities of one context transforming into another context can be determined according to topics contained in the contexts.
In one example of the present disclosure, a school zone context and an environmental context are included in the target session text. The school district context comprises elementary school subjects, and the environment context also comprises elementary school subjects. When a user talks about a primary school theme in the context of a school district, the user sometimes talks about the influence of a nearby primary school on the environment, for example, whether the nearby primary school affects rest or travel of residents, thereby realizing the context transfer.
In the present embodiment, from the topic distribution information of the target session text in the school district context and the environment context, the number M of primary and secondary topics in the school district context is extracted, and the number N of primary and secondary topics in the environment context is extracted. The transition probability between the school district context and the environmental context can be determined according to the number M of the primary and secondary topics in the school district context and the number N of the primary and secondary topics in the environmental context.
In the embodiment, the transition probability among the contexts of the multiple contexts can be reasonably determined according to the topic distribution information of the multiple contexts in the target conversation text, and then after a certain context in the target conversation text is determined, the context possibly related to the next problem proposed by the user is determined based on the transition probability among the contexts of the multiple contexts, so that the intention of the user is known to effectively communicate, and the satisfaction degree of the user is improved.
In one embodiment of the present disclosure, step S4 includes:
s4-1: a first context including a target topic is obtained in a plurality of contexts, and a second context including the target topic is obtained in the plurality of contexts.
FIG. 3 is a diagram illustrating obtaining partial context and topic distribution information based on the session text in one example of the present disclosure. As shown in fig. 3, context 1 can be considered a first context, context 4 can be considered a second context, and topic 4 can be considered a target topic. Context 1 and context 4 each include a topic 4.
S4-2: topic distribution information of a target topic in a first context is obtained, and topic distribution information of the target topic in a second context is obtained.
With continued reference to fig. 3, the topic distribution information of the topic 4 in the context 1 is n4, and the topic distribution information of the topic 4 in the context 4 is n 5.
S4-3: 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, a transition probability between the first context and the second context is determined.
The transition probability p between context 1 and context 4 can be determined in the following way1,4
Figure BDA0003374878870000111
In the embodiment, the transition probability between contexts can be calculated quickly and reasonably aiming at different contexts comprising the same theme, the transition probability between contexts is provided for workers, and the workers can know other contexts that the users possibly talk to after the users talk to a certain context in a communication scene, so that the workers and the users can be assisted to effectively communicate, and the user experience is improved.
In an embodiment of the present disclosure, after step S4, the method further includes:
S5-A: normalizing the transition probabilities between contexts of the plurality of contexts, for example by:
Figure BDA0003374878870000112
wherein p isi,jRepresents the transition probability, Σ, of a transition from context i to context jjpi,jTo representFrom pi,1To pi,jMake a summation, qi,jThe probability after the normalization process is expressed for transition from context i to context j.
In the embodiment, by normalizing the transition probabilities among the contexts, the normalized transition probabilities can be used for assisting in further analyzing the target dialog text.
In an embodiment of the present disclosure, after step S4, the method further includes:
S5-B: a state transition table between contexts of the plurality of contexts is generated based on transition probabilities between contexts of the plurality of contexts.
In one example of the present disclosure, the target dialog text may include 5 contexts, each with a1、A2、A3、A4And A5By way of representation, the transition probabilities between 5 contexts can be shown in table 1.
Context(s) A1 A2 A3 A4 A5
A1 P1,1 P1,2 P1,3 P1,4 P1,5
A2 P2,1 P2,2 P2,3 P2,4 P2,5
A3 P31 P3,2 P3,3 P3,4 P3,5
A4 P4,1 P4,2 P4,3 P4,4 P4,5
A5 P5,1 P5,2 P5,3 P5,4 P5,5
TABLE 1 State transition Table
In this embodiment, a state transition table between contexts of multiple contexts may be generated based on transition probabilities between contexts of multiple contexts, and the state transition table may be provided to a worker to assist the worker in analyzing a target user.
Fig. 4 is a block diagram of a device for determining a context of a conversation according to an embodiment of the present disclosure. As shown in fig. 4, the apparatus for determining a session context according to an embodiment of the present disclosure includes: an acquisition module 100 and a context determination module 200.
The obtaining module 100 is configured to obtain a target session text. The context determination module 200 is configured to perform context segmentation on the target session text through the session context segmentation model to obtain a plurality of contexts of the target session text. The conversation context segmentation model is obtained by training according to sample conversation text, and the sample conversation text comprises a plurality of subjects and one or more context labels aiming at the plurality of subjects.
In one embodiment of the present disclosure, the determining device of the session context further includes:
the model training module is used for acquiring a sample conversation text and determining a plurality of topics corresponding to a plurality of sentences in the sample conversation text; the model training module is further used for obtaining one or more context labels aiming at the multiple subjects, and then performing model training on the sample conversation text based on the multiple subjects and the multiple context labels to obtain a conversation context segmentation model.
In one embodiment of the present disclosure, the model training module is configured to obtain a location of an occurrence of a target object in the sample session text. The model training module is further used for removing 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 for determining a plurality of topics corresponding to the multiple sentences in the training text.
In one embodiment of the present disclosure, the determining device of the session context further includes:
and the transition probability determining module is used for acquiring the theme distribution information of the plurality of contexts and further determining the transition probability among the contexts of the plurality of contexts based on the theme distribution information of the plurality of contexts.
In one embodiment of the disclosure, the transition probability determination module is configured to obtain a first context including a target topic in a plurality of contexts and obtain a second context including the target topic in the plurality of contexts. The transition probability determination module is further configured to 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. The transition probability determination module is further configured to 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.
In one embodiment of the present disclosure, the determining device of the session context further includes:
and the normalization processing module is used for normalizing the transition probability among the contexts of the plurality of contexts.
According to an embodiment of the present disclosure, the apparatus for determining a context of a conversation further includes:
a state transition table determination module to generate a state transition table between contexts of the plurality of contexts based on transition probabilities between contexts of the plurality of contexts.
It should be noted that, the specific implementation of the apparatus for determining a session context in the embodiment of the present disclosure is similar to the specific implementation of the method for determining a session context in the embodiment of the present disclosure, and specific reference is specifically made to the description of the embodiment of the method for determining a session context, and in order to reduce redundancy, no further description is given.
In addition, an embodiment of the present disclosure also provides an electronic device, including:
a memory for storing a computer program;
a processor configured to execute the computer program stored in the memory, and when the computer program is executed, the method for determining a session context according to any of the above embodiments of the present disclosure is implemented.
Fig. 5 is a schematic structural diagram of an embodiment of an electronic device according to the present disclosure. As shown in fig. 5, the electronic device includes one or more processors and memory.
The processor may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
The memory may include one or more computer program products that 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), cache memory (cache), and/or the like. 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 executed by a processor to implement the above-described methods of determining a session context of the various embodiments of the present disclosure and/or other desired functionality.
In one example, the electronic device may further include: an input device and an output device, which are interconnected by a bus system and/or other form of connection mechanism (not shown).
The input device may also include, for example, a keyboard, a mouse, and the like.
The output device may output various information including the determined distance information, direction information, and the like to the outside. The output devices may include, for example, a display, speakers, a printer, and a communication network and remote output devices connected thereto, among others.
Of course, for simplicity, only some of the components of the electronic device relevant to the present disclosure are shown in fig. 5, omitting components such as buses, input/output interfaces, and the like. In addition, the electronic device may include any other suitable components, depending on the particular application.
In addition to the above methods, apparatuses and devices, embodiments of the present disclosure also disclose a computer program product comprising computer program instructions which, when executed by a processor, cause the processor to perform the steps in the method of determining a session context according to various embodiments of the present disclosure described in the above section of the present specification.
The computer program product may write program code for carrying out operations for embodiments of the present disclosure in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present disclosure also disclose a computer-readable storage medium having stored thereon computer program instructions which, when executed by a processor, cause the processor to perform the steps in the method of determining a session context according to various embodiments of the present disclosure described in the above section of the present specification.
The computer-readable storage medium may take any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
The foregoing describes the general principles of the present disclosure in conjunction with specific embodiments, however, it is noted that the advantages, effects, etc. mentioned in the present disclosure are merely examples and are not limiting, and they should not be considered essential to the various embodiments of the present disclosure. Furthermore, the foregoing disclosure of specific details is for the purpose of illustration and description and is not intended to be limiting, since the disclosure is not intended to be limited to the specific details so described.
In the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts in the embodiments are referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The block diagrams of devices, apparatuses, systems referred to in this disclosure are only given as illustrative examples and are not intended to require or imply that the connections, arrangements, configurations, etc. must be made in the manner shown in the block diagrams. These devices, apparatuses, devices, systems may be connected, arranged, configured in any manner, as will be appreciated by those skilled in the art. Words such as "including," "comprising," "having," and the like are open-ended words that mean "including, but not limited to," and are used interchangeably therewith. The words "or" and "as used herein mean, and are used interchangeably with, the word" and/or, "unless the context clearly dictates otherwise. The word "such as" is used herein to mean, and is used interchangeably with, the phrase "such as but not limited to".
The methods and apparatus of the present disclosure may be implemented in a number of ways. For example, the methods and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order for the steps of 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 specifically stated otherwise. Further, in some embodiments, the present disclosure may also be embodied as programs recorded in a recording medium, the programs including machine-readable instructions for implementing the methods according to the present disclosure. Thus, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
It is also noted that in the devices, apparatuses, and methods of the present disclosure, each component or step can be decomposed and/or recombined. These decompositions and/or recombinations are to be considered equivalents of the present disclosure.
The previous 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 generic principles defined herein may be applied to other aspects without departing from the scope of the disclosure. Thus, the present disclosure is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit embodiments of the disclosure to the form disclosed herein. While a number of example aspects and embodiments have been discussed above, those of skill in the art will recognize certain variations, modifications, alterations, additions and sub-combinations thereof.

Claims (10)

1. A method for determining a context of a conversation, comprising:
acquiring a target session text;
and performing context segmentation on the target session text through a session context segmentation model to obtain a plurality of contexts of the target session text, wherein the session context segmentation model is obtained by training according to a sample session text, and the sample session text comprises a plurality of subjects and one or more context labels aiming at the plurality of subjects.
2. The method for determining the context of a conversation according to claim 1, further comprising, before the obtaining the target conversation text:
acquiring the sample session text;
determining the plurality of topics corresponding to a plurality of sentences in the sample conversation text;
obtaining the one or more context labels for the plurality of topics;
model training is carried out on the sample conversation text based on the multiple subjects and the multiple context label training, and the conversation context segmentation model is obtained.
3. The method of determining a conversation context according to claim 2, wherein said determining the plurality of topics corresponding to a plurality of sentences in the sample conversation text comprises:
acquiring the position of the target object in the sample session text;
removing text content before the position where the target object appears in the sample conversation text to obtain a training text;
and determining the plurality of topics corresponding to the plurality of sentences in the training text.
4. The method according to claim 1, further comprising, after the context segmentation of the target conversational text by the conversational context segmentation model to obtain a plurality of contexts of the target conversational text:
obtaining topic distribution information of the plurality of contexts;
determining transition probabilities between contexts of the plurality of contexts based on the topic distribution information of the plurality of contexts.
5. The method according to claim 4, wherein determining transition probabilities between contexts of the plurality of contexts based on the topic distribution information of the plurality of contexts comprises:
acquiring a first context comprising a target subject in the plurality of contexts, and acquiring a second context comprising the target subject in the plurality of contexts;
obtaining topic distribution information of the target topic in the first context, and obtaining topic distribution information of the target topic in the second context;
determining a transition probability between the first context and the second context based on the topic distribution information for the target topic in the first context and the topic distribution information for the target topic in the second context.
6. The method according to claim 4, further comprising, after determining transition probabilities between contexts of the plurality of contexts based on the topic distribution information of the plurality of contexts:
normalizing the transition probabilities between contexts of the plurality of contexts.
7. The method according to claim 4, further comprising, after determining transition probabilities between contexts of the plurality of contexts based on the topic distribution information of the plurality of contexts:
generating a state transition table between contexts of the plurality of contexts based on transition probabilities between contexts of the plurality of contexts.
8. An apparatus for determining a context of a conversation, comprising:
the acquisition module is used for acquiring a target session text;
the context determination module is used for performing context segmentation on the target session text through a session context segmentation model to obtain a plurality of contexts of the target session text, wherein the session context segmentation model is obtained by training according to a sample session text, and the sample session text comprises a plurality of subjects and one or more context labels aiming at the plurality of subjects.
9. A computer program product comprising computer program/instructions, characterized in that the computer program/instructions, when executed by a processor, implement the method for determining a session context according to any of the preceding claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method for determining a session context according to any one of the claims 1 to 7.
CN202111414855.5A 2021-11-25 2021-11-25 Method, apparatus, computer program product and storage medium for determining a context of a conversation Pending CN114036959A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111414855.5A CN114036959A (en) 2021-11-25 2021-11-25 Method, apparatus, computer program product and storage medium for determining a context of a conversation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111414855.5A CN114036959A (en) 2021-11-25 2021-11-25 Method, apparatus, computer program product and storage medium for determining a context of a conversation

Publications (1)

Publication Number Publication Date
CN114036959A true CN114036959A (en) 2022-02-11

Family

ID=80145548

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111414855.5A Pending CN114036959A (en) 2021-11-25 2021-11-25 Method, apparatus, computer program product and storage medium for determining a context of a conversation

Country Status (1)

Country Link
CN (1) CN114036959A (en)

Similar Documents

Publication Publication Date Title
CN110555095B (en) Man-machine conversation method and device
US11954613B2 (en) Establishing a logical connection between an indirect utterance and a transaction
CN111552880B (en) Knowledge graph-based data processing method and device, medium and electronic equipment
WO2018033030A1 (en) Natural language library generation method and device
CN110704626B (en) Short text classification method and device
EP3617896A1 (en) Method and apparatus for intelligent response
US20210406913A1 (en) Metric-Driven User Clustering for Online Recommendations
CN112667805B (en) Work order category determining method, device, equipment and medium
CN110268472B (en) Detection mechanism for automated dialog system
CN110543550B (en) Method and device for automatically generating test questions
CN111090739A (en) Information processing method, information processing device, electronic device, and storage medium
CA3147634A1 (en) Method and apparatus for analyzing sales conversation based on voice recognition
US11531821B2 (en) Intent resolution for chatbot conversations with negation and coreferences
CN111639162A (en) Information interaction method and device, electronic equipment and storage medium
US11699435B2 (en) System and method to interpret natural language requests and handle natural language responses in conversation
US11688393B2 (en) Machine learning to propose actions in response to natural language questions
Glasser et al. Accessibility for deaf and hard of hearing users: Sign language conversational user interfaces
US20220215184A1 (en) Automatic evaluation of natural language text generated based on structured data
WO2021098397A1 (en) Data processing method, apparatus, and storage medium
CN113051389A (en) Knowledge pushing method and device
CN114036959A (en) Method, apparatus, computer program product and storage medium for determining a context of a conversation
CN111753062A (en) Method, device, equipment and medium for determining session response scheme
CN113360630B (en) Interactive information prompting method
CN114297390B (en) Aspect category identification method and system in long tail distribution scene
Dias et al. Chatbot for Government Examination using AI

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination