CN113935397A - Intelligent interaction method and device - Google Patents

Intelligent interaction method and device Download PDF

Info

Publication number
CN113935397A
CN113935397A CN202111108553.5A CN202111108553A CN113935397A CN 113935397 A CN113935397 A CN 113935397A CN 202111108553 A CN202111108553 A CN 202111108553A CN 113935397 A CN113935397 A CN 113935397A
Authority
CN
China
Prior art keywords
user interaction
interaction information
entity
database
preset
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
CN202111108553.5A
Other languages
Chinese (zh)
Inventor
李欢欢
殷青栋
陈亚萍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Eastcom Software Technology Co ltd
Original Assignee
Hangzhou Eastcom Software Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Eastcom Software Technology Co ltd filed Critical Hangzhou Eastcom Software Technology Co ltd
Priority to CN202111108553.5A priority Critical patent/CN113935397A/en
Publication of CN113935397A publication Critical patent/CN113935397A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • 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/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • 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
    • G06F40/295Named entity recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

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

Abstract

The invention relates to the technical field of artificial intelligence, and provides an intelligent interaction method and an intelligent interaction device, wherein in the embodiment, the method comprises the following steps: receiving user interaction information sent by a client; performing intention recognition on the user interaction information based on a classification model to determine an interaction type to which the user interaction information belongs; the training samples of the classification model comprise any of a problem text, a Linux instruction text and a database instruction text; determining a processing strategy corresponding to the interaction type based on the interaction type to which the user interaction information belongs; and processing the user interaction information based on the processing strategy corresponding to the interaction type. By the technical scheme of the embodiment of the invention, the interaction type of the user interaction information can be identified, the user interaction information is processed based on different processing strategies corresponding to different interaction types, and the application scene is expanded; meanwhile, the classification model carries out classification based on intention identification, and has a good classification effect.

Description

