CN115544203A - Machine learning-based inquiry method, device, medium and electronic equipment - Google Patents

Machine learning-based inquiry method, device, medium and electronic equipment Download PDF

Info

Publication number
CN115544203A
CN115544203A CN202110729423.7A CN202110729423A CN115544203A CN 115544203 A CN115544203 A CN 115544203A CN 202110729423 A CN202110729423 A CN 202110729423A CN 115544203 A CN115544203 A CN 115544203A
Authority
CN
China
Prior art keywords
question
user
target
questions
word
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110729423.7A
Other languages
Chinese (zh)
Inventor
张思强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Securities Co Ltd
Original Assignee
Ping An Securities Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Securities Co Ltd filed Critical Ping An Securities Co Ltd
Priority to CN202110729423.7A priority Critical patent/CN115544203A/en
Publication of CN115544203A publication Critical patent/CN115544203A/en
Pending legal-status Critical Current

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/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • 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/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Databases & Information Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure relates to the field of natural language processing, and discloses a query method, device, medium and electronic device based on machine learning. The method comprises the following steps: acquiring a user question, and extracting keywords in the user question according to the interword distance in the user question; inputting keywords in the user questions into a question matching model to obtain target questions matched with the user questions, wherein the question matching model is obtained by training keyword samples based on the user questions and question labels corresponding to the keyword samples; searching a target answer corresponding to the target question from a robot brain file according to the target question, wherein the robot brain file is generated by loading files in a question library in advance; and sending the target answer to a terminal. According to the method, the accuracy of question searching and the searching efficiency of answers are improved, and further the response speed and the accuracy of question answering are improved.

Description

