WO2022121152A1 - 智能对话方法、装置、电子设备及存储介质 - Google Patents

智能对话方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2022121152A1
WO2022121152A1 PCT/CN2021/082869 CN2021082869W WO2022121152A1 WO 2022121152 A1 WO2022121152 A1 WO 2022121152A1 CN 2021082869 W CN2021082869 W CN 2021082869W WO 2022121152 A1 WO2022121152 A1 WO 2022121152A1
Authority
WO
WIPO (PCT)
Prior art keywords
text
entity
information
speech recognition
extracted
Prior art date
Application number
PCT/CN2021/082869
Other languages
English (en)
French (fr)
Inventor
倪子凡
王健宗
程宁
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2022121152A1 publication Critical patent/WO2022121152A1/zh

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

Definitions

  • the present application relates to the field of artificial intelligence, and in particular, to an intelligent dialogue method, apparatus, electronic device, and computer-readable storage medium.
  • intelligent dialogue methods based on deep learning networks have sprung up like mushrooms after the rain.
  • the commonly used intelligent dialogue methods include LSTM synthesis method, BERT synthesis method, etc.
  • the method generally directly inputs the text to be replied into the model to predict the reply text, which lacks the processing optimization of the text to be replied. If the text data of the text to be replied is too long, it is not easy to extract the text features, which in turn makes the generated reply text readable. sexual issues.
  • An intelligent dialogue method provided by this application includes:
  • the reply text of the text to be replied is generated by using the triple information.
  • the present application also provides an intelligent dialogue device, the device comprising:
  • a part-of-speech recognition module configured to receive the text to be replied, perform part-of-speech recognition on the text to be replied, and obtain a text set to be extracted;
  • an entity extraction module configured to extract a text entity set to be optimized from the information to be extracted text set, optimize the text entity set to be optimized to obtain a text entity set, and use the text entity set to generate entity relationships;
  • a triplet information building module is used to perform information fusion of the text entity set and the entity relationship to obtain triplet information
  • a text reply module configured to generate a reply text of the text to be replied by using the triple information.
  • the present application also provides an electronic device, the electronic device comprising:
  • a processor that executes the instructions stored in the memory to achieve the following steps:
  • the reply text of the text to be replied is generated by using the triple information.
  • the present application also provides a computer-readable storage medium, including a storage data area and a storage program area, the storage data area stores created data, and the storage program area stores a computer program; wherein, the computer program is implemented as follows when executed by a processor step:
  • the reply text of the text to be replied is generated by using the triple information.
  • FIG. 1 is a schematic flowchart of an intelligent dialogue method provided by an embodiment of the present application
  • FIG. 2 is a detailed schematic flowchart of S2 in the intelligent dialogue method provided by an embodiment of the present application
  • FIG. 3 is a schematic diagram of a module of an intelligent dialogue device provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of the internal structure of an electronic device for implementing an intelligent dialogue method provided by an embodiment of the present application
  • the embodiments of the present application provide an intelligent dialogue method, and the execution subject of the intelligent dialogue method includes but is not limited to at least one of electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiments of the present application.
  • the intelligent dialogue method can be executed by software or hardware installed in a terminal device or a server device, and the software can 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.
  • the intelligent dialogue method includes:
  • the text to be replied includes text input by the user, text crawled from the network using a crawler program, etc., such as text A to be replied input by the user: "My friend loves traveling, but he likes to go to The lively places, such as Nanjing Road in Shanghai he visited in March 2019, as one of the most promising commercial streets in Asia, left a deep impression on him. Do you have any recommended tourist spots?"
  • the text to be replied generally has words with different parts of speech, so words with different parts of speech need to be extracted to facilitate information extraction in subsequent steps.
  • performing part-of-speech recognition on the text to be replied includes: Perform denoising, stop word removal and word segmentation processing to obtain the part-of-speech text to be recognized; use the pre-trained part-of-speech recognition model to perform part-of-speech recognition on the part of speech to be recognized text to obtain the information to be extracted text set.
  • the denoising process can use a regular expression constructed based on a programming language to complete the effect of removing noise such as numbers, emoticons, and special symbols such as URL, "@", "#”, etc.
  • the embodiment of the present application uses the stuttering word segmentation method to perform word segmentation on the denoised text to obtain multiple sets of words corresponding to the text to be replied.
  • stop words refer to words that have no practical meaning and have no effect on triple information extraction in Chinese texts.
  • stop words due to the high frequency of stop words, including commonly used pronouns, prepositions, etc., if stop words are retained , which will impose a computational burden on the embodiment of the present application, and even affect the accuracy of the intelligent dialogue, so it is necessary to perform stop word removal processing on the word set.
  • the stop word table filtering method can be used to remove stop words, and the pre-built stop word table is matched with each word in the word set one by one. If the match is successful, the The word is judged to be a stop word, and the word is deleted.
  • Step A Build and train a part-of-speech recognition model, wherein the part-of-speech recognition model includes a feature conversion layer and a part-of-speech recognition layer.
  • the building and training 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 masking operations on the training text set, and obtaining a semi-masked text set; constructing a part of speech Recognition model, using the part-of-speech recognition model to calculate the part-of-speech prediction set of the semi-covered text set; calculating the difference value between the part-of-speech prediction set and the part-of-speech tag set, when the difference value is greater than or equal to a preset threshold, The internal parameters of the part-of-speech recognition model are adjusted until the difference value is less than the preset threshold, and a trained part-of-speech recognition model is obtained.
  • the part-of-speech recognition model mainly includes a feature conversion layer and a part-of-speech recognition layer.
  • the feature conversion layer is composed of a BERT model (Bidirectional Encoder Representations from Transformers), and the part-of-speech recognition layer is composed of a CRF (Conditional Random Field) model.
  • the training text set is text data obtained by crawling from the network in advance and manually cleaned by means such as crawler.
  • the part-of-speech tag set records the part-of-speech tag of each word in the training text set.
  • the training text set includes the training text a: "Huangshan is so beautiful, it is as haunting as Hengshan", and the part-of-speech tag set records the The part of speech of each word in the training text a is: "Huangshan (noun) beautiful (adjective)!.
  • 70% of the words in the training text set are masked with preset symbols, and the remaining 30% of the words in the training text set are kept unchanged to obtain the semi-masked text set .
  • the training text a "Huangshan is so beautiful, it is as lingering as Hengshan”, if "Huangshan” is selected, if "Huangshan” is masked, the training text a becomes: "[mask] is really beautiful, and Hengshan is just as lingering as it is inherent.”
  • calculating the part-of-speech prediction set of the semi-occluded text set using the part-of-speech recognition model includes: using the feature conversion layer to convert the semi-occluded text set into a semi-occluded vector set; using the part-of-speech recognition layer, perform part-of-speech recognition on the semi-masked vector set, and obtain the part-of-speech prediction set.
  • a BERT model using a 12-layer bidirectional encoder is used to convert the semi-masked text set into a semi-masked vector set.
  • the bidirectional encoding can be a disclosed feature extraction neural network.
  • the CRF model is used to calculate part-of-speech probability values of different parts of speech corresponding to each word, and select the part-of-speech corresponding to the largest part-of-speech probability value, so as to achieve the purpose of part-of-speech prediction.
  • the Chebyshev algorithm may be used to calculate the difference value between the part-of-speech prediction set and the part-of-speech tag set, and when the difference value is less than the preset threshold, the trained part-of-speech recognition model is obtained.
  • Step B Receive the part of speech to be recognized text, use the feature conversion layer to convert the part of speech to be recognized text into a text feature set, use the part of speech recognition layer to perform part-of-speech recognition on the text feature set, and obtain the information The set of texts to be extracted.
  • the embodiment of the present application uses the part-of-speech text to be identified into the text feature set, and the part-of-speech to identify the text feature set to obtain the information to be extracted text set, which is the same as the above model training steps, and will not be repeated here.
  • the text to be extracted from the information can be obtained. It can be seen that the text to be extracted from the information is composed of several words with part-of-speech information.
  • the entity set of the text to be optimized includes information such as persons, places, organizations, and times involved in the text to be replied, for example, in the text to be replied A: "My friend loves traveling, but he He likes to go to lively places. For example, he visited Nanjing Road in Shanghai in March 2019. As one of the most technological commercial streets in Asia, he left a deep impression on him. Do you have any recommended tourist spots?"
  • the text entity set to be optimized includes: “Friends”, “Nanjing Road”, “Asia”, “Travel”, “March 19”, etc.
  • the text entity set to be optimized obtained by extracting the text set to be extracted from the information includes:
  • the entity probability function P(W i ) is:
  • W 1 , W 2 ,...,W i are different words in the information to be extracted text set
  • i is the serial number
  • m is the number of the information to be extracted text set
  • the Markov model can be used to calculate P(W i ) represents the entity probability corresponding to the word Wi.
  • the optimizing the text entity set to be optimized to obtain the text entity set includes: calculating the 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.
  • P(s i ) is the entity matrix corresponding to the text entity si to be optimized in the text entity set to be optimized
  • T is the entity ranking value corresponding to the text entity si to be optimized
  • is calculated by using the pagerank algorithm
  • I is a coordination matrix with a value of 1 corresponding to the entity matrix.
  • the text entities to be optimized whose entity ranking value is less than the preset threshold value are removed, so as to obtain the text entity set.
  • the BERT model is used to realize the entity relationship generation of the text entity set.
  • the use of the text entity set to generate the entity relationship includes: inputting the text entity set and the text to be replied to.
  • the BERT model that has been trained use the BERT model to extract the text entity to be proofread from the text to be replied, and perform proofreading between the text entity to be proofread and the text entity set to obtain a proofread entity set, and use the The BERT model and the proofreading entity set are extracted to obtain the entity relationship.
  • the BERT model can perform feature transformation in S1, and can also be used to perform entity relationship extraction.
  • the text entity to be proofread is extracted from the text to be replied by the BERT model, and there may be deviations. Therefore, it is necessary to use the text entity set to perform correction.
  • the BERT is further used. model, and extract the entity relationship with reference to the proofreading entity set.
  • the text entity set of the above-mentioned text A to be replied includes: “friends”, “Nanjing Road”, “Asia”, “tourism”, “March 19”, etc.
  • the entity relationship includes: “love”, “like” “ visit”, “recommend”, etc.
  • the text entity set of the above text A to be replied includes “friends”, “Nanjing Road”, “Asia”, “tourism”, etc., and the entity relationship includes “love”, “like”, “visit”, “recommendation” and so on.
  • triple information such as (friends-love-travel), (friends-visit-Nanjing Road), (friends-March 2019-Nanjing Road), etc. are obtained.
  • the triplet information is input into the pre-trained transform model, and the reply text corresponding to the text to be replied can be obtained.
  • the transform model is a currently published intelligent text dialogue model. When the transform model receives different input information, it will obtain different reply information.
  • the input information is extracted from the text to be replied. And optimize the obtained triple information, and then use the transform model to generate the corresponding reply text to complete the intelligent dialogue function.
  • the reply text may be stored in a blockchain node.
  • This embodiment of the present application performs part-of-speech recognition on the text to be replied to, obtains a text set to be extracted, and extracts a text entity set to be optimized from the information to be extracted text set, and optimizes the text entity set to be optimized to obtain a text entity set, use the text entity set to generate entity relationship, and perform information fusion on the text entity set and the entity relationship to obtain triple information.
  • the embodiment of the present application uses triple information to generate the reply text.
  • the text to be replied is directly used as the input data of models such as LSTM and BERT, and the embodiment of the present application increases the processing of the text to be replied.
  • the intelligent dialogue method, device and computer-readable storage medium proposed in this application can solve the problem of lack of processing of the text to be replied. Optimization, resulting in poor readability of the reply text.
  • FIG. 3 it is a schematic diagram of a module of the intelligent dialogue device of the present application.
  • the intelligent dialogue device 100 described in this application can be installed in an electronic device.
  • the intelligent dialogue device may include a part-of-speech recognition module 101 , an entity extraction module 102 , a triple information construction module 103 and a text reply module 104 .
  • the modules described in the present invention can also be called units, which refer to a series of computer program segments that can be executed by the electronic device processor and can perform fixed functions, and are stored in the memory of the electronic device.
  • each module/unit is as follows:
  • the part-of-speech recognition module 101 is configured to receive the text to be replied, perform part-of-speech recognition on the text to be replied, and obtain a text set to be extracted;
  • the entity extraction module 102 is configured to extract a text entity set to be optimized from the information to be extracted text set, optimize the text entity set to be optimized to obtain a text entity set, and use the text entity set to generate entity relationships;
  • the triple information building module 103 is used to perform information fusion of the text entity set and the entity relationship to obtain triple information;
  • the text reply module 104 is configured to generate reply text of the text to be replied by using the triplet information.
  • Each module in the intelligent dialogue device 100 provided by the embodiment of the present application can use the same means as the above-mentioned intelligent dialogue method, and the specific implementation steps will not be repeated here.
  • the technical effect is the same as that of the above-mentioned intelligent dialogue method, that is, the processing optimization of the text to be replied is lacking, resulting in the problem of poor readability of the reply text.
  • FIG. 4 it is a schematic structural diagram of an electronic device implementing the intelligent dialogue method of the present application.
  • the electronic device 1 may include a processor 10, a memory 11 and a bus, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as an intelligent dialogue program 12.
  • the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, magnetic disk, CD etc.
  • the memory 11 may be an internal storage unit of the electronic device 1 , such as a mobile hard disk of the electronic device 1 .
  • the memory 11 may also be an external storage device of the electronic device 1, such as a pluggable mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital) equipped on the electronic device 1. , SD) card, flash memory card (Flash Card), etc.
  • the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
  • the memory 11 can not only be used to store application software installed in the electronic device 1 and various types of data, such as codes of the intelligent dialogue program 12, etc., but also can be used to temporarily store data that has been output or will be output.
  • the processor 10 may be composed of integrated circuits, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits packaged with the same function or different functions, including one or more integrated circuits.
  • Central Processing Unit CPU
  • microprocessor digital processing chip
  • graphics processor and combination of various control chips, etc.
  • the processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect the various components of the entire electronic device, by running or executing the program or module (for example, executing the program) stored in the memory 11. intelligent dialogue program, etc.), and call the data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
  • the bus may be a peripheral component interconnect (PCI for short) bus or an extended industry standard architecture (Extended industry standard architecture, EISA for short) bus or the like.
  • PCI peripheral component interconnect
  • EISA Extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the bus is configured to implement connection communication between the memory 11 and at least one processor 10 and the like.
  • FIG. 4 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 4 does not constitute a limitation on the electronic device 1, and may include fewer or more components than those shown in the drawings. components, or a combination of certain components, or a different arrangement of components.
  • the electronic device 1 may also include a power supply (such as a battery) for powering the various components, preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that the power management
  • the device implements functions such as charge management, discharge management, and power consumption management.
  • the power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and any other components.
  • the electronic device 1 may further include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
  • the electronic device 1 may also include a network interface, 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 is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
  • a network interface 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 is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
  • the electronic device 1 may further include a user interface, and the user interface may be a display (Display), an input unit (eg, a keyboard (Keyboard)), optionally, the user interface may also be a standard wired interface or a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, and the like.
  • the display may also be appropriately called a display screen or a display unit, which is used for displaying information processed in the electronic device 1 and for displaying a visualized user interface.
  • the intelligent dialogue program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions, and when running in the processor 10, it can realize:
  • the reply text of the text to be replied is generated by using the triple information.
  • the modules/units integrated in the electronic device 1 may be stored in a computer-readable storage medium.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, removable hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) .
  • the computer-readable 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 by at least one function, and the like; The data created by the use of the node, etc.
  • the present application also provides a computer-readable storage medium, the computer-readable storage medium may be volatile or non-volatile, and the readable storage medium stores a computer program, and the computer program is electronically stored When executed by the device's processor, it can achieve:
  • the reply text of the text to be replied is generated by using the triple information.
  • modules described as separate components may or may not be physically separated, and components shown as modules may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional module in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit may be implemented in the form of hardware, or may be implemented in the form of hardware plus software function modules.
  • the blockchain referred to in this application is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Machine Translation (AREA)

