CN115658858A - Dialog recommendation method based on artificial intelligence and related equipment - Google Patents

Dialog recommendation method based on artificial intelligence and related equipment Download PDF

Info

Publication number
CN115658858A
CN115658858A CN202211193054.5A CN202211193054A CN115658858A CN 115658858 A CN115658858 A CN 115658858A CN 202211193054 A CN202211193054 A CN 202211193054A CN 115658858 A CN115658858 A CN 115658858A
Authority
CN
China
Prior art keywords
content
preset
initial
dialog
conversation
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
CN202211193054.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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202211193054.5A priority Critical patent/CN115658858A/en
Publication of CN115658858A publication Critical patent/CN115658858A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Machine Translation (AREA)

Abstract

The application relates to an artificial intelligence technology, can be applied to medical scenes, and provides a dialog recommendation method, a device, computer equipment and a storage medium based on artificial intelligence, which comprises the following steps: obtaining conversation content; selecting a current theme corresponding to the conversation content from a preset theme set; determining a next theme corresponding to the current theme as a target theme corresponding to the dialog content; determining an initial candidate utterance set corresponding to the target subject, wherein the initial candidate utterance set comprises a plurality of initial candidate utterances; performing relevance matching on any initial candidate utterance in the initial candidate utterance set according to the conversation content to obtain a target candidate utterance; and recommending the target candidate utterance to a preset port. The application can improve the accuracy of conversation recommendation and promote the rapid development of the smart city.

Description