Query method, device, medium and electronic device based on machine learning
Technical Field
The present disclosure relates to the field of natural language processing technologies, and in particular, to a query method, device, medium, and electronic device based on machine learning.
Background
In many application environments requiring inquiry, a user can be helped to answer various questions through manual customer service, but under the condition of more questions, the inquiry requirement of the user is automatically realized generally by constructing an inquiry system, the user can input the questions requiring inquiry through the inquiry system, and the system automatically feeds back answers to the terminal. However, this method often fails to accurately answer or process the user's question, so that the final output solution is not accurate enough and the response speed is not high.
Disclosure of Invention
In order to solve the above technical problems, an object of the present disclosure is to provide a query method, device, medium, and electronic device based on machine learning in the field of natural language processing.
According to an aspect of the present disclosure, there is provided a machine learning-based query method, the method including:
acquiring a user question, and extracting a keyword in the user question according to an inter-word distance in the user question, wherein the keyword is a word of which the corresponding inter-word distance in the user question is greater than a preset inter-word distance threshold value, and the inter-word distance is calculated according to the position of the word in the user question;
inputting keywords in the user questions into a question matching model, obtaining at least two candidate target questions through the calculation of the question matching model based on parameters in a neural network model, and selecting target questions matched with the user questions from the candidate target questions, wherein the question matching model is obtained by training a keyword sample based on the user questions and question labels corresponding to the keyword sample;
searching a target answer corresponding to the target question from a robot brain file according to the target question, wherein the robot brain file is generated by loading files in a question library in advance;
and sending the target answer to a terminal.
According to another aspect of the present disclosure, there is provided a machine learning-based query apparatus, the apparatus including:
the extraction module is configured to acquire a user question and extract a keyword in the user question according to an inter-word distance in the user question, wherein the keyword is a word of which the corresponding inter-word distance in the user question is greater than a preset inter-word distance threshold value, and the inter-word distance is calculated according to the position of the word in the user question;
the input module is configured to input keywords in the user questions into a question matching model, obtain at least two candidate target questions through calculation of the question matching model based on parameters in a neural network model, and select target questions matched with the user questions from the candidate target questions, wherein the question matching model is obtained through training of keyword samples based on the user questions and question labels corresponding to the keyword samples;
the searching module is configured to search a target answer corresponding to the target question from a robot brain file according to the target question, wherein the robot brain file is generated by loading files in a question library in advance;
a sending module configured to send the target answer to a terminal.
According to another aspect of the present disclosure, there is provided a computer readable program medium storing computer program instructions which, when executed by a computer, cause the computer to perform the method as described above.
According to another aspect of the present disclosure, there is provided an electronic device including:
a processor;
a memory having computer readable instructions stored thereon which, when executed by the processor, implement the method as previously described.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
for a machine learning based query method, apparatus, medium and electronic device provided by the present disclosure, the method comprises the steps of: acquiring a user question, and extracting a keyword in the user question according to an inter-word distance in the user question, wherein the keyword is a word of which the corresponding inter-word distance in the user question is greater than a preset inter-word distance threshold value, and the inter-word distance is calculated according to the position of the word in the user question; inputting keywords in the user questions into a question matching model, obtaining at least two candidate target questions through the calculation of the question matching model based on parameters in a neural network model, and selecting target questions matched with the user questions from the candidate target questions, wherein the question matching model is obtained by training a keyword sample based on the user questions and question labels corresponding to the keyword sample; searching a target answer corresponding to the target question from a robot brain file according to the target question, wherein the robot brain file is generated by loading files in a question library in advance; and sending the target answer to a terminal.
According to the method, the user questions are obtained, the keywords of the user questions are input into the question matching model, the target questions matched with the user questions are obtained, the target answers corresponding to the target questions are searched from the question library, the target questions corresponding to the user questions are searched by establishing the question matching model based on a machine learning method, the precision of question searching is improved, the target answers corresponding to the target questions are searched from the pre-loaded robot brain file, the answer searching efficiency is improved, and the response speed and the accuracy of question answering are improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a system architecture diagram illustrating a method of machine learning-based interrogation in accordance with an exemplary embodiment;
FIG. 2 is a flow diagram illustrating a method of machine learning based querying in accordance with an exemplary embodiment;
FIG. 3 is a schematic diagram illustrating the structure of a problem matching model in accordance with an exemplary embodiment;
FIG. 4 is a flow diagram illustrating a machine learning-based query methodology for use in the field of operation and maintenance problem solving, according to an exemplary embodiment;
FIG. 5 is a block diagram of a machine learning based interrogation apparatus, according to an example embodiment;
FIG. 6 is a block diagram illustrating an example electronic device implementing the above-described machine learning-based query method in accordance with one example embodiment;
fig. 7 is a program product for implementing the above-described machine learning-based query method according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings in which the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities.
The present disclosure first provides a machine learning-based query method. The inquiry method based on the machine learning can be used in the field of solving platform operation and maintenance problems, and the platform can be various types of platforms such as a transaction platform.
The implementation terminal of the present disclosure may be any device having computing, processing, and communication functions, which may be connected to an external device for receiving or sending data, and specifically may be a portable mobile device, such as a smart phone, a tablet computer, a notebook computer, a PDA (Personal Digital Assistant), or the like, or may be a fixed device, such as a computer device, a field terminal, a desktop computer, a server, a workstation, or the like, or may be a set of multiple devices, such as a physical infrastructure of cloud computing or a server cluster.
Optionally, the implementation terminal of the present disclosure may be a server or a physical infrastructure of cloud computing.
Fig. 1 is a system architecture diagram illustrating a method of machine learning based querying in accordance with an exemplary embodiment. As shown in fig. 1, the system architecture includes a personal computer 110, a server 120 and a database 130, and the personal computer 110 and the server 120 and the database 130 are connected via communication links, which can be used to send or receive data. The server 120 is an implementation terminal in this embodiment, on which a question matching model is deployed, and the database 130 is a question bank. When a machine learning based query method provided by the present disclosure is applied to the system architecture shown in fig. 1, one procedure may be as follows: first, the server 120 loads the files in the database 130 to generate a robot brain file; next, the server 120 retrieves the user questions submitted by the user of the personal computer 110; next, the server 120 extracts a keyword from the user question, and inputs the keyword into a deployed question matching model to obtain a target question; then, the server 120 finds a target answer corresponding to the target question from the brain file of the robot; finally, the server 120 transmits the target answer to the personal computer 110.
It is worth mentioning that fig. 1 is only one embodiment of the present disclosure. Although the enforcement terminal in this embodiment is a server and the source terminal of the user question is a personal computer, in other embodiments, the enforcement terminal and the source terminal of the user question may be various terminals or devices as described above; although in the present embodiment, the server 120 generates the robot brain file before the server 120 obtains the user question, in other embodiments or specific applications, the server 120 generates the robot brain file may also be performed after the server 120 obtains the user question, as long as the step of the server 120 generating the robot brain file is performed before the server 120 searches the target answer from the robot brain file. The present disclosure is not intended to be limited thereby, nor should the scope of the present disclosure be limited thereby.
FIG. 2 is a flow chart illustrating a method of machine learning based interrogation according to an exemplary embodiment. The machine learning-based query method provided by the embodiment may be executed by a server, as shown in fig. 2, and includes the following steps:
step 210, obtaining a user question, and extracting a keyword in the user question according to an interword distance in the user question.
The keywords are words of which the corresponding inter-word distance in the user question is greater than a preset inter-word distance threshold value, and the inter-word distance is obtained through calculation according to the positions of the words in the user question.
In one embodiment of the present application, the inter-word distance is calculated by the following formula:
Figure BDA0003138780400000051
wherein, last a Indicating the position of the last word a in the text, first a Representing the position of the first occurrence of word a in the text and Σ a representing the total number of words in the text.
In the embodiment, the keywords in the user question are extracted by calculating the distance between the words. Specifically, in this embodiment, the inter-word distance is used to indicate a distance between a first occurrence and a last occurrence of a word or phrase in a question, and a larger inter-word distance indicates that the word is more important to a text, which may reflect a core element of a user question.
In this embodiment, the user problem may include a problem encountered in the operation and maintenance process, and specifically may be that a software program is messy, no user operation information is received for a long time when a user operation is required, and an invalid operation executed by the user is received for multiple times. In theory, any node in the process of using the application software by the user running can be regarded as a problem for the user as long as the phenomenon of running interruption of the application software program is generated.
Optionally, the problem encountered by the user when running the application software may also be a problem uploaded by the user, or a problem automatically detected by the system.
Specifically, in the embodiment, it may be set that, in the operation and maintenance process of the user, whether a problem occurs is detected in real time, that is, whether the user encounters a problem in the use process is determined in real time, and specifically, the method may be implemented by determining whether the application program is interrupted or repeated for multiple times.
The problem detection process may be performed by the application software itself, or may be performed by another software detection program. When the application software is used for completion, a software operation detection program can be set in the application software program to detect whether the operation of the application software program is smooth or not and whether a problem occurs or not; when the software detection is completed by other software detection programs, other software detection programs can be set to monitor the running process of the application software, and whether the application software has problems or abnormal conditions in the operation and maintenance process is judged.
When the user question is a question uploaded by the user, the user question can be acquired through a text entry box in the Web page.
In one embodiment of the present application, before obtaining the user question, the method further comprises:
and judging whether the access request of the user is legal or not, wherein the user problem is acquired under the condition that the access request of the user is judged to be legal.
For example, the IP address of the access request may be obtained, and whether the access request is legal may be determined by determining whether the IP address is a blacklist IP address.
In the embodiment, whether the access request is legal or not is judged firstly, so that the inquiry of the problem can be carried out only through the legal request, and the information safety is ensured.
In one embodiment of the present application, before obtaining the user question, the method further comprises:
judging whether the access request of the user is legal or not;
if the access request of the user is legal, acquiring authentication information carried in the access request;
and judging whether the authentication information passes the authentication, wherein the user question is acquired under the condition that the authentication information is judged to pass the authentication.
For example, the authentication information may include a picture of a user identity card and a picture of a user face, and whether the person in the picture of the user identity card and the person in the picture of the user face are the same person is determined by determining the similarity between the picture of the user identity card and the picture of the user face, if so, the authentication information is determined to pass the authentication, otherwise, the authentication information is determined not to pass the authentication.
In the embodiment, the authentication information is authenticated by judging whether the access request is legal or not, so that only the user who passes the authentication and submits the legal request can inquire the problem, and the safety of the information is further ensured.
Besides, the keywords in the user question can be extracted through the word segmentation model, which is described in detail as follows:
when the word segmentation model is constructed, firstly, the use frequency of single Chinese characters in a problem sample is counted, the association distance between the Chinese characters is determined according to the use frequency, and the word segmentation model is established according to the association distance between the Chinese characters. Illustratively, the question input by the user is "start-up is not to enter the system", wherein the word "start" of the word "start" and the word "machine" are used together with high frequency, and the word "system" of the word "system" and the word "system" are used together with high frequency, so that the word "start-up" and the word "system" can be determined as keywords.
Step 220, inputting the keywords in the user question into a question matching model, obtaining at least two candidate target questions by the question matching model based on the calculation of parameters in the neural network model, and selecting the target question matched with the user question from the candidate target questions.
The problem matching model is obtained by training a keyword sample based on a user problem and a problem label corresponding to the keyword sample.
In one embodiment of the present application, before entering the keywords in the user question into a question matching model, the method further comprises:
acquiring a keyword sample and a problem label corresponding to the keyword sample;
inputting the keyword sample into a preset neural network model to obtain an output result;
determining a loss function of the training according to the character matching degree between the output result and the problem label;
and adjusting parameters of the neural network model based on the loss function to obtain a problem matching model.
In the present embodiment, a training process of the problem matching model is involved.
Specifically, when training the problem matching model, since the number of keywords obtained through the user problem may be multiple, in this embodiment, the problem matching model is first constructed based on the framework of the multitask learning mode. FIG. 3 is a schematic diagram illustrating a structure of a problem matching model, according to an example embodiment. Please refer to fig. 3, conv _1, conv _2, and conv _3respectively represent network modules with residuals; fc _1 represents a fully connected layer having multiple dimensions, for example 1024 dimensions.
As shown in fig. 3, in consideration of the processing efficiency of the background, the problem matching model adopts a multi-task model, that is, a plurality of tasks share a backbone network, in this embodiment, several network layers of Conv _1, conv_2, conv_3, and fc_1 are shared network layers, and each task shares parameters of the network layers, so as to obtain problems corresponding to each keyword, such as problem one, problem two, and problem three in fig. 3, by passing a plurality of keywords through the shared network in the multi-task model.
After obtaining the at least two questions, selecting one of the at least two questions as an output result. And obtaining the loss function of the training by calculating the character matching degree between the output result and the problem label. And finally, adjusting parameters of the neural network model based on the loss function to obtain a problem matching model.
In an embodiment of the present application, the determining a loss function of the training according to the character matching degree between the output result and the question label includes:
performing word segmentation on the output result to obtain a first word segmentation sequence;
performing word segmentation on the question label to obtain a second word segmentation sequence;
calculating the similarity between the first word segmentation sequence and the second word segmentation sequence, and determining the character matching degree according to the similarity;
and determining a loss function of the training according to the character matching degree.
Specifically, in the manner of calculating the word matching degree in this embodiment, word segmentation is performed on two objects respectively to obtain corresponding word segmentation sequences, and then the similarity between the first word segmentation sequence and the second word segmentation sequence is calculated to serve as the word matching degree. In this embodiment, the similarity between the first term sequence and the second term sequence may be calculated by the following formula:
Figure BDA0003138780400000081
wherein, A and B respectively represent two participle sequences, and the first participle sequence A comprises participle A 1 、A 2 、…、A n The second word segmentation sequence B comprises word segmentation B 1 、B 2 、…、B n
And step 230, searching a target answer corresponding to the target question from a brain file of the robot according to the target question.
Wherein the robot brain file is generated by loading files in a question bank in advance.
The robot brain file includes at least a portion of the files in the problem bank. The files in the question bank include questions and corresponding answers, and the robot brain file includes a plurality of questions and answers corresponding to each question.
In this embodiment, corresponding answers are set in advance for various questions, and after the target question corresponding to the user question is determined through the above process, the corresponding target answer is found from the brain file of the robot based on the target question.
Optionally, in an application scenario in which an automatic response is made to an operation and maintenance question, the embodiment arranges the common operation and maintenance questions into a book and uploads the book to the server to generate a question bank, so that a user can obtain a corresponding operation and maintenance knowledge point in a form of remotely accessing a webpage.
Optionally, in this embodiment, the operation and maintenance problem may be converted into an AIML form through an artificial intelligence markup intelligence language (AIML), so as to generate a problem library. And then developing a set of navigation intelligent customer service by using a python or java language, and dynamically answering common operation and maintenance problems consulted by the user all weather.
In one embodiment of the present application, the robot brain file is generated by loading all files in the problem bank in advance.
The method provided by the embodiment of the application can be used in an intelligent customer service processing program, and the brain file of the robot can be generated by loading all files in the question bank when the intelligent customer service processing program is started.
In one embodiment of the application, files in the problem bank are loaded into the robot brain file periodically.
In this embodiment, the robot brain file is periodically updated by periodically loading the files in the question bank.
In one embodiment of the application, the robot brain file is generated by loading files corresponding to common questions in a question bank in advance.
Common questions may be determined by counting user questions. In this embodiment, since the robot brain file is generated by loading in advance files corresponding to common questions in the question bank, and user questions are likely to be common questions, the file size of the robot brain file is reduced while the target answer search efficiency is ensured, thereby saving the storage space.
In one embodiment of the present application, the robot brain file is stored in the memory of the disclosed implementation terminal.
Storing data in memory may improve access speed compared to storing data in a hard disk of a terminal embodying the present disclosure or in a database external to the terminal embodying the present disclosure. Therefore, the robot brain file is stored in the memory of the implementation terminal of the disclosure, so that the speed of searching for the target answer can be increased, and the response speed of answering questions is improved.
In an embodiment of the present application, after searching a target answer corresponding to the target question from a brain file of a robot according to the target question, the method further includes:
if the target answer corresponding to the target question cannot be found from the robot brain file, loading a file which is not loaded into the robot brain file in the question bank into the robot brain file;
and searching the target answer corresponding to the target question from the robot brain file again.
Specifically, when the target answer corresponding to the target question is searched for again from the brain file of the robot, the target answer corresponding to the target question is actually searched for from an unrelooked-up portion of the brain file of the robot.
The part which is not searched in the robot brain file, namely the file which is not loaded in the robot brain file in the problem library is generated by loading the file in the problem library in advance, and the problem library can be updated at any time, so the robot brain file does not contain the file which is newly added for updating the problem library; when the robot brain file is generated by loading the files corresponding to the common problems in the problem library in advance, the robot brain file does not contain the files corresponding to the uncommon problems in the problem library.
In the embodiment, the files in the question bank are loaded again, so that the comprehensiveness of the query is improved.
In an embodiment of the present application, after searching again the target answer corresponding to the target question from the robot brain file, the method further includes:
if the target answer corresponding to the target question cannot be found from the robot brain file again, returning reminding information for representing the result of no related question to the terminal;
triggering manual customer service according to the service request of the user, and sending manual answer information provided by the manual customer service to the terminal;
and updating the question bank according to the manual answering information and the user questions.
In this embodiment, if the target answer corresponding to the target question cannot be found from the brain file of the robot again, it is described that the answer cannot be given based on the data in the question bank, that is, the intelligent analysis engine cannot give the answer scheme, and at this time, the artificial answer information is provided by the artificial customer service and the question bank is updated according to the artificial answer information, so that the user question is solved, and data support is provided for other users to ask similar questions in the future.
And 240, sending the target answer to the terminal.
In this embodiment, after the target answer is determined, the target answer is sent to the terminal to be displayed on an application interface of the terminal.
In addition, if the execution subject of the embodiment is the terminal itself, the target answer can be directly found and displayed on the corresponding interface.
In one embodiment of the present application, after sending the target answer to the terminal, the method further includes:
obtaining satisfaction information of a user of the terminal to the target answer;
and if the user of the terminal is determined to be unsatisfactory to the target answer according to the satisfaction information, storing the user question and the target answer so as to update the question bank according to the user question and the target answer.
After obtaining the target answer, the user may select and submit the satisfaction (for example, the satisfaction is highest 10 points, and the satisfaction is submitted in a scoring manner) on the interface, and when the user is not satisfied, it indicates that the target answer is not matched with the user question, at this time, the user question and the target answer are stored, and then the user question and the target answer may be sent to a terminal of a maintenance person, and the maintenance person may add the user question and a corresponding correct answer to a question bank or modify the target answer according to the user question and the target answer.
In the embodiment, the problem database can be updated in a targeted manner according to the satisfaction information of the user on the target answer, so that the reliability of the data in the problem database is further improved.
In one embodiment of the present application, the method further comprises: and updating the question bank in batches.
The batch update of the question bank may be performed periodically or aperiodically.
When a large number of new knowledge points need to be solved, the problem database is updated in batch, so that the problem database is more comprehensive.
FIG. 4 is a flow chart illustrating a machine learning-based query method for use in the field of operation and maintenance problem solving, according to an exemplary embodiment. The machine learning-based query method provided by the embodiment of the present disclosure is further described below with reference to fig. 4. Firstly, a user accesses a Web Server through IP or a domain name, the Web Server judges whether a user request is legal or not, and if the user request is an illegal request, the access is refused; if the Web Server receives a user legal request, inputting a user question into an intelligent customer service processing program; then, the intelligent customer service processing program can read a robot brain file pre-loaded with common operation and maintenance problems (the operation and maintenance problems exist in the form of AIML files and are stored in a Git database), then judges whether the answers of the user are in the robot brain file, if yes, the answers are fed back to the user, and if not, the latest operation and maintenance problem AIML files are reloaded and stored in the brain file; and then judging whether the user answer is in the newly loaded file, if so, feeding back the answer to the user, otherwise, feeding back the user to inform a result of no relevant problem and ask the user to seek manual help. In addition, the AIML file of the operation and maintenance problem can be updated irregularly through the piloting operation and maintenance system and uploaded to the Git database.
The embodiment realizes automatic response to the operation and maintenance questions of the trading platform.
In the embodiment, the common operation and maintenance problems are arranged into the book and uploaded to the server, so that the knowledge points can be timely updated and effectiveness can be guaranteed. The user acquires the corresponding operation and maintenance knowledge points in a remote webpage access mode, dependence on people is eliminated, and access convenience is improved. The operation and maintenance problems are converted into an AIML form by adopting an artificial intelligence markup intelligent language (AIML), then a set of navigation intelligent customer service is developed by utilizing python or java language, and the common operation and maintenance problems consulted by the user are answered dynamically and all the day. In addition, the problem matching model is constructed by the method based on machine learning, so that the accuracy of problem searching is improved, and the efficiency and accuracy of question answering are improved.
In summary, according to the query method based on machine learning provided by the embodiment of fig. 2, the target question corresponding to the user question is found by constructing the question matching model based on the machine learning method, so that the precision of question search is improved, the target answer corresponding to the target question is found from the pre-loaded brain file of the robot, so that the answer search efficiency is improved, and further, the response speed and the accuracy of question answer are improved.
The disclosure also provides a query device based on machine learning, and the following are device embodiments of the disclosure.
Fig. 5 is a block diagram illustrating a machine learning based interrogation apparatus in accordance with an exemplary embodiment. As shown in fig. 5, the apparatus 500 includes:
an extracting module 510, configured to obtain a user question, and extract a keyword in the user question according to an inter-word distance in the user question, where the keyword is a word in the user question, where a corresponding inter-word distance is greater than a predetermined inter-word distance threshold, and the inter-word distance is calculated according to a position of the word in the user question;
an input module 520, configured to input keywords in the user questions into a question matching model, obtain at least two candidate target questions from the question matching model based on calculation of parameters in a neural network model, and select a target question matched with the user question from the candidate target questions, where the question matching model is obtained by training a keyword sample based on the user question and a question tag corresponding to the keyword sample;
a searching module 530 configured to search a target answer corresponding to the target question from a robot brain file according to the target question, wherein the robot brain file is generated by loading files in a question library in advance;
a sending module 540 configured to send the target answer to the terminal.
According to a third aspect of the present disclosure, there is also provided an electronic device capable of implementing the above method.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 600 according to this embodiment of the invention is described below with reference to fig. 6. The electronic device 600 shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 6, the electronic device 600 is embodied in the form of a general purpose computing device. The components of the electronic device 600 may include, but are not limited to: the at least one processing unit 610, the at least one memory unit 620, and a bus 630 that couples the various system components including the memory unit 620 and the processing unit 610.
Wherein the storage unit stores program code that is executable by the processing unit 610 such that the processing unit 610 performs the steps according to various exemplary embodiments of the present invention as described in the section "example methods" above in this specification.
The storage unit 620 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM) 621 and/or a cache memory unit 622, and may further include a read only memory unit (ROM) 623.
The storage unit 620 may also include a program/utility 624 having a set (at least one) of program modules 625, such program modules 625 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 630 may be one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 600 may also communicate with one or more external devices 800 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 600, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 600 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 650, such as with a display unit 640. Also, the electronic device 600 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the Internet) via the network adapter 660. As shown, the network adapter 660 communicates with the other modules of the electronic device 600 over the bus 630. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, and may also be implemented by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
According to a fourth aspect of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-mentioned method of the present specification. In some possible embodiments, the various aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above section "exemplary method" of this description, when said program product is run on said terminal device.
Referring to fig. 7, a program product 700 for implementing the above method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (10)

