CN112507728A - Intelligent conversation method and device, electronic equipment and storage medium - Google Patents

Intelligent conversation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112507728A
CN112507728A CN202011442523.3A CN202011442523A CN112507728A CN 112507728 A CN112507728 A CN 112507728A CN 202011442523 A CN202011442523 A CN 202011442523A CN 112507728 A CN112507728 A CN 112507728A
Authority
CN
China
Prior art keywords
text
entity
information
speech recognition
replied
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
CN202011442523.3A
Other languages
Chinese (zh)
Inventor
倪子凡
王健宗
程宁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202011442523.3A priority Critical patent/CN112507728A/en
Publication of CN112507728A publication Critical patent/CN112507728A/en
Priority to PCT/CN2021/082869 priority patent/WO2022121152A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • G06F40/35Discourse or dialogue representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates

Abstract

The invention relates to an artificial intelligence technology, and discloses an intelligent dialogue method, which comprises the following steps: receiving a text to be replied, performing part-of-speech recognition on the text to be replied to obtain a text set to be extracted, extracting the text set to be extracted from the text set to be extracted to obtain a text entity set to be optimized, optimizing the text entity set to be optimized to obtain a text entity set, generating an entity relationship by using the text entity set, fusing the text entity set and the entity relationship execution information to obtain triple information, and generating a reply text of the text to be replied by using the triple information. The invention also discloses an intelligent dialogue device, electronic equipment and a storage medium. The invention also relates to blockchain technology, and the reply text can be stored in blockchain nodes. The method and the device can solve the problem of poor readability of the reply text due to lack of processing optimization of the text to be replied.

Description