Dialog recommendation method based on artificial intelligence and related equipment
Technical Field
The application relates to the technical field of artificial intelligence, in particular to a dialogue recommendation method based on artificial intelligence and related equipment.
Background
With the development of information technology, information processing technology based on voice has been rapidly developed and has been widely used. In order to enable the conversation users (e.g., doctors, sales, customer service, etc.) to quickly engage in their work and improve work efficiency, many companies set corresponding dialogues for the conversation users so that the conversation users can answer with the corresponding dialogues when communicating with the users (e.g., patients, customers).
In the course of implementing the present application, the applicant has found that the following problems exist in the prior art: some dialogs at present are fixed in advance, the situations in an actual field dialog scene are complex and various, the preset dialogs cannot be covered comprehensively, and the accuracy of dialog recommendation is poor.
Therefore, it is necessary to provide a dialog recommendation method capable of improving the accuracy of dialog recommendation.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a dialog recommendation method and related apparatus based on artificial intelligence, which can improve the accuracy of dialog recommendation.
A first aspect of an embodiment of the present application provides a dialog recommendation method based on artificial intelligence, where the dialog recommendation method based on artificial intelligence includes:
obtaining conversation content;
selecting a current theme corresponding to the conversation content from a preset theme set;
determining that a next theme corresponding to the current theme is a target theme corresponding to the conversation content;
determining an initial candidate utterance set corresponding to the target subject, wherein the initial candidate utterance set comprises a plurality of initial candidate utterances;
performing relevance matching on any initial candidate utterance in the initial candidate utterance set according to the conversation content to obtain a target candidate utterance;
and recommending the target candidate utterance to a preset port.
Further, in the dialog recommendation method based on artificial intelligence provided in an embodiment of the present application, the selecting a current topic corresponding to the dialog content from a preset topic set includes:
performing labeling processing on the conversation content to obtain a plurality of labels corresponding to the conversation content to form a label set;
determining a preset theme corresponding to each label in the label set from a preset theme set;
determining the number of labels contained in the preset theme;
and selecting the preset theme with the maximum number of labels as the current theme corresponding to the conversation content.
Further, in the above dialog recommendation method based on artificial intelligence provided in an embodiment of the present application, the determining that the next topic corresponding to the current topic is the target topic corresponding to the dialog content includes:
determining a target conversation user corresponding to the conversation content;
determining dialog preference information of the target dialog user;
determining a sorting mode of preset topics in the preset topic set according to the conversation preference information;
and determining that the next theme corresponding to the current theme is the target theme according to the sorting mode.
Further, in the above artificial intelligence based dialog recommendation method provided in an embodiment of the present application, before the determining an initial candidate utterance set corresponding to the target topic, the method further includes:
acquiring a historical conversation content set;
determining a preset theme corresponding to each historical dialogue content in the historical dialogue content set from a preset theme set;
clustering analysis is carried out on the historical conversation content set by taking the preset topics as categories to obtain a plurality of initial historical conversation contents corresponding to the preset topics;
and preprocessing the initial historical conversation content to obtain a plurality of target historical conversation contents to form a candidate utterance set.
Further, in the above artificial intelligence based dialog recommendation method provided in an embodiment of the present application, the preprocessing the initial historical dialog content to obtain a plurality of target historical dialog contents, and forming a candidate utterance set, including:
vectorizing the initial historical dialogue contents respectively to obtain a plurality of initial historical dialogue content vectors to form an initial historical dialogue content vector set;
calculating a distance between a first initial historical dialog content vector and a second initial historical dialog content vector in the initial historical dialog content vector set;
detecting whether the distance exceeds a preset distance threshold;
when the detection result is that the distance exceeds the preset distance threshold, retaining first initial historical conversation content corresponding to the first initial historical conversation content vector and second initial historical conversation content corresponding to the second initial historical conversation content vector;
when the detection result is that the distance does not exceed the preset distance threshold, deleting first initial historical dialogue content corresponding to the first initial historical dialogue content vector or deleting second initial historical dialogue content corresponding to the second initial historical dialogue content vector;
and obtaining and combining a plurality of target historical conversation contents under the preset theme according to the detection result to obtain a candidate utterance set.
Further, in the above dialog recommendation method based on artificial intelligence provided by the embodiment of the present application, the determining an initial candidate utterance set corresponding to the target topic includes:
acquiring a preset mapping relation between a theme and a candidate utterance set;
and traversing the mapping relation to obtain an initial candidate utterance set corresponding to the target subject.
Further, in the above dialog recommendation method based on artificial intelligence provided by an embodiment of the present application, the performing correlation matching on any initial candidate utterance in the initial candidate utterance set according to the dialog content to obtain a target candidate utterance includes:
vectorizing the dialogue content to obtain a dialogue content vector;
vectorizing any initial candidate utterance in the initial candidate utterance set to obtain an initial candidate utterance vector;
inputting the dialogue content vector and the initial candidate utterance vector into a preset dialogue recall model to obtain a relevance score value;
and selecting the candidate utterance corresponding to the candidate utterance vector with the highest relevance score value as a target candidate utterance.
The second aspect of the embodiments of the present application further provides an artificial intelligence-based dialog recommendation apparatus, where the artificial intelligence-based dialog recommendation apparatus includes:
the conversation acquisition module is used for acquiring conversation contents;
the theme selection module is used for selecting a current theme corresponding to the conversation content from a preset theme set;
the theme determining module is used for determining that the next theme corresponding to the current theme is a target theme corresponding to the conversation content;
the utterance determining module is used for determining an initial candidate utterance set corresponding to the target subject, wherein the initial candidate utterance set comprises a plurality of initial candidate utterances;
the utterance matching module is used for performing relevance matching on any initial candidate utterance in the initial candidate utterance set according to the dialogue content to obtain a target candidate utterance;
and the utterance recommending module is used for recommending the target candidate utterance to a preset port.
A third aspect of embodiments of the present application further provides a computer device, which includes a processor, and the processor is configured to implement the artificial intelligence based dialog recommendation method according to any one of the above items when executing the computer program stored in the memory.
The fourth aspect of the embodiments of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when executed by a processor, the computer program implements the artificial intelligence based dialog recommendation method described in any one of the above.
According to the artificial intelligence based conversation recommendation method, the conversation recommendation device, the computer equipment and the computer readable storage medium, the current subject corresponding to the conversation content is selected from the preset subject set, the next subject corresponding to the current subject is determined to be the target subject corresponding to the conversation content, the candidate words under the target subject are determined to be the conversation recommendation, the conversation recommendation can be flexibly provided according to the conversation content, the conversation recommendation is prevented from being provided according to the fixed subject sequence, and the accuracy of the conversation recommendation can be improved; and when the embodiment of the application carries out conversation recommendation, carrying out correlation matching on any initial candidate utterance in the initial candidate utterance set according to the conversation content to obtain a target candidate utterance, ensuring the correlation degree of the candidate utterance and the conversation content, and further improving the accuracy of the conversation recommendation. The intelligent city dialogue recommendation system can be applied to various functional modules of intelligent cities such as intelligent government affairs and intelligent traffic, for example, the intelligent city dialogue recommendation module based on artificial intelligence can promote the rapid development of the intelligent city.
Drawings
Fig. 1 is a flowchart of an artificial intelligence based dialog recommendation method according to an embodiment of the present application.
Fig. 2 is a flowchart of a theme selection method according to an embodiment of the present application.
Fig. 3 is a flowchart of a theme determination method according to an embodiment of the present application.
Fig. 4 is a flowchart of a candidate utterance determination method provided in an embodiment of the present application.
Fig. 5 is a block diagram of an artificial intelligence based dialog recommendation device according to a second embodiment of the present application.
Fig. 6 is a schematic structural diagram of a computer device provided in the third embodiment of the present application.
The following detailed description will further illustrate the present application in conjunction with the above-described figures.
Detailed Description
In order that the above objects, features and advantages of the present application may be more clearly understood, a detailed description of the present application is given below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments and features of the embodiments of the present application may be combined with each other without conflict.
In the following description, numerous specific details are set forth to provide a thorough understanding of the present application, and the described embodiments are a part, but not all, of the present application.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence base technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
The dialog recommendation method based on artificial intelligence provided by the embodiment of the invention is executed by computer equipment, and accordingly, the dialog recommendation device based on artificial intelligence operates in the computer equipment. Fig. 1 is a flowchart of a dialog recommendation method based on artificial intelligence according to an embodiment of the present application. As shown in FIG. 1, the dialog recommendation method based on artificial intelligence can include the following steps, the sequence of the steps in the flowchart can be changed according to different requirements, and some steps can be omitted:
and S11, acquiring the conversation content.
In at least one embodiment of the present application, the dialog content may be a one-to-one, one-to-many, or many-to-one type of dialog, which is not limited herein. In the embodiment of the present application, the dialog content is in a one-to-one form, and the dialog content may be generated in an online dialog manner, for example, the user a communicates with the user B in a text or voice manner on a preset platform, the voice on the preset platform is converted into text, and the text content is collected as the dialog content according to the sequence of the dialog timestamps. The dialog content may also be generated in a offline dialog manner, for example, the user a communicates with the user B in a preset platform in a voice manner, the voice in the preset platform is collected, the collected voice is converted into text, and the text content is used as the dialog content. The application scenario of the dialog content is not limited, and for example, the dialog content may be applied to a scenario of a user and customer service, a scenario of a user and sales, and a medical scenario. The embodiment of the application takes a medical scene as an example, and the conversation content is inquiry content, which can include aspects such as inquiry of a disease condition, proposed diagnosis, discussion of medication, prescription making, discussion of development of a disease condition, life suggestion and answer of a patient's question.
Optionally, when the dialog content is an online dialog, the obtaining the dialog content includes:
when a conversation starting instruction is received, acquiring initial conversation content according to a preset time interval;
monitoring whether a speech form conversation exists in the initial conversation content;
and when the monitoring result shows that the voice form conversation exists in the initial conversation content, converting the voice form conversation into character form conversation to obtain conversation content.
The dialog start instruction is used to identify the start of the dialog content, and the dialog start instruction may be an instruction for issuing the first dialog content, an instruction for editing the software keyboard, or an instruction for inputting a voice, which is not limited herein. The preset time interval is a preset time interval for acquiring the dialog content, for example, the preset time interval may be 0 second (that is, the initial dialog content is acquired in real time), and 30 seconds. Converting speech form dialogue into text form dialogue is prior art and is not described herein.
Optionally, when the dialog content is an offline dialog, the obtaining the dialog content includes:
when a conversation starting instruction is received, acquiring initial conversation content according to a preset time interval, wherein the initial conversation content is a voice form conversation;
and converting the voice form conversation into a text form conversation to obtain conversation content.
And S12, selecting a current theme corresponding to the conversation content from a preset theme set.
In at least one embodiment of the present application, in a medical scenario, the preset topics include a plurality of preset topics, and the preset topics may be topics such as inquiry of a disease condition, planned diagnosis, discussion of medication, prescription, discussion of development of a disease condition, life advice, and answer to a patient's question. And the conversation contents are expanded according to the preset theme, and each section of the conversation contents has the corresponding preset theme. The preset theme may appear only once or many times during the inquiry process.
The flow of the current theme selection method is described with reference to fig. 2. Optionally, the selecting a current topic corresponding to the dialog content from a preset topic set includes:
s120, performing tagging processing on the conversation content to obtain a plurality of tags corresponding to the conversation content to form a tag set;
s121, determining a preset theme corresponding to each label in the label set from a preset theme set;
s122, determining the number of the labels contained in the preset theme;
and S123, selecting the preset theme with the largest number of labels as the current theme corresponding to the conversation content.
The conversation content comprises a plurality of preset theme keywords, the preset theme keywords are preset keywords with high correlation degree with the preset theme, the preset theme is taken as an illness condition inquiry as an example, and the preset theme keywords can be words such as 'illness condition', 'uncomfortable' and 'how good'. And taking the preset topic keywords as the labels of the conversation contents, and performing labeling processing on the conversation contents. The preset topic keywords are stored in a preset database, and the preset database can be a target node in a block chain in consideration of reliability and privacy of data storage.
The conversation content can be a one-sentence conversation or a multi-sentence conversation. In an embodiment, when the dialog content is a sentence content, that is, the dialog content includes a sentence of a dialog user a and a sentence of a dialog user B, optionally, the labeling processing is performed on the dialog content to obtain a plurality of labels corresponding to the dialog content, and form a label set, where the label set includes:
performing word segmentation processing on the conversation content to obtain a word segmentation result;
detecting whether a target word with a semantic similar to a preset theme keyword exists in the word segmentation result;
and when the detection result is that a target word with similar semantics with the preset topic key words exists in the word segmentation result, determining the preset topic key words corresponding to the target word as tags to form a tag set.
The word segmentation processing technology is the prior art and is not described herein. The semantic similarity refers to the fact that the semantic similarity between a word and the preset topic keyword exceeds a preset similarity threshold, and the preset similarity threshold is a preset threshold used for evaluating whether the two words are similar in semantic.
In other embodiments, when the dialog content is a multi-sentence content, that is, the dialog content includes the multi-sentence of the dialog user a and the multi-sentence of the dialog user B, because the dialog with the latest timestamp can better reflect the current topic of the dialog content, the embodiment of the present application may further set a higher weight for the dialog with the latest timestamp in a manner of setting the weight, so as to improve the accuracy of determining the current topic, and further improve the accuracy of recommending the dialog. Optionally, the performing tagging processing on the dialog content to obtain a plurality of tags corresponding to the dialog content, and forming a tag set, including:
performing word segmentation processing on the conversation content to obtain a word segmentation result;
detecting whether a target word with a semantic similar to a preset theme keyword exists in the word segmentation result;
when the detection result is that the target words with similar semanteme to the preset topic keywords exist in the word segmentation result, determining the timestamp information of the target words in the conversation content;
traversing a preset mapping relation between a timestamp and the weight to obtain the weight of the timestamp information corresponding to the target word;
and taking the preset topic keywords corresponding to the target words as tags according to the weights to form a tag set.
And mapping relation exists between the time stamps and the weights, wherein the more the time stamps are, the higher the weights of the conversations are, and the more the time stamps are, the lower the weights of the conversations are. The distance of the timestamp is obtained by comparing with the time of ending the dialog, for example, the starting time of a piece of dialog content is 8. For example, for a preset topic keyword corresponding to a target word with a timestamp of 8.
Optionally, the detecting whether a target word having a semantic similar to a preset topic keyword exists in the word segmentation result may include:
determining semantic similarity between each participle in the participle result and the preset topic keyword;
detecting whether the semantic similarity exceeds a preset similarity threshold;
when the semantic similarity exceeds the preset similarity threshold, determining that a target word with similar semantics to the preset topic keyword exists in the word segmentation result;
and when the semantic similarity does not exceed the preset similarity threshold, determining that no target words with similar semantics with the preset topic keywords exist in the word segmentation result.
The semantic similarity can be obtained by processing a pre-trained semantic similarity calculation model, wherein the semantic similarity calculation model inputs participles and the preset theme keywords and outputs semantic similarity. The model training process is prior art and is not described herein.
And S13, determining that the next theme corresponding to the current theme is the target theme corresponding to the conversation content.
In at least one embodiment of the present application, a sorting manner of preset topics in the preset topic set is determined, and a next topic corresponding to the current topic is selected as a target topic corresponding to the dialog content according to the sorting manner. The arrangement mode can be determined according to the conversation preference information of the conversation users, the ordering mode of the preset topics is determined according to the conversation preference information of the conversation users, then the target topics are determined, and finally the candidate utterances under the target topics are recommended, so that the accuracy of conversation recommendation can be improved.
The flow of target topic determination is described in conjunction with fig. 3. Optionally, the determining that the next topic corresponding to the current topic is the target topic corresponding to the dialog content includes:
s130, determining a target conversation user corresponding to the conversation content;
s131, determining dialog preference information of the target dialog user;
s132, determining the ordering mode of the preset topics in the preset topic set according to the conversation preference information;
and S133, determining that the next theme corresponding to the current theme is the target theme according to the sorting mode.
The target conversation user is a user in a dominant position in the conversation process and is used for guiding the conversation process. In a medical scenario, taking the conversation content as the doctor-patient conversation content as an example, in an inquiry process, a general doctor is the conversation leader and is used for leading a patient to communicate the illness state, and the target conversation user is a doctor. The dialogue preference information refers to an inquiry flow preferred by a doctor, and the dialogue preference information comprises information such as an inquiry sequence of a preset theme. In one embodiment, the dialog preference information may be derived from historical interrogation data of the physician. In other embodiments, a doctor profile may be pre-established, and the dialog preference information determined based on the doctor profile.
In one embodiment, the determining the dialog preference information of the target dialog user includes:
acquiring historical inquiry data of the target dialogue user;
determining a preset theme contained in the historical inquiry data and a sequencing mode of the preset theme;
and marking the sorting mode according to a preset data format to obtain the conversation preference information.
The historical inquiry data refers to the complete conversation content between the target conversation user and the patients who are treated in history, and is stored in the preset database. The determining of the preset subject included in the historical inquiry data is described above, and is not described herein again. The preset data format is a marking mode of the sorting mode, for example, the preset data format may be { preset theme 1, preset theme 2, \8230;, preset theme n }.
In other embodiments, the determining the dialog preference information of the target dialog user includes:
determining user information of the target dialog user;
constructing a target user portrait of the target dialogue user according to the user information;
and traversing the preset mapping relation between the user portrait and the conversation preference information to obtain the conversation preference information corresponding to the target user portrait.
The user information may be content such as age information, gender information, and academic calendar information of the target dialog user.
In at least one embodiment of the present application, the target topic corresponding to the dialog content may be obtained through prediction by a preset topic prediction model, and the preset topic prediction model may be constructed based on a recurrent neural network. And inputting the preset theme prediction model into dialog contents and a current theme corresponding to the dialog contents, and outputting the dialog contents and the current theme as a target theme.
S14, determining an initial candidate utterance set corresponding to the target subject, wherein the initial candidate utterance set comprises a plurality of initial candidate utterances.
In at least one embodiment of the present application, the initial candidate utterance set includes a plurality of initial candidate utterances, and the initial candidate utterances may be a sentence content or a segment content, which is not limited herein.
Optionally, before the determining the initial set of candidate utterances for which the target subject corresponds, the method further comprises:
acquiring a historical conversation content set;
determining a preset theme corresponding to each historical dialogue content in the historical dialogue content set from a preset theme set;
clustering analysis is carried out on the historical conversation content set by taking the preset topics as categories to obtain a plurality of initial historical conversation contents corresponding to the preset topics;
and preprocessing the initial historical conversation content to obtain a plurality of target historical conversation contents to form a candidate utterance set.
The historical dialogue content set can be historical inquiry data of different doctors on different patients, and can be obtained by crawling from a preset platform through a crawler technology. Each historical conversation content in the historical conversation content set has a preset theme corresponding to the historical conversation content, and the preset theme corresponding to the conversation content is determined to be described above and is not described herein any more. And preprocessing the initial historical dialogue content to obtain a plurality of target historical dialogue contents, and forming a candidate utterance set, namely performing similarity duplication elimination processing on the initial historical dialogue content of the preset theme.
Optionally, the preprocessing the initial historical dialog content to obtain a plurality of target historical dialog contents, and forming a candidate utterance set, including:
vectorizing the initial historical dialogue contents respectively to obtain a plurality of initial historical dialogue content vectors to form an initial historical dialogue content vector set;
calculating a distance between a first initial historical dialog content vector and a second initial historical dialog content vector in the initial historical dialog content vector set;
detecting whether the distance exceeds a preset distance threshold;
when the detection result is that the distance exceeds the preset distance threshold, retaining first initial historical conversation content corresponding to the first initial historical conversation content vector and second initial historical conversation content corresponding to the second initial historical conversation content vector;
when the detection result is that the distance does not exceed the preset distance threshold, deleting first initial historical dialogue content corresponding to the first initial historical dialogue content vector or deleting second initial historical dialogue content corresponding to the second initial historical dialogue content vector;
and obtaining and combining a plurality of target historical conversation contents under the preset theme according to the detection result to obtain a candidate utterance set.
Wherein, the distance between the vectors can be Euclidean distance. The preset distance threshold is a preset threshold for evaluating the distance between vectors. The first initial historical dialog content vector and the second initial historical dialog content vector are any two vectors in the initial historical dialog content vector set.
Exemplarily, the number of the initial historical dialogue contents is 10, the initial historical dialogue contents are subjected to vectorization processing, the number of the obtained initial historical dialogue content vectors is also 10 and is respectively marked as initial historical dialogue content vectors 1, 2 and 3 \8230, 10, the initial historical dialogue content vector 1 and the initial historical dialogue content vector 2 are arbitrarily selected from the initial historical dialogue content vector set for distance calculation, and when the detection result is that the distance exceeds the preset distance threshold value, the initial historical dialogue content corresponding to the initial historical dialogue content vector 1 and the initial historical dialogue content corresponding to the initial historical dialogue content vector 2 are reserved; and when the detection result shows that the distance does not exceed the preset distance threshold, deleting the initial historical dialogue content corresponding to the initial historical dialogue content vector 1 or deleting the initial historical dialogue content corresponding to the initial historical dialogue content vector 2, wherein the vectors in the initial historical dialogue content vector set are updated for the first time. Taking the example of reserving the initial historical dialogue content corresponding to the initial historical dialogue content vector 1 and the initial historical dialogue content corresponding to the initial historical dialogue content vector 2, then arbitrarily selecting the initial historical dialogue content vector 1 and the initial historical dialogue content vector 3 from the initial historical dialogue content vector set after the first update to perform distance calculation, and performing the second update on the vectors in the initial historical dialogue content vector set according to the detection result. Taking the example of deleting the initial historical dialogue content corresponding to the initial historical dialogue content vector 1, then randomly selecting an initial historical dialogue content vector 2 and an initial historical dialogue content vector 4 from the initial historical dialogue content vector set after the second updating for distance calculation, updating the vectors in the initial historical dialogue content vector set for the third time according to the detection result, and so on until distance calculation is carried out on any two vectors in the initial historical dialogue content vector set to obtain a final updated initial historical dialogue content vector set as a target historical dialogue content vector set, wherein the target historical dialogue content vector set corresponds to the target historical dialogue content, and a plurality of target historical dialogue contents form a candidate utterance set.
Optionally, the determining an initial candidate utterance set corresponding to the target topic includes:
acquiring a preset mapping relation between a theme and a candidate utterance set;
and traversing the mapping relation to obtain an initial candidate utterance set corresponding to the target subject.
And S15, performing correlation matching on any initial candidate utterance in the initial candidate utterance set according to the conversation content to obtain a target candidate utterance.
In at least one embodiment of the present application, correlation matching is performed on any initial candidate utterance in the initial candidate utterance set according to the dialog content, and a candidate utterance with the strongest correlation is selected as a target candidate utterance for dialog recommendation. In an embodiment, the relevance matching may be obtained by calculating a relevance score value through a preset dialogue recall model. The preset dialogue recall model has the input of a dialogue content vector and an initial candidate utterance vector and the output of a correlation score value between the two vectors. The training mode of the preset dialogue recall model is the prior art, and is not described herein.
The flow of determining the target candidate utterance is described in conjunction with fig. 4. Optionally, the performing, according to the dialog content, relevance matching on any initial candidate utterance in the initial candidate utterance set to obtain a target candidate utterance includes:
s150, vectorizing the conversation content to obtain a conversation content vector;
s151, performing vectorization processing on any initial candidate utterance in the initial candidate utterance set to obtain an initial candidate utterance vector;
s152, inputting the dialogue content vector and the initial candidate utterance vector into a preset dialogue recall model to obtain a relevance score value;
s153, selecting the candidate utterance corresponding to the candidate utterance vector with the highest relevance score value as a target candidate utterance.
Wherein the dialog content vector and the initial candidate utterance vector may be combined in a preset format, for example, the preset format may be { dialog content vector, initial candidate utterance vector }.
And S16, recommending the target candidate utterance to a preset port.
In at least one embodiment of the present application, the preset port may be a port corresponding to the target dialog user, for example, a doctor-patient inquiry, and the preset port is a doctor port, and the target candidate utterance is recommended to the preset port and displayed on a display screen of the preset port for reference of a doctor.
According to the dialog recommendation method based on artificial intelligence, the current theme corresponding to the dialog content is selected from the preset theme set, the next theme corresponding to the current theme is determined to be the target theme corresponding to the dialog content, the candidate utterances under the target theme are determined to be the dialog recommendation, the dialog recommendation can be flexibly provided according to the dialog content, the dialog recommendation is prevented from being provided according to the fixed theme sequence, and the accuracy of the dialog recommendation can be improved; and when the embodiment of the application carries out conversation recommendation, carrying out correlation matching on any initial candidate utterance in the initial candidate utterance set according to the conversation content to obtain a target candidate utterance, ensuring the correlation degree of the candidate utterance and the conversation content, and further improving the accuracy of the conversation recommendation. The application can be applied to various functional modules of smart cities such as smart government affairs and smart traffic, for example, a conversation recommendation module of the smart government affairs can promote the rapid development of the smart cities. The application can be applied to various functional modules of smart cities such as smart government affairs and smart traffic, for example, a conversation recommendation module of the smart government affairs can promote the rapid development of the smart cities.
Referring to fig. 5, fig. 5 is a block diagram of an artificial intelligence based dialog recommendation device according to a second embodiment of the present application.
In some embodiments, the artificial intelligence based dialog recommendation device 20 may include a plurality of functional modules comprised of computer program segments. The computer program of each program segment in the artificial intelligence based dialog recommendation device 20 may be stored in a memory of a computer device and executed by at least one processor to perform the functions of dialog recommendation (described in detail with reference to fig. 1).
In this embodiment, the dialog recommendation device 20 based on artificial intelligence can be divided into a plurality of functional modules according to the functions performed by the dialog recommendation device. The functional module may include: a conversation acquisition module 201, a topic extraction module 202, a topic determination module 203, an utterance determination module 204, an utterance matching module 205, and an utterance recommendation module 206. A module as referred to herein is a series of computer program segments capable of being executed by at least one processor and capable of performing a fixed function and is stored in a memory. In the present embodiment, the functions of the modules will be described in detail in the following embodiments.
The dialog acquisition module 201 may be used to acquire dialog content.
In at least one embodiment of the present application, the dialog content may be a one-to-one, one-to-many, or many-to-one type of dialog, which is not limited herein. In the embodiment of the present application, the dialog content is in a one-to-one form, and the dialog content may be generated in an online dialog manner, for example, the user a communicates with the user B in a text or voice manner on a preset platform, the voice on the preset platform is converted into text, and the text content is collected as the dialog content according to the sequence of the dialog timestamps. The dialog content may also be generated in a offline dialog manner, for example, the user a communicates with the user B in a preset platform in a voice manner, the voice in the preset platform is collected, the collected voice is converted into text, and the text content is used as the dialog content. The application scenario of the dialog content is not limited, and for example, the dialog content may be applied to a scenario of a user and customer service, a scenario of a user and sales, and a medical scenario. The embodiment of the application takes a medical scene as an example, and the conversation content is inquiry content, which can include the content of inquiry of a disease condition, plan for a diagnosis, discussion of medication, prescription, discussion of development of a disease condition, life advice, answer of a patient's question and the like.
Optionally, when the dialog content is an online dialog, the obtaining the dialog content includes:
when a conversation starting instruction is received, acquiring initial conversation content according to a preset time interval;
monitoring whether a speech form conversation exists in the initial conversation content;
and when the monitoring result shows that the voice form conversation exists in the initial conversation content, converting the voice form conversation into a character form conversation to obtain conversation content.
The dialog start instruction is used to identify the start of dialog content, and the dialog start instruction may be an instruction for issuing the first dialog content, an instruction for editing a soft keyboard, or an instruction for inputting a voice, which is not limited herein. The preset time interval is a preset time interval for acquiring the dialog content, for example, the preset time interval may be 0 second (that is, the initial dialog content is acquired in real time), and 30 seconds. Converting speech form dialogue into text form dialogue is prior art and is not described herein.
Optionally, when the dialog content is an offline dialog, the obtaining the dialog content includes:
when a conversation starting instruction is received, acquiring initial conversation content according to a preset time interval, wherein the initial conversation content is a voice form conversation;
and converting the voice form conversation into a text form conversation to obtain conversation content.
The theme selection module 202 may be configured to select a current theme corresponding to the dialog content from a preset theme set.
In at least one embodiment of the present application, in a medical scenario, the preset topic set includes a plurality of preset topics, and the preset topics may be topics such as inquiry of medical conditions, proposed diagnosis, discussion of medication, prescription, discussion of development of medical conditions, life advice, and answer to questions of patients. And the conversation contents are expanded according to the preset theme, and each section of the conversation contents has the corresponding preset theme. The preset theme may appear only once or many times during the inquiry process.
Optionally, the selecting a current topic corresponding to the dialog content from a preset topic set includes:
performing tagging processing on the conversation content to obtain a plurality of tags corresponding to the conversation content to form a tag set;
determining a preset theme corresponding to each label in the label set from a preset theme set;
determining the number of labels contained in the preset theme;
and selecting the preset theme with the largest number of labels as the current theme corresponding to the conversation content.
The conversation content comprises a plurality of preset theme keywords, the preset theme keywords are preset keywords with high correlation degree with the preset theme, the preset theme is taken as an illness condition inquiry as an example, and the preset theme keywords can be words such as 'illness condition', 'uncomfortable' and 'how good'. And taking the preset topic keywords as the labels of the conversation contents, and performing labeling processing on the conversation contents. The preset topic keywords are stored in a preset database, and the preset database can be a target node in a block chain in consideration of reliability and privacy of data storage.
The conversation content can be a one-sentence conversation or a multi-sentence conversation. In an embodiment, when the dialog content is a sentence content, that is, the dialog content includes a sentence of a dialog user a and a sentence of a dialog user B, optionally, the tagging is performed on the dialog content to obtain a plurality of tags corresponding to the dialog content, and a tag set is formed, where the tag set includes:
performing word segmentation processing on the conversation content to obtain a word segmentation result;
detecting whether a target word with a semantic similar to a preset theme keyword exists in the word segmentation result;
and when the detection result is that a target word with similar semantics to the preset topic keyword exists in the word segmentation result, determining the preset topic keyword corresponding to the target word as a tag to form a tag set.
The word segmentation processing technology is the prior art and is not described herein. The semantic similarity refers to the fact that the semantic similarity between a word and the preset topic keyword exceeds a preset similarity threshold, and the preset similarity threshold is a preset threshold used for evaluating whether the two words are similar in semantic.
In other embodiments, when the dialog content is a multi-sentence content, that is, the dialog content includes a multi-sentence of the dialog user a and a multi-sentence of the dialog user B, because the dialog with the latest timestamp can better reflect the current topic of the dialog content, the embodiment of the present application may also set the higher weight for the dialog with the latest timestamp by setting the weight, so as to improve the accuracy of determining the current topic, and further improve the accuracy of recommending the dialog. Optionally, the tagging is performed on the dialog content to obtain a plurality of tags corresponding to the dialog content, and a tag set is formed, where the tag set includes:
performing word segmentation processing on the conversation content to obtain a word segmentation result;
detecting whether a target word with similar semantics with a preset subject keyword exists in the word segmentation result;
when the detection result is that the target words with similar semanteme to the preset topic keywords exist in the word segmentation result, determining the timestamp information of the target words in the conversation content;
traversing a mapping relation between a preset timestamp and the weight to obtain the weight of the timestamp information corresponding to the target word;
and taking the preset topic keywords corresponding to the target words as tags according to the weights to form a tag set.
And mapping relation exists between the time stamps and the weights, wherein the more the time stamps are, the higher the weights of the conversations are, and the more the time stamps are, the lower the weights of the conversations are. The distance of the timestamp is obtained by comparing with the time of ending the dialog, for example, the starting time of a piece of dialog content is 8. For example, for a preset topic keyword corresponding to a target word with a timestamp of 8, the corresponding weight is 5, and at this time, the number of the preset topic keyword may be 5, so as to increase the number of the preset topic keyword in the tag set.
Optionally, the detecting whether a target word having a semantic similar to a preset topic keyword exists in the word segmentation result may include:
determining semantic similarity between each participle in the participle result and the preset topic keyword;
detecting whether the semantic similarity exceeds a preset similarity threshold;
when the semantic similarity exceeds the preset similarity threshold, determining that a target word with similar semantics to the preset topic keyword exists in the word segmentation result;
and when the semantic similarity does not exceed the preset similarity threshold, determining that no target words with similar semantics with the preset topic keywords exist in the word segmentation result.
The semantic similarity can be obtained by processing a pre-trained semantic similarity calculation model, wherein the input of the semantic similarity calculation model is segmentation and the preset topic keywords, and the output of the semantic similarity calculation model is semantic similarity. The model training process is prior art and will not be described herein.
The theme determining module 203 may be configured to determine that a next theme corresponding to the current theme is a target theme corresponding to the dialog content.
In at least one embodiment of the present application, a sorting manner of preset topics in the preset topic set is determined, and a next topic corresponding to the current topic is selected as a target topic corresponding to the dialog content according to the sorting manner. The arrangement mode can be determined according to the conversation preference information of the conversation users, the ordering mode of the preset topics is determined according to the conversation preference information of the conversation users, then the target topics are determined, and finally the candidate utterances under the target topics are recommended, so that the conversation recommendation accuracy can be improved.
Optionally, the determining that the next topic corresponding to the current topic is the target topic corresponding to the dialog content includes:
determining a target conversation user corresponding to the conversation content;
determining dialog preference information of the target dialog user;
determining a sorting mode of preset topics in the preset topic set according to the conversation preference information;
and determining that the next theme corresponding to the current theme is the target theme according to the sorting mode.
The target conversation user is a user in a dominant position in the conversation process and is used for guiding the conversation process. In a medical scenario, taking the conversation content as the doctor-patient conversation content as an example, in an inquiry process, a general doctor is the conversation leader and is used for leading a patient to communicate the illness state, and the target conversation user is a doctor. The dialogue preference information refers to an inquiry flow preferred by a doctor, and the dialogue preference information comprises information such as an inquiry sequence of a preset theme. In one embodiment, the dialog preference information may be derived from historical interrogation data of the physician. In other embodiments, a physician representation may be pre-established, with the dialog preference information determined based on the physician representation.
In one embodiment, the determining the dialog preference information of the target dialog user includes:
acquiring historical inquiry data of the target dialogue user;
determining a preset theme contained in the historical inquiry data and a sequencing mode of the preset theme;
and marking the sorting mode according to a preset data format to obtain the conversation preference information.
The historical inquiry data refers to the complete conversation content between the target conversation user and the patients who are treated in history, and is stored in the preset database. The determination of the preset subject included in the historical inquiry data is described above, and is not described herein any more. The preset data format is a marking mode of the sorting mode, for example, the preset data format may be { preset subject 1, preset subject 2, \8230;, preset subject n }.
In other embodiments, the determining the dialog preference information of the target dialog user includes:
determining user information of the target dialogue user;
constructing a target user portrait of the target dialog user according to the user information;
and traversing the preset mapping relation between the user portrait and the conversation preference information to obtain the conversation preference information corresponding to the target user portrait.
The user information may be age information, gender information, academic information, and the like of the target dialog user.
In at least one embodiment of the present application, the target topic corresponding to the dialog content may be obtained through prediction by a preset topic prediction model, and the preset topic prediction model may be constructed based on a recurrent neural network. And inputting the preset theme prediction model into dialog contents and current themes corresponding to the dialog contents, and outputting the dialog contents as target themes.
The utterance determination module 204 may be configured to determine an initial set of candidate utterances corresponding to the target subject, where the initial set of candidate utterances includes a number of initial candidate utterances.
In at least one embodiment of the present application, the initial candidate utterance set includes a plurality of initial candidate utterances, and the initial candidate utterances may be a sentence content or a segment content, which is not limited herein.
Optionally, before the determining the initial candidate utterance set corresponding to the target subject, the utterance determination module 204 further includes:
acquiring a historical conversation content set;
determining a preset theme corresponding to each historical dialogue content in the historical dialogue content set from a preset theme set;
clustering analysis is carried out on the historical dialogue content set by taking the preset topics as categories to obtain a plurality of initial historical dialogue contents corresponding to the preset topics;
and preprocessing the initial historical conversation content to obtain a plurality of target historical conversation contents to form a candidate utterance set.
The historical dialogue content set can be historical inquiry data of different doctors on different patients, and can be obtained by crawling from a preset platform through a crawler technology. Each historical dialogue content in the historical dialogue content set has a preset theme corresponding to the historical dialogue content, and it is determined that the preset theme corresponding to the dialogue content is described above, which is not described herein any more. And preprocessing the initial historical dialogue content to obtain a plurality of target historical dialogue contents, and forming a candidate utterance set, namely performing similarity deduplication processing on the initial historical dialogue content of the preset theme.
Optionally, the preprocessing the initial historical dialog content to obtain a plurality of target historical dialog contents, and forming a candidate utterance set, including:
vectorizing the initial historical dialogue contents respectively to obtain a plurality of initial historical dialogue content vectors to form an initial historical dialogue content vector set;
calculating a distance between a first initial historical dialog content vector and a second initial historical dialog content vector in the initial historical dialog content vector set;
detecting whether the distance exceeds a preset distance threshold;
when the detection result is that the distance exceeds the preset distance threshold, retaining first initial historical dialogue content corresponding to the first initial historical dialogue content vector and second initial historical dialogue content corresponding to the second initial historical dialogue content vector;
when the detection result is that the distance does not exceed the preset distance threshold, deleting first initial historical dialogue content corresponding to the first initial historical dialogue content vector or deleting second initial historical dialogue content corresponding to the second initial historical dialogue content vector;
and obtaining and combining a plurality of target historical conversation contents under the preset theme according to the detection result to obtain a candidate utterance set.
Wherein, the distance between the vectors can be Euclidean distance. The preset distance threshold is a preset threshold used for evaluating the distance between vectors. The first initial historical dialog content vector and the second initial historical dialog content vector are any two vectors in the initial historical dialog content vector set.
Exemplarily, the number of the initial historical dialogue contents is 10, the initial historical dialogue contents are subjected to vectorization processing, the number of the obtained initial historical dialogue content vectors is also 10 and is respectively marked as initial historical dialogue content vectors 1, 2 and 3 \8230, 10, the initial historical dialogue content vector 1 and the initial historical dialogue content vector 2 are arbitrarily selected from the initial historical dialogue content vector set for distance calculation, and when the detection result is that the distance exceeds the preset distance threshold value, the initial historical dialogue content corresponding to the initial historical dialogue content vector 1 and the initial historical dialogue content corresponding to the initial historical dialogue content vector 2 are reserved; and when the detection result shows that the distance does not exceed the preset distance threshold, deleting the initial historical dialogue content corresponding to the initial historical dialogue content vector 1 or deleting the initial historical dialogue content corresponding to the initial historical dialogue content vector 2, wherein the vectors in the initial historical dialogue content vector set are updated for the first time. Taking the example of reserving the initial historical dialogue content corresponding to the initial historical dialogue content vector 1 and the initial historical dialogue content corresponding to the initial historical dialogue content vector 2, then arbitrarily selecting the initial historical dialogue content vector 1 and the initial historical dialogue content vector 3 from the initial historical dialogue content vector set after the first update to perform distance calculation, and performing the second update on the vectors in the initial historical dialogue content vector set according to the detection result. Taking the example of deleting the initial historical dialogue content corresponding to the initial historical dialogue content vector 1, then randomly selecting an initial historical dialogue content vector 2 and an initial historical dialogue content vector 4 from the initial historical dialogue content vector set after the second updating for distance calculation, updating the vectors in the initial historical dialogue content vector set for the third time according to the detection result, and so on until distance calculation is carried out on any two vectors in the initial historical dialogue content vector set to obtain a final updated initial historical dialogue content vector set as a target historical dialogue content vector set, wherein the target historical dialogue content vector set corresponds to the target historical dialogue content, and a plurality of target historical dialogue contents form a candidate utterance set.
Optionally, the determining an initial candidate utterance set corresponding to the target topic includes:
acquiring a preset mapping relation between a theme and a candidate utterance set;
and traversing the mapping relation to obtain an initial candidate utterance set corresponding to the target subject.
The utterance matching module 205 may be configured to perform correlation matching on any initial candidate utterance in the initial candidate utterance set according to the dialog content to obtain a target candidate utterance;
in at least one embodiment of the present application, correlation matching is performed on any initial candidate utterance in the initial candidate utterance set according to the dialog content, and a candidate utterance with the strongest correlation is selected as a target candidate utterance for dialog recommendation. In an embodiment, the relevance match may be obtained by calculating a relevance score value through a preset dialogue recall model. The preset dialogue recall model has the input of a dialogue content vector and an initial candidate utterance vector and the output of a correlation score value between the two vectors. The training mode of the preset dialogue recall model is the prior art, and is not described herein.
Optionally, the performing, according to the dialog content, relevance matching on any initial candidate utterance in the initial candidate utterance set to obtain a target candidate utterance includes:
vectorizing the dialogue content to obtain a dialogue content vector;
vectorizing any initial candidate utterance in the initial candidate utterance set to obtain an initial candidate utterance vector;
inputting the dialogue content vector and the initial candidate utterance vector into a preset dialogue recall model to obtain a relevance score value;
and selecting the candidate utterance corresponding to the candidate utterance vector with the highest relevance score value as a target candidate utterance.
Wherein the dialog content vector and the initial candidate utterance vector may be combined in a preset format, for example, the preset format may be { dialog content vector, initial candidate utterance vector }.
The utterance recommendation module 206 may be configured to recommend the target candidate utterance to a preset port.
Fig. 6 is a schematic structural diagram of a computer device according to a third embodiment of the present application. In the preferred embodiment of the present application, the computer device 3 includes a memory 31, at least one processor 32, at least one communication bus 33, and a transceiver 34.
It will be appreciated by those skilled in the art that the configuration of the computer device shown in fig. 6 does not constitute a limitation of the embodiments of the present application, and may be a bus-type configuration or a star-type configuration, and that the computer device 3 may include more or less hardware or software than those shown, or a different arrangement of components.
In some embodiments, the computer device 3 is a device capable of automatically performing numerical calculation and/or information processing according to instructions set or stored in advance, and the hardware includes but is not limited to a microprocessor, an application specific integrated circuit, a programmable gate array, a digital processor, an embedded device, and the like. The computer device 3 may also include a client device, which includes, but is not limited to, any electronic product capable of interacting with a client through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device, for example, a personal computer, a tablet computer, a smart phone, a digital camera, etc.
It should be noted that the computer device 3 is only an example, and other existing or future electronic products, such as those that may be adapted to the present application, are also included in the scope of the present application and are incorporated herein by reference.
In some embodiments, the memory 31 has stored therein a computer program that, when executed by the at least one processor 32, performs all or a portion of the steps of the artificial intelligence based dialog recommendation method as described. The Memory 31 includes a Read-Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), a One-time Programmable Read-Only Memory (OTPROM), an electronically Erasable rewritable Read-Only Memory (Electrically-Erasable Programmable Read-Only Memory (EEPROM)), an optical Read-Only disk (CD-ROM) or other optical disk Memory, a magnetic disk Memory, a tape Memory, or any other medium readable by a computer capable of carrying or storing data.
Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
The block chain referred by the application is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a string of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, which is used for verifying the validity (anti-counterfeiting) of the information and generating a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
In some embodiments, the at least one processor 32 is a Control Unit (Control Unit) of the computer device 3, connects various components of the whole computer device 3 by using various interfaces and lines, and executes various functions of the computer device 3 and processes data by running or executing programs or modules stored in the memory 31 and calling data stored in the memory 31. For example, the at least one processor 32, when executing the computer program stored in the memory, implements all or a portion of the steps of the artificial intelligence based dialog recommendation method described in the embodiments of the present application; or implement all or part of the functionality of an artificial intelligence based dialog recommendation device. The at least one processor 32 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same function or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips.
In some embodiments, the at least one communication bus 33 is arranged to enable connectivity communication between the memory 31 and the at least one processor 32, and/or the like.
Although not shown, the computer device 3 may further include a power supply (such as a battery) for supplying power to the various components, and preferably, the power supply may be logically connected to the at least one processor 32 through a power management device, so as to implement functions of managing charging, discharging, and power consumption through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The computer device 3 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
The integrated unit implemented in the form of a software functional module may be stored in a computer-readable storage medium. The software functional module is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a computer device, or a network device) or a processor (processor) to execute parts of the methods according to the embodiments of the present application.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the present application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is obvious that the word "comprising" does not exclude other elements or that the singular does not exclude the plural. A plurality of units or means recited in the specification may also be implemented by one unit or means through software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only used for illustrating the technical solutions of the present application and not for limiting, and although the present application is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions can be made on the technical solutions of the present application without departing from the spirit and scope of the technical solutions of the present application.