Intelligent interaction method and device
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to an intelligent interaction method and device.
Background
In recent years, with the development of DevOps, ChatOps is becoming more widely used. From DevOps, the purpose is to promote research, development, operation and maintenance integration, reduce communication cost and improve work efficiency. Different roles are organically fused together through a series of automated tools. The communication cost between operation and maintenance and research and development is reduced to the greatest extent through various automation tools, and the efficiency of each link is improved. For the ChatOps, the purpose is to complete corresponding work by the operation and maintenance robot only by instructions which need to be executed for the operation and maintenance robot in a chat mode. With the popularization of social communication software, the operation and maintenance robot can be communicated through the social communication software. The operation and maintenance robot serves as a hub to tightly connect the human and the system together, and the efficiency of cooperation and communication is further improved.
At present, the operation and maintenance robot completes feedback of the questions input by the user by calculating text similarity matching, in other words, the operation and maintenance robot matches the answers corresponding to the questions in the corpus.
However, the operation and maintenance robot may also need to meet other user requirements besides the user question and answer, and a technical scheme of combining the user question and answer with other user requirements is lacking at present to expand the application scenario of the operation and maintenance robot.
Disclosure of Invention
The invention provides an intelligent interaction method, an intelligent interaction device, a computer-readable storage medium and electronic equipment, which can identify the interaction type of user interaction information, process the user interaction information based on different processing strategies corresponding to different interaction types and expand application scenes; meanwhile, the classification model carries out classification based on intention identification, and has a good classification effect.
In a first aspect, the present invention provides an intelligent interaction method, including:
receiving user interaction information sent by a client;
performing intention recognition on the user interaction information based on a classification model to determine an interaction type to which the user interaction information belongs; the training samples of the classification model comprise any of a problem text, a Linux instruction text and a database instruction text;
determining a processing strategy corresponding to the interaction type based on the interaction type to which the user interaction information belongs;
and processing the user interaction information based on the processing strategy corresponding to the interaction type.
In a second aspect, the present invention provides an intelligent interaction device, including:
the receiving module is used for receiving user interaction information sent by the client;
the classification module is used for identifying the intention of the user interaction information based on a classification model so as to determine the interaction type of the user interaction information; the training samples of the classification model comprise any of a problem text, a Linux instruction text and a database instruction text;
the strategy determining module is used for determining a processing strategy corresponding to the interaction type based on the interaction type to which the user interaction information belongs;
and the processing module is used for processing the user interaction information based on the processing strategy corresponding to the interaction type.
In a third aspect, the invention provides a computer-readable storage medium comprising executable instructions which, when executed by a processor of an electronic device, cause the processor to perform the method according to any one of the first aspect.
In a fourth aspect, the present invention provides an electronic device, comprising a processor and a memory storing execution instructions, wherein when the processor executes the execution instructions stored in the memory, the processor performs the method according to any one of the first aspect.
The invention provides an intelligent interaction method, an intelligent interaction device, a computer readable storage medium and electronic equipment, wherein the method comprises the steps of receiving user interaction information sent by a client; then, based on the classification model, performing intention identification on the user interaction information to determine an interaction type to which the user interaction information belongs; the training samples of the classification model comprise any of a problem text, a Linux instruction text and a database instruction text; then, determining a processing strategy corresponding to the interaction type based on the interaction type to which the user interaction information belongs; and then, processing the user interaction information based on the processing strategy corresponding to the interaction type. In summary, according to the technical scheme of the invention, the interaction type of the user interaction information can be identified, the user interaction information is processed based on different processing strategies corresponding to different interaction types, and the application scene is expanded; meanwhile, the classification model carries out classification based on intention identification, and has a good classification effect.
Further effects of the above-mentioned unconventional preferred modes will be described below in conjunction with specific embodiments.
Drawings
In order to more clearly illustrate the embodiments or the prior art solutions of the present invention, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments described in the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
Fig. 1 is a schematic structural diagram of an intelligent interactive system according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of an intelligent interaction method according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of another intelligent interaction method according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a data structure of a knowledge-graph provided by an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an intelligent interaction device according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be described in detail and completely with reference to the following embodiments and accompanying drawings. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the 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.
Fig. 1 is a system architecture diagram of an intelligent interactive system according to an embodiment of the present invention. As shown in fig. 1, the system includes: client 110 and operation and maintenance robot platform 120. The client 110 may collect the user interaction information, upload the user interaction information to the operation and maintenance robot platform 120, and process the user interaction information by the operation and maintenance robot platform 120 to implement intelligent interaction. In one example, the interaction type of the user interaction information may be an intelligent question and answer, a Linux instruction, a database instruction, or the like.
In the scheme, the operation and maintenance robot platform 120 may identify different interaction types, and process different interaction types by using different processing strategies, thereby expanding an application scenario.
It is understood that, in the present embodiment, the client 110 and the operation and maintenance robot platform 120 may be installed on the same electronic device, or may be installed on different electronic devices. Different electronic devices may be connected through a network to perform data interaction, such as a Wired network (Wired network) or a wireless network (wireless network). It is understood that the network between different electronic devices may be implemented using any known network communication protocol, which may be various wired or wireless communication protocols, such as ethernet, Universal Serial Bus (USB), firewire (firewire), global system for mobile communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), time division multiple access (TD-SCDMA), long term evolution (long term evolution, LTE), new air interface (new radio, NR), bluetooth (bluetooth), wireless fidelity (Wi-Fi), and so on. For example, the communication mode between the client 110 and the operation and maintenance robot platform 120 may be an http secure transmission channel.
In one example, the electronic device where the client 110 is located may be a mobile phone, a tablet computer, a wearable device, a smart television, a smart screen, a smart speaker, a car machine, or the like. The electronic device according to the present embodiment may be equipped with iOS, android, Windows, a hong meng system (Harmony OS), or another operating system. The embodiment of the present invention does not specifically limit the type of the electronic device.
In one example, the electronic device where the operation and maintenance robot platform 120 is located may be a server or a super terminal that can establish a communication connection with the electronic device and provide data processing, computing, and/or storage functions for the electronic device. The server involved in the present scheme may be a hardware server, or may be embedded in a virtualization environment, for example, the server involved in the present scheme may be a virtual machine executed on a hardware server including one or more other virtual machines.
As shown in fig. 2, an intelligent interaction method according to an embodiment of the present invention is provided. The method provided by the embodiment of the invention can be executed by any device, equipment, platform and equipment cluster with computing and processing capabilities. In addition, the method can be applied to an intelligent interactive system comprising a client and a server. For example, the client may be the client 110 described above, and the server may be the operation and maintenance robot platform 120 described above. The operation and maintenance robot platform is described as an execution subject.
As shown in fig. 2, an embodiment of the present invention provides an intelligent interaction method, including the following steps:
step 201, receiving user interaction information sent by a client.
In this embodiment, the client may collect the voice input by the user through a voice collecting device, such as a microphone, and convert the voice into a text through technologies such as voice recognition, where the text is the user interaction information, and the specific process of converting the voice into the text is not described herein again. In addition, the client can input text through an input device such as a keyboard, and the text is the user interaction information. And then, the client reports the user interaction information to the operation and maintenance robot platform so that the operation and maintenance robot platform receives the user interaction information sent by the client.
202, performing intention identification on the user interaction information based on a classification model to determine an interaction type of the user interaction information; the training samples of the classification model comprise any of a problem text, a Linux instruction text and a database instruction text.
In this embodiment, the classification model is used to identify a plurality of interaction types. In one example, the plurality of interaction types may be smart question answering, Linux commands, and database commands, which are described as examples below. It should be noted that the above interaction types are only examples, and do not constitute specific limitations, and the interaction types need to be determined in combination with actual service requirements.
In one example, the training sample of the classification model consists of a question text, a Linux instruction text, and a database instruction text. The number of the problem text, the number of the Linux instruction text and the number of the database instruction text should not differ too much, and the Linux instruction text and the database instruction text are preferably the same, so that the model accuracy of the classification model is ensured. The problem text can be understood as a user problem, for example, what the deep learning model does, how to log in the deep learning module, what the deep learning module forgets about the password, and how the deep learning module applies for resources. The Linux instruction text can be understood as kernel operation issued by a user, such as checking a container, stopping running the container, checking a server, checking the use condition of a system memory, and checking the use condition of a system CPU. The database instruction text can be understood as the relevant operation of the database that the user wants to perform. For example, i want to see how many ten am visits Hangzhou today.
Considering the limited number of samples, the classification model should be insensitive to the number of samples. Meanwhile, the processing strategy is determined by considering the classification result of the user interaction information, so that the requirement on the classification accuracy of the user interaction information is high, in other words, the requirement on the precision of the classification model is high. Based on the above considerations, in one example, the structure of the classification model may be LSTM + Attention, which is used to perform semantic recognition on the user interaction information, and determine the interaction type based on the result of the semantic recognition, so as to ensure the accuracy of the classification result. It should be noted that the Attention can enhance the model interpretability, and focus the calculation on important information to improve the model accuracy. Correspondingly, the model structure adopting LSTM + Attention associates the input and output of the model through Attention in the training process, thereby acquiring more characteristics and improving the precision of the model. The structure of the classification model is merely an example, and is not specifically limited, and any structure capable of realizing classification of the question text, the Linux instruction text, and the database instruction text may be used.
It should be noted that if the punctuation mark "? ", then the classification model can identify a question mark"? And classifying the user interaction information in combination with the semantics of the user interaction information, namely classifying the user interaction information based on punctuation marks and semantics of the user interaction information.
Step 203, determining a processing strategy corresponding to the interaction type based on the interaction type to which the user interaction information belongs; and processing the user interaction information based on the processing strategy corresponding to the interaction type.
The following describes processing the user interaction information based on the processing policy corresponding to the interaction type with reference to fig. 3.
In one example, the interaction type is smart question answering. The specific implementation manner of processing the user interaction information based on the processing strategy corresponding to the intelligent question answering is as follows:
performing entity recognition on the user interaction information based on the entity recognition model to obtain an entity recognition result; performing entity relationship identification on the user interaction information based on the entity relationship identification model to obtain an entity relationship identification result; generating a knowledge graph query statement according to the result of the entity identification and the result of the relationship identification; searching in a preset knowledge map database according to the knowledge map query statement to obtain an answer corresponding to the user interaction information, and returning the answer to the client.
As will be appreciated by those skilled in the art, a knowledge-graph consists of nodes (points) and edges (edges). Wherein a node, i.e. a resource entity, is identified by a globally unique ID and a relationship (also called an attribute) is used to connect two nodes. Generally, a knowledge graph is a relational network obtained by connecting all kinds of Information (Heterogeneous Information). Knowledge-graphs provide the ability to analyze problems from a "relational" perspective. If facts are expressed in triplets of (resource entity 1, relationship, resource entity 2), (resource entity, attribute value), graph databases may be selected as storage media, such as open source Neo4j, Twitter's FlockDB, janussgraph, etc. Fig. 4 shows a data structure of a knowledge graph in an embodiment of the present invention, where nodes include an entity node and an answer node, and edges between the entity node and the answer node represent entity relationships. In the embodiment of the present invention, the knowledge graph database includes a plurality of query graphs, and the query graphs are constructed based on the data structure shown in fig. 3. For example, for a knowledge graph of an artificial intelligence model, the entity name may be deep learning, machine learning, face recognition, PAI platform, feature engineering, model evaluation, and the entity relationship indicates an operation related to the entity name, which may be login (login), add (add), call (default), view (look), use (use), update (update), open (open), change (change), create (creation), and the like, and the answer information indicates the answer information for the user about the entity name in a certain entity relationship. When a data structure of the knowledge graph is constructed, the entity name and the answer information are imported and stored, and the relation fields of the entity name and the answer information are stored to obtain a graph database corresponding to the knowledge graph, namely a knowledge graph database.
Natural Language Processing (NLP) is a direction in the fields of computer science and artificial intelligence, and aims to realize various theories and methods for efficient communication between a person and a computer using natural Language. The natural language processing technology generally comprises technologies such as text processing, semantic understanding, machine translation, robot question answering and knowledge maps and the like, and by utilizing the natural language processing technology, a computer can solve a natural language question input by a user and analyze key words, namely an entity name and an entity relationship name in the embodiment of the invention, corresponding to resource entities and relationship data in the natural language question.
Specifically, in the embodiment of the invention, when a user queries the knowledge graph, the user interaction information, namely the natural language question, is input in the query interface of the client and is sent to the processing device, namely the operation and maintenance robot platform. And after receiving the natural language question, the operation and maintenance robot platform performs entity identification and entity relationship identification on the natural language question to obtain query information in the natural language question, namely an entity name identified by the entity and an entity relationship name identified by the entity relationship. After the query information is obtained, reading a pre-constructed query graph, and then converting the natural language question sentence according to the analyzed query information to obtain a corresponding query sentence, namely converting the query sentence into a computer language capable of querying a knowledge graph database.
The structure of the entity recognition model can be BERT + LSTM + CRF. The intelligent question answering method has the advantages that problems are complicated for intelligent question answering, and similar entities are more, so that the model accuracy is ensured by adopting BERT + LSTM + CRF. In addition, the training samples of the solid recognition model are user questions. Illustratively, the training samples may be deep learning related questions.
The structure of the entity relationship identification model can be Bi-GRU + Attention. Here, the entity relationship recognition model is essentially an intent recognition. The use of GRUs, although losing some of the model accuracy, can increase the training speed. In addition, the training sample of the entity recognition model is a problem text. Illustratively, the training samples may be deep learning related questions. It should be noted that the entity relationship recognition model and the training sample of the entity recognition model may be the same.
The structures of the entity identification model and the entity relationship identification model are merely examples, and are not limited to specific ones, and any structure capable of realizing entity identification and entity relationship identification may be used.
In the embodiment, the entity recognition and the entity relation recognition are realized through deep learning, the knowledge map query sentence is generated according to the entity recognition result and the relation recognition result, the question and answer is realized by combining the preset knowledge map database, a large number of question and answer corpora do not need to be manually sorted, and a good effect can be achieved only by a small number of corpora in a knowledge map mode.
Further, if the query statement is searched in a preset knowledge graph database according to the knowledge graph, an answer corresponding to the user interaction information cannot be obtained; matching a preset entity similar word bank with a result of entity recognition of user interaction information based on an entity recognition model to determine a matched entity name; matching a preset entity relationship similar word library with a result of entity relationship identification of user interaction information based on an entity relationship identification model to determine a matched entity relationship name; re-determining the knowledge graph query statement based on the matched entity name and the matched entity relationship name; searching in a preset knowledge graph database according to the re-determined knowledge graph query statement to obtain an answer corresponding to the user interaction information.
The entity similarity corpus includes synonyms of entity names in the knowledge map database. Illustratively, the name of an entity in the knowledge graph database is deep learning, and the entity similarity word library includes a plurality of synonyms for deep learning, such as deep learning, deep learning model, deep learning network, deep learning neural network, deep network, and the like. It should be understood that the matching entity name should be the entity name in the knowledge-graph database. The entity relationship similar word library and the matched entity relationship name type are not described in detail herein.
And if the entity recognition result cannot be obtained after the entity recognition is carried out on the user interaction information, the entity relation recognition result cannot be obtained after the entity relation recognition is carried out on the user interaction information, or the answer corresponding to the user interaction information cannot be obtained in a preset knowledge map database according to the redetermined knowledge map query statement, carrying out similarity matching on the user interaction information and the problem texts existing in the preset question-answer database, taking N problem texts with the highest similarity and returning the N problem texts to the client for the user to select, and matching the answer of the problem text from the question-answer database according to the problem text selected by the user.
The N question texts with the highest similarity can be understood as the question texts in the preset question-answer library which are sorted according to the sequence of the similarity from large to small, and the first N question texts are the N question texts with the highest similarity.
In one example, a Jacard similarity coefficient method is used to perform similarity matching between the user interaction information and the questions in the question-answer library. It should be noted that the jaccard similarity coefficient can calculate a higher similarity compared to the cosine similarity, which is convenient for subsequent processing. In addition, the difference between texts is obvious, and on the basis of considering the calculation efficiency and accuracy, the similarity calculation is carried out by adopting a Jacard similarity coefficient method.
In one example, the user interaction information and the N question texts with the highest similarity matched with the user interaction information are stored in a storage in a one-to-one correspondence mode, and the corpus of the preset question-answer library is expanded. In other words, the user interaction information and the N question texts form N question-answer samples, each of which includes the user interaction information and one of the N question samples.
In one example, the interaction type is a Linux instruction. The specific implementation manner of processing the user interaction information based on the processing strategy corresponding to the Linux instruction is as follows:
matching the user interaction information with a Linux instruction text in a preset instruction library to obtain a matched Linux instruction text; and acquiring a Linux instruction corresponding to the matched Linux instruction text from a preset instruction library, and executing the Linux instruction.
The preset instruction library comprises a preset Linux instruction text and a Linux instruction corresponding to the preset Linux instruction text. Considering that the Linux instruction is easy to be confused, in one example, the BERT method is adopted for similarity matching. During specific implementation, for each preset Linux instruction text in a preset instruction library, the preset instruction text and user interaction information are encoded through a BERT model to obtain corresponding word feature vectors, and similarity between the word feature vectors is calculated. And taking the preset Linux instruction text with the highest similarity as the matched Linux instruction text. It should be noted that, word vector similarity matching is performed through the BERT model, and since BERT can have higher expansibility, the work of manually collecting Linux instruction corpora is reduced to a great extent, and a better effect can be achieved, for example, a Linux instruction text is a deletion container, and because BERT is used, the similar instruction texts such as deletion containers and removal containers can be identified as deletion containers when the similar instruction texts are processed. Illustratively, the BERT model is obtained by training based on preset user interaction information related to Linux instructions. In practical application, because the user interaction information contains irrelevant information, when similarity matching is performed, only the Linux instruction text is determined to exist in the user interaction information.
In addition, the Linux instruction text is the Chinese meaning of the Linux instruction. The Linux instruction is a computer language adopting a Linux operating system.
Illustratively, the Linux instruction text and the Linux instructions are shown in the following tables:
linux instruction text Linux instruction
CPU information (type) cat/proc/cpuinfo∣grep“processor”∣wc-1
Number of CPU cores cat/proc/cpuinfo∣grep“cpu cores”∣unip
Iinux version cat/proc/version
Stopping container Docker stop
Memory device cat/proc/meninfo∣grep MemTotal
Kernel CPU usage Uname-a
Partition usage df-h
Deleting containers Docker rm
Deleting a process Kill
Deleting mirror images docker rmi
Starting container docker star
Starting process nohup
Installed software package Rpm-qa
Current position pwd
And the matched Linux instruction text is the instruction text with the highest similarity with the user interaction information in the preset instruction library.
In addition, the Linux command can operate a plurality of servers and has the functions of providing a selected server, exiting the server and the like. In one example, the client is asked which server to operate before executing the Linux instruction, and the Linux instruction is executed to the server after the user inputs the server. In another example, before executing the Linux instruction, the client may send an operable server list to the client for the user to select, and after receiving the selected server returned by the client, the Linux instruction is executed on the server.
In one example, the interaction type is a database instruction. The specific implementation manner of processing the user interaction information based on the processing policy corresponding to the database instruction is as follows:
performing intention recognition on the user interaction information based on an intention recognition model to obtain database operation; entity identification is carried out on the user interaction information to obtain an operation object corresponding to database operation; and generating an SQL statement based on the database operation and the operation object corresponding to the database operation, and executing the SQL statement.
The database operation can be addition, deletion, modification and query. The operation object comprises database ID and data. Illustratively, the user interaction information is the amount of accesses in Hangzhou today ten am that I want to view the IP address. The database operation is look-up, the database ID is an IP address, and the data is ten am visits from hangzhou today. In addition, when the database ID does not exist as the operation target, the client needs to be queried for the database ID to be operated. For example, sending a database selection prompt text and a plurality of preset database IDs to the client; the database selection prompt text is used for prompting a user to select a database ID, and can be used for selecting a database to be operated for the user; the preset database ID can be understood as the identifier of the database for establishing connection of the operation and maintenance robot platform; and then, sending the ID of the database selected by the user to the operation and maintenance robot platform, and adding the ID of the database selected by the user into the operation object. Here, the database ID may be understood as a database identification.
The SQL statement is a computer language that can perform database processing.
Wherein, the structure of the intention recognition model is LSTM + Attention. The training sample of the intention recognition model is the database operation text.
Considering that time information exists in the user interaction information, the time information specifically refers to a time point or a time period expressed in language, and is generally expressed as a noun, an adjective, a verb and its constituent phrases. Only the time information in the user interaction information can be identified through the entity identification model, and the time information in the user interaction information cannot be converted into a uniform time format, so that a regular expression mode is adopted when the time entity is identified. In one example, entity recognition is carried out on the user interaction information through an entity recognition model so as to determine the result of the entity recognition; carrying out time entity identification on the user interaction information through a regular expression to determine a time entity identification result; the operation object is determined based on the result of the entity recognition and the result of the time entity recognition. The structure of the entity recognition model may be LSTM + CRF. It should be noted that, because the entity of the database instruction is relatively simple, it is only required to perform entity identification directly through LSTM + CRF without encoding in a BERT manner, and the entity identification model is merely an example, and is not limited to any specific structure, and any structure capable of implementing entity identification is sufficient. Regular expression (regular expression) describes a pattern (pattern) for matching a character string, which can be used to check whether a string contains a certain substring, to replace the matched substring or to extract a substring meeting a certain condition from a certain string, etc.; the regular expression is constructed in the same way as the mathematical expression is created. That is, small expressions can be combined together with a variety of meta characters and operators to create larger expressions. The components of the regular expression may be individual characters, a collection of characters, a range of characters, a selection between characters, or any combination of all of these components. Regular expressions are literal patterns composed of common characters (e.g., characters a through z) and special characters (called "meta characters"). The pattern describes one or more character strings to be matched when searching for text. The regular expression is used as a template to match a certain character pattern with the searched character string. The intention recognition and the entity recognition are realized through deep learning, the time entity recognition is realized through a regular expression method, time corpus data is not needed, a large amount of labor cost is saved, and a good effect can be achieved.
Further, after the user interaction information is processed based on the processing strategy corresponding to the interaction type, the processed result needs to be fed back to the client. Illustratively, the answer of the user question is fed back, the result of executing the Linux instruction is fed back, and the result of executing the SQL statement is fed back, such as the question-answer result, the execution result, and the data information shown in fig. 3.
According to the technical scheme, the beneficial effects of the embodiment are as follows:
on one hand, the embodiment has wider range of design, can simultaneously realize intelligent question answering, Linux instructions and database instructions, and has better effect.
On the other hand, according to the embodiment, a large amount of question and answer corpora do not need to be manually arranged, and a good effect can be achieved only by a small amount of corpora in a knowledge graph mode.
On the other hand, the key point of the Linux instruction in this embodiment is to use a BERT method to perform similarity matching, and since BERT can have higher expansibility, the work of manually collecting the Linux instruction corpus is reduced to a great extent, and a better effect can be achieved.
In another aspect, the key point of the database instruction in this embodiment is to use LSTM + Attention and LSTM + CRF in deep learning to implement intent recognition and entity recognition; and the regular expression method is used for realizing time entity identification, time corpus data is not needed, a large amount of labor cost is saved, and a good effect can be achieved.
Referring to fig. 5, based on the same concept as the method embodiment of the present invention, an embodiment of the present invention further provides an intelligent interaction apparatus, including:
a receiving module 501, configured to receive user interaction information sent by a client;
a classification module 502, configured to perform intent recognition on the user interaction information based on a classification model, so as to determine an interaction type to which the user interaction information belongs; the training samples of the classification model comprise any of a problem text, a Linux instruction text and a database instruction text;
a policy determining module 503, configured to determine, based on the interaction type to which the user interaction information belongs, a processing policy corresponding to the interaction type;
a processing module 504, configured to process the user interaction information based on a processing policy corresponding to the interaction type.
In one embodiment of the invention, the interaction type is intelligent question answering;
the processing strategy comprises selecting an answer matched with a first knowledge graph query statement corresponding to the user interaction information from a preset knowledge graph database; the preset knowledge map database comprises entity names, entity relations and answer information, and the knowledge map query statement determines a result of entity recognition of the user interaction information based on the first entity recognition model and a result of entity relation recognition of the user interaction information based on the entity relation recognition model.
In one embodiment of the present invention, the structure of the first entity identification model is BERT + LSTM + CRF; the structure of the entity relationship identification model is Bi-GRU + Attention.
In an embodiment of the present invention, the processing policy further includes: selecting an answer matched with a second knowledge graph query sentence corresponding to the user interaction information from a preset knowledge graph database when the answer matched with the first knowledge graph query sentence corresponding to the user interaction information cannot be selected from the preset knowledge graph database; the second knowledge graph query statement is determined based on an entity name obtained by matching a preset entity similar word bank with the result of the entity identification and an entity relation name obtained by matching a preset entity relation similar word bank with the result of the entity relation identification.
In an embodiment of the present invention, the processing policy further includes: and when the answer matched with the second knowledge graph query sentence corresponding to the user interaction information cannot be selected from the preset knowledge graph database, selecting a question sentence matched with the user interaction information from the preset question-answer database and returning the question sentence to the client.
In one embodiment of the invention, the interaction type is a Linux instruction; the processing strategy comprises the following steps: determining a Linux instruction of a Linux instruction text matched with the user interaction information from a preset instruction library, and executing the Linux instruction; the preset instruction library comprises a preset Linux instruction text and a Linux instruction corresponding to the preset Linux instruction text, and the user interaction information is matched with the preset Linux instruction text through word vector similarity.
In one embodiment of the present invention, the interaction type is a database instruction; the processing strategy comprises the following steps: generating an SQL statement based on the database operation and the operation object corresponding to the user interaction information, and executing the SQL statement; the database operation is obtained by performing intention recognition on the user interaction information based on an intention recognition model, and the operation object comprises a result of performing entity recognition on the user interaction information by a second entity recognition model and a result of performing time entity recognition on the user interaction information based on a regular expression.
In an embodiment of the present invention, the processing policy further includes: when the operation object does not comprise a database identifier, sending a database selection prompt text and a plurality of preset database identifiers to the client; and receiving the selected database identification sent by the client, and adding the selected database identification into the operation object.
In an embodiment of the present invention, the classification model and the intention recognition model have the same structure and are LSTM + Attention.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. On the hardware level, the electronic device includes a processor 601 and a memory 602 storing executable instructions, and optionally further includes an internal bus 603 and a network interface 604. The Memory 602 may include a Memory 6021, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory 6022 (e.g., at least 1 disk Memory); the processor 601, the network interface 604, and the memory 602 may be connected to each other by an internal bus 603, and the internal bus 603 may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like; the internal bus 603 may be divided into an address bus, a data bus, a control bus, etc., which is indicated by only one double-headed arrow in fig. 6 for convenience of illustration, but does not indicate only one bus or one type of bus. Of course, the electronic device may also include hardware required for other services. When the processor 601 executes execution instructions stored by the memory 602, the processor 601 performs a method in any of the embodiments of the present invention and at least for performing the method as shown in fig. 2.
In a possible implementation manner, the processor reads the corresponding execution instruction from the nonvolatile memory to the memory and then runs the execution instruction, and the corresponding execution instruction can also be obtained from other equipment, so as to form an intelligent interaction device on a logic level. The processor executes the execution instructions stored in the memory to realize the intelligent interaction method provided by any embodiment of the invention through the executed execution instructions.
The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Embodiments of the present invention further provide a computer-readable storage medium, which includes an execution instruction, and when a processor of an electronic device executes the execution instruction, the processor executes a method provided in any one of the embodiments of the present invention. The electronic device may specifically be the electronic device shown in fig. 6; the execution instruction is a computer program corresponding to the intelligent interaction device.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects.
The embodiments of the present invention are described in a progressive manner, and the same and similar parts among the embodiments can be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above description is only an example of the present invention, and is not intended to limit the present invention. Various modifications and alterations to this invention will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of the claims of the present invention.