Intelligent conversation method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of artificial intelligence, and in particular, to an intelligent dialogue method, an intelligent dialogue device, an electronic device, and a computer-readable storage medium.
Background
With the rapid development of deep learning, intelligent dialogue methods based on a deep learning network emerge like spring shoots after rain, and currently, commonly used intelligent dialogue methods include an LSTM synthesis method, a BERT synthesis method and the like, although intelligent dialogue can be realized, the methods generally directly input a text to be replied into a model to predict a reply text, processing optimization of the text to be replied is lacked, if text data of the text to be replied is too long, text features are not easy to extract, and the problem that the generated reply text is poor in readability is caused.
Disclosure of Invention
The invention provides an intelligent conversation method, an intelligent conversation device, electronic equipment and a computer readable storage medium, and mainly aims to solve the problem of poor readability of a reply text due to lack of processing optimization of the text to be replied.
In order to achieve the above object, the present invention provides an intelligent dialogue method, including:
receiving a text to be replied, and performing part-of-speech recognition on the text to be replied to obtain a text set of information to be extracted;
extracting the information to-be-extracted text set to obtain a text entity set to be optimized;
optimizing the text entity set to be optimized to obtain a text entity set, and generating an entity relationship by using the text entity set;
performing information fusion on the text entity set and the entity relationship to obtain triple information;
and generating a reply text of the text to be replied by using the triple information.
Optionally, the extracting the text entity set to be optimized from the information text set to be extracted includes:
constructing an entity probability function of each group of words in the information text set to be extracted;
and solving the entity probability function to obtain an entity probability set, and extracting the text set to be optimized from the information text set to be extracted by using the entity probability set.
Optionally, the optimizing the text entity set to be optimized to obtain a text entity set includes:
calculating entity ranking values of the text entity set to be optimized;
and cleaning the text entity set to be optimized by using the entity ranking value to obtain the text entity set.
Optionally, the generating an entity relationship by using the text entity set includes:
inputting the text entity set and the text to be replied into a trained BERT model;
extracting a text entity to be corrected from the text to be replied by using the BERT model;
performing proofreading on the text entity to be proofread and the text entity set to obtain a proofreading entity set;
and extracting to obtain the entity relationship by using the BERT model and the proofreading entity set.
Optionally, the performing part-of-speech recognition on the text to be replied to obtain a text set of information to be extracted includes:
denoising, word-off and word-segmentation processing are carried out on the text to be replied to obtain a part-of-speech text to be recognized;
and performing part-of-speech recognition on the part-of-speech to-be-recognized text by using the part-of-speech recognition model which is trained in advance to obtain the information to-be-extracted text set.
Optionally, the performing part-of-speech recognition on the part-of-speech to-be-recognized text by using the pre-trained part-of-speech recognition model to obtain the information to-be-extracted text set includes:
constructing and training a part-of-speech recognition model, wherein the part-of-speech recognition model comprises a characteristic conversion layer and a part-of-speech recognition layer;
and converting the part-of-speech to-be-recognized text into a text feature set by using the feature conversion layer, and performing part-of-speech recognition on the text feature set by using the part-of-speech recognition layer to obtain the information to-be-extracted text set.
Optionally, the constructing and training the part-of-speech recognition model includes:
receiving a training text set and a part-of-speech tag set corresponding to the training text set;
performing replacement and shielding operation on the training text set to obtain a semi-shielding text set;
constructing a part-of-speech recognition model, and calculating a part-of-speech prediction set of the semi-occlusion text set by using the part-of-speech recognition model;
and calculating a difference value between the part of speech prediction set and the part of speech tag set, and when the difference value is greater than or equal to a preset threshold value, adjusting internal parameters of the part of speech recognition model until the difference value is less than the preset threshold value, so as to obtain a trained part of speech recognition model.
In order to solve the above problem, the present invention also provides an intelligent dialogue apparatus, including:
the part-of-speech recognition module is used for receiving a text to be replied and executing part-of-speech recognition on the text to be replied to obtain a text set of information to be extracted;
the entity extraction module is used for extracting a text entity set to be optimized from the information text set to be extracted, optimizing the text entity set to be optimized to obtain a text entity set, and generating an entity relationship by using the text entity set;
the triple information construction module is used for fusing the text entity set and the entity relationship execution information to obtain triple information;
and the text reply module is used for generating a reply text of the text to be replied by utilizing the triple information.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one instruction; and
a processor executing instructions stored in the memory to implement the intelligent dialog method of any of the above.
In order to solve the above problem, the present invention further provides a computer-readable storage medium including a storage data area and a storage program area, the storage data area storing created data, the storage program area storing a computer program; wherein the computer program, when executed by a processor, implements the intelligent dialog method of any of the above.
The method comprises the steps of performing part-of-speech recognition on a text to be replied to obtain a text set to be extracted, extracting the text set to be extracted from the text set to be extracted to obtain a text entity set to be optimized, optimizing the text entity set to be optimized to obtain a text entity set, generating an entity relationship by using the text entity set, and fusing the text entity set and entity relationship execution information to obtain triple information. In summary, the embodiment of the present invention generates the reply text by using the triple information, and compared with the background art in which the text to be replied is directly used as the input data of the models such as LSTM, BERT, and the like, the embodiment of the present invention increases the processing optimization of the text to be replied until the triple information meeting the requirements is obtained, and generates the reply text by using the triple information, and even when the text data of the text to be replied is too long, by using the method of extracting the triple information, the problem that the text data of the text to be replied is too long, which causes difficulty in extracting text features, and causes poor readability of the generated reply text is avoided.
Drawings
Fig. 1 is a schematic flow chart of an intelligent dialogue method according to an embodiment of the present invention;
fig. 2 is a detailed flowchart of S2 in the intelligent dialog method according to an embodiment of the present invention;
fig. 3 is a schematic block diagram of an intelligent dialogue device according to an embodiment of the present invention;
fig. 4 is a schematic internal structural diagram of an electronic device implementing an intelligent dialog method according to an embodiment of the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the present application provides an intelligent dialogue method, and an execution subject of the intelligent dialogue method includes but is not limited to at least one of a server, a terminal, and other electronic devices that can be configured to execute the method provided by the embodiment of the present application. In other words, the intelligent dialogue method may be performed by software or hardware installed in the terminal device or the server device, and the software may be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
Fig. 1 is a schematic flow chart of an intelligent dialogue method according to an embodiment of the present invention. In this embodiment, the intelligent dialogue method includes:
and S1, receiving the text to be replied, and performing part-of-speech recognition on the text to be replied to obtain a text set of information to be extracted.
In the embodiment of the present invention, the text to be replied includes a text input by a user, a text crawled from a network by using a crawler program, and the like, for example, a text a to be replied input by a user: "my friend loves to travel in particular, but he likes to go to a busy extraordinary place, such as he visits Nanjing road in Shanghai in 3 months in 19 years, as one of the most luxurious commercial streets in Asia, leaving him a deep impression asking you to have a recommended travel place to buy a prayer.
The text to be replied generally has words with different parts of speech, so that words with different parts of speech need to be extracted, which facilitates information extraction in subsequent steps, and in detail, the performing part of speech recognition on the text to be replied includes: denoising, word-off and word-segmentation processing are carried out on the text to be replied to obtain a part-of-speech text to be recognized; and performing part-of-speech recognition on the part-of-speech to-be-recognized text by using the part-of-speech recognition model which is trained in advance to obtain the information to-be-extracted text set.
Further, since the text to be replied may include non-text data, such as hyperlinks, web tags, etc., which may affect the extraction of the triple information, it is necessary to perform denoising on the text to be replied. In the embodiment of the invention, the denoising process can adopt a regular expression constructed based on a programming language to complete the function of removing noises such as numbers, expression symbols and special symbols such as URL, "@", "#", and the like.
In detail, the embodiment of the invention performs word segmentation on the denoised text by using a crust word segmentation method to obtain a plurality of word sets corresponding to the text to be replied.
Further, the stop word refers to a word which has no practical meaning and has no influence on the extraction of the triple information in the chinese text, but because the stop word has a high occurrence frequency, including commonly used pronouns, prepositions, and the like, if the stop word is retained, a computational burden is generated on the embodiment of the present invention, and even the accuracy of the intelligent dialogue is affected, so that the stop word processing needs to be performed on the word set. In detail, in the embodiment of the present invention, the stop word may be a stop word list filtering method, and the stop word list and each word in the word set are matched one by one through a pre-established stop word list, and if the matching is successful, the word is determined as a stop word, and the word is deleted.
In detail, the performing part-of-speech recognition on the part-of-speech to-be-recognized text by using the part-of-speech recognition model completed through pre-training to obtain the information to-be-extracted text set includes:
step A: and constructing and training a part of speech recognition model, wherein the part of speech recognition model comprises a characteristic conversion layer and a part of speech recognition layer.
Further, the constructing and training the part-of-speech recognition model includes: receiving a training text set and a part-of-speech tag set corresponding to the training text set, and performing replacement and shielding operations on the training text set to obtain a semi-shielded text set; constructing a part-of-speech recognition model, and calculating a part-of-speech prediction set of the semi-occlusion text set by using the part-of-speech recognition model; and calculating a difference value between the part of speech prediction set and the part of speech tag set, and when the difference value is greater than or equal to a preset threshold value, adjusting internal parameters of the part of speech recognition model until the difference value is less than the preset threshold value, so as to obtain a trained part of speech recognition model.
In the embodiment of the invention, the part-of-speech recognition model mainly comprises a characteristic conversion layer and a part-of-speech recognition layer. Wherein the feature transformation layer is composed of BERT (Bidirectional Encoder expressions from transformations), and the part of speech recognition layer is composed of CRF (Conditional Random Field) model.
In the embodiment of the invention, the training text set is text data obtained by crawling from a network in advance and manually cleaning by means of crawlers and the like. And the part-of-speech tag set records part-of-speech tags of each word in the training text set, and if the training text set comprises a training text a: "Huangshan Zhenhei beauty, which is the same as Hengshan to make people forget to return, the part of speech of each word of the training text a is recorded in the part of speech tag set as: "Huangshan beauty (noun) … …".
In the preferred embodiment of the present invention, 70% of the words in the training text set are masked with a preset symbol (masked token), and 30% of the remaining words in the training text set are kept unchanged to obtain the semi-masked text set. As the training text a: the ' Huangshan is beautiful and like a Hengshan, people are forgetted to return, the ' Huangshan ' is selected, and if the ' Huangshan ' is shielded, the training text a is changed into: "mask" is beautiful and like Heng shan to make people forget to return.
Further, the calculating a part-of-speech prediction set of the semi-occluded text set using the part-of-speech recognition model includes: converting the semi-occlusion text set into a semi-occlusion vector set by utilizing the characteristic conversion layer; and performing part-of-speech recognition on the semi-occlusion vector set by utilizing the part-of-speech recognition layer to obtain the part-of-speech prediction set.
In the preferred embodiment of the present invention, the semi-masked text set is converted into a semi-masked vector set using a BERT model using 12-layer bi-directional coding (encoder-decoder). Wherein the bi-directional encoding may be a published feature extraction neural network.
Furthermore, the CRF model is used for calculating the part-of-speech probability value of different parts-of-speech corresponding to each word, and the part-of-speech corresponding to the maximum part-of-speech probability value is selected, so that the purpose of part-of-speech prediction is achieved.
According to the method and the device, a Chebyshev calculation method can be used for calculating the difference value between the part of speech prediction set and the part of speech tag set, and when the difference value is smaller than the preset threshold value, the part of speech recognition model which is trained is obtained.
And B: and receiving the part-of-speech to-be-recognized text, converting the part-of-speech to-be-recognized text into a text feature set by using the feature conversion layer, and performing part-of-speech recognition on the text feature set by using the part-of-speech recognition layer to obtain the information to-be-extracted text set.
The text set to be extracted is obtained by converting the part-of-speech to-be-identified text into the text feature set and identifying the text feature set by the part-of-speech, and the steps are the same as the steps of the model training and are not repeated here.
In summary, after the denoising, the stop word removing, the word segmentation processing and the part-of-speech recognition are completed, the information text to be extracted is obtained, and it can be seen that the information text set to be extracted is composed of a plurality of words with part-of-speech information.
And S2, extracting the text entity set to be optimized from the information text set to be extracted.
In detail, the text entity set to be optimized includes information of people, places, organizations, time, and the like involved in the text to be replied, such as in the text to be replied a: "my friend loves a tour in particular, but he likes to go to a busy and extraordinary place, such as he visits Nanjing road in Shanghai in 3 months in 19 years, as one of the most luxurious commercial streets in Asia, leaving him a deep impression to ask you to have a recommended tour place to buy", the text entity set to be optimized includes: "friends", "Nanjing road", "Asia", "travel", "19 years and 3 months", etc.
Further, referring to fig. 2, the extracting the text entity set to be optimized from the information text set to be extracted includes:
s21, constructing an entity probability function of each group of words in the information text set to be extracted;
and S22, solving the entity probability function to obtain an entity probability set, and extracting the text set to be optimized from the information text set to be extracted by using the entity probability set.
In the embodiment of the invention, the entity probability function P (W)i) Comprises the following steps:
Figure BDA0002830618570000071
wherein, W1,W2,...,WiI is a number, m is the number of the text set to be extracted,
Figure BDA0002830618570000072
means word WiIn the word Wi-1For conditional probability, in the embodiment of the present invention, a Markov model may be used to calculate
Figure BDA0002830618570000073
P(Wi) Means word WiCorresponding entity probabilities.
Further, after the entity probabilities corresponding to the different words are obtained, the words are ranked from large to small to obtain a ranked entity probability set, and the words corresponding to the entity probability values are selected according to the preset number, namely the text entity set to be optimized.
And S3, optimizing the text entity set to be optimized to obtain a text entity set, and generating an entity relationship by using the text entity set.
In detail, the optimizing the text entity set to be optimized to obtain a text entity set includes: and calculating an entity ranking value of the text entity set to be optimized, and cleaning the text entity set to be optimized by using the entity ranking value to obtain the text entity set.
Further, calculating an entity ranking value of the text entity set to be optimized by using the following formula:
T=αP(si)+(1-α)I
wherein, P(s)i) For the text entity s to be optimized in the text entity set to be optimizediCorresponding entity matrix, T is text entity s to be optimizediThe corresponding entity ranking value alpha is the text entity s to be optimized calculated by using the pagerank algorithmiAnd (3) the jump probability in the webpage, wherein I is a coordination matrix with the value of 1 corresponding to the entity matrix.
And after the entity ranking value of each text entity to be optimized is obtained through calculation, removing the text entities to be optimized, of which the entity ranking value is smaller than a preset threshold value, so as to obtain the text entity set.
In the embodiment of the present invention, generating an entity relationship of the text entity set by using a BERT model, in detail, generating an entity relationship by using the text entity set includes: inputting the text entity set and the text to be replied into a trained BERT model, extracting a text entity to be corrected from the text to be replied by using the BERT model, performing correction on the text entity to be corrected and the text entity set to obtain a correction entity set, and extracting to obtain the entity relationship by using the BERT model and the correction entity set.
In the embodiment of the invention, the BERT model can execute feature transformation in S1 and can be used for entity relationship extraction similarly, and the training method based on the BERT model is different in action. In addition, the text entity to be corrected is extracted from the text to be replied through the BERT model, and deviation may exist, so that correction needs to be performed by using the text entity set, and after the corrected entity set is obtained, the BERT model is further used to extract the entity relationship by referring to the corrected entity set.
The text entity set of the text a to be replied includes: "friend", "Nanjing road", "Asia", "travel", "19 years and 3 months", etc., the entity relationship includes: "love", "like", "visit", "recommend", etc.
And S4, fusing the text entity set and the entity relation execution information to obtain triple information.
According to the text A to be replied input by the user, it can be seen that the information quantity expressed by each group of words in the text A to be replied is different, for example, the word "special" is compared with the word "travel", and the "travel" obviously provides more important information quantity in the text A to be replied, so that in order to effectively extract important information words in the text A to be replied, triple information needs to be constructed.
The text entity set of the text a to be replied includes "friend", "Nanjing road", "Asia", "travel", etc., and the entity relationship includes "love", "like", "visit", "recommend", etc. And (5) performing information fusion to obtain triple information such as (friend-love-tour), (friend-visit-Nanjing road), (friend-19 years, 3 months-Nanjing road) and the like.
And S5, generating a reply text of the text to be replied by utilizing the triple information.
In the embodiment of the invention, after the triple information is obtained, the triple information is input into a pre-trained transform model, so that a reply text corresponding to the text to be replied can be obtained. In the embodiment of the invention, the input information is triple information extracted and optimized from the text to be replied, and then the transform model is used for generating a corresponding reply text to complete an intelligent dialogue function.
In one embodiment of the present invention, the reply text may be stored in a blockchain node.
The method comprises the steps of performing part-of-speech recognition on a text to be replied to obtain a text set to be extracted, extracting the text set to be extracted from the text set to be extracted to obtain a text entity set to be optimized, optimizing the text entity set to be optimized to obtain a text entity set, generating an entity relationship by using the text entity set, and fusing the text entity set and entity relationship execution information to obtain triple information. In summary, the embodiment of the present invention generates the reply text by using the triple information, and compared with the background art in which the text to be replied is directly used as the input data of the models such as LSTM, BERT, and the like, the embodiment of the present invention increases the processing optimization of the text to be replied until the triple information meeting the requirements is obtained, and generates the reply text by using the triple information, and even when the text data of the text to be replied is too long, by using the method of extracting the triple information, the problem that the text data of the text to be replied is too long, which causes difficulty in extracting text features, and causes poor readability of the generated reply text is avoided.
Fig. 3 is a schematic block diagram of the intelligent dialogue device according to the present invention.
The intelligent dialogue device 100 of the invention can be installed in an electronic device. According to the realized functions, the intelligent dialogue device can comprise a part of speech recognition module 101, an entity extraction module 102, a triple information construction module 103 and a text reply module 104. A module according to the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the part-of-speech recognition module 101 is configured to receive a text to be replied, perform part-of-speech recognition on the text to be replied, and obtain a text set of information to be extracted;
the entity extraction module 102 is configured to extract the information to-be-extracted text set to obtain a to-be-optimized text entity set, optimize the to-be-optimized text entity set to obtain a text entity set, and generate an entity relationship by using the text entity set;
the triple information construction module 103 is configured to fuse the text entity set and the entity relationship execution information to obtain triple information;
the text reply module 104 is configured to generate a reply text of the text to be replied by using the triple information.
Each module in the intelligent dialog device 100 provided in the embodiment of the present invention can adopt the same means as the intelligent dialog method described above when in use, and the specific implementation steps are not described herein again, and the technical effect generated by the function of each module/unit is the same as that of the intelligent dialog method described above, that is, the processing optimization of the text to be replied is lacked, which causes the problem of poor readability of the reply text.
Fig. 4 is a schematic structural diagram of an electronic device implementing the intelligent dialog method according to the present invention.
The electronic device 1 may comprise a processor 10, a memory 11 and a bus, and may further comprise a computer program, such as a smart dialog program 12, stored in the memory 11 and operable on the processor 10.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used not only to store application software installed in the electronic device 1 and various types of data, such as codes of the intelligent dialog program 12, but also to temporarily store data that has been output or is to be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device 1 by running or executing programs or modules (e.g., executing a smart conversation program, etc.) stored in the memory 11 and calling data stored in the memory 11.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
Fig. 4 only shows an electronic device with components, and it will be understood by those skilled in the art that the structure shown in fig. 4 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so as to implement functions of charge management, discharge management, power consumption management, and the like through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device 1 may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used for establishing a communication connection between the electronic device 1 and other electronic devices.
Optionally, the electronic device 1 may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the electronic device 1 and for displaying a visualized user interface, among other things.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The intelligent dialog program 12 stored in the memory 11 of the electronic device 1 is a combination of instructions that, when executed in the processor 10, enable:
receiving a text to be replied, and performing part-of-speech recognition on the text to be replied to obtain a text set of information to be extracted;
extracting the information to-be-extracted text set to obtain a text entity set to be optimized;
optimizing the text entity set to be optimized to obtain a text entity set, and generating an entity relationship by using the text entity set;
performing information fusion on the text entity set and the entity relationship to obtain triple information;
and generating a reply text of the text to be replied by using the triple information.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
Further, the computer usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
The present invention also provides a computer-readable storage medium, storing a computer program which, when executed by a processor of an electronic device, may implement:
receiving a text to be replied, and performing part-of-speech recognition on the text to be replied to obtain a text set of information to be extracted;
extracting the information to-be-extracted text set to obtain a text entity set to be optimized;
optimizing the text entity set to be optimized to obtain a text entity set, and generating an entity relationship by using the text entity set;
performing information fusion on the text entity set and the entity relationship to obtain triple information;
and generating a reply text of the text to be replied by using the triple information.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any accompanying claims should not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. An intelligent dialog method, characterized in that the method comprises:
receiving a text to be replied, and performing part-of-speech recognition on the text to be replied to obtain a text set of information to be extracted;
extracting the information to-be-extracted text set to obtain a text entity set to be optimized;
optimizing the text entity set to be optimized to obtain a text entity set, and generating an entity relationship by using the text entity set;
performing information fusion on the text entity set and the entity relationship to obtain triple information;
and generating a reply text of the text to be replied by using the triple information.
2. The intelligent dialog method of claim 1, wherein said extracting from the information to-be-extracted corpus of text to obtain a corpus of text entities to be optimized comprises:
constructing an entity probability function of each group of words in the information text set to be extracted;
and solving the entity probability function to obtain an entity probability set, and extracting the text set to be optimized from the information text set to be extracted by using the entity probability set.
3. The intelligent dialog method of claim 1, wherein said optimizing the set of textual entities to be optimized to obtain a set of textual entities comprises:
calculating entity ranking values of the text entity set to be optimized;
and cleaning the text entity set to be optimized by using the entity ranking value to obtain the text entity set.
4. The intelligent dialog method of claim 1 wherein said generating entity relationships using said set of textual entities comprises:
inputting the text entity set and the text to be replied into a trained BERT model;
extracting a text entity to be corrected from the text to be replied by using the BERT model;
performing proofreading on the text entity to be proofread and the text entity set to obtain a proofreading entity set;
and extracting to obtain the entity relationship by using the BERT model and the proofreading entity set.
5. The intelligent dialogue method of claim 1, wherein said performing part-of-speech recognition on the text to be replied to obtain a text set of information to be extracted comprises:
denoising, word-off and word-segmentation processing are carried out on the text to be replied to obtain a part-of-speech text to be recognized;
and performing part-of-speech recognition on the part-of-speech to-be-recognized text by using the part-of-speech recognition model which is trained in advance to obtain the information to-be-extracted text set.
6. The intelligent dialogue method of claim 5, wherein the performing part-of-speech recognition on the part-of-speech to-be-recognized text by using the pre-trained part-of-speech recognition model to obtain the information to-be-extracted text set comprises:
constructing and training a part-of-speech recognition model, wherein the part-of-speech recognition model comprises a characteristic conversion layer and a part-of-speech recognition layer;
and converting the part-of-speech to-be-recognized text into a text feature set by using the feature conversion layer, and performing part-of-speech recognition on the text feature set by using the part-of-speech recognition layer to obtain the information to-be-extracted text set.
7. The intelligent dialogue method of any one of claims 1 to 6, wherein the building and training of part-of-speech recognition models comprises:
receiving a training text set and a part-of-speech tag set corresponding to the training text set;
performing replacement and shielding operation on the training text set to obtain a semi-shielding text set;
constructing a part-of-speech recognition model, and calculating a part-of-speech prediction set of the semi-occlusion text set by using the part-of-speech recognition model;
and calculating a difference value between the part of speech prediction set and the part of speech tag set, and when the difference value is greater than or equal to a preset threshold value, adjusting internal parameters of the part of speech recognition model until the difference value is less than the preset threshold value, so as to obtain a trained part of speech recognition model.
8. An intelligent dialog device, the device comprising:
the part-of-speech recognition module is used for receiving a text to be replied and executing part-of-speech recognition on the text to be replied to obtain a text set of information to be extracted;
the entity extraction module is used for extracting a text entity set to be optimized from the information text set to be extracted, optimizing the text entity set to be optimized to obtain a text entity set, and generating an entity relationship by using the text entity set;
the triple information construction module is used for fusing the text entity set and the entity relationship execution information to obtain triple information;
and the text reply module is used for generating a reply text of the text to be replied by utilizing the triple information.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the intelligent dialog method of any of claims 1 to 7.
10. A computer-readable storage medium comprising a storage data area and a storage program area, wherein the storage data area stores created data, and the storage program area stores a computer program; wherein the computer program, when executed by a processor, implements the intelligent dialog method of any one of claims 1 to 7.
CN202011442523.3A 2020-12-11 2020-12-11 Intelligent conversation method and device, electronic equipment and storage medium Pending CN112507728A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011442523.3A CN112507728A (en) 2020-12-11 2020-12-11 Intelligent conversation method and device, electronic equipment and storage medium
PCT/CN2021/082869 WO2022121152A1 (en) 2020-12-11 2021-03-25 Smart dialog method, apparatus, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011442523.3A CN112507728A (en) 2020-12-11 2020-12-11 Intelligent conversation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112507728A true CN112507728A (en) 2021-03-16