Claims (10)

1. A dialog recommendation method based on artificial intelligence is characterized in that the dialog recommendation method comprises the following steps:
obtaining conversation content;
selecting a current theme corresponding to the conversation content from a preset theme set;
determining that a next theme corresponding to the current theme is a target theme corresponding to the conversation content;
determining an initial candidate utterance set corresponding to the target subject, wherein the initial candidate utterance set comprises a plurality of initial candidate utterances;
performing relevance matching on any initial candidate utterance in the initial candidate utterance set according to the conversation content to obtain a target candidate utterance;
and recommending the target candidate utterance to a preset port.
2. The artificial intelligence based dialog recommendation method according to claim 1, wherein said selecting a current topic corresponding to the dialog content from a preset topic set comprises:
performing labeling processing on the conversation content to obtain a plurality of labels corresponding to the conversation content to form a label set;
determining a preset theme corresponding to each label in the label set from a preset theme set;
determining the number of labels contained in the preset theme;
and selecting the preset theme with the maximum number of labels as the current theme corresponding to the conversation content.
3. The artificial intelligence based dialog recommendation method according to claim 1, wherein said determining that the next topic corresponding to the current topic is the target topic corresponding to the dialog content comprises:
determining a target conversation user corresponding to the conversation content;
determining dialog preference information of the target dialog user;
determining a sorting mode of preset topics in the preset topic set according to the conversation preference information;
and determining the next theme corresponding to the current theme as a target theme according to the sorting mode.
4. The artificial intelligence based dialog recommendation method of claim 1 wherein prior to the determining an initial set of candidate utterances to which the target subject corresponds, the method further comprises:
acquiring a historical conversation content set;
determining a preset theme corresponding to each historical conversation content in the historical conversation content set from a preset theme set;
clustering analysis is carried out on the historical dialogue content set by taking the preset topics as categories to obtain a plurality of initial historical dialogue contents corresponding to the preset topics;
and preprocessing the initial historical conversation content to obtain a plurality of target historical conversation contents to form a candidate utterance set.
5. The artificial intelligence based dialog recommendation method of claim 4 wherein preprocessing the initial historical dialog content to obtain a plurality of target historical dialog contents, forming a candidate utterance set, comprises:
vectorizing the initial historical dialogue contents respectively to obtain a plurality of initial historical dialogue content vectors to form an initial historical dialogue content vector set;
calculating a distance between a first initial historical dialog content vector and a second initial historical dialog content vector in the initial historical dialog content vector set;
detecting whether the distance exceeds a preset distance threshold;
when the detection result is that the distance exceeds the preset distance threshold, retaining first initial historical dialogue content corresponding to the first initial historical dialogue content vector and second initial historical dialogue content corresponding to the second initial historical dialogue content vector;
when the detection result is that the distance does not exceed the preset distance threshold, deleting first initial historical dialogue content corresponding to the first initial historical dialogue content vector or deleting second initial historical dialogue content corresponding to the second initial historical dialogue content vector;
and obtaining and combining a plurality of target historical conversation contents under the preset theme according to the detection result to obtain a candidate utterance set.
6. The artificial intelligence based dialog recommendation method of claim 1 wherein the determining an initial set of candidate utterances for which the target topic corresponds comprises:
acquiring a preset mapping relation between a theme and a candidate utterance set;
and traversing the mapping relation to obtain an initial candidate utterance set corresponding to the target subject.
7. The artificial intelligence based dialog recommendation method according to claim 1, wherein said performing a correlation matching on any initial candidate utterance in the initial candidate utterance set according to the dialog content to obtain a target candidate utterance comprises:
vectorizing the dialogue content to obtain a dialogue content vector;
vectorizing any initial candidate utterance in the initial candidate utterance set to obtain an initial candidate utterance vector;
inputting the dialogue content vector and the initial candidate utterance vector into a preset dialogue recall model to obtain a relevance score value;
and selecting the candidate utterance corresponding to the candidate utterance vector with the highest relevance score value as a target candidate utterance.
8. An artificial intelligence based dialog recommendation device, characterized in that the artificial intelligence based dialog recommendation device comprises:
the conversation acquisition module is used for acquiring conversation contents;
the theme selection module is used for selecting a current theme corresponding to the conversation content from a preset theme set;
the theme determining module is used for determining that the next theme corresponding to the current theme is a target theme corresponding to the conversation content;
the utterance determining module is used for determining an initial candidate utterance set corresponding to the target subject, wherein the initial candidate utterance set comprises a plurality of initial candidate utterances;
the utterance matching module is used for performing relevance matching on any initial candidate utterance in the initial candidate utterance set according to the conversation content to obtain a target candidate utterance;
and the utterance recommending module is used for recommending the target candidate utterance to a preset port.
9. A computer device, characterized in that the computer device comprises a processor for implementing the artificial intelligence based dialog recommendation method according to any one of claims 1 to 7 when executing a computer program stored in a memory.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the artificial intelligence based dialog recommendation method of any one of claims 1 to 7.
CN202211193054.5A 2022-09-28 2022-09-28 Dialog recommendation method based on artificial intelligence and related equipment Pending CN115658858A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211193054.5A CN115658858A (en) 2022-09-28 2022-09-28 Dialog recommendation method based on artificial intelligence and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211193054.5A CN115658858A (en) 2022-09-28 2022-09-28 Dialog recommendation method based on artificial intelligence and related equipment