Claims (10)

1. An intelligent interaction method is applied to an operation and maintenance robot platform and comprises the following steps:
receiving user interaction information sent by a client;
performing intention recognition on the user interaction information based on a classification model to determine an interaction type to which the user interaction information belongs; the training samples of the classification model comprise any of a problem text, a Linux instruction text and a database instruction text;
determining a processing strategy corresponding to the interaction type based on the interaction type to which the user interaction information belongs;
and processing the user interaction information based on the processing strategy corresponding to the interaction type.
2. The method of claim 1, wherein the interaction type is smart question answering;
the processing strategy comprises selecting an answer matched with a first knowledge graph query statement corresponding to the user interaction information from a preset knowledge graph database; the preset knowledge map database comprises entity names, entity relations and answer information, and the knowledge map query statement determines a result of entity recognition of the user interaction information based on the first entity recognition model and a result of entity relation recognition of the user interaction information based on the entity relation recognition model.
3. The method of claim 2 wherein the first entity identification model has a structure of BERT + LSTM + CRF;
the structure of the entity relationship identification model is Bi-GRU + Attention.
4. The method of claim 2, wherein the processing policy further comprises: selecting an answer matched with a second knowledge graph query sentence corresponding to the user interaction information from a preset knowledge graph database when the answer matched with the first knowledge graph query sentence corresponding to the user interaction information cannot be selected from the preset knowledge graph database; the second knowledge graph query statement is determined based on an entity name obtained by matching a preset entity similar word bank with the result of the entity identification and an entity relation name obtained by matching a preset entity relation similar word bank with the result of the entity relation identification.
5. The method of claim 4, wherein the processing policy further comprises: and when the answer matched with the second knowledge graph query sentence corresponding to the user interaction information cannot be selected from the preset knowledge graph database, selecting a question sentence matched with the user interaction information from the preset question-answer database and returning the question sentence to the client.
6. The method according to claim 1, wherein the interaction type is a Linux instruction;
the processing strategy comprises the following steps: determining a Linux instruction of a Linux instruction text matched with the user interaction information from a preset instruction library, and executing the Linux instruction; the preset instruction library comprises a preset Linux instruction text and a Linux instruction corresponding to the preset Linux instruction text, and the user interaction information is matched with the preset Linux instruction text through word vector similarity.
7. The method of claim 1, wherein the interaction type is a database instruction;
the processing strategy comprises the following steps: generating an SQL statement based on the database operation and the operation object corresponding to the user interaction information, and executing the SQL statement; the database operation is obtained by performing intention recognition on the user interaction information based on an intention recognition model, and the operation object comprises a result of performing entity recognition on the user interaction information based on a second entity recognition model and a result of performing time entity recognition on the user interaction information based on a regular expression.
8. The method of claim 7, wherein the processing policy further comprises: when the operation object does not comprise a database identifier, sending a database selection prompt text and a plurality of preset database identifiers to the client; and receiving the selected database identification sent by the client, and adding the selected database identification into the operation object.
9. The method of claim 7, wherein the classification model and the intent recognition model are structurally identical and are both LSTM + Attention;
the structure of the second entity recognition model is LSTM + CRF.
10. An intelligent interaction device, comprising:
the receiving module is used for receiving user interaction information sent by the client;
the classification module is used for identifying the intention of the user interaction information based on a classification model so as to determine the interaction type of the user interaction information; the training samples of the classification model comprise any of a problem text, a Linux instruction text and a database instruction text;
the strategy determining module is used for determining a processing strategy corresponding to the interaction type based on the interaction type to which the user interaction information belongs;
and the processing module is used for processing the user interaction information based on the processing strategy corresponding to the interaction type.
CN202111108553.5A 2021-09-22 2021-09-22 Intelligent interaction method and device Pending CN113935397A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111108553.5A CN113935397A (en) 2021-09-22 2021-09-22 Intelligent interaction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111108553.5A CN113935397A (en) 2021-09-22 2021-09-22 Intelligent interaction method and device