Family

ID=74971005

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011442523.3A Pending CN112507728A (en) 2020-12-11 2020-12-11 Intelligent conversation method and device, electronic equipment and storage medium

Country Status (2)

Country Link
CN (1) CN112507728A (en)
WO (1) WO2022121152A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113326367A (en) * 2021-06-30 2021-08-31 四川启睿克科技有限公司 Task type dialogue method and system based on end-to-end text generation
WO2022121152A1 (en) * 2020-12-11 2022-06-16 平安科技(深圳)有限公司 Smart dialog method, apparatus, electronic device, and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10839298B2 (en) * 2016-11-30 2020-11-17 International Business Machines Corporation Analyzing text documents
CN109918494B (en) * 2019-03-22 2022-11-04 元来信息科技(湖州)有限公司 Context association reply generation method based on graph, computer and medium
CN111666393A (en) * 2020-04-29 2020-09-15 平安科技(深圳)有限公司 Verification method and device of intelligent question-answering system, computer equipment and storage medium
CN111708874B (en) * 2020-08-24 2020-11-13 湖南大学 Man-machine interaction question-answering method and system based on intelligent complex intention recognition
CN112507728A (en) * 2020-12-11 2021-03-16 平安科技(深圳)有限公司 Intelligent conversation method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022121152A1 (en) * 2020-12-11 2022-06-16 平安科技(深圳)有限公司 Smart dialog method, apparatus, electronic device, and storage medium
CN113326367A (en) * 2021-06-30 2021-08-31 四川启睿克科技有限公司 Task type dialogue method and system based on end-to-end text generation