1. A method of machine learning based interrogation, the method comprising:
acquiring a user question, and extracting a keyword in the user question according to an inter-word distance in the user question, wherein the keyword is a word of which the corresponding inter-word distance in the user question is greater than a preset inter-word distance threshold value, and the inter-word distance is calculated according to the position of the word in the user question;
inputting keywords in the user questions into a question matching model, obtaining at least two candidate target questions by the question matching model based on calculation of parameters in a neural network model, and selecting target questions matched with the user questions from the candidate target questions, wherein the question matching model is obtained by training keyword samples based on the user questions and question labels corresponding to the keyword samples;
searching a target answer corresponding to the target question from a robot brain file according to the target question, wherein the robot brain file is generated by loading files in a question library in advance;
and sending the target answer to a terminal.
2. The method of claim 1, wherein prior to entering keywords in the user question into a question matching model, the method further comprises:
obtaining a keyword sample and a problem label corresponding to the keyword sample;
inputting the keyword sample into a preset neural network model to obtain an output result;
determining a loss function of the training according to the character matching degree between the output result and the problem label;
and adjusting parameters of the neural network model based on the loss function to obtain a problem matching model.
3. The method of claim 2, wherein determining the loss function of the training according to the text matching degree between the output result and the question label comprises:
performing word segmentation on the output result to obtain a first word segmentation sequence;
performing word segmentation on the problem label to obtain a second word segmentation sequence;
calculating the similarity between the first word segmentation sequence and the second word segmentation sequence, and determining the character matching degree according to the similarity;
and determining a loss function of the training according to the character matching degree.
4. The method according to claim 1, wherein after searching a target answer corresponding to the target question from a brain file of a robot according to the target question, the method further comprises:
if the target answer corresponding to the target question cannot be found from the robot brain file, loading a file which is not loaded into the robot brain file in the question bank into the robot brain file;
and searching the target answer corresponding to the target question from the robot brain file again.
5. The method according to claim 4, wherein after searching the target answer corresponding to the target question from the robot brain file again, the method further comprises:
if the target answer corresponding to the target question cannot be found from the robot brain file again, returning reminding information for indicating no relevant question result to the terminal;
triggering manual customer service according to the service request of the user, and sending manual answer information provided by the manual customer service to the terminal;
and updating the question bank according to the manual answering information and the user questions.
6. The method of claim 1, wherein after sending the target answer to a terminal, the method further comprises:
obtaining satisfaction information of a user of the terminal to the target answer;
and if the user of the terminal is determined to be unsatisfactory to the target answer according to the satisfaction information, storing the user question and the target answer so as to update the question bank according to the user question and the target answer.
7. The method according to any one of claims 1-6, wherein the inter-word distance is calculated by the following formula:
Figure FDA0003138780390000021
wherein, last a Indicating the position of the last word a in the text, firsta indicating the position of the first occurrence of word a in the text, and Σ a indicating the total number of words in the text.
8. A machine learning based query apparatus, the apparatus comprising:
the extraction module is configured to acquire a user question and extract a keyword in the user question according to an inter-word distance in the user question, wherein the keyword is a word of which the corresponding inter-word distance in the user question is greater than a preset inter-word distance threshold value, and the inter-word distance is calculated according to the position of the word in the user question;
the input module is configured to input keywords in the user questions into a question matching model, obtain at least two candidate target questions through calculation of the question matching model based on parameters in a neural network model, and select target questions matched with the user questions from the candidate target questions, wherein the question matching model is obtained through training of keyword samples based on the user questions and question labels corresponding to the keyword samples;
the searching module is configured to search a target answer corresponding to the target question from a robot brain file according to the target question, wherein the robot brain file is generated by loading files in a question library in advance;
a sending module configured to send the target answer to a terminal.
9. A computer-readable program medium, characterized in that it stores computer program instructions which, when executed by a computer, cause the computer to perform the method according to any one of claims 1 to 7.
10. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory having stored thereon computer readable instructions which, when executed by the processor, implement the method of any of claims 1 to 7.
CN202110729423.7A 2021-06-29 2021-06-29 Machine learning-based inquiry method, device, medium and electronic equipment Pending CN115544203A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110729423.7A CN115544203A (en) 2021-06-29 2021-06-29 Machine learning-based inquiry method, device, medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110729423.7A CN115544203A (en) 2021-06-29 2021-06-29 Machine learning-based inquiry method, device, medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN115544203A true CN115544203A (en) 2022-12-30

