CN113688246A - Artificial intelligence-based historical problem recall method and device and related equipment - Google Patents

Artificial intelligence-based historical problem recall method and device and related equipment Download PDF

Info

Publication number
CN113688246A
CN113688246A CN202111016985.3A CN202111016985A CN113688246A CN 113688246 A CN113688246 A CN 113688246A CN 202111016985 A CN202111016985 A CN 202111016985A CN 113688246 A CN113688246 A CN 113688246A
Authority
CN
China
Prior art keywords
question
complete
questions
historical
coding
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.)
Granted
Application number
CN202111016985.3A
Other languages
Chinese (zh)
Other versions
CN113688246B (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

Images

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Databases & Information Systems (AREA)
  • Computational Linguistics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

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 rate of the historical problems is low and the recall effect is incomplete because a brief question cannot be recalled in the historical problem recall process. The method provided by the invention comprises the following steps: acquiring historical problems comprising simple questions and complete questions in the same session; combining every two simple questions and any one complete question to obtain multiple groups of historical questions; respectively processing the simple question and the complete question through a pre-trained question to obtain a first text characteristic and a second text characteristic; respectively inputting the first text characteristic and the second text characteristic 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 simplified question and the complete question are similar questions, the simplified question and the complete question are recalled simultaneously.

Description

Artificial intelligence-based historical problem recall method and device and related equipment
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a history problem recalling method and device based on artificial intelligence, computer equipment and a storage medium.
Background
In order to reduce cost and timely answer questions of users, an intelligent question and answer system is created, and aims to require a machine to understand questions composed of natural languages and give reasonable and accurate answers.
In the current intelligent question-answering system, in order to improve the user experience and convenience of the intelligent question-answering system, after a user enters the question-answering system and before a question is asked, the user can recommend the question according to the historical information, the historical scene and other information of the user, the question which the user may ask is displayed, the user can conveniently and directly click the corresponding question to ask the question, so that the user is prevented from inputting the relevant question again, and the user experience of the whole question-answering system is improved.
The problem recall is a subject to be researched in the scene, the problem recall is to recall a problem which is most possibly concerned and clicked by a user from a large number of candidate questions and is the most key step of problem recommendation, a traditional recall method generally directly displays historical problems input by the user to realize the problem recall, when the user inputs related problems in a text box, the existing method is not to recall through semantic recall or keyword recall, similar problems briefly asked by the user cannot be recalled together in the process of the problem recall by combining the context of the historical problems, and the effect of the problem recall is greatly influenced.
Disclosure of Invention
The embodiment of the invention provides a history problem recalling method and device based on artificial intelligence, computer equipment and a storage medium, and aims to solve the technical problems that in the historical problem recalling process, a simple question cannot be recalled, so that the historical problem recalling rate is low and the recall effect is incomplete.
An artificial intelligence based historical question recalling method comprises the following steps:
acquiring historical problems comprising simple questions and complete questions in the same session;
combining every two simple questions and any one complete question to obtain multiple groups of historical questions;
respectively coding simple questions and complete questions 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 first coding features and second coding features;
converting the first coding feature into a first text feature through a first full-link layer of a pre-trained problem comparison model, and converting the second coding feature into a second text feature through a second full-link layer of the pre-trained problem comparison model;
respectively inputting the first text characteristic and the second text characteristic 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 or not;
when the prediction result indicates 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.
An artificial intelligence based historical problem recall apparatus, the apparatus comprising:
the problem acquisition module is used for acquiring historical problems containing simple problems and complete problems in the same session;
the combination module is used for combining each simplified question and any one complete question in pairs to obtain a plurality of groups of historical questions;
the coding module is used for respectively coding the simple questions and the complete questions 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 first coding features and second coding features;
the conversion module is used for converting the first coding feature into a first text feature through a first full-link layer of a pre-trained problem comparison model and converting the second coding feature into a second text feature through a second full-link layer of the pre-trained problem comparison model;
the prediction module is used for respectively inputting the first text characteristic and the second text characteristic 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 recalling 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.
A computer apparatus 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 historical problem recall method described above when executing the computer program.
A computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the artificial intelligence based historical problem recall method described above.
The invention provides a historical question recalling method, a device, computer equipment and a storage medium based on artificial intelligence, which can simply recall the user with the similar questions of the complete questions by acquiring the historical questions containing the simple questions and the complete questions in the same session, combining each simple question with any complete question in pairs to obtain a plurality of groups of historical questions, analyzing whether the simple questions and the complete questions in each group of historical questions have the similar questions or not through a pre-trained question comparison model, recalling the simple questions and the corresponding complete questions simultaneously when the simple questions and the corresponding complete questions exist, wherein the possibility that the similar questions exist in the historical questions generally belonging to the same session is higher. The historical problem recall rate based on artificial intelligence is improved, and the historical problem recall effect is better.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
FIG. 1 is a schematic diagram of an application environment of an artificial intelligence-based historical question recall method according to an embodiment of the present invention;
FIG. 2 is a flow chart of an artificial intelligence based historical problem recall method in accordance with an 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 network diagram of a problem comparison model according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of an artificial intelligence-based historical problem recall apparatus according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a computer device according to an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The artificial intelligence based historical problem recalling method can be applied to the application environment as shown in FIG. 1, wherein the computer equipment can communicate with a server through a network. Wherein the computer device may be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server may be implemented as a stand-alone server or as a server cluster of multiple servers.
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 infrastructure generally includes 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.
In order to solve the technical problem that similar questions briefly asked by a user cannot be recalled together with the context of the historical questions in the historical question recalling process in a scene after the user enters the intelligent question-answering system and before the user asks the questions, and the historical question recalling effect is poor, as shown in fig. 2, the embodiment provides an artificial intelligence-based historical question recalling method, which is explained by taking the method applied to the computer equipment in fig. 1 as an example, and includes the following steps S101 to S106.
S101, acquiring historical problems containing brief questions and complete questions in the same session.
Wherein historical questions posed by the same user ID between a preset time interval, for example, 5 minutes, may be determined as historical questions in the same session. It can be understood that, this embodiment is not limited to acquiring historical questions in one same session, and may also acquire historical questions including a short question and a complete question in multiple sessions according to service needs, for example, acquire historical questions including a short question and a complete question in one or more same sessions within a preset time period, and when the preset time period is within a month, it means that the historical questions including a short question and a complete question in one or more same sessions within a month are acquired.
One 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 the last month, and the history questions in each session including the short question and the complete question in the 5 sessions acquired in step S101 will execute the processing in the subsequent steps S102 to S106. It can be understood that if only the complete question is included in the same session, the complete question can be directly recalled by the existing processing mode when the historical question is recalled. The probability that the case of only including the brief question in the same session occurs is extremely small, and if it is recognized that the same session only includes the brief question, the brief question in the session is not considered to correspond to the similar general conventional question, and is not considered within the scope of the present embodiment.
In one embodiment, it can be determined whether the historical question is a brief question by the word count of the historical question statement, i.e.:
identifying the number of words contained in the statement of the historical problem;
and when the number of words contained in the statement of the historical question is less than the preset number of words, judging the historical question to be a simple question, otherwise, judging the historical question to be a complete question.
The preset word number is, for example, 5 words, that is, when the word number of the history question sentence is less than 5, the history question is determined as a simple question, otherwise, the history question is determined as a complete question.
In other embodiments, it may also be determined whether the historical problem is a simple problem by determining the number of different entities included in the statement of the historical problem, and the method specifically includes the following steps:
performing word segmentation processing on the historical problem to obtain a plurality of words;
inquiring the entity to which each word belongs according to a pre-stored mapping relation table;
and when the number of the different entities obtained by query is two or more, judging the historical question to be a complete question, otherwise, judging the historical question to be a simple question.
One application scenario according to the present embodiment is for example: the existing historical problem "can a cold be guaranteed e live insurance? "," pneumonia woollen? "after the two historical questions are subjected to word segmentation and query, the obtained entities are respectively ' diseases, insurance categories ' and ' diseases ', namely ' can a cold be guaranteed for e? "is a complete question," pneumonia woollen? "is a simple question.
And S102, combining each simplified question and any one complete question in pairs to obtain multiple groups of historical questions.
It can be understood that, when there is only one simplified question, the simplified question and each of the complete questions need to be combined in pairs to obtain the corresponding group of historical questions. When there are a plurality of simplified questions in the same session, each simplified question and each complete question need to be combined in pairs.
S103, respectively coding the simple questions and the complete questions 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 first coding features and second coding features.
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-link layer, an output of the second coding layer is connected to a second full-link layer, and the first full-link layer and the second full-link layer are simultaneously connected to a classification layer of the problem comparison model.
In one embodiment, the first coding layer and the second coding layer can both be coded by using a model of Bert, Bi-lstm, etc., 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, obtaining conversation question training sample pairs from historical log data, wherein the conversation question training sample pairs comprise positive example sample pairs belonging to the same conversation and negative example sample pairs belonging to different conversations, each pair of positive example samples comprises simple question and complete question with similar semantemes, and each pair of negative example samples comprises simple question and complete question with irrelevant semantemes.
It can be understood that each pair of the training samples of the session question carries a label, and the label is used for marking whether the corresponding training sample pair of the session question is a positive example or a negative example. In one embodiment, the pair of training samples of the session question 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 the 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 the second coding layer of the question comparison model to be trained to obtain second sample coding characteristics.
S403, converting the first sample coding features into first text sample features through a first full-link layer of the problem comparison model to be trained, and converting the second sample coding features into second text sample features through a second full-link layer of the problem comparison model to be trained.
S404, calculating the contrast loss between the first text sample characteristic and the second text sample characteristic.
In one embodiment, the loss of contrast between the first text sample feature and the second text sample feature is calculated by:
Figure BDA0003240220110000071
wherein z isiRepresenting said first text sample feature, zjRepresenting the second text sample feature, S representing a 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:
Figure BDA0003240220110000081
wherein z isiRepresenting said first text sample feature, zi +Represents the first text sample feature in the positive example sample pair, τ represents an empirical parameter, and K represents a batch.
It can be understood that, in the process of training the problem comparison model, the pairs of session problem training samples are input into the problem comparison model in batches, the number of the pairs of session problem training samples included in each batch is the same, and the number of the positive example pairs and the number of the negative example pairs included in each batch of the pairs of session problem training samples may be the same or different.
In one embodiment, a smaller value of τ indicates a greater impact of positive samples on the problem-contrast model during the training process, and optionally τ e [0.05, 0.1 ].
S406, judging whether the loss function of the problem comparison model to be trained is converged according to the final loss, adjusting the parameters of the problem comparison model to be trained when the loss function is not converged, and circulating the step of obtaining the session problem training sample pair from the historical log data until the loss function of the problem comparison model to be trained is converged to obtain the trained problem comparison model.
And S104, converting the first coding features into first text features through a first full-connection layer of a pre-trained problem comparison model, and converting the second coding features into second text features 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.
And S105, respectively inputting the first text characteristic and the second text characteristic 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.
In one embodiment, the classification layer of the trained question comparison model is mainly used for calculating the similarity according to the first text feature and the second text feature, and judging whether the simple question and the complete question in the corresponding group are similar questions 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, recalling the simple question and the complete question simultaneously.
One application scenario according to the present embodiment is for example: the complete question contained in the same session is "can a cold be applied e-guaranty? "is the brief question" accident worries? When the prediction result is yes, and when a history question is recalled, the' can you put an e for a cold to live a life guarantee? "," accident worship? "recall at the same time.
The present embodiment obtains a history question containing a brief question and a complete question in the same session, and combining every simplified question with any one of the complete questions in pairs to obtain multiple sets of historical questions, then analyzing whether similar questions exist in the simple questions and the complete questions in each group of historical questions through a pre-trained question comparison model, when the historical problems exist, the simplified question and the corresponding complete question are recalled at the same time, the probability that similar questions exist in the historical problems generally belonging to the same session is high, in the process of recalling the historical problems, the user can recall the problems similar to the complete questions together through combining the contexts of the historical problems in the same session through the pre-trained problem comparison model, and the recall rate of the historical problems based on artificial intelligence is improved, so that the recall effect of the historical problems is good.
Fig. 3 is a flowchart of an artificial intelligence-based historical question recalling method in 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 step when the prediction result indicates that the simplified question and the complete question in the corresponding group are similar questions based on the above steps S101 to S105:
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 an entity to which each first term belongs and inquiring an entity to which each second term belongs according to a pre-stored mapping relation table;
s303, replacing the first words of the corresponding entities in the complete question by the second words which are the same as the belonged entities to obtain the complete question of the simple question;
the step of recalling the simplified 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 category of the entity includes, but is not limited to, disease, age, risk category, and the like.
One application scenario according to the present embodiment is for example: the complete question when a concurrent recall is required is "can a cold be applied for e-life? "the brief question is" pneumonia woollen? "when entity query is performed after word segmentation, entities belonging to cold and pneumonia are all diseases, and after word replacement, the complete question of the simple question is obtained as" can pneumonia be guaranteed for e to live for insurance? ".
Another application scenario according to the present embodiment is for example: the complete question when a concurrent recall is required is "can a cold be applied for e-life? "is the brief question" accident worries? "when entity query is performed after word segmentation, the entities belonging to" e live insurance "and" accident "are both dangerous types, and the complete question of the simple question after word replacement is" can a cold be applied with accident? ".
It is understood that when the complete question and the complete question corresponding to the simple question are recalled simultaneously, the displayed result is the complete question and the complete question after the word replacement.
The embodiment enables the user to more clearly and completely know the historical questions asked before and before the user asks the questions after entering the intelligent question-answering system by supplementing and completing the simple questions in the similar questions and recalling and displaying the simple questions and the corresponding common questions together, and the user can more comprehensively, accurately and clearly recall the historical questions.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
In one embodiment, an artificial intelligence based historical problem recalling device is provided, and the artificial intelligence based historical problem recalling device corresponds to the artificial intelligence based historical problem recalling method in the embodiment one by one. As shown in fig. 5, the artificial intelligence based historical question recalling apparatus 100 includes a question acquiring module 11, a combining module 12, an encoding module 13, a converting module 14, a predicting module 15 and a recalling module 16. The functional modules are explained in detail as follows:
and the question acquisition module 11 is used for acquiring historical questions containing simple questions and complete questions in the same session.
Wherein historical questions posed by the same user ID between a preset time interval, for example, 5 minutes, may be determined as historical questions in the same session. It can be understood that, this embodiment is not limited to acquiring historical questions in one same session, and may also acquire historical questions including a short question and a complete question in multiple sessions according to service needs, for example, acquire historical questions including a short question and a complete question in one or more same sessions within a preset time period, and when the preset time period is within a month, it means that the historical questions including a short question and a complete question in one or more same sessions within a month are acquired.
One 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 the history questions in each session including the simple question and the complete question in the 5 sessions acquired by the question acquisition module 11 are processed by the subsequent modules 12 to 16. It can be understood that if only the complete question is included in the same session, the complete question can be directly recalled by the existing processing mode when the historical question is recalled. The probability that the case of only including the brief question in the same session occurs is extremely small, and if it is recognized that the same session only includes the brief question, the brief question in the session is not considered to correspond to the similar general conventional question, and is not considered within the scope of the present embodiment.
And the combination module 12 is used for combining each simplified question and any one complete question in pairs to obtain a plurality of groups of historical questions.
It can be understood that, when there is only one simplified question, the simplified question and each of the complete questions need to be combined in pairs to obtain the corresponding group of historical questions. When there are a plurality of simplified questions in the same session, each simplified question and each complete question need to be combined in pairs.
And the coding module 13 is configured to code the simple questions and the complete questions in each group of the combined historical questions respectively through a first coding layer and a second coding layer of the pre-trained question comparison model, so as to obtain first coding features and second coding features.
In this embodiment, a schematic structural diagram of the problem comparison model is shown in fig. 4. In one embodiment, the first coding layer and the second coding layer can both be coded by using a model of Bert, Bi-lstm, etc., and Project in fig. 4 represents a fully connected network.
And a conversion module 14, configured to convert the first coding feature into a first text feature through a first fully-connected layer of the pre-trained problem comparison model, and convert the second coding feature into a second text feature through a second fully-connected 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.
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, 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 the similarity according to the first text feature and the second text feature, and judging whether the simple question and the complete question in the corresponding group are similar questions according to the calculated similarity.
And a recalling module 16, configured to recall the simplified question and the complete question simultaneously when the prediction result indicates that the simplified question and the complete question in the corresponding group are similar questions.
One application scenario according to the present embodiment is for example: the complete question contained in the same session is "can a cold be applied e-guaranty? "is the brief question" accident worries? When the prediction result is yes, and when a history question is recalled, the' can you put an e for a cold to live a life guarantee? "," accident worship? "recall at the same time.
The history problem recall device 100 based on artificial intelligence provided by this embodiment analyzes whether a simple question similar to a complete question exists in the same session through a pre-trained problem comparison model, and recalls the simple question and the corresponding complete question simultaneously when the simple question and the corresponding complete question exist, so that the context of the history problem is combined in the process of recalling the history problem, the similar questions briefly asked by the user can be recalled together, and the effect of recalling the history problem is better.
In one embodiment, the problem obtaining module 11 further includes:
the first word segmentation unit is used for carrying out word segmentation processing on the historical 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 the historical problem to be a complete problem when the number of the different entities obtained by query is two or more, and otherwise, judging the historical problem to be a simple problem.
One application scenario according to the present embodiment is for example: the existing historical problem "can a cold be guaranteed e live insurance? "," pneumonia woollen? "after the two historical questions are subjected to word segmentation and query, the obtained entities are respectively ' diseases, insurance categories ' and ' diseases ', namely ' can a cold be guaranteed for e? "is a complete question," pneumonia woollen? "is a simple question.
In another embodiment, the problem obtaining module 11 specifically includes:
a word number identification unit for identifying the number of words contained in the sentence of the history question;
and the second judging unit is used for judging the historical question as a simple question when the number of words contained in the statement of the historical question is less than the preset number of words, and otherwise, judging the historical question as a complete question.
The preset word number is, for example, 5 words, that is, when the word number of the history question sentence is less than 5, the history question is determined as a simple question, otherwise, the history question is determined as a complete question.
In one embodiment, the artificial intelligence based historical question recalling apparatus 100 further comprises:
the conversation sample acquisition module is used for acquiring a conversation question training sample pair from historical log data, wherein the conversation question training sample pair comprises a positive example sample pair belonging to the same conversation and a negative example sample pair belonging to different conversations, each pair of positive example samples comprises a simple question and a complete question with similar semantemes, and each pair of negative example samples comprises a simple question and a complete question with irrelevant semantemes;
the sample coding module is used for coding the complete problem in the session problem training sample pair through a first coding layer of the problem comparison model to be trained to obtain a first sample coding characteristic, and coding the simple problem in the session problem training sample pair through a second coding layer of the problem comparison model to be trained to obtain a second sample coding characteristic;
the sample conversion module is used for converting the first sample coding features into first text sample features through a first full-connection layer of a problem 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 problem comparison model to be trained;
a first calculation module for calculating a contrast loss 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 problem comparison model to be trained is converged according to the final loss, adjusting the parameters of the problem comparison model to be trained when the loss function is not converged, and circulating the step until the session problem training sample pair is obtained from the historical log data, so that the trained problem comparison model is obtained when the loss function of the problem comparison model to be trained is converged.
Each pair of the session problem training samples carries a label, and the label is used for marking whether the corresponding session problem training sample pair is a positive example or a negative example. In one embodiment, the pair of training samples of the session question may be labeled with a "0" label as a positive example and a "1" label as a negative example.
In one embodiment, the first calculating module is specifically configured to calculate the contrast loss by the following formula:
Figure BDA0003240220110000151
wherein z isiRepresenting said first text sample feature, zjRepresenting the second text sample feature, S representing a calculated contrast loss.
In one embodiment, the loss function is:
Figure BDA0003240220110000152
wherein z isiRepresenting said first text sample feature, zi +Represents the first text sample feature in the positive example sample pair, τ represents an empirical parameter, and K represents a batch.
It can be understood that, in the process of training the problem comparison model, the pairs of session problem training samples are input into the problem comparison model in batches, the number of the pairs of session problem training samples included in each batch is the same, and the number of the positive example pairs and the number of the negative example pairs included in each batch of the pairs of session problem training samples may be the same or different.
In one embodiment, a smaller value of τ indicates a greater impact of positive samples on the problem-contrast model during the training process, and optionally τ e [0.05, 0.1 ].
Optionally, the artificial intelligence based historical question recalling apparatus 100 further comprises:
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 simple 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 replacing module is used for replacing the first words of the corresponding entities in the complete question with the second words which belong to the same entities to obtain the complete question of the simple question.
In one embodiment, the recall module 16 is specifically configured to: and simultaneously recalling the complete question and the complete question corresponding to the simple question.
In one embodiment, the category of the entity includes, but is not limited to, disease, age, risk category, and the like.
One application scenario according to the present embodiment is for example: the complete question when a concurrent recall is required is "can a cold be applied for e-life? "the brief question is" pneumonia woollen? "when entity query is performed after word segmentation, entities belonging to cold and pneumonia are all diseases, and after word replacement, the complete question of the simple question is obtained as" can pneumonia be guaranteed for e to live for insurance? ".
Another application scenario according to the present embodiment is for example: the complete question when a concurrent recall is required is "can a cold be applied for e-life? "is the brief question" accident worries? "when entity query is performed after word segmentation, the entities belonging to" e live insurance "and" accident "are both dangerous types, and the complete question of the simple question after word replacement is" can a cold be applied with accident? ".
It is understood that when the complete question and the complete question corresponding to the simple question are recalled simultaneously, the displayed result is the complete question and the complete question after the word replacement.
The embodiment enables the user to more clearly and completely know the historical questions asked before and before the user asks the questions after entering the intelligent question-answering system by supplementing and completing the simple questions in the similar questions and recalling and displaying the simple questions and the corresponding common questions together, and the user can more comprehensively, accurately and clearly recall the historical questions.
Wherein the meaning of "first" and "second" in the above modules/units is only to distinguish different modules/units, and is not used to define which module/unit has higher priority or other defining meaning. Furthermore, the terms "comprises," "comprising," and "having," 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 explicitly listed, but may include other steps or modules not explicitly listed or inherent to such process, method, article, or apparatus, and such that a division of modules presented in this application is merely a logical division and may be implemented in a practical application in a further manner.
For specific limitations of the artificial intelligence based historical question recalling apparatus, reference may be made to the above limitations of the artificial intelligence based historical question recalling method, and details thereof are not repeated here. The modules in the artificial intelligence based historical problem recalling device can be wholly or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the 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 comprises a storage medium and an internal memory. The storage medium includes a non-volatile storage medium and/or a volatile storage medium storing an operating system, a computer program, and a database. The internal memory provides an environment for the operating system and computer programs in the storage medium to run. The database of the computer device is used for storing data involved in the artificial intelligence based historical problem recalling method. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement an artificial intelligence based historical problem recall method.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram 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 comprises a storage medium and 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 operating system and computer programs in the storage medium to run. The network interface of the computer device is used for communicating with an external server through a network connection. The computer program is executed by a processor to implement an artificial intelligence based historical problem recall method.
In one embodiment, a computer device is provided, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the artificial intelligence based historical problem recall method in the above-described embodiments, such as the steps 101 to 106 shown in fig. 2 and other extensions of the method and related steps. Alternatively, the processor, when executing the computer program, implements the functions of the modules/units of the artificial intelligence based historical problem recalling apparatus in the above-described embodiment, such as the functions of the modules 11 to 16 shown in fig. 5. To avoid repetition, further description is omitted here.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like which is the control center for the computer device and which connects the various parts of the overall computer device using various interfaces and lines.
The memory may be used to store the computer programs and/or modules, and the processor may implement various functions of the computer device by running or executing the computer programs 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 required by at least one function (such as a sound playing function, an image playing function, etc.), 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 stored thereon a computer program that, when executed by a processor, performs the steps of the artificial intelligence based historical problem recall method of the embodiments described above, such as the steps 101-106 and other extensions and related steps of the method shown in FIG. 2. Alternatively, the computer program, when executed by the processor, implements the functions of the modules/units of the artificial intelligence based historical problem recalling apparatus in the above-described embodiments, such as the functions of the modules 11 to 16 shown in fig. 5. To avoid repetition, further description is omitted here.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile and/or volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the computer program is executed. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile 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), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present 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 solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. An artificial intelligence based historical question recalling method, which is characterized by comprising the following steps:
acquiring historical problems comprising simple questions and complete questions in the same session;
combining every two simplified questions and any one complete question to obtain multiple groups of historical questions;
respectively coding simple questions and complete questions 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 first coding features and second coding features;
converting the first coding features into first text features through a first full-link layer of a pre-trained problem comparison model, and converting the second coding features into second text features through a second full-link layer of the pre-trained problem comparison model;
respectively inputting the first text characteristic and the second text characteristic 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 or not;
and when the prediction result indicates that the simple question and the complete question in the corresponding group are similar questions, recalling the simple question and the complete question simultaneously.
2. The artificial intelligence based historical question recalling method according to claim 1, wherein the step of obtaining the historical questions containing the simplified questions and the complete questions in the same session further comprises:
performing word segmentation processing on the historical problem to obtain a plurality of words;
inquiring the entity to which each word belongs according to a pre-stored mapping relation table;
and when the number of the different entities obtained by query is two or more, judging the historical question to be a complete question, otherwise, judging the historical question to be a simple question.
3. The artificial intelligence based historical question recall method of claim 1 wherein the step of training the question comparison model comprises:
acquiring conversation problem training sample pairs from historical log data, wherein the conversation problem training sample pairs comprise positive example sample pairs belonging to the same conversation and negative example sample pairs belonging to different conversations, each pair of positive example samples comprises simple question and complete question with similar semantemes, and each pair of negative example samples comprises simple question and complete question with irrelevant semantemes;
coding the complete questions in the session question training sample pair through a first coding layer of a 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;
converting the first sample coding features into first text sample features through a first full-link layer of a problem comparison model to be trained, and converting the second sample coding features into second text sample features through a second full-link layer of the problem comparison model to be trained;
calculating a loss of contrast 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;
and judging whether the loss function of the problem comparison model to be trained is converged according to the final loss, adjusting the parameters of the problem comparison model to be trained when the loss function is not converged, and circulating the step of obtaining the session problem training sample pair from the historical log data until the loss function of the problem comparison model to be trained is converged to obtain the trained problem comparison model.
4. The artificial intelligence based historical question recall method of claim 3 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 was calculated by the following formula:
Figure FDA0003240220100000021
wherein z isiRepresenting said first text sample feature, zjRepresenting the second text sample feature, S representing a calculated contrast loss.
5. The artificial intelligence based historical problem recall method of claim 3 wherein the loss function is:
Figure FDA0003240220100000031
wherein z isiRepresenting said first text sample feature, zi +Represents the first text sample feature in the positive example sample pair, τ represents an empirical parameter, and K represents a batch.
6. The artificial intelligence based historical question recall method according to claim 1, wherein after the step of when the predicted result indicates that the simplified question and the complete question in the corresponding group are similar questions, the method further comprises:
performing word segmentation processing on the complete problem to obtain a plurality of first words;
performing word segmentation processing on the brief question to obtain at least one second word;
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 replacing the first words of the corresponding entities in the complete question by the second words with the same entities to obtain the complete question of the simple question.
7. The artificial intelligence based historical question recalling method according to claim 6, wherein the step of recalling the simplified question and the complete question simultaneously further comprises:
and simultaneously recalling the complete question and the complete question corresponding to the simple question.
8. An artificial intelligence based historical question recalling apparatus, the apparatus comprising:
the problem acquisition module is used for acquiring historical problems containing simple problems and complete problems in the same session;
the combination module is used for combining each simplified question and any one complete question in pairs to obtain a plurality of groups of historical questions;
the coding module is used for respectively coding simple questions and complete questions 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 first coding features and second coding features;
the conversion module is used for converting the first coding features into first text features through a first full-link layer of a pre-trained problem comparison model and converting the second coding features into second text features through a second full-link layer of the pre-trained problem comparison model;
the prediction module is used for respectively inputting the first text characteristic and the second text characteristic 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 recalling 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.
9. 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 historical problem recall method of any one of claims 1 to 7.
10. 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 historical problem recall method according to any one of claims 1 to 7.
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 true CN113688246A (en) 2021-11-23
CN113688246B 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 (5)