Also Published As

Publication number Publication date
WO2022121152A1 (en) 2022-06-16

Similar Documents

Publication Publication Date Title
CN112541338A (en) Similar text matching method and device, electronic equipment and computer storage medium
CN113515938B (en) Language model training method, device, equipment and computer readable storage medium
CN113449187A (en) Product recommendation method, device and equipment based on double portraits and storage medium
CN114822812A (en) Character dialogue simulation method, device, equipment and storage medium
CN111460797A (en) Keyword extraction method and device, electronic equipment and readable storage medium
CN112988963A (en) User intention prediction method, device, equipment and medium based on multi-process node
CN112507663A (en) Text-based judgment question generation method and device, electronic equipment and storage medium
CN112507728A (en) Intelligent conversation method and device, electronic equipment and storage medium
CN113378970A (en) Sentence similarity detection method and device, electronic equipment and storage medium
CN115392237B (en) Emotion analysis model training method, device, equipment and storage medium
CN112528013A (en) Text abstract extraction method and device, electronic equipment and storage medium
CN112507230A (en) Webpage recommendation method and device based on browser, electronic equipment and storage medium
CN112885478A (en) Medical document retrieval method, medical document retrieval device, electronic device, and storage medium
CN113886708A (en) Product recommendation method, device, equipment and storage medium based on user information
CN113821622A (en) Answer retrieval method and device based on artificial intelligence, electronic equipment and medium
CN112667775A (en) Keyword prompt-based retrieval method and device, electronic equipment and storage medium
CN113360654B (en) Text classification method, apparatus, electronic device and readable storage medium
CN113918704A (en) Question-answering method and device based on machine learning, electronic equipment and medium
CN113706322A (en) Service distribution method, device, equipment and storage medium based on data analysis
CN112668281A (en) Automatic corpus expansion method, device, equipment and medium based on template
CN113420542B (en) Dialogue generation method, device, electronic equipment and storage medium
CN116701574A (en) Text semantic similarity calculation method, device, equipment and storage medium
CN116168403A (en) Medical data classification model training method, classification method, device and related medium
CN114610854A (en) Intelligent question and answer method, device, equipment and storage medium
CN116522164B (en) User matching method, device and storage medium based on user acquisition information

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