Family

ID=84705490

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110729423.7A Pending CN115544203A (en) 2021-06-29 2021-06-29 Machine learning-based inquiry method, device, medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN115544203A (en)

Similar Documents

Publication Publication Date Title
US11151177B2 (en) Search method and apparatus based on artificial intelligence
US20190188326A1 (en) Domain specific natural language understanding of customer intent in self-help
US11861319B2 (en) Chatbot conducting a virtual social dialogue
US20220035845A1 (en) Search indexing using discourse trees
JP2020537224A (en) Determining cross-document rhetorical connections based on parsing and identification of named entities
US11238050B2 (en) Method and apparatus for determining response for user input data, and medium
CN112926308B (en) Method, device, equipment, storage medium and program product for matching text
EP3961426A2 (en) Method and apparatus for recommending document, electronic device and medium
CN116501960B (en) Content retrieval method, device, equipment and medium
US11379527B2 (en) Sibling search queries
WO2023122051A1 (en) Contextual clarification and disambiguation for question answering processes
CN115168545A (en) Group searching method, device, electronic equipment and medium
CN114580383A (en) Log analysis model training method and device, electronic equipment and storage medium
US11610401B2 (en) Acquiring public opinion and training word viscosity model
CN114186040A (en) Operation method of intelligent robot customer service
CN113590756A (en) Information sequence generation method and device, terminal equipment and computer readable medium
CN111797211B (en) Service information searching method, device, computer equipment and storage medium
CN113051389A (en) Knowledge pushing method and device
CN115544203A (en) Machine learning-based inquiry method, device, medium and electronic equipment
US11599801B2 (en) Method for solving problem, computing system and program product
CN114490986A (en) Computer-implemented data mining method, computer-implemented data mining device, electronic device, and storage medium
CN111324820B (en) Inviting method, inviting device, terminal equipment and computer storage medium
CN111753548A (en) Information acquisition method and device, computer storage medium and electronic equipment
CN109844737B (en) Method and apparatus for unsupervised information extraction
CN117171433A (en) Logistics information acquisition 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