Publications (1)

Publication Number Publication Date
CN115658858A true CN115658858A (en) 2023-01-31

Family

ID=84985498

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211193054.5A Pending CN115658858A (en) 2022-09-28 2022-09-28 Dialog recommendation method based on artificial intelligence and related equipment

Country Status (1)

Country Link
CN (1) CN115658858A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116313162A (en) * 2023-05-12 2023-06-23 北京梆梆安全科技有限公司 Medical inquiry system based on AI model

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116313162A (en) * 2023-05-12 2023-06-23 北京梆梆安全科技有限公司 Medical inquiry system based on AI model
CN116313162B (en) * 2023-05-12 2023-08-18 北京梆梆安全科技有限公司 Medical inquiry system based on AI model

Similar Documents

Publication Publication Date Title
CN111783439B (en) Man-machine interaction dialogue processing method and device, computer equipment and storage medium
CN111984793A (en) Text emotion classification model training method and device, computer equipment and medium
CN112614578B (en) Doctor intelligent recommendation method and device, electronic equipment and storage medium
CN112906385B (en) Text abstract generation method, computer equipment and storage medium
CN112149409B (en) Medical word cloud generation method and device, computer equipment and storage medium
CN112860848B (en) Information retrieval method, device, equipment and medium
CN111986744B (en) Patient interface generation method and device for medical institution, electronic equipment and medium
CN112634889B (en) Electronic case input method, device, terminal and medium based on artificial intelligence
CN114007131A (en) Video monitoring method and device and related equipment
CN113870974A (en) Risk prediction method and device based on artificial intelligence, electronic equipment and medium
CN114663223A (en) Credit risk assessment method, device and related equipment based on artificial intelligence
CN114387061A (en) Product pushing method and device, electronic equipment and readable storage medium
CN115658858A (en) Dialog recommendation method based on artificial intelligence and related equipment
CN114862520A (en) Product recommendation method and device, computer equipment and storage medium
CN113723513A (en) Multi-label image classification method and device and related equipment
CN114020892A (en) Answer selection method and device based on artificial intelligence, electronic equipment and medium
CN114334175A (en) Hospital epidemic situation monitoring method and device, computer equipment and storage medium
CN112395432B (en) Course pushing method and device, computer equipment and storage medium
CN113724830A (en) Medicine taking risk detection method based on artificial intelligence and related equipment
CN111651452A (en) Data storage method and device, computer equipment and storage medium
CN116860935A (en) Content management method, device, equipment and medium based on prompt word question-answer interaction
CN113469291B (en) Data processing method and device, electronic equipment and storage medium
CN116108276A (en) Information recommendation method and device based on artificial intelligence and related equipment
CN113420847B (en) Target object matching method based on artificial intelligence and related equipment
CN113674065B (en) Service contact-based service recommendation method and device, electronic equipment and medium

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