* 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
US20200257861A1 (en) * 2019-02-13 2020-08-13 Oracle International Corporation Chatbot conducting a virtual social dialogue
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

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200257861A1 (en) * 2019-02-13 2020-08-13 Oracle International Corporation Chatbot conducting a virtual social dialogue
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
CN113688246B (en) 2023-09-26

Similar Documents

Publication Publication Date Title
CN111324713B (en) Automatic replying method and device for conversation, storage medium and computer equipment
CN109800307B (en) Product evaluation analysis method and device, computer equipment and storage medium
CN113505205A (en) System and method for man-machine conversation
EP3979098A1 (en) Data processing method and apparatus, storage medium, and electronic apparatus
CN112948534A (en) Interaction method and system for intelligent man-machine conversation and electronic equipment
CN112084789A (en) Text processing method, device, equipment and storage medium
CN111291172A (en) Method and device for processing text
CN110597965B (en) Emotion polarity analysis method and device for article, electronic equipment and storage medium
CN114550241B (en) Face recognition method and device, computer equipment and storage medium
CN112287068A (en) Artificial intelligence-based inquiry dialogue data processing method and device
CN112101042A (en) Text emotion recognition method and device, terminal device and storage medium
CN113688245A (en) Method, device and equipment for processing pre-training language model based on artificial intelligence
CN114399396A (en) Insurance product recommendation method and device, computer equipment and storage medium
CN114266946A (en) Feature identification method and device under shielding condition, computer equipment and medium
CN113919363A (en) Sentence vector generation model processing method, device and equipment based on artificial intelligence
CN113434648A (en) Meta learning method, device and equipment of text classification model and storage medium
CN113158057A (en) Buddha meridian recommendation processing device, computer equipment and storage medium
CN113688246A (en) Artificial intelligence-based historical problem recall method and device and related equipment
CN113255368B (en) Method and device for emotion analysis of text data and related equipment
CN114266324B (en) Model visualization modeling method and device, computer equipment and storage medium
CN113626468B (en) SQL sentence generation method, device and equipment based on artificial intelligence and storage medium
CN114969544A (en) Hot data-based recommended content generation method, device, equipment and medium
CN114428838A (en) Content recall method and device, computer equipment and storage medium
CN114238798A (en) Search ranking method, system, device and storage medium based on neural network
CN115881103B (en) Speech emotion recognition model training method, speech emotion recognition method and device

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