CN113688246B - Historical problem recall method and device based on artificial intelligence and related equipment - Google Patents

Historical problem recall method and device based on artificial intelligence and related equipment Download PDF

Info

Publication number
CN113688246B
CN113688246B CN202111016985.3A CN202111016985A CN113688246B CN 113688246 B CN113688246 B CN 113688246B CN 202111016985 A CN202111016985 A CN 202111016985A CN 113688246 B CN113688246 B CN 113688246B
Authority
CN
China
Prior art keywords
question
questions
complete
coding
feature
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.)
Active
Application number
CN202111016985.3A
Other languages
Chinese (zh)
Other versions
CN113688246A (en
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 Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China 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 Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN202111016985.3A priority Critical patent/CN113688246B/en
Publication of CN113688246A publication Critical patent/CN113688246A/en
Application granted granted Critical
Publication of CN113688246B publication Critical patent/CN113688246B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • 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/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking

Abstract

The invention discloses an artificial intelligence based historical problem recall method, which is applied to the technical field of artificial intelligence and is used for solving the technical problems that the recall of simple problems is not carried out in the process of the recall of historical problems, so that the recall rate of the historical problems is low and the recall effect is imperfect. The method provided by the invention comprises the following steps: acquiring historical questions containing simple questions and complete questions in the same session; combining each simple question with any one of the complete questions two by two to obtain a plurality of groups of historical questions; the simple question and the complete question are respectively processed through a pre-trained question to obtain a first text feature and a second text feature; respectively inputting the first text feature and the second text feature into a classification layer of a trained question comparison model to obtain a prediction result of whether the simple question and the complete question in the corresponding group are similar questions or not; when the simple question and the complete question are similar questions, the simple question and the complete question are recalled simultaneously.

Description

Historical problem recall method and device based on artificial intelligence and related equipment
Technical Field
The present invention relates to the field of artificial intelligence technologies, and in particular, to an artificial intelligence-based historical problem recall method, an apparatus, a computer device, and a storage medium.
Background
In order to reduce the cost and solve the questions of users in time, an intelligent question-answering system is generated, and aims to require a machine to understand questions composed of natural language and give reasonable and accurate answers, and the intelligent question-answering system is a research hotspot in the current academia and industry.
In the current intelligent question-answering system, in order to improve user experience and convenience of the intelligent question-answering system, after a user enters the question-answering system and before asking questions, the user can recommend questions according to information such as historical information and historical scenes of the user, and the questions possibly asked by the user are displayed, so that the user can click on corresponding questions directly to ask questions, and the user cannot input the related questions again, so that user experience of the whole question-answering system is improved.
The problem recall is the problem that we need to study under the scene, and is the most likely problem of being concerned and clicked by users from massive candidate questions, and is the most critical step of problem recommendation, the traditional recall method is generally to directly display the historical problems input by users to realize the problem recall, when the users input related problems in text boxes, the traditional method does not need to recall similar problems of the user profile together by semantic recall or keyword recall, and the effect of the problem recall is greatly influenced.
Disclosure of Invention
The embodiment of the invention provides an artificial intelligence-based historical problem recall method, an artificial intelligence-based historical problem recall device, computer equipment and a storage medium, which are used for solving the technical problems that in the process of recalling the historical problem, the recall rate of the historical problem is low and the recall effect is imperfect because the simple problem cannot be recalled.
An artificial intelligence based historical problem recall method, the method comprising:
acquiring historical questions containing simple questions and complete questions in the same session;
combining each simple question with any one of the complete questions two by two to obtain a plurality of groups of historical questions;
respectively encoding the simple question and the complete question in each group of combined historical questions through a first encoding layer and a second encoding layer of a pre-trained question comparison model to obtain a first encoding feature and a second encoding feature;
converting the first coding feature into a first text feature through a first full-connection layer of a pre-trained problem comparison model, and converting the second coding feature into a second text feature through a second full-connection layer of the pre-trained problem comparison model;
respectively inputting the first text feature and the second text feature into a classification layer of the pre-trained question comparison model to obtain a prediction result of whether the simple question and the complete question in the corresponding group are similar questions;
And when the prediction result shows that the simple question and the complete question in the corresponding group are similar questions, recalling the simple question and the complete question simultaneously.
An artificial intelligence based history problem recall device, the device comprising:
the problem acquisition module is used for acquiring historical problems including simple questions and complete questions in the same session;
the combination module is used for combining each simple question with any one of the complete questions two by two to obtain a plurality of groups of historical questions;
the coding module is used for respectively coding the simple question and the complete question in each group of combined historical questions through a first coding layer and a second coding layer of a pre-trained question comparison model to obtain a first coding feature and a second coding feature;
the conversion module is used for converting the first coding feature into a first text feature through a first full-connection layer of the pre-trained problem comparison model, and converting the second coding feature into a second text feature through a second full-connection layer of the pre-trained problem comparison model;
the prediction module is used for respectively inputting the first text feature and the second text feature into the classification layer of the pre-trained question comparison model to obtain a prediction result of whether the simple question and the complete question in the corresponding group are similar questions or not;
And the recall module is used for recalling the simple question and the complete question simultaneously when the prediction result shows that the simple question and the complete question in the corresponding group are similar questions.
A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the artificial intelligence based history problem recall method described above when the computer program is executed.
A computer readable storage medium storing a computer program which when executed by a processor performs the steps of the artificial intelligence based history problem recall method described above.
According to the historical problem recall method, device, computer equipment and storage medium based on artificial intelligence, through obtaining the historical problems including the simple questions and the complete questions in the same session, combining each simple question with any complete question two by two to obtain a plurality of groups of historical problems, analyzing whether the simple questions and the complete questions in each group of historical problems have similar questions through a pre-trained question comparison model, and when the similar questions exist, recalling the simple questions and the corresponding complete questions at the same time, wherein the possibility that the similar questions generally exist in the historical questions in the same session is high.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments of the present invention will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic illustration of an application environment of an artificial intelligence based historical problem recall method in accordance with an embodiment of the present invention;
FIG. 2 is a flow chart of an artificial intelligence based historical problem recall method in accordance with one embodiment of the present invention;
FIG. 3 is a flow chart of an artificial intelligence based historical problem recall method in accordance with another embodiment of the present invention;
FIG. 4 is a schematic diagram of a network structure of a problem comparison model according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of an artificial intelligence based history problem recall device in accordance with an embodiment of the present invention;
FIG. 6 is a schematic diagram of a computer device in accordance with an embodiment of the invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The historical problem recall method based on artificial intelligence provided by the application can be applied to an application environment as shown in fig. 1, wherein the computer equipment can communicate with a server through a network. The computer device may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, among others. The server may be implemented as a stand-alone server or as a cluster of servers.
The embodiment of the application can acquire and process the related data based on the artificial intelligence technology. Among these, artificial intelligence (Artificial Intelligence, AI) is the theory, method, technique and application system that uses a digital computer or a digital computer-controlled machine to simulate, extend and extend human intelligence, sense the environment, acquire knowledge and use knowledge to obtain optimal results.
Artificial intelligence infrastructure 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 other directions.
In a scenario after a user enters an intelligent question-answering system and before a question, in order to solve a technical problem that similar questions asked by a user simply cannot be recalled together with a context in which the history questions are located in a history question recall process, and a history question recall effect is poor, as shown in fig. 2, the embodiment provides an artificial intelligence-based history question recall method, and the method is described by taking a computer device in fig. 1 as an example.
S101, acquiring historical questions comprising simple questions and complete questions in the same session.
Wherein the history problem posed by the same user ID between preset time intervals, for example, 5 minutes, can be determined as the history problem in the same session. It can be understood that the present embodiment is not limited to acquiring the history problem in one same session, but may also acquire the history problem including the simple question and the complete question in a plurality of sessions according to the service requirement, for example, acquire the history problem including the simple question and the complete question in one or more same sessions within a near preset time period, and when the preset time period is within a month, it means that the history problem including the simple question and the complete question in one or more same sessions within a month is acquired.
An application scenario according to the present embodiment is, for example: by querying the history log data, it is found that the user a has performed 5 sessions within a month, and then the history problems in each session including the simple question and the complete question in the 5 sessions obtained by this step S101 will execute the processing of the subsequent steps S102 to S106. It can be understood that if only the complete question is included in the same session, when the history question is recalled, the complete question is directly recalled through the existing processing mode. The possibility that the case where only the question is included in the same session is extremely small, and if it is recognized that only the question is included in the same session, it is considered that the question does not correspond to the similar general problem in the session, and it is not within the consideration of the present embodiment.
In one embodiment, it can be determined whether the history problem is a simple question by the number of words of the history problem statement, namely:
identifying the number of words contained in the statement of the history question;
and when the number of words contained in the statement of the history question is less than the preset number of words, judging that the history question is a simple question, otherwise, judging that the history question is a complete question.
The preset word number is, for example, 5 words, i.e., when the word number of the historical problem statement is less than 5, the historical problem is judged to be a simple problem, otherwise, the historical problem is judged to be a complete problem.
In other embodiments, it may also be determined whether the historical problem is a simple question by determining the number of different entities included in the statement of the historical problem, specifically by:
word segmentation processing is carried out on the history problems to obtain a plurality of words;
inquiring the entity of each word according to a pre-stored mapping relation table;
and when the number of different entities obtained by query is two or more, judging that the historical problem is a complete problem, otherwise, judging that the historical problem is a simple problem.
An application scenario according to the present embodiment is, for example: the existing history problem "do the cold warrant e life? "," pneumonia? After the two history questions are segmented and queried, the obtained entities are respectively ' disease, insurance category ' and ' disease ', namely, can judge ' can guarantee that an e-life insurance can be applied to a cold? "is a complete problem," pneumonia? "is a question of a simple question.
S102, combining each simple question with any one of the complete questions two by two to obtain a plurality of groups of historical questions.
It can be understood that when there is only one question, the question and each complete question need to be combined in sequence two by two to obtain a corresponding set of history questions. When there are a plurality of questions in the same session, each question needs to be combined with each of the complete questions two by two.
S103, respectively encoding the simple questions and the complete questions in each group of combined historical questions through a first encoding layer and a second encoding layer of a pre-trained question comparison model to obtain a first encoding feature and a second encoding feature.
In this embodiment, a schematic structural diagram of the problem comparison model is shown in fig. 4, where the problem comparison model includes a first coding layer and a second coding layer that are independent of each other, an output of the first coding layer is connected to a first full connection layer, an output of the second coding layer is connected to a second full connection layer, and the first full connection layer and the second full connection layer are simultaneously connected to a classification layer of the problem comparison model.
In one embodiment, the first encoding layer and the second encoding layer may each be encoded using a Bert, bi-lstm, etc. model, and Project in fig. 4 represents a fully connected network.
In one embodiment, the step of training the problem comparison model includes the following steps S401 to S406:
s401, acquiring session problem training sample pairs from history log data, wherein the session problem training sample pairs comprise positive sample pairs belonging to the same session and negative sample pairs belonging to different sessions, each pair of positive sample pairs comprises a simple question and a complete question with similar semantics, and each pair of negative sample pairs comprises a simple question and a complete question with irrelevant semantics.
It can be understood that each pair of session problem training samples carries a label, and the label is used for marking whether the corresponding pair of session problem training samples is a positive example or a negative example. In one embodiment, the session question training sample pair may be labeled with a "0" label as a positive example and a "1" label as a negative example.
S402, coding the complete questions in the session question training sample pair through a first coding layer of the question comparison model to be trained to obtain first sample coding features, and coding the simple questions in the session question training sample pair through a second coding layer of the question comparison model to be trained to obtain second sample coding features.
S403, converting the first sample coding feature into a first text sample feature through a first full-connection layer of the question contrast model to be trained, and converting the second sample coding feature into a second text sample feature through a second full-connection layer of the question contrast model to be trained.
S404, calculating the contrast loss between the first text sample feature and the second text sample feature.
In one embodiment, the loss of contrast between the first text sample feature and the second text sample feature is calculated by:
wherein z is i Representing the first text sample feature, z j And representing the second text sample characteristic, wherein S represents the calculated contrast loss.
S405, calculating the final loss of the problem comparison model to be trained according to the comparison loss and the loss function.
In one embodiment, the loss function is:
wherein z is i Representing the first text sample feature, z i + Representing the first text sample feature in the positive example sample pair, τ represents an empirical parameter, and K represents a batch.
It can be appreciated that in the process of training the problem comparison model, the session problem training sample pairs are input into the problem comparison model in batches, the number of session problem training sample pairs included in each batch is the same, and the number of positive sample pairs and negative sample pairs included in each batch of session problem training sample pairs can be the same or different.
In one embodiment, a smaller τ value indicates a greater impact of the positive sample on the problem contrast model during training, alternatively τ e [0.05,0.1].
S406, judging whether the loss function of the to-be-trained problem comparison model is converged according to the final loss, and when the loss function is not converged, adjusting parameters of the to-be-trained problem comparison model, and circularly obtaining the session problem training sample pair from the historical log data until the loss function of the to-be-trained problem comparison model is converged, so as to obtain the trained problem comparison model.
S104, converting the first coding feature into a first text feature through a first full-connection layer of the pre-trained problem comparison model, and converting the second coding feature into a second text feature through a second full-connection layer of the pre-trained problem comparison model.
It will be appreciated that the output of the first encoding layer is connected to the input of the first fully connected layer and the output of the second encoding layer is connected to the input of the fully connected layer.
S105, respectively inputting the first text feature and the second text feature into a classification layer of the pre-trained question comparison model to obtain a prediction result of whether the simple question and the complete question in the corresponding group are similar questions.
In one embodiment, the classification layer of the trained question comparison model is mainly used for calculating similarity according to the first text feature and the second text feature, and judging whether the simple questions and the complete questions in the corresponding group are similar questions or not according to the calculated similarity.
And S106, when the prediction result shows that the simple question and the complete question in the corresponding group are similar questions, recalling the simple question and the complete question at the same time.
An application scenario according to the present embodiment is, for example: the complete question contained in the same session is "do the cold can apply for e-life-protection? ", the simple question is" unexpected danger? And converting the complete question into a first coding feature and a first text feature in turn, converting the simple question into a second coding feature and a second text feature in turn, and outputting a prediction result of whether the simple question and the complete question are similar questions through a classification layer of the question comparison model, wherein when the prediction result is yes, the cold can be guaranteed to be a life-saving party when a history question is recalled? "," unexpected danger? "concurrent recall.
According to the method and the device, the historical questions comprising the simple question questions and the complete questions in the same session are obtained, each simple question is combined with any one complete question in pairs to obtain a plurality of groups of historical questions, then the situation that whether the simple question questions and the complete questions in each group of historical questions are similar to each other is analyzed through a pre-trained question comparison model, when the similar question exists, the simple question questions and the corresponding complete questions are recalled simultaneously, the possibility that similar questions exist in the historical questions generally belonging to the same session is high, in the process of recalling the historical questions, the context where the historical questions in the same session are located is combined through the pre-trained question comparison model, the user can recall the similar questions together with the complete questions, and the historical question recall rate based on artificial intelligence is improved, so that the effect of recalling the historical questions is better.
FIG. 3 is a flowchart of an artificial intelligence based historical problem recall method according to another embodiment of the present invention, in one embodiment, as shown in FIG. 3, the method further includes the following steps S301 to S304 after the steps when the prediction result indicates that the simple problem and the complete problem in the corresponding group are similar problems:
s301, performing word segmentation on the complete question to obtain a plurality of first words, and performing word segmentation on the simple question to obtain at least one second word;
s302, inquiring the entity of each first term according to a pre-stored mapping relation table, and inquiring the entity of each second term;
s303, replacing the first word of the corresponding entity in the complete question with the second word of the same entity to obtain an integrated question of the simple question;
the step of recalling the simple question and the complete question simultaneously is further the following step S304:
s304, recalling the complete question and the complete question corresponding to the simple question at the same time.
In one embodiment, the categories of entities include, but are not limited to, disease, age, risk, and the like.
An application scenario according to the present embodiment is, for example: when the complete question that a concurrent recall is required is "do the cold warrant e life? ", the simple question is" pneumonia? ", when entity inquiry is carried out after word segmentation, the entities which are the cold and the pneumonia are diseases, and after word replacement, the complete problem of the simplified question is that" can guarantee e life-time of pneumonia? ".
Another application scenario according to the present embodiment is, for example: when the complete question that a concurrent recall is required is "do the cold warrant e life? ", the simple question is" unexpected danger? When the entity query is performed after word segmentation, the entities to which the e life insurance and the accident insurance belong are dangerous, and the complete problem of the simplified question obtained after word replacement is that the cold can apply the accident insurance? ".
It will be appreciated that when the complete question and the complete question corresponding to the simple question are recalled simultaneously, the result is displayed as the complete question and the complete question after the word replacement.
The simple question in the similar questions is supplemented and recalled and displayed together with the corresponding common questions, so that the user can more clearly and completely know the historical questions and possibly asked questions which the user has asked after entering the intelligent question-answering system and before asking questions, and the recall of the historical questions is more comprehensive, accurate and clear.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present invention.
In one embodiment, an artificial intelligence based historical problem recall device is provided, and the artificial intelligence based historical problem recall device corresponds to the artificial intelligence based historical problem recall method in the embodiment one by one. As shown in fig. 5, the artificial intelligence based history question recall apparatus 100 includes a question acquisition module 11, a combination module 12, an encoding module 13, a conversion module 14, a prediction module 15, and a recall module 16. The functional modules are described in detail as follows:
the question obtaining module 11 is configured to obtain a history question including a simple question and a complete question in the same session.
Wherein the history problem posed by the same user ID between preset time intervals, for example, 5 minutes, can be determined as the history problem in the same session. It can be understood that the present embodiment is not limited to acquiring the history problem in one same session, but may also acquire the history problem including the simple question and the complete question in a plurality of sessions according to the service requirement, for example, acquire the history problem including the simple question and the complete question in one or more same sessions within a near preset time period, and when the preset time period is within a month, it means that the history problem including the simple question and the complete question in one or more same sessions within a month is acquired.
An application scenario according to the present embodiment is, for example: by querying the history log data, it is found that the user a has performed 5 sessions within a month, and then the history problems in each session including the simple question and the complete question in the 5 sessions acquired by the question acquisition module 11 will be processed by the following modules 12 to 16. It can be understood that if only the complete question is included in the same session, when the history question is recalled, the complete question is directly recalled through the existing processing mode. The possibility that the case where only the question is included in the same session is extremely small, and if it is recognized that only the question is included in the same session, it is considered that the question does not correspond to the similar general problem in the session, and it is not within the consideration of the present embodiment.
And a combination module 12, configured to combine each of the simple questions with any one of the complete questions two by two to obtain a plurality of groups of history questions.
It can be understood that when there is only one question, the question and each complete question need to be combined in sequence two by two to obtain a corresponding set of history questions. When there are a plurality of questions in the same session, each question needs to be combined with each of the complete questions two by two.
And the encoding module 13 is configured to encode the simple questions and the complete questions in each group of the combined historical questions respectively through a first encoding layer and a second encoding layer of the pre-trained question comparison model, so as to obtain a first encoding feature and a second encoding feature.
In this embodiment, a schematic structural diagram of the problem comparison model is shown in fig. 4. In one embodiment, the first encoding layer and the second encoding layer may each be encoded using a Bert, bi-lstm, etc. model, and Project in fig. 4 represents a fully connected network.
The conversion module 14 is configured to convert the first coding feature into a first text feature through a first fully connected layer of the pre-trained question comparison model, and convert the second coding feature into a second text feature through a second fully connected layer of the pre-trained question comparison model.
It will be appreciated that the output of the first encoding layer is connected to the input of the first fully connected layer and the output of the second encoding layer is connected to the input of the fully connected layer.
And the prediction module 15 is configured to input the first text feature and the second text feature into the classification layer of the pre-trained question comparison model respectively, so as to obtain a prediction result of whether the simple question and the complete question in the corresponding group are similar questions.
In one embodiment, the classification layer of the trained question comparison model is mainly used for calculating similarity according to the first text feature and the second text feature, and judging whether the simple questions and the complete questions in the corresponding group are similar questions or not according to the calculated similarity.
And a recall module 16, configured to recall the questions and the complete questions simultaneously when the prediction result indicates that the questions and the complete questions in the corresponding group are similar questions.
An application scenario according to the present embodiment is, for example: the complete question contained in the same session is "do the cold can apply for e-life-protection? ", the simple question is" unexpected danger? And converting the complete question into a first coding feature and a first text feature in turn, converting the simple question into a second coding feature and a second text feature in turn, and outputting a prediction result of whether the simple question and the complete question are similar questions through a classification layer of the question comparison model, wherein when the prediction result is yes, the cold can be guaranteed to be a life-saving party when a history question is recalled? "," unexpected danger? "concurrent recall.
According to the historical problem recall device 100 based on artificial intelligence provided by the embodiment, whether the simple question similar to the complete question exists in the same session is analyzed through the pre-trained question comparison model, and when the simple question and the corresponding complete question are recalled simultaneously, so that the context of the historical question is combined in the process of recalling the historical question, the similar questions of the user simple question can be recalled together, and the recall effect of the historical question is better.
In one embodiment, the problem acquisition module 11 further includes:
the first word segmentation unit is used for carrying out word segmentation processing on the history problem to obtain a plurality of words;
the first query unit is used for querying the entity to which each term belongs according to a pre-stored mapping relation table;
and the first judging unit is used for judging that the historical problem is a complete problem when the number of different entities obtained by inquiry is two or more, and judging that the historical problem is a simple problem otherwise.
An application scenario according to the present embodiment is, for example: the existing history problem "do the cold warrant e life? "," pneumonia? After the two history questions are segmented and queried, the obtained entities are respectively ' disease, insurance category ' and ' disease ', namely, can judge ' can guarantee that an e-life insurance can be applied to a cold? "is a complete problem," pneumonia? "is a question of a simple question.
In another embodiment, the problem obtaining module 11 specifically includes:
a word number recognition unit configured to recognize the number of words included in the sentence of the history problem;
and the second judging unit is used for judging that the historical problem is a simple question when the number of words contained in the statement of the historical problem is less than the preset number of words, and judging that the historical problem is a complete problem otherwise.
The preset word number is, for example, 5 words, i.e., when the word number of the historical problem statement is less than 5, the historical problem is judged to be a simple problem, otherwise, the historical problem is judged to be a complete problem.
In one embodiment, the artificial intelligence based history problem recall device 100 further comprises:
the system comprises a session sample acquisition module, a database and a database, wherein the session sample acquisition module is used for acquiring session problem training sample pairs from history log data, the session problem training sample pairs comprise positive sample pairs belonging to the same session and negative sample pairs belonging to different sessions, each pair of positive sample comprises a simple question and a complete question with similar semanteme, and each pair of negative sample comprises a simple question and a complete question with irrelevant semanteme;
the sample coding module is used for coding the complete questions in the session question training sample pair through a first coding layer of the question comparison model to be trained to obtain first sample coding characteristics, and coding the simple questions in the session question training sample pair through a second coding layer of the question comparison model to be trained to obtain second sample coding characteristics;
the sample conversion module is used for converting the first sample coding feature into a first text sample feature through a first full-connection layer of the problem comparison model to be trained, and converting the second sample coding feature into a second text sample feature through a second full-connection layer of the problem comparison model to be trained;
A first calculation module for calculating a loss of contrast between the first text sample feature and the second text sample feature;
the second calculation module is used for calculating the final loss of the problem comparison model to be trained according to the comparison loss and the loss function;
and the circulation module is used for judging whether the loss function of the to-be-trained problem comparison model is converged according to the final loss, when the loss function is not converged, the parameters of the to-be-trained problem comparison model are regulated, and the session problem training sample pair obtained from the history log data is circulated to the step until the loss function of the to-be-trained problem comparison model is converged, so that the trained problem comparison model is obtained.
Each pair of session problem training samples carries a label, and the label is used for marking whether the corresponding pair of session problem training samples is a positive example or a negative example. In one embodiment, the session question training sample pair may be labeled with a "0" label as a positive example and a "1" label as a negative example.
In one embodiment, the first calculation module is specifically configured to calculate the contrast loss by the following formula:
Wherein z is i Representing the first text sample feature, z j And representing the second text sample characteristic, wherein S represents the calculated contrast loss.
In one embodiment, the loss function is:
wherein z is i Representing the first text sample feature, z i + Representing the first text sample feature in the positive example sample pair, τ represents an empirical parameter, and K represents a batch.
It can be appreciated that in the process of training the problem comparison model, the session problem training sample pairs are input into the problem comparison model in batches, the number of session problem training sample pairs included in each batch is the same, and the number of positive sample pairs and negative sample pairs included in each batch of session problem training sample pairs can be the same or different.
In one embodiment, a smaller τ value indicates a greater impact of the positive sample on the problem contrast model during training, alternatively τ e [0.05,0.1].
Optionally, the artificial intelligence based history problem recall device 100 further includes:
the first word segmentation module is used for carrying out word segmentation processing on the complete problem to obtain a plurality of first words;
the second word segmentation module is used for carrying out word segmentation processing on the question to obtain at least one second word;
The mapping module is used for inquiring the entity to which each first term belongs and inquiring the entity to which each second term belongs according to a pre-stored mapping relation table;
and the replacement module is used for replacing the first word of the corresponding entity in the complete question with the second word of the same entity to obtain the complete question of the simple question.
In one embodiment, the recall module 16 is specifically configured to: and recalling the complete question and the complete question corresponding to the simple question at the same time.
In one embodiment, the categories of entities include, but are not limited to, disease, age, risk, and the like.
An application scenario according to the present embodiment is, for example: when the complete question that a concurrent recall is required is "do the cold warrant e life? ", the simple question is" pneumonia? ", when entity inquiry is carried out after word segmentation, the entities which are the cold and the pneumonia are diseases, and after word replacement, the complete problem of the simplified question is that" can guarantee e life-time of pneumonia? ".
Another application scenario according to the present embodiment is, for example: when the complete question that a concurrent recall is required is "do the cold warrant e life? ", the simple question is" unexpected danger? When the entity query is performed after word segmentation, the entities to which the e life insurance and the accident insurance belong are dangerous, and the complete problem of the simplified question obtained after word replacement is that the cold can apply the accident insurance? ".
It will be appreciated that when the complete question and the complete question corresponding to the simple question are recalled simultaneously, the result is displayed as the complete question and the complete question after the word replacement.
The simple question in the similar questions is supplemented and recalled and displayed together with the corresponding common questions, so that the user can more clearly and completely know the historical questions and possibly asked questions which the user has asked after entering the intelligent question-answering system and before asking questions, and the recall of the historical questions is more comprehensive, accurate and clear.
The meaning of "first" and "second" in the above modules/units is merely to distinguish different modules/units, and is not used to limit which module/unit has higher priority or other limiting meaning. Furthermore, the terms "comprises," "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or modules is not necessarily limited to those steps or modules that are expressly listed or inherent to such process, method, article, or apparatus, but may include other steps or modules that may not be expressly listed or inherent to such process, method, article, or apparatus, and the partitioning of such modules by means of any other means that may be implemented by such means.
For specific limitations regarding the artificial intelligence based history problem recall apparatus, reference may be made to the above limitations regarding the artificial intelligence based history problem recall method, and no further description is given here. The above-described modules in the artificial intelligence-based history problem recall device may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a storage medium, an internal memory. The storage medium includes a non-volatile storage medium and/or a volatile storage medium having stored therein an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the storage media. The database of the computer device is used for storing data involved in an artificial intelligence based historical problem recall method. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements an artificial intelligence based historical problem recall method.
In one embodiment, a computer device is provided, which may be a terminal, and the internal structure of which may be as shown in fig. 6. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a storage medium, an internal memory. The storage medium includes a non-volatile storage medium and/or a volatile storage medium, which stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer programs in the storage media. The network interface of the computer device is for communicating with an external server via a network connection. The computer program, when executed by a processor, implements an artificial intelligence based historical problem recall method.
In one embodiment, a computer device is provided that includes a memory, a processor, and a computer program stored on the memory and executable on the processor, when executing the computer program, implementing the steps of the artificial intelligence based history problem recall method of the above embodiments, such as steps 101 through 106 shown in fig. 2 and other extensions of the method and extensions of related steps. Alternatively, the processor, when executing the computer program, implements the functions of the modules/units of the artificial intelligence based history problem recall apparatus in the above embodiments, such as the functions of modules 11 to 16 shown in fig. 5. In order to avoid repetition, a description thereof is omitted.
The processor may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like that is a control center of the computer device, connecting various parts of the overall computer device using various interfaces and lines.
The memory may be used to store the computer program and/or modules, and the processor may implement various functions of the computer device by running or executing the computer program and/or modules stored in the memory, and invoking data stored in the memory. The memory 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 (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data (such as audio data, video data, etc.) created according to the use of the cellular phone, etc.
The memory may be integrated in the processor or may be provided separately from the processor.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, implements the steps of the artificial intelligence based history problem recall method of the above embodiments, such as steps 101 through 106 shown in fig. 2 and other extensions of the method and related steps. Alternatively, the computer program when executed by the processor implements the functions of the modules/units of the artificial intelligence based history problem recall apparatus of the above embodiments, such as the functions of modules 11 to 16 shown in fig. 5. In order to avoid repetition, a description thereof is omitted.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-volatile and/or volatile computer-readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention.

Claims (9)

1. An artificial intelligence based historical problem recall method, the method comprising:
acquiring historical questions containing simple questions and complete questions in the same session;
Combining each simple question with any one of the complete questions two by two to obtain a plurality of groups of historical questions;
respectively coding the simple question and the complete question in each group of combined historical questions through a first coding layer and a second coding layer of a pre-trained question comparison model to obtain a first coding feature and a second coding feature;
converting the first coding feature into a first text feature through a first full-connection layer of a pre-trained problem comparison model, and converting the second coding feature into a second text feature through a second full-connection layer of the pre-trained problem comparison model;
respectively inputting the first text feature and the second text feature into a classification layer of the pre-trained question comparison model to obtain a prediction result of whether the simple question and the complete question in the corresponding group are similar questions;
when the prediction result shows that the simple question and the complete question in the corresponding group are similar questions, the simple question and the complete question are recalled simultaneously;
the step of training the problem comparison model comprises:
obtaining a session problem training sample pair from history log data, wherein the session problem training sample pair comprises a positive sample pair belonging to the same session and a negative sample pair belonging to different sessions, each pair of positive samples comprises a simple question and a complete question with similar semantics, and each pair of negative samples comprises a simple question and a complete question with irrelevant semantics;
Coding the complete questions in the session question training sample pair through a first coding layer of the question comparison model to be trained to obtain first sample coding features, and coding the simple questions in the session question training sample pair through a second coding layer of the question comparison model to be trained to obtain second sample coding features;
converting the first sample coding features into first text sample features through a first full-connection layer of the question comparison model to be trained, and converting the second sample coding features into second text sample features through a second full-connection layer of the question comparison model to be trained;
calculating a contrast loss between the first text sample feature and the second text sample feature;
calculating the final loss of the problem comparison model to be trained according to the comparison loss and the loss function;
judging whether the loss function of the to-be-trained problem comparison model is converged or not according to the final loss, and when the loss function is not converged, adjusting parameters of the to-be-trained problem comparison model, and circularly obtaining the session problem training sample pair from the historical log data until the loss function of the to-be-trained problem comparison model is converged, so as to obtain the trained problem comparison model.
2. The method of claim 1, wherein the step of obtaining the history questions including the simple questions and the complete questions in the same session further comprises:
word segmentation processing is carried out on the history problems to obtain a plurality of words;
inquiring the entity of each word according to a pre-stored mapping relation table;
and when the number of different entities obtained by query is two or more, judging that the historical problem is a complete problem, otherwise, judging that the historical problem is a simple problem.
3. The artificial intelligence based history question recall method of claim 1 wherein the step of calculating a loss of contrast between the first text sample feature and the second text sample feature further comprises:
the contrast loss is calculated by the following formula:
wherein z is i Representing the first text sample feature, z j And representing the second text sample characteristic, wherein S represents the calculated contrast loss.
4. The artificial intelligence based history problem recall method of claim 3 wherein the loss function is:
Wherein z is i Representing the first text sample feature, z i + Representing the positive exampleThe first text sample feature in this pair, τ, represents the empirical parameter and K represents the batch.
5. The artificial intelligence based historical question recall method of claim 1 wherein, after the step of when the prediction results indicate that the simple question and the complete question in the corresponding group are similar questions, the method further comprises:
word segmentation processing is carried out on the complete problem to obtain a plurality of first words;
word segmentation processing is carried out on the simple question to obtain at least one second word;
inquiring the entity of each first term according to a pre-stored mapping relation table, and inquiring the entity of each second term;
and replacing the first words of the corresponding entities in the complete question with the second words of the same entities to obtain the complete question of the simple question.
6. The artificial intelligence based historical problem recall method of claim 5 wherein the step of recalling the simple question and the complete question simultaneously further comprises:
and recalling the complete question and the complete question corresponding to the simple question at the same time.
7. An artificial intelligence based history problem recall apparatus for implementing an artificial intelligence based history problem recall method according to any one of claims 1 to 6, the apparatus comprising:
the problem acquisition module is used for acquiring historical problems including simple questions and complete questions in the same session;
the combination module is used for combining each simple question with any one of the complete questions two by two to obtain a plurality of groups of historical questions;
the coding module is used for respectively coding the simple question and the complete question in each group of combined historical questions through a first coding layer and a second coding layer of a pre-trained question comparison model to obtain a first coding feature and a second coding feature;
the conversion module is used for converting the first coding feature into a first text feature through a first full-connection layer of the pre-trained problem comparison model, and converting the second coding feature into a second text feature through a second full-connection layer of the pre-trained problem comparison model;
the prediction module is used for respectively inputting the first text feature and the second text feature into a classification layer of the pre-trained question comparison model to obtain a prediction result of whether the simple question and the complete question in the corresponding group are similar questions;
And the recall module is used for recalling the simple question and the complete question simultaneously when the prediction result shows that the simple question and the complete question in the corresponding group are similar questions.
8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the artificial intelligence based history problem recall method of any one of claims 1 to 6.
9. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the steps of the artificial intelligence based history problem recall method of any one of claims 1 to 6.
CN202111016985.3A 2021-08-31 2021-08-31 Historical problem recall method and device based on artificial intelligence and related equipment Active CN113688246B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111016985.3A CN113688246B (en) 2021-08-31 2021-08-31 Historical problem recall method and device based on artificial intelligence and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111016985.3A CN113688246B (en) 2021-08-31 2021-08-31 Historical problem recall method and device based on artificial intelligence and related equipment

Publications (2)

Publication Number Publication Date
CN113688246A CN113688246A (en) 2021-11-23
CN113688246B true CN113688246B (en) 2023-09-26

Family

ID=78584573

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111016985.3A Active CN113688246B (en) 2021-08-31 2021-08-31 Historical problem recall method and device based on artificial intelligence and related equipment

Country Status (1)

Country Link
CN (1) CN113688246B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111400470A (en) * 2020-03-13 2020-07-10 深圳市腾讯计算机系统有限公司 Question processing method and device, computer equipment and storage medium
CN112214593A (en) * 2020-11-05 2021-01-12 腾讯科技(深圳)有限公司 Question and answer processing method and device, electronic equipment and storage medium
CN112287085A (en) * 2020-11-06 2021-01-29 中国平安财产保险股份有限公司 Semantic matching method, system, device and storage medium
CN112463949A (en) * 2020-12-01 2021-03-09 贝壳技术有限公司 Data recall method and system, interaction method and interaction system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11321536B2 (en) * 2019-02-13 2022-05-03 Oracle International Corporation Chatbot conducting a virtual social dialogue

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111400470A (en) * 2020-03-13 2020-07-10 深圳市腾讯计算机系统有限公司 Question processing method and device, computer equipment and storage medium
CN112214593A (en) * 2020-11-05 2021-01-12 腾讯科技(深圳)有限公司 Question and answer processing method and device, electronic equipment and storage medium
CN112287085A (en) * 2020-11-06 2021-01-29 中国平安财产保险股份有限公司 Semantic matching method, system, device and storage medium
CN112463949A (en) * 2020-12-01 2021-03-09 贝壳技术有限公司 Data recall method and system, interaction method and interaction system

Also Published As

Publication number Publication date
CN113688246A (en) 2021-11-23

Similar Documents

Publication Publication Date Title
CN108427707B (en) Man-machine question and answer method, device, computer equipment and storage medium
CN109800307B (en) Product evaluation analysis method and device, computer equipment and storage medium
CN111460290B (en) Information recommendation method, device, equipment and storage medium
CN113157863A (en) Question and answer data processing method and device, computer equipment and storage medium
CN114528844A (en) Intention recognition method and device, computer equipment and storage medium
CN113420113A (en) Semantic recall model training and recall question and answer method, device, equipment and medium
CN112287089A (en) Classification model training and automatic question-answering method and device for automatic question-answering system
CN112084789A (en) Text processing method, device, equipment and storage medium
CN111291172A (en) Method and device for processing text
CN116434741A (en) Speech recognition model training method, device, computer equipment and storage medium
CN112101042A (en) Text emotion recognition method and device, terminal device and storage medium
CN113836192B (en) Parallel corpus mining method and device, computer equipment and storage medium
CN113254620B (en) Response method, device and equipment based on graph neural network and storage medium
CN113919363A (en) Sentence vector generation model processing method, device and equipment based on artificial intelligence
CN113688246B (en) Historical problem recall method and device based on artificial intelligence and related equipment
CN113255368B (en) Method and device for emotion analysis of text data and related equipment
CN113626468B (en) SQL sentence generation method, device and equipment based on artificial intelligence and storage medium
CN114428838A (en) Content recall method and device, computer equipment and storage medium
CN112732423B (en) Process migration method, device, equipment and medium
CN114449310A (en) Video editing method and device, computer equipment and storage medium
CN112148902A (en) Data processing method, device, server and storage medium
CN113268578B (en) Text semantic recognition method and device, computer equipment and storage medium
CN111368044A (en) Intelligent question answering method and device, computer equipment and storage medium
CN115881103B (en) Speech emotion recognition model training method, speech emotion recognition method and device
CN113570404B (en) Target user positioning method, device and related equipment

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
GR01 Patent grant
GR01 Patent grant