Abstract

一种智能对话方法涉及人工智能技术,包括:接收待回复文本,对所述待回复文本执行词性识别,得到信息待抽取文本集(S1),从所述信息待抽取文本集中抽取得到待优化文本实体集(S2),优化所述待优化文本实体集,得到文本实体集,利用所述文本实体集生成实体关系(S3),将所述文本实体集及所述实体关系执行信息融合,得到三元组信息(S4),利用所述三元组信息生成所述待回复文本的回复文本(S5)。该方法还涉及区块链技术,该回复文本可以存储于区块链节点中。该方法可解决缺少对待回复文本的处理优化,造成回复文本可阅读性差的问题。

Description

智能对话方法、装置、电子设备及存储介质
本申请要求于2020年12月11日提交中国专利局、申请号为CN202011442523.3、名称为“智能对话方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人工智能领域,尤其涉及一种智能对话方法、装置、电子设备及计算机可读存储介质。
背景技术
随着深度学习的迅速发展,基于深度学习网络的智能对话方法如雨后春笋般涌现,目前常用的智能对话方法包括LSTM合成法、BERT合成法等,虽然都可实现智能对话,发明人意识到该类方法一般直接将待回复文本输入至模型中预测出回复文本,缺乏对待回复文本的处理优化,若待回复文本的文本数据过长时,不容易提取出文本特征,进而导致生成的回复文本可阅读性较差的问题。
发明内容
本申请提供的一种智能对话方法,包括:
接收待回复文本,对所述待回复文本执行词性识别,得到信息待抽取文本集;
从所述信息待抽取文本集中抽取得到待优化文本实体集;
优化所述待优化文本实体集,得到文本实体集,利用所述文本实体集生成实体关系;
将所述文本实体集及所述实体关系执行信息融合,得到三元组信息;
利用所述三元组信息生成所述待回复文本的回复文本。
本申请还提供一种智能对话装置,所述装置包括:
词性识别模块,用于接收待回复文本,对所述待回复文本执行词性识别,得到信息待抽取文本集;
实体抽取模块,用于从所述信息待抽取文本集中抽取得到待优化文本实体集,优化所述待优化文本实体集,得到文本实体集,利用所述文本实体集生成实体关系;
三元组信息构建模块,用于将所述文本实体集及所述实体关系执行信息融合,得到三元组信息;
文本回复模块,用于利用所述三元组信息生成所述待回复文本的回复文本。
本申请还提供一种电子设备,所述电子设备包括:
存储器,存储至少一个指令;及
处理器,执行所述存储器中存储的指令以实现如下步骤:
接收待回复文本,对所述待回复文本执行词性识别,得到信息待抽取文本集;
从所述信息待抽取文本集中抽取得到待优化文本实体集;
优化所述待优化文本实体集,得到文本实体集,利用所述文本实体集生成实体关系;
将所述文本实体集及所述实体关系执行信息融合,得到三元组信息;
利用所述三元组信息生成所述待回复文本的回复文本。
本申请还提供一种计算机可读存储介质,包括存储数据区和存储程序区,存储数据区存储创建的数据,存储程序区存储有计算机程序;其中,所述计算机程序被处理器执行时实现如下步骤:
接收待回复文本,对所述待回复文本执行词性识别,得到信息待抽取文本集;
从所述信息待抽取文本集中抽取得到待优化文本实体集;
优化所述待优化文本实体集,得到文本实体集,利用所述文本实体集生成实体关系;
将所述文本实体集及所述实体关系执行信息融合,得到三元组信息;
利用所述三元组信息生成所述待回复文本的回复文本。
附图说明
图1为本申请一实施例提供的智能对话方法的流程示意图;
图2为本申请一实施例提供的智能对话方法中S2的详细流程示意图;
图3为本申请一实施例提供的智能对话装置的模块示意图;
图4为本申请一实施例提供的实现智能对话方法的电子设备的内部结构示意图;
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请实施例提供一种智能对话方法,所述智能对话方法的执行主体包括但不限于服务端、终端等能够被配置为执行本申请实施例提供的该方法的电子设备中的至少一种。换言之,所述智能对话方法可以由安装在终端设备或服务端设备的软件或硬件来执行,所述软件可以是区块链平台。所述服务端包括但不限于:单台服务器、服务器集群、云端服务器或云端服务器集群等。
参照图1所示,为本申请一实施例提供的智能对话方法的流程示意图。在本实施例中,所述智能对话方法包括:
S1、接收待回复文本,对所述待回复文本执行词性识别,得到信息待抽取文本集。
本申请实施例中,所述待回复文本包括用户输入的文本、利用爬虫程序从网络中爬取的文本等,如用户输入的待回复文本A:“我的朋友特别热爱旅游,不过他喜欢去热闹非凡的地方,比如他19年3月参观过上海的南京路,作为亚洲最繁华的商业街之一,让他留下了深深的印象,请问你有推荐的旅游地点嘛”。
待回复文本中一般具有不同词性的词语,因此需要提取出不同词性的词语,方便后续步骤进行信息抽取,详细地,所述对所述待回复文本执行词性识别,包括:将所述待回复文本执行去噪、去停用词及分词处理,得到词性待识别文本;利用预训练完成的词性识别模型,对所述词性待识别文本执行词性识别,得到所述信息待抽取文本集。
进一步,由于所述待回复文本可能包含非文本数据,例如超链接、网页标签等,会对三元组信息提取产生影响,因此需要对所述待回复文本进行执行去噪处理。本申请实施例中,去噪处理可采用基于编程语言为基础构建的正则表达式,完成去除如数字、表情符号以及特殊符号如URL、“@”、“#”等噪声的作用。
详细地,本申请实施例利用结巴分词方法,对去噪后的文本执行分词,得到多组与所述待回复文本对应的词语集。
进一步地,停用词指没有什么实际意义且在中文文本内对三元组信息提取没有影响的词,但由于停用词出现频率高,包括常用的代词、介词等,因此若保留停用词,会对本申请实施例产生计算负担,甚至影响智能对话的准确率,因此需要对所述词语集执行去停用词处理。详细地,本申请实施例中,去停用词可采用停用词表过滤法,通过预先构建好的停用词表和所述词语集中每个词语进行一一匹配,如果匹配成功,那么该词语则被判断为停用词,则将该词删除。
详细地,所述利用预训练完成的词性识别模型,对所述词性待识别文本执行词性识别,得到所述信息待抽取文本集,包括:
步骤A:构建及训练词性识别模型,其中所述词性识别模型包括特征转化层及词性识别层。
进一步地,所述构建及训练词性识别模型,包括:接收训练文本集与所述训练文本集对应的词性标签集,将所述训练文本集执行替换及遮蔽操作,得到半遮蔽文本集;构建词 性识别模型,利用所述词性识别模型计算所述半遮蔽文本集的词性预测集;计算所述词性预测集与所述词性标签集的差异值,当所述差异值大于或等于预设阈值时,调整所述词性识别模型的内部参数,直至所述差异值小于所述预设阈值,得到训练完成的词性识别模型。
本申请实施例中,所述词性识别模型主要包括特征转化层及词性识别层。其中所述特征转化层由BERT模型(Bidirectional Encoder Representations from Transformers)组成,所述词性识别层由CRF(Conditional Random Field,条件随机场)模型组成。
本申请实施例中,所述训练文本集是利用爬虫等手段,预先从网络中爬取并人工清理得到的文本数据。所述词性标签集记录所述训练文本集中每个词语的词性标签,如训练文本集中包括训练文本a:“黄山真美丽,和衡山一样让人流连忘返”,在所述词性标签集中记录了所述训练文本a各词语的词性为:“黄山(名词)美丽(形容词)……”。
本申请较佳实施例将所述训练文本集中70%的词语用预设的符号进行遮蔽(masked token),保持所述训练文本集剩下30%的词语不变,得到所述半遮蔽文本集。如所述训练文本a:“黄山真美丽,和衡山一样让人流连忘返”,选中“黄山”,若对“黄山”进行遮蔽,则所述训练文本a变为:“[mask]真美丽,和衡山一样让人流连忘返”。
进一步地,所述利用所述词性识别模型计算所述半遮蔽文本集的词性预测集,包括:利用所述特征转化层将所述半遮蔽文本集转化为半遮蔽向量集;利用所述词性识别层,对所述半遮蔽向量集执行词性识别,得到所述词性预测集。
本申请较佳实施例中,采用采用12层的双向编码(encoer-decoder)的BERT模型,将所述半遮蔽文本集转化为半遮蔽向量集。其中所述双向编码可以是已公开的特征提取神经网络。
进一步地,利用所述CRF模型计算每个词语对应的不同词性的词性概率值,并选择出最大的词性概率值所对应的词性,达到词性预测的目的。
本申请实施例可使用切比雪夫计算法计算所述词性预测集与所述词性标签集的差异值,当所述差异值小于所述预设阈值,得到训练完成的所述词性识别模型。
步骤B:接收所述词性待识别文本,利用所述特征转化层将所述词性待识别文本转变为文本特征集,利用所述词性识别层对所述文本特征集执行词性识别,得到所述信息待抽取文本集。
本申请实施例利用将所述词性待识别文本转为所述文本特征集,及词性识别所述文本特征集,得到所述信息待抽取文本集,与上述模型训练步骤相同,这里不再赘述。
综上,当完成上述去噪、去停用词、分词处理及词性识别后,可得到所述信息待提取文本,可见所述信息待抽取文本集是由若干具有词性信息的词语组成。
S2、从所述信息待抽取文本集中抽取得到待优化文本实体集。
详细地,所述待优化文本实体集包括所述待回复文本中涉及的人物、地点、组织机构、时间等信息,如在所述待回复文本A中:“我的朋友特别热爱旅游,不过他喜欢去热闹非凡的地方,比如他19年3月参观过上海的南京路,作为亚洲最繁华的商业街之一,让他留下了深深的印象,请问你有推荐的旅游地点嘛”,则待优化文本实体集包括:“朋友”、“南京路”、“亚洲”、“旅游”、“19年3月”等。
进一步地,参阅图2所示,所述从所述信息待抽取文本集中抽取得到待优化文本实体集,包括:
S21、构建所述信息待抽取文本集内每组词语的实体概率函数;
S22、求解所述实体概率函数得到实体概率集,利用所述实体概率集,从所述信息待抽取文本集中抽取得到所述待优化文本实体集。
本申请实施例中,所述实体概率函数P(W i)为:
Figure PCTCN2021082869-appb-000001
其中,W 1,W 2,…,W i为所述信息待抽取文本集内不同的词语,i为编号,m为所述信息待抽取文本集的数量,
Figure PCTCN2021082869-appb-000002
表示词语W i在词语W i-1为条件下的条件概率,本申请实施例中,可使用马尔科夫模型计算出
Figure PCTCN2021082869-appb-000003
P(W i)表示词语W i对应的实体概率。
进一步地,当得到不同词语所对应的实体概率后,按照从大到小进行排序,得到排序后的实体概率集,根据预设数量,选择出实体概率值所对应的词语,即为所述待优化文本实体集。
S3、优化所述待优化文本实体集,得到文本实体集,利用所述文本实体集生成实体关系。
详细地,所述优化所述待优化文本实体集,得到文本实体集包括:计算所述待优化文本实体集的实体排名值,利用所述实体排名值,清洗所述待优化文本实体集,得到所述文本实体集。
进一步地,利用下述公式,计算所述所述待优化文本实体集的实体排名值:
T=αP(s i)+(1-α)I
其中,P(s i)为所述待优化文本实体集内待优化文本实体s i对应的实体矩阵,T为待优化文本实体s i对应的所述实体排名值,α为利用pagerank算法计算出的待优化文本实体s i在网页中的跳转概率,I是与所述实体矩阵对应的数值为1的协调矩阵。
当计算得到每个待优化文本实体的实体排名值后,去除实体排名值小于预设阈值的待优化文本实体,从而得到所述文本实体集。
本申请实施例中,利用BERT模型实现所述文本实体集的实体关系生成,详细地,所述利用所述文本实体集生成实体关系,包括:将所述文本实体集及所述待回复文本输入至训练完成的BERT模型中,利用所述BERT模型从所述待回复文本中抽取待校对文本实体,将所述待校对文本实体与所述文本实体集执行校对,得到校对实体集,利用所述BERT模型及校对实体集,抽取得到所述实体关系。
本申请实施例中,所述BERT模型在S1中可执行特征转化,同样地可用来进行实体关系抽取,作用不同主要基于训练BERT模型的训练方法不同。另外通过BERT模型从所述待回复文本中抽取得到所述待校对文本实体,可能存在偏差,因此需要利用所述文本实体集执行校正,当得到校正后的校对实体集后,进一步利用所述BERT模型,参照所述校对实体集抽取得到所述实体关系。
如上述待回复文本A的文本实体集包括:“朋友”、“南京路”、“亚洲”、“旅游”、“19年3月”等,则实体关系包括:“热爱”、“喜欢”“参观”、“推荐”等。
S4、将所述文本实体集及所述实体关系执行信息融合,得到三元组信息。
根据用户输入的待回复文本A可看出,在待回复文本A中,每组词语所表达的信息量不同,如词语“特别”与词语“旅游”相比,“旅游”在所述待回复文本A中明显会提供更重要的信息量,因此为了有效提取出所述待回复文本中重要的信息词语,需构建出三元组信息。
如上述待回复文本A的文本实体集包括“朋友”、“南京路”、“亚洲”、“旅游”等,实体关系包括“热爱”、“喜欢”“参观”、“推荐”等。执行信息融合后得到(朋友-热爱-旅游)、(朋友-参观-南京路)、(朋友-19年3月-南京路)等三元组信息。
S5、利用所述三元组信息生成所述待回复文本的回复文本。
本申请实施例中,当得到所述三元组信息后,将所述三元组信息输入至预先训练完成的transform模型中,可得到与所述待回复文本对应的回复文本。其中transform模型是一种当前已公开的文本对话智能模型,当transform模型接收到不同的输入信息时,会得到不同的回复信息,本申请实施例中,输入信息是从所述待回复文本中抽取并优化得到的三元组信息,进而利用transform模型生成对应的回复文本,完成智能对话功能。
本申请其中一个实施例中,所述回复文本可以存储于区块链节点中。
本申请实施例对所述待回复文本执行词性识别,得到信息待抽取文本集,并从所述信息待抽取文本集中抽取得到待优化文本实体集,同时优化所述待优化文本实体集得到文本实体集,利用所述文本实体集生成实体关系,将所述文本实体集及所述实体关系执行信息融合,得到三元组信息。综合来说,本申请实施例利用三元组信息生成回复文本,相比于背景技术直接将待回复文本作为LSTM、BERT等模型的输入数据来说,本申请实施例增加了对待回复文本的处理优化,直至得到满足要求的三元组信息,并利用三元组信息生成回复文本,即使当待回复文本的文本数据过长时,通过提取出三元组信息的方法,避免待回复文本的文本数据过长,造成不容易提取出文本特征,导致生成的回复文本可阅读性较差的问题,因此本申请提出的智能对话方法、装置及计算机可读存储介质,可以解决缺少对待回复文本的处理优化,造成回复文本可阅读性差的问题。
如图3所示,是本申请智能对话装置的模块示意图。
本申请所述智能对话装置100可以安装于电子设备中。根据实现的功能,所述智能对话装置可以包括词性识别模块101、实体抽取模块102、三元组信息构建模块103及文本回复模块104。本发所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。
在本实施例中,关于各模块/单元的功能如下:
所述词性识别模块101,用于接收待回复文本,对所述待回复文本执行词性识别,得到信息待抽取文本集;
所述实体抽取模块102,用于从所述信息待抽取文本集中抽取得到待优化文本实体集,优化所述待优化文本实体集,得到文本实体集,利用所述文本实体集生成实体关系;
所述三元组信息构建模块103,用于将所述文本实体集及所述实体关系执行信息融合,得到三元组信息;
所述文本回复模块104,用于利用所述三元组信息生成所述待回复文本的回复文本。
本申请实施例所提供的智能对话装置100中的各个模块能够在使用时基于与上述的智能对话方法采用相同的手段,具体地实施步骤在此不再赘述,关于各模块/单元的功能所产生技术效果与上述的智能对话方法的技术效果相同的,即缺少对待回复文本的处理优化,造成回复文本可阅读性差的问题。
如图4所示,是本申请实现智能对话方法的电子设备的结构示意图。
所述电子设备1可以包括处理器10、存储器11和总线,还可以包括存储在所述存储器11中并可在所述处理器10上运行的计算机程序,如智能对话程序12。
其中,所述存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、移动硬盘、多媒体卡、卡型存储器(例如:SD或DX存储器等)、磁性存储器、磁盘、光盘等。所述存储器11在一些实施例中可以是电子设备1的内部存储单元,例如该电子设备1的移动硬盘。所述存储器11在另一些实施例中也可以是电子设备1的外部存储设备,例如电子设备1上配备的插接式移动硬盘、智能存储卡(Smart Media Card,SMC)、安全数字(Secure Digital,SD)卡、闪存卡(Flash Card)等。进一步地,所述存储器11还可以既包括电子设备1的内部存储单元也包括外部存储设备。所述存储器11不仅可以用于存储安装于电子设备1的应用软件及各类数据,例如智能对话程序12的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。
所述处理器10在一些实施例中可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(Central Processing unit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。所述处理器10是所述电子设备的控制核心(Control Unit),利用各种接口和线路连接整个电子设备的各个部件,通过运行或执行存储在所述存储器11内的程序或者模块(例如执行智能对话程序等),以及调用存储在所述存储器11内的数据,以 执行电子设备1的各种功能和处理数据。
所述总线可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。所述总线被设置为实现所述存储器11以及至少一个处理器10等之间的连接通信。
图4仅示出了具有部件的电子设备,本领域技术人员可以理解的是,图4示出的结构并不构成对所述电子设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。
例如,尽管未示出,所述电子设备1还可以包括给各个部件供电的电源(比如电池),优选地,电源可以通过电源管理装置与所述至少一个处理器10逻辑相连,从而通过电源管理装置实现充电管理、放电管理、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、再充电装置、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。所述电子设备1还可以包括多种传感器、蓝牙模块、Wi-Fi模块等,在此不再赘述。
进一步地,所述电子设备1还可以包括网络接口,可选地,所述网络接口可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该电子设备1与其他电子设备之间建立通信连接。
可选地,该电子设备1还可以包括用户接口,用户接口可以是显示器(Display)、输入单元(比如键盘(Keyboard)),可选地,用户接口还可以是标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在电子设备1中处理的信息以及用于显示可视化的用户界面。
应该了解,所述实施例仅为说明之用,在专利申请范围上并不受此结构的限制。
所述电子设备1中的所述存储器11存储的智能对话程序12是多个指令的组合,在所述处理器10中运行时,可以实现:
接收待回复文本,对所述待回复文本执行词性识别,得到信息待抽取文本集;
从所述信息待抽取文本集中抽取得到待优化文本实体集;
优化所述待优化文本实体集,得到文本实体集,利用所述文本实体集生成实体关系;
将所述文本实体集及所述实体关系执行信息融合,得到三元组信息;
利用所述三元组信息生成所述待回复文本的回复文本。
进一步地,所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)。
进一步地,所述计算机可读存储介质可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据区块链节点的使用所创建的数据等。
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质可以是易失性,也可以是非易失性,所述可读存储介质存储有计算机程序,所述计算机程序在被电子设备的处理器所执行时,可以实现:
接收待回复文本,对所述待回复文本执行词性识别,得到信息待抽取文本集;
从所述信息待抽取文本集中抽取得到待优化文本实体集;
优化所述待优化文本实体集,得到文本实体集,利用所述文本实体集生成实体关系;
将所述文本实体集及所述实体关系执行信息融合,得到三元组信息;
利用所述三元组信息生成所述待回复文本的回复文本。
在本申请所提供的几个实施例中,应该理解到,所揭露的设备,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。
因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图表记视为限制所涉及的权利要求。
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。
此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。系统权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第二等词语用来表示名称,而并不表示任何特定的顺序。
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。