Publications (1)

Publication Number Publication Date
CN113935397A true CN113935397A (en) 2022-01-14

Family

ID=79276324

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111108553.5A Pending CN113935397A (en) 2021-09-22 2021-09-22 Intelligent interaction method and device

Country Status (1)

Country Link
CN (1) CN113935397A (en)

Similar Documents

Publication Publication Date Title
CN109284363B (en) Question answering method and device, electronic equipment and storage medium
CN107391677B (en) Method and device for generating Chinese general knowledge graph with entity relation attributes
JP2022538591A (en) A Predictive Similarity Scoring Subsystem in a Natural Language Understanding (NLU) Framework
CN108664599B (en) Intelligent question-answering method and device, intelligent question-answering server and storage medium
WO2019084810A1 (en) Information processing method and terminal, and computer storage medium
CN111159330B (en) Database query statement generation method and device
CN109408811B (en) Data processing method and server
CN109325040B (en) FAQ question-answer library generalization method, device and equipment
CN111309863B (en) Natural language question-answering method and device based on knowledge graph
CN112214593A (en) Question and answer processing method and device, electronic equipment and storage medium
US20210406473A1 (en) System and method for building chatbot providing intelligent conversational service
CN111737400A (en) Knowledge reasoning-based big data service tag expansion method and system
CN112115232A (en) Data error correction method and device and server
CN112559709A (en) Knowledge graph-based question and answer method, device, terminal and storage medium
CN112507089A (en) Intelligent question-answering engine based on knowledge graph and implementation method thereof
CN112632239A (en) Brain-like question-answering system based on artificial intelligence technology
CN110019714A (en) More intent query method, apparatus, equipment and storage medium based on historical results
CN109684357B (en) Information processing method and device, storage medium and terminal
CN117112595A (en) Information query method and device, electronic equipment and storage medium
CN110147358B (en) Construction method and construction system of automatic question-answering knowledge base
CN113935397A (en) Intelligent interaction method and device
WO2021135103A1 (en) Method and apparatus for semantic analysis, computer device, and storage medium
CN116414996A (en) Knowledge graph-based problem query method and device and electronic equipment
CN111859148A (en) Theme extraction method, device and equipment and computer readable storage medium
CN106682221B (en) Question-answer interaction response method and device and question-answer system

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