Claims (20)

  1. 一种智能对话方法,其中,所述方法包括:
    接收待回复文本,对所述待回复文本执行词性识别,得到信息待抽取文本集;
    从所述信息待抽取文本集中抽取得到待优化文本实体集;
    优化所述待优化文本实体集,得到文本实体集,利用所述文本实体集生成实体关系;
    将所述文本实体集及所述实体关系执行信息融合,得到三元组信息;
    利用所述三元组信息生成所述待回复文本的回复文本。
  2. 如权利要求1所述的智能对话方法,其中,所述从所述信息待抽取文本集中抽取得到待优化文本实体集,包括:
    构建所述信息待抽取文本集内每组词语的实体概率函数;
    求解所述实体概率函数得到实体概率集,利用所述实体概率集,从所述信息待抽取文本集中抽取得到所述待优化文本实体集。
  3. 如权利要求1所述的智能对话方法,其中,所述优化所述待优化文本实体集,得到文本实体集,包括:
    计算所述待优化文本实体集的实体排名值;
    利用所述实体排名值,清洗所述待优化文本实体集,得到所述文本实体集。
  4. 如权利要求1所述的智能对话方法,其中,所述利用所述文本实体集生成实体关系,包括:
    将所述文本实体集及所述待回复文本输入至训练完成的BERT模型中;
    利用所述BERT模型从所述待回复文本中抽取待校对文本实体;
    将所述待校对文本实体与所述文本实体集执行校对,得到校对实体集;
    利用所述BERT模型及校对实体集,抽取得到所述实体关系。
  5. 如权利要求1所述的智能对话方法,其中,所述对所述待回复文本执行词性识别,得到信息待抽取文本集,包括:
    将所述待回复文本执行去噪、去停用词及分词处理,得到词性待识别文本;
    利用预训练完成的词性识别模型,对所述词性待识别文本执行词性识别,得到所述信息待抽取文本集。
  6. 如权利要求5所述的智能对话方法,其中,所述利用预训练完成的词性识别模型,对所述词性待识别文本执行词性识别,得到所述信息待抽取文本集,包括:
    构建及训练词性识别模型,其中所述词性识别模型包括特征转化层及词性识别层;
    利用所述特征转化层将所述词性待识别文本转变为文本特征集,利用所述词性识别层对所述文本特征集执行词性识别,得到所述信息待抽取文本集。
  7. 如权利要求1至6中任意一项所述的智能对话方法,其中,所述构建及训练词性识别模型,包括:
    接收训练文本集与所述训练文本集对应的词性标签集;
    将所述训练文本集执行替换及遮蔽操作,得到半遮蔽文本集;
    构建词性识别模型,利用所述词性识别模型计算所述半遮蔽文本集的词性预测集;
    计算所述词性预测集与所述词性标签集的差异值,当所述差异值大于或等于预设阈值时,调整所述词性识别模型的内部参数,直至所述差异值小于所述预设阈值,得到训练完成的词性识别模型。
  8. 一种智能对话装置,其中,所述装置包括:
    词性识别模块,用于接收待回复文本,对所述待回复文本执行词性识别,得到信息待抽取文本集;
    实体抽取模块,用于从所述信息待抽取文本集中抽取得到待优化文本实体集,优化所 述待优化文本实体集,得到文本实体集,利用所述文本实体集生成实体关系;
    三元组信息构建模块,用于将所述文本实体集及所述实体关系执行信息融合,得到三元组信息;
    文本回复模块,用于利用所述三元组信息生成所述待回复文本的回复文本。
  9. 一种电子设备,其中,所述电子设备包括:
    至少一个处理器;以及,
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如下步骤:
    接收待回复文本,对所述待回复文本执行词性识别,得到信息待抽取文本集;
    从所述信息待抽取文本集中抽取得到待优化文本实体集;
    优化所述待优化文本实体集,得到文本实体集,利用所述文本实体集生成实体关系;
    将所述文本实体集及所述实体关系执行信息融合,得到三元组信息;
    利用所述三元组信息生成所述待回复文本的回复文本。
  10. 如权利要求9所述的电子设备,其中,所述从所述信息待抽取文本集中抽取得到待优化文本实体集,包括:
    构建所述信息待抽取文本集内每组词语的实体概率函数;
    求解所述实体概率函数得到实体概率集,利用所述实体概率集,从所述信息待抽取文本集中抽取得到所述待优化文本实体集。
  11. 如权利要求9所述的电子设备,其中,所述优化所述待优化文本实体集,得到文本实体集,包括:
    计算所述待优化文本实体集的实体排名值;
    利用所述实体排名值,清洗所述待优化文本实体集,得到所述文本实体集。
  12. 如权利要求9所述的电子设备,其中,所述利用所述文本实体集生成实体关系,包括:
    将所述文本实体集及所述待回复文本输入至训练完成的BERT模型中;
    利用所述BERT模型从所述待回复文本中抽取待校对文本实体;
    将所述待校对文本实体与所述文本实体集执行校对,得到校对实体集;
    利用所述BERT模型及校对实体集,抽取得到所述实体关系。
  13. 如权利要求9所述的电子设备,其中,所述对所述待回复文本执行词性识别,得到信息待抽取文本集,包括:
    将所述待回复文本执行去噪、去停用词及分词处理,得到词性待识别文本;
    利用预训练完成的词性识别模型,对所述词性待识别文本执行词性识别,得到所述信息待抽取文本集。
  14. 如权利要求13所述的电子设备,其中,所述利用预训练完成的词性识别模型,对所述词性待识别文本执行词性识别,得到所述信息待抽取文本集,包括:
    构建及训练词性识别模型,其中所述词性识别模型包括特征转化层及词性识别层;
    利用所述特征转化层将所述词性待识别文本转变为文本特征集,利用所述词性识别层对所述文本特征集执行词性识别,得到所述信息待抽取文本集。
  15. 如权利要求9至14中任意一项所述的电子设备,其中,所述构建及训练词性识别模型,包括:
    接收训练文本集与所述训练文本集对应的词性标签集;
    将所述训练文本集执行替换及遮蔽操作,得到半遮蔽文本集;
    构建词性识别模型,利用所述词性识别模型计算所述半遮蔽文本集的词性预测集;
    计算所述词性预测集与所述词性标签集的差异值,当所述差异值大于或等于预设阈值时,调整所述词性识别模型的内部参数,直至所述差异值小于所述预设阈值,得到训练完成的词性识别模型。
  16. 一种计算机可读存储介质,包括存储数据区和存储程序区,其中,所述存储数据区存储创建的数据,所述存储程序区存储有计算机程序;其中,所述计算机程序被处理器执行时实现如下步骤:
    接收待回复文本,对所述待回复文本执行词性识别,得到信息待抽取文本集;
    从所述信息待抽取文本集中抽取得到待优化文本实体集;
    优化所述待优化文本实体集,得到文本实体集,利用所述文本实体集生成实体关系;
    将所述文本实体集及所述实体关系执行信息融合,得到三元组信息;
    利用所述三元组信息生成所述待回复文本的回复文本。
  17. 如权利要求16所述的计算机可读存储介质,其中,所述从所述信息待抽取文本集中抽取得到待优化文本实体集,包括:
    构建所述信息待抽取文本集内每组词语的实体概率函数;
    求解所述实体概率函数得到实体概率集,利用所述实体概率集,从所述信息待抽取文本集中抽取得到所述待优化文本实体集。
  18. 如权利要求16所述的计算机可读存储介质,其中,所述优化所述待优化文本实体集,得到文本实体集,包括:
    计算所述待优化文本实体集的实体排名值;
    利用所述实体排名值,清洗所述待优化文本实体集,得到所述文本实体集。
  19. 如权利要求16所述的计算机可读存储介质,其中,所述利用所述文本实体集生成实体关系,包括:
    将所述文本实体集及所述待回复文本输入至训练完成的BERT模型中;
    利用所述BERT模型从所述待回复文本中抽取待校对文本实体;
    将所述待校对文本实体与所述文本实体集执行校对,得到校对实体集;
    利用所述BERT模型及校对实体集,抽取得到所述实体关系。
  20. 如权利要求16所述的计算机可读存储介质,其中,所述对所述待回复文本执行词性识别,得到信息待抽取文本集,包括:
    将所述待回复文本执行去噪、去停用词及分词处理,得到词性待识别文本;
    利用预训练完成的词性识别模型,对所述词性待识别文本执行词性识别,得到所述信息待抽取文本集。
PCT/CN2021/082869 2020-12-11 2021-03-25 智能对话方法、装置、电子设备及存储介质 WO2022121152A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011442523.3A CN112507728A (zh) 2020-12-11 2020-12-11 智能对话方法、装置、电子设备及存储介质
CN202011442523.3 2020-12-11

Publications (1)

Publication Number Publication Date
WO2022121152A1 true WO2022121152A1 (zh) 2022-06-16

Family

ID=74971005

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/082869 WO2022121152A1 (zh) 2020-12-11 2021-03-25 智能对话方法、装置、电子设备及存储介质

Country Status (2)

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

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112507728A (zh) * 2020-12-11 2021-03-16 平安科技(深圳)有限公司 智能对话方法、装置、电子设备及存储介质
CN113326367B (zh) * 2021-06-30 2023-06-16 四川启睿克科技有限公司 基于端到端文本生成的任务型对话方法和系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180150753A1 (en) * 2016-11-30 2018-05-31 International Business Machines Corporation Analyzing text documents
CN109918494A (zh) * 2019-03-22 2019-06-21 深圳狗尾草智能科技有限公司 基于图的上下文关联回复生成方法、计算机及介质
CN111666393A (zh) * 2020-04-29 2020-09-15 平安科技(深圳)有限公司 智能问答系统的验证方法、装置、计算机设备及存储介质
CN111708874A (zh) * 2020-08-24 2020-09-25 湖南大学 基于复杂意图智能识别的人机交互问答方法与系统
CN111967242A (zh) * 2020-08-17 2020-11-20 支付宝(杭州)信息技术有限公司 一种文本信息的抽取方法、装置及设备
CN112507728A (zh) * 2020-12-11 2021-03-16 平安科技(深圳)有限公司 智能对话方法、装置、电子设备及存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180150753A1 (en) * 2016-11-30 2018-05-31 International Business Machines Corporation Analyzing text documents
CN109918494A (zh) * 2019-03-22 2019-06-21 深圳狗尾草智能科技有限公司 基于图的上下文关联回复生成方法、计算机及介质
CN111666393A (zh) * 2020-04-29 2020-09-15 平安科技(深圳)有限公司 智能问答系统的验证方法、装置、计算机设备及存储介质
CN111967242A (zh) * 2020-08-17 2020-11-20 支付宝(杭州)信息技术有限公司 一种文本信息的抽取方法、装置及设备
CN111708874A (zh) * 2020-08-24 2020-09-25 湖南大学 基于复杂意图智能识别的人机交互问答方法与系统
CN112507728A (zh) * 2020-12-11 2021-03-16 平安科技(深圳)有限公司 智能对话方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN112507728A (zh) 2021-03-16

Similar Documents

Publication Publication Date Title
WO2021068329A1 (zh) 中文命名实体识别方法、装置及计算机可读存储介质
CN112541338A (zh) 相似文本匹配方法、装置、电子设备及计算机存储介质
WO2021042516A1 (zh) 命名实体识别方法、装置及计算机可读存储介质
WO2022116435A1 (zh) 标题生成方法、装置、电子设备及存储介质
WO2022160454A1 (zh) 医疗文献的检索方法、装置、电子设备及存储介质
CN111414561B (zh) 用于呈现信息的方法和装置
WO2022121152A1 (zh) 智能对话方法、装置、电子设备及存储介质
CN113706322B (zh) 基于数据分析的服务分发方法、装置、设备及存储介质
CN113360654B (zh) 文本分类方法、装置、电子设备及可读存储介质
CN113515938B (zh) 语言模型训练方法、装置、设备及计算机可读存储介质
CN112559687B (zh) 问题识别及查询方法、装置、电子设备及存储介质
CN112507230B (zh) 基于浏览器的网页推荐方法、装置、电子设备及存储介质
CN111460797A (zh) 关键字抽取方法、装置、电子设备及可读存储介质
WO2023040742A1 (zh) 文本数据的处理方法、神经网络的训练方法以及相关设备
CN112507663A (zh) 基于文本的判断题生成方法、装置、电子设备及存储介质
CN116701574A (zh) 文本语义相似度计算方法、装置、设备及存储介质
CN116821373A (zh) 基于图谱的prompt推荐方法、装置、设备及介质
CN113850643B (zh) 产品推荐方法、装置、电子设备及可读存储介质
CN114420168A (zh) 情绪识别方法、装置、设备及存储介质
CN112069824B (zh) 基于上下文概率和引证的地域识别方法、装置及介质
CN112668281B (zh) 基于模板的语料自动化扩充方法、装置、设备及介质
CN112015866A (zh) 用于生成同义文本的方法、装置、电子设备及存储介质
CN116757193A (zh) 基于对比学习的多轮对话生成方法、装置、设备及介质
CN116720525A (zh) 基于问诊数据的疾病辅助分析方法、装置、设备及介质
US20140372106A1 (en) Assisted Free Form Decision Definition Using Rules Vocabulary

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21901869

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21901869

Country of ref document: EP

Kind code of ref document: A1