WO2020224099A1 - 智能化情感问答方法、装置及计算机可读存储介质 - Google Patents

智能化情感问答方法、装置及计算机可读存储介质 Download PDF

Info

Publication number
WO2020224099A1
WO2020224099A1 PCT/CN2019/102194 CN2019102194W WO2020224099A1 WO 2020224099 A1 WO2020224099 A1 WO 2020224099A1 CN 2019102194 W CN2019102194 W CN 2019102194W WO 2020224099 A1 WO2020224099 A1 WO 2020224099A1
Authority
WO
WIPO (PCT)
Prior art keywords
question
answer
data set
neural network
word
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2019/102194
Other languages
English (en)
French (fr)
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
Publication of WO2020224099A1 publication Critical patent/WO2020224099A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/951Indexing; Web crawling techniques
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • This application relates to the field of artificial intelligence technology, and in particular to an intelligent emotional question-and-answer method, device and computer-readable storage medium for intelligently giving answers to the questions after receiving user questions.
  • This application provides an intelligent emotional question and answer method, device, and computer-readable storage medium, the main purpose of which is to present the user with an emotionally inclined answer when the user inputs a question.
  • an intelligent emotional question-and-answer method includes:
  • a question data set and multiple answer data sets corresponding to the question data set are obtained from the Internet through web crawler technology, the question data set and the multiple answer data sets are formed into a question and answer data set, and the question and answer data sets are Perform emotional attribute labeling on the data set to obtain an emotional attribute label set corresponding to the question and answer data set;
  • Input the emotional attribute annotation set into the loss function input the problem word vector set into the convolutional neural network model, use the convolutional neural network model to train to obtain training values, and input the training values into Loss function, using the loss function to calculate a loss value based on the emotional attribute label set and the training value, and judging the relationship between the loss value and a preset threshold, until the loss value is less than the preset threshold,
  • the convolutional neural network exits training;
  • the convolutional neural network When the convolutional neural network exits training, the convolutional neural network inputs the question word vector set to the recurrent neural network, and at the same time prompts the recurrent neural network to accept the answer word vector set for training until the When the recurrent neural network meets the preset threshold requirements, it exits training;
  • Receive user questions perform the preprocessing operation and the word vectorization operation on the user questions, and then input them to the convolutional neural network to determine the emotional attribute category, and the recurrent neural network outputs the information according to the emotional attribute category State the answer to the user’s question.
  • the present application also provides an intelligent emotional question and answer device, which includes a memory and a processor, and the memory stores an intelligent emotional question and answer program that can run on the processor.
  • the intelligent emotional question and answer program is executed by the processor, the following steps are implemented:
  • a question data set and multiple answer data sets corresponding to the question data set are obtained from the Internet through web crawler technology, the question data set and the multiple answer data sets are formed into a question and answer data set, and the question and answer data sets are Perform emotional attribute labeling on the data set to obtain an emotional attribute label set corresponding to the question and answer data set;
  • Input the emotional attribute annotation set into the loss function input the problem word vector set into the convolutional neural network model, use the convolutional neural network model to train to obtain training values, and input the training values into Loss function, using the loss function to calculate a loss value based on the emotional attribute label set and the training value, and judging the relationship between the loss value and a preset threshold, until the loss value is less than the preset threshold,
  • the convolutional neural network exits training;
  • the convolutional neural network When the convolutional neural network exits training, the convolutional neural network inputs the question word vector set to the recurrent neural network, and at the same time prompts the recurrent neural network to accept the answer word vector set for training until the When the recurrent neural network meets the preset threshold requirements, it exits training;
  • Receive user questions perform the preprocessing operation and the word vectorization operation on the user questions, and then input them to the convolutional neural network to determine the emotional attribute category, and the recurrent neural network outputs the information according to the emotional attribute category State the answer to the user’s question.
  • the present application also provides a computer-readable storage medium that stores an intelligent emotional question-and-answer program, and the intelligent emotional question-and-answer program can be used by one or more The processor executes to realize the steps of the intelligent emotional question answering method described above.
  • the multi-layer network structure of the convolutional neural network can automatically extract the deep features of the data, it can learn features at different levels, thereby greatly improving the accuracy of text processing.
  • the cyclic neural network will contact the data before and after the timing state to make efficient judgments. Therefore, the intelligent emotional question answering method, device and computer-readable storage medium proposed in this application can realize accurate and intelligent emotional question answering functions.
  • FIG. 1 is a schematic flowchart of an intelligent emotional question answering method provided by an embodiment of this application
  • FIG. 2 is a schematic diagram of the internal structure of an intelligent emotional question and answer device provided by an embodiment of the application
  • FIG. 3 is a schematic diagram of modules of an intelligent emotion question answering program in an intelligent emotion question answering device provided by an embodiment of the application.
  • FIG. 1 it is a schematic flowchart of an intelligent emotional question answering method provided by an embodiment of this application.
  • the method may be executed by an apparatus, and the apparatus may be realized by software and/or hardware.
  • the intelligent emotional question answering method includes:
  • questions asked in text form are crawled from URL pages, and the questions asked in text form are formed into a question data set.
  • Traverse the questions in the question data set use the web crawler technology to crawl multiple different answers corresponding to the question from the URL page, until the traversal of the question data set ends, and obtain the question data set Corresponding multiple answer data sets;
  • the answers in the various answer data sets are labeled with emotional attributes according to emotional tendencies to obtain the emotional property annotation set, and the emotional tendencies include humor, sincerity, Suggestions etc.
  • the question and answer data set is subjected to preprocessing operations including word segmentation and keyword extraction, and word vectorization is performed on the question and answer data set completed by the preprocessing operation according to the Word2Vec algorithm to obtain a question and answer word vector set.
  • the vector set includes question word vector set and answer word vector set.
  • the word segmentation establishes a word segmentation probability model P(S) according to the question and answer data set, and maximizes the word segmentation probability model to complete the word segmentation operation, the word segmentation probability model P(S) for:
  • W 1 , W 2 ,..., W m are the words of the data in the question and answer data set, and m is the number of the question and answer data set;
  • the keyword extraction includes constructing the relevance of the word and extracting keywords based on the relevance, and the relevance is:
  • f (W i, W j ) is the correlation word W i and the words W j is, tfidf (W i) is the term frequency and inverse frequency value of the word W i is, tfidf (W j) is the term frequency words W j and inverse frequency value, d is the words W i and W j Euclidean distance word on the word vectors;
  • the Word2Vec algorithm in the preferred embodiment of the present application is a CBOW model.
  • the CBOW model includes an input layer, a projection layer, and an output layer.
  • the projection layer ⁇ ( ⁇ ,j) is:
  • the convolutional neural network includes a convolutional layer, a pooling layer, a Flatten layer, a Dropout layer, and a fully connected layer
  • the problem word vector set is in the form of a one-dimensional vector in the time dimension Therefore, the filters of the convolutional layer and the pooling layer are also one-dimensional vectors.
  • the Dropout layer is added to the convolutional layer and the pooling layer. ;
  • x is the training value
  • ⁇ j is the emotional attribute annotation set
  • m is the number of the question and answer data set
  • the preset threshold is generally set to 0.01.
  • the convolutional neural network After the convolutional neural network exits training, the convolutional neural network inputs the question word vector set to the recurrent neural network, and prompts the recurrent neural network to accept the answer word vector set for training until When the recurrent neural network meets the requirements of the preset threshold, the training is exited.
  • the recurrent neural network is a long and short-term memory network
  • the long and short-term memory network includes forgetting gates, input gates, and output gates, and the forgetting gates are:
  • f t is the output data of the forgetting gate
  • x t is the input data of the forgetting gate
  • t is the current time of the question and answer word vector set
  • t-1 is before the current time of the question and answer word vector set
  • h t-1 is the output data of the output gate at a time before the current time of the question and answer word vector set
  • w t is the weight of the current time
  • b t is the offset of the current time
  • [] is a matrix multiplication operation
  • represents the sigmoid function.
  • a user question is received, and after the preprocessing operation and the word vectorization operation are performed on the user question, it is input to the convolutional neural network to determine the emotional attribute category, and the recurrent neural network is based on the emotional attribute category The answer to the user question is output.
  • the invention also provides an intelligent emotional question answering device.
  • FIG. 2 it is a schematic diagram of the internal structure of an intelligent emotional question answering device provided by an embodiment of this application.
  • the intelligent emotional question and answer device 1 may be a PC (Personal Computer, personal computer), or a terminal device such as a smart phone, a tablet computer, or a portable computer, or a server.
  • the intelligent emotional question answering device 1 at least includes a memory 11, a processor 12, a communication bus 13, and a network interface 14.
  • the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc.
  • the memory 11 may be an internal storage unit of the intelligent emotional question answering device 1, for example, the hard disk of the intelligent emotional question answering device 1.
  • the memory 11 may also be an external storage device of the intelligent emotional question and answer device 1, such as a plug-in hard disk or a smart memory card (Smart Media Card, SMC) equipped on the intelligent emotional question and answer device 1. Secure Digital (SD) card, flash card (Flash Card), etc.
  • SD Secure Digital
  • flash card Flash Card
  • the memory 11 may also include both the internal storage unit of the intelligent emotional question and answer apparatus 1 and an external storage device.
  • the memory 11 can be used not only to store application software and various data installed in the intelligent emotional question and answer device 1, such as the code of the intelligent emotional question and answer program 01, etc., but also to temporarily store data that has been output or will be output. .
  • the processor 12 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip, and is used to run the program code or processing stored in the memory 11 Data, such as the implementation of intelligent emotional question and answer program 01, etc.
  • CPU central processing unit
  • controller microcontroller
  • microprocessor or other data processing chip
  • the communication bus 13 is used to realize the connection and communication between these components.
  • the network interface 14 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface), and is usually used to establish a communication connection between the device 1 and other electronic devices.
  • the device 1 may also include a user interface.
  • the user interface may include a display (Display) and an input unit such as a keyboard (Keyboard).
  • the optional user interface may also include a standard wired interface and 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, etc.
  • the display can also be appropriately called a display screen or a display unit, which is used to display the information processed in the intelligent emotional question and answer device 1 and to display a visualized user interface.
  • Figure 2 only shows the intelligent emotional question answering device 1 with components 11-14 and the intelligent emotional question answering program 01. Those skilled in the art can understand that the structure shown in Figure 1 does not constitute an intelligent
  • the emotional question answering device 1 may include fewer or more components than shown, or a combination of certain components, or different component arrangements.
  • the memory 11 stores an intelligent emotional question and answer program 01; when the processor 12 executes the intelligent emotional question and answer program 01 stored in the memory 11, the following steps are implemented:
  • Step 1 Obtain a question data set and multiple answer data sets corresponding to the question data set from the Internet through the web crawler technology, compose the question data set and the multiple answer data sets into a question and answer data set, and compare The emotional attribute labeling is performed on the question answering data set, and an emotional attribute labeling set corresponding to the question answering data set is obtained.
  • questions asked in text form are crawled from URL pages, and the questions asked in text form are formed into a question data set.
  • Traverse the questions in the question data set use the web crawler technology to crawl multiple different answers corresponding to the question from the URL page, until the traversal of the question data set ends, and obtain the question data set Corresponding multiple answer data sets;
  • the answers in the various answer data sets are labeled with emotional attributes according to emotional tendencies to obtain the emotional property annotation set, and the emotional tendencies include humor, sincerity, Suggestions etc.
  • Step 2 Perform preprocessing operations including word segmentation and keyword extraction on the Q&A data set, and perform word vectorization operations on the Q&A data set completed by the preprocessing operation according to the Word2Vec algorithm to obtain a Q&A word vector set.
  • the question and answer word vector set includes a question word vector set and an answer word vector set.
  • the word segmentation establishes a word segmentation probability model P(S) according to the question and answer data set, and maximizes the word segmentation probability model to complete the word segmentation operation, the word segmentation probability model P(S) for:
  • W 1 , W 2 ,..., W m are the words of the data in the question and answer data set, and m is the number of the question and answer data set;
  • the keyword extraction includes constructing the relevance of the word and extracting keywords based on the relevance, and the relevance is:
  • f (W i, W j ) is the correlation word W i and the words W j is, tfidf (W i) is the term frequency and inverse frequency value of the word W i is, tfidf (W j) is the term frequency words W j and inverse frequency value, d is the words W i and W j Euclidean distance word on the word vectors;
  • the Word2Vec algorithm in the preferred embodiment of the present application is a CBOW model
  • the CBOW model includes an input layer, a projection layer, and an output layer
  • the projection layer ⁇ ( ⁇ ,j) is:
  • Step 3 Input the emotional attribute annotation set into the loss function, input the problem word vector set into the convolutional neural network model, use the convolutional neural network model to train to obtain training values, and use the training
  • the value is input to the loss function, the loss value is calculated by using the loss function and according to the emotional attribute label set and the training value, and the relationship between the loss value and a preset threshold is judged until the loss value is less than the preset When the threshold is reached, the convolutional neural network exits training.
  • the convolutional neural network includes a convolutional layer, a pooling layer, a Flatten layer, a Dropout layer, and a fully connected layer
  • the problem word vector set is in the form of a one-dimensional vector in the time dimension Therefore, the filters of the convolutional layer and the pooling layer are also one-dimensional vectors.
  • the Dropout layer is added to the convolutional layer and the pooling layer. ;
  • x is the training value
  • ⁇ j is the emotional attribute annotation set
  • m is the number of the question and answer data set
  • the preset threshold is generally set to 0.01.
  • Step 4 After the convolutional neural network exits training, the convolutional neural network inputs the question word vector set to the recurrent neural network, and at the same time prompts the recurrent neural network to accept the answer word vector set for training, Until the recurrent neural network meets the preset threshold requirement, the training is exited.
  • the recurrent neural network is a long and short-term memory network
  • the long and short-term memory network includes forgetting gates, input gates, and output gates, and the forgetting gates are:
  • f t is the output data of the forgetting gate
  • x t is the input data of the forgetting gate
  • t is the current time of the question and answer word vector set
  • t-1 is before the current time of the question and answer word vector set
  • h t-1 is the output data of the output gate at a time before the current time of the question and answer word vector set
  • w t is the weight of the current time
  • b t is the offset of the current time
  • [] is a matrix multiplication operation
  • represents the sigmoid function.
  • Step 5 Receive user questions, perform the preprocessing operation and the word vectorization operation on the user questions, and then input them to the convolutional neural network to determine the emotion attribute category, and the recurrent neural network will determine the emotion attribute category according to the emotion attribute The category outputs the answer to the user's question.
  • the intelligent emotional question-and-answer program can also be divided into one or more modules, and the one or more modules are stored in the memory 11 and run by one or more processors (this embodiment For example, it is executed by the processor 12) to complete this application.
  • the module referred to in this application refers to a series of computer program instruction segments that can complete specific functions, which are used to describe the intelligent emotional question and answer program in the intelligent emotional question and answer device The implementation process.
  • FIG. 3 is a schematic diagram of the program modules of the intelligent emotional question and answer program in an embodiment of the intelligent emotional question and answer device of this application
  • the intelligent emotional question and answer program can be divided into The data receiving module 10, the data processing module 20, the model training module 30, and the question and answer result output module 40 are exemplary:
  • the data receiving module 10 is configured to: obtain a question data set and multiple answer data sets corresponding to the question data set from the Internet, and combine the question data set and the multiple answer data sets to form a question and answer data set, The emotion attribute labeling is performed on the question answering data set to obtain an emotion attribute labeling set corresponding to the question answering data set.
  • the data processing module 20 is configured to perform preprocessing operations including word segmentation and keyword extraction on the question and answer data set, and perform word vectorization operations on the question and answer data set completed by the preprocessing operation according to the Word2Vec algorithm to obtain a question and answer A word vector set, the question and answer word vector set includes a question word vector set and an answer word vector set.
  • the model training module 30 is configured to: input the emotional attribute annotation set into a loss function, input the problem word vector set into a convolutional neural network model for training, and the convolutional neural network model is trained to obtain training values , And input the training value to a loss function, the loss function is calculated according to the sentiment attribute label set and the training value to obtain a loss value, to determine the magnitude relationship between the loss value and a preset threshold, until the loss When the value is less than the preset threshold, the convolutional neural network exits training.
  • the convolutional neural network When the convolutional neural network exits training, the convolutional neural network inputs the problem word vector set to the recurrent neural network and prompts the The recurrent neural network receives the answer word vector set for training, and exits the training when the recurrent neural network meets the preset threshold requirement.
  • the question and answer result output module 40 is configured to: receive user questions, perform the preprocessing operation and the word vectorization operation on the user questions, and then input them into the convolutional neural network to determine the emotional attribute category, and the loop The neural network outputs the answer to the user's question according to the emotional attribute category.
  • the embodiment of the present application also proposes a computer-readable storage medium, the computer-readable storage medium stores an intelligent emotional question and answer program, the intelligent emotional question and answer program can be executed by one or more processors To achieve the following operations:
  • the sentiment attribute annotation set is input into the loss function
  • the problem word vector set is input into the convolutional neural network model for training
  • the convolutional neural network model is trained to obtain training values
  • the training values are input into Loss function
  • the loss function is calculated according to the sentiment attribute label set and the training value to obtain a loss value
  • the size relationship between the loss value and a preset threshold is judged, until the loss value is less than the preset threshold
  • the convolutional neural network inputs the question word vector set to the recurrent neural network, and at the same time prompts the recurrent neural network to accept the answer word vector Set training until the recurrent neural network meets the preset threshold requirements, then exit the training.
  • Receive user questions perform the preprocessing operation and the word vectorization operation on the user questions, and then input them to the convolutional neural network to determine the emotional attribute category, and the recurrent neural network outputs the information according to the emotional attribute category State the answer to the user’s question.

Landscapes

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

Abstract

一种智能化情感问答方法、装置及计算机可读存储介质,其中智能化情感问答方法包括:接收问答数据集,并对所述问答数据集进行情感属性标注得到情感属性标注集(S1);对所述问答数据集进行预处理和词向量化得到问答词向量集(S2);将所述情感属性标注集和所述问答词向量集先输入至卷积神经网络模型中训练(S3);所述卷积神经网络退出训练并将所述问答词向量集输入至循环神经网络,直至所述循环神经网络满足预设阈值要求时退出训练(S4);接收用户问题并输入至所述卷积神经网络判断情感属性,基于所述循环神经网络输出所述用户问题的答案(S5)。从而可以实现精准的智能化的情感问答功能。

Description

智能化情感问答方法、装置及计算机可读存储介质
本申请基于巴黎公约申明享有2019年5月9日递交的申请号为CN201910386282.6、名称为“智能化情感问答方法、装置及计算机可读存储介质”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。
技术领域
本申请涉及人工智能技术领域,尤其涉及一种接收用户问题后智能化的给予所述问题答案的智能化情感问答方法、装置及计算机可读存储介质。
背景技术
目前大部分问答系统的研究重点都关注在生成语句的语法和语义是否合理上,且所述问答系统的答案生成方式大都基于上下文或结合主题,很少考虑到对话者的情感,如用户输入:昨天的考试我没有及格,多数问答系统给予的回复一般如:竟然不是倒数,好神奇;用户输入:我养的狗今天去世了。回复:宠物狗特别容易死。但在现实生活中,如果对方通过语言表达出开心的情绪,通常情况下,对方的回复也应该是积极的情绪。如果对方通过语言表达出悲伤的情绪,往往另一方回应的内容也应是安慰等。因此,问答系统带有情感的回复往往更能受到用户的欢迎。
发明内容
本申请提供一种智能化情感问答方法、装置及计算机可读存储介质,其主要目的在于当用户输入问题时,给用户呈现出具有情感倾向的答案结果。
为实现上述目的,本申请提供的一种智能化情感问答方法,包括:
通过网络爬虫技术从互联网中获取问题数据集和与所述问题数据集对应的多种答案数据集,将所述问题数据集与所述多种答案数据集组成问答数据集,并对所述问答数据集进行情感属性标注,得到与所述问答数据集对应的情感属性标注集;
对所述问答数据集进行包括分词和关键字抽取的预处理操作,并根据 Word2Vec算法对所述预处理操作完成的问答数据集进行词向量化操作,得到问答词向量集,所述问答词向量集包括问题词向量集和答案词向量集;
将所述情感属性标注集输入至损失函数中,将所述问题词向量集输入至卷积神经网络模型中,利用所述卷积神经网络模型训练得到训练值,并将所述训练值输入至损失函数,利用所述损失函数并根据所述情感属性标注集与所述训练值计算得到损失值,判断所述损失值与预设阈值的大小关系,直至所述损失值小于预设阈值时,所述卷积神经网络退出训练;
当所述卷积神经网络退出训练后,所述卷积神经网络将所述问题词向量集输入至循环神经网络,同时提示所述循环神经网络接受所述答案词向量集进行训练,直至所述循环神经网络满足预设阈值要求时,退出训练;
接收用户问题,对所述用户问题进行所述预处理操作和所述词向量化操作后,输入至所述卷积神经网络判断情感属性类别,所述循环神经网络根据所述情感属性类别输出所述用户问题的答案。
此外,为实现上述目的,本申请还提供一种智能化的情感问答装置,该装置包括存储器和处理器,所述存储器中存储有可在所述处理器上运行的智能化的情感问答程序,所述智能化的情感问答程序被所述处理器执行时实现如下步骤:
通过网络爬虫技术从互联网中获取问题数据集和与所述问题数据集对应的多种答案数据集,将所述问题数据集与所述多种答案数据集组成问答数据集,并对所述问答数据集进行情感属性标注,得到与所述问答数据集对应的情感属性标注集;
对所述问答数据集进行包括分词和关键字抽取的预处理操作,并根据Word2Vec算法对所述预处理操作完成的问答数据集进行词向量化操作,得到问答词向量集,所述问答词向量集包括问题词向量集和答案词向量集;
将所述情感属性标注集输入至损失函数中,将所述问题词向量集输入至卷积神经网络模型中,利用所述卷积神经网络模型训练得到训练值,并将所述训练值输入至损失函数,利用所述损失函数并根据所述情感属性标注集与所述训练值计算得到损失值,判断所述损失值与预设阈值的大小关系,直至所述损失值小于预设阈值时,所述卷积神经网络退出训练;
当所述卷积神经网络退出训练后,所述卷积神经网络将所述问题词向量集输入至循环神经网络,同时提示所述循环神经网络接受所述答案词向量集进行训练,直至所述循环神经网络满足预设阈值要求时,退出训练;
接收用户问题,对所述用户问题进行所述预处理操作和所述词向量化操作后,输入至所述卷积神经网络判断情感属性类别,所述循环神经网络根据所述情感属性类别输出所述用户问题的答案。
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有智能化的情感问答程序,所述智能化的情感问答程序可被一个或者多个处理器执行,以实现如上所述的智能化情感问答方法的步骤。
由于卷积神经网络的多层网络结构能自动提取数据的深层特征,可学习不同层次的特征,从而大大提高对文本处理的准确率,同时循环神经网络会联系数据的前后时序状态进行高效判断,因此本申请提出的智能化情感问答方法、装置及计算机可读存储介质,可以实现精准的智能化的情感问答功能。
附图说明
图1为本申请一实施例提供的智能化情感问答方法的流程示意图;
图2为本申请一实施例提供的智能化的情感问答装置的内部结构示意图;
图3为本申请一实施例提供的智能化的情感问答装置中智能化的情感问答程序的模块示意图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请提供一种智能化情感问答方法。参照图1所示,为本申请一实施例提供的智能化情感问答方法的流程示意图。该方法可以由一个装置执行, 该装置可以由软件和/或硬件实现。
在本实施例中,智能化情感问答方法包括:
S1、通过网络爬虫技术从互联网中获取问题数据集和与所述问题数据集对应的多种答案数据集,将所述问题数据集与所述多种答案数据集组成问答数据集,并对所述问答数据集进行情感属性标注,得到与所述问答数据集对应的情感属性标注集。
本申请较佳实施例,根据所述网络爬虫(Web crawler)技术从URL页面内爬取以文本形式提问的问题,将所述以文本形式提问的问题组成问题数据集。遍历所述问题数据集内的问题,使用所述网络爬虫技术从URL页面内爬取与所述问题对应的多种不同的答案,直至所述问题数据集遍历结束,得到与所述问题数据集对应的多种答案数据集;
本申请较佳实施例中,根据所述问题数据集,将所述多种答案数据集中的答案按照情感倾向进行情感属性标注,得到所述情感属性标注集,所述情感倾向包括幽默、诚恳、建议等。
S2、所述问答数据集进行包括分词和关键字抽取的预处理操作,并根据Word2Vec算法对所述预处理操作完成的问答数据集进行词向量化操作,得到问答词向量集,所述问答词向量集包括问题词向量集和答案词向量集。
本申请较佳实施例中,所述分词根据所述所述问答数据集建立分词概率模型P(S),并最大化所述分词概率模型,完成分词操作,所述分词概率模型P(S)为:
Figure PCTCN2019102194-appb-000001
其中,W 1,W 2,…,W m为所述问答数据集内数据的词,m为所述问答数据集的数量;
所述关键字抽取包括构建所述词的相关度并基于所述相关度提取关键字,所述相关度为:
Figure PCTCN2019102194-appb-000002
其中,f(W i,W j)为词W i和词W j的相关度,tfidf(W i)为词W i的词频与逆向频率值,tfidf(W j)为词W j的词频与逆向频率值,d为词W i和词W j关于词向量的欧式距离;
本申请较佳实施例所述Word2Vec算法为CBOW模型,所述CBOW模型 包括输入层、投影层和输出层,所述投影层ζ(ω,j)为:
Figure PCTCN2019102194-appb-000003
其中,
Figure PCTCN2019102194-appb-000004
表示在路径ω内,第j个结点对应的霍夫曼编码,θ为所述CBOW模型的迭代因子,σ表示sigmoid函数,X ω为所述预处理操作完成的问答数据集。
S3、将所述情感属性标注集输入至损失函数中,将所述问题词向量集输入至卷积神经网络模型中,利用所述卷积神经网络模型训练得到训练值,并将所述训练值输入至损失函数,利用所述损失函数并根据所述情感属性标注集与所述训练值计算得到损失值,判断所述损失值与预设阈值的大小关系,直至所述损失值小于预设阈值时,所述卷积神经网络退出训练。
本申请较佳实施例中,所述卷积神经网络包括卷积层、池化层、Flatten层、Dropout层和全连接层,且所述问题词向量集在时间维度上是一维向量的形式,所以所述卷积层与所述池化层的过滤器(filter)也是一维向量,同时为了防止过拟合现象,在所述卷积层与所述池化层中加入所述Dropout层;当多次卷积与池化操作后再扁平化数据,即所述Flatten层的作用,最后通过所述全连接层(Dense)输出所述训练值.
本申请较佳实施例所述损失值E为:
Figure PCTCN2019102194-appb-000005
其中,x为所述训练值,μ j为所述情感属性标注集,m为所述问答数据集的数量,所述预设阈值一般设定为0.01。
S4、当所述卷积神经网络退出训练后,所述卷积神经网络将所述问题词向量集输入至循环神经网络,同时提示所述循环神经网络接受所述答案词向量集进行训练,直至所述循环神经网络满足预设阈值要求时,退出训练。
本申请较佳实施例,所述循环神经网络为长短期记忆网络,所述长短期记忆网络包括遗忘门、输入门、输出门,所述遗忘门为:
f t=σ(w t[h t-1,x t]+b t)
其中,f t为所述遗忘门的输出数据,x t为所述遗忘门的输入数据,t为所述问答词向量集的当前时间,t-1为所述问答词向量集当前时间的前一个时间,h t-1为所述输出门在所述问答词向量集当前时间的前一个时间的输出数据,w t为所述当前时间的权重,b t为所述当前时间的偏置,[]为矩阵乘法操作, σ表示所述sigmoid函数。
S5、接收用户问题,对所述用户问题进行所述预处理操作和所述词向量化操作后,输入至所述卷积神经网络判断情感属性类别,所述循环神经网络根据所述情感属性类别输出所述用户问题的答案。
发明还提供一种智能化的情感问答装置。参照图2所示,为本申请一实施例提供的智能化的情感问答装置的内部结构示意图。
在本实施例中,所述智能化的情感问答装置1可以是PC(Personal Computer,个人电脑),或者是智能手机、平板电脑、便携计算机等终端设备,也可以是一种服务器等。该智能化的情感问答装置1至少包括存储器11、处理器12,通信总线13,以及网络接口14。
其中,存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器11在一些实施例中可以是智能化的情感问答装置1的内部存储单元,例如该智能化的情感问答装置1的硬盘。存储器11在另一些实施例中也可以是智能化的情感问答装置1的外部存储设备,例如智能化的情感问答装置1上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器11还可以既包括智能化的情感问答装置1的内部存储单元也包括外部存储设备。存储器11不仅可以用于存储安装于智能化的情感问答装置1的应用软件及各类数据,例如智能化的情感问答程序01的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。
处理器12在一些实施例中可以是一中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器11中存储的程序代码或处理数据,例如执行智能化的情感问答程序01等。
通信总线13用于实现这些组件之间的连接通信。
网络接口14可选的可以包括标准的有线接口、无线接口(如WI-FI接口),通常用于在该装置1与其他电子设备之间建立通信连接。
可选地,该装置1还可以包括用户接口,用户接口可以包括显示器(Display)、输入单元比如键盘(Keyboard),可选的用户接口还可以包括 标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在智能化的情感问答装置1中处理的信息以及用于显示可视化的用户界面。
图2仅示出了具有组件11-14以及智能化的情感问答程序01的智能化的情感问答装置1,本领域技术人员可以理解的是,图1示出的结构并不构成对智能化的情感问答装置1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。
在图2所示的装置1实施例中,存储器11中存储有智能化的情感问答程序01;处理器12执行存储器11中存储的智能化的情感问答程序01时实现如下步骤:
步骤一、通过网络爬虫技术从互联网中获取问题数据集和与所述问题数据集对应的多种答案数据集,将所述问题数据集与所述多种答案数据集组成问答数据集,并对所述问答数据集进行情感属性标注,得到与所述问答数据集对应的情感属性标注集。
本申请较佳实施例,根据所述网络爬虫(Web crawler)技术从URL页面内爬取以文本形式提问的问题,将所述以文本形式提问的问题组成问题数据集。遍历所述问题数据集内的问题,使用所述网络爬虫技术从URL页面内爬取与所述问题对应的多种不同的答案,直至所述问题数据集遍历结束,得到与所述问题数据集对应的多种答案数据集;
本申请较佳实施例中,根据所述问题数据集,将所述多种答案数据集中的答案按照情感倾向进行情感属性标注,得到所述情感属性标注集,所述情感倾向包括幽默、诚恳、建议等。
步骤二、对所述问答数据集进行包括分词和关键字抽取的预处理操作,并根据Word2Vec算法对所述预处理操作完成的问答数据集进行词向量化操作,得到问答词向量集,所述问答词向量集包括问题词向量集和答案词向量集。
本申请较佳实施例中,所述分词根据所述所述问答数据集建立分词概率模型P(S),并最大化所述分词概率模型,完成分词操作,所述分词概率模型P(S) 为:
Figure PCTCN2019102194-appb-000006
其中,W 1,W 2,…,W m为所述问答数据集内数据的词,m为所述问答数据集的数量;
所述关键字抽取包括构建所述词的相关度并基于所述相关度提取关键字,所述相关度为:
Figure PCTCN2019102194-appb-000007
其中,f(W i,W j)为词W i和词W j的相关度,tfidf(W i)为词W i的词频与逆向频率值,tfidf(W j)为词W j的词频与逆向频率值,d为词W i和词W j关于词向量的欧式距离;
本申请较佳实施例所述Word2Vec算法为CBOW模型,所述CBOW模型包括输入层、投影层和输出层,所述投影层ζ(ω,j)为:
Figure PCTCN2019102194-appb-000008
其中,
Figure PCTCN2019102194-appb-000009
表示在路径ω内,第j个结点对应的霍夫曼编码,θ为所述CBOW模型的迭代因子,σ表示sigmoid函数,X ω为所述预处理操作完成的问答数据集。
步骤三、将所述情感属性标注集输入至损失函数中,将所述问题词向量集输入至卷积神经网络模型中,利用所述卷积神经网络模型训练得到训练值,并将所述训练值输入至损失函数,利用所述损失函数并根据所述情感属性标注集与所述训练值计算得到损失值,判断所述损失值与预设阈值的大小关系,直至所述损失值小于预设阈值时,所述卷积神经网络退出训练。
本申请较佳实施例中,所述卷积神经网络包括卷积层、池化层、Flatten层、Dropout层和全连接层,且所述问题词向量集在时间维度上是一维向量的形式,所以所述卷积层与所述池化层的过滤器(filter)也是一维向量,同时为了防止过拟合现象,在所述卷积层与所述池化层中加入所述Dropout层;当多次卷积与池化操作后再扁平化数据,即所述Flatten层的作用,最后通过所述全连接层(Dense)输出所述训练值.
本申请较佳实施例所述损失值E为:
Figure PCTCN2019102194-appb-000010
其中,x为所述训练值,μ j为所述情感属性标注集,m为所述问答数据集的数量,所述预设阈值一般设定为0.01。
步骤四、当所述卷积神经网络退出训练后,所述卷积神经网络将所述问题词向量集输入至循环神经网络,同时提示所述循环神经网络接受所述答案词向量集进行训练,直至所述循环神经网络满足预设阈值要求时,退出训练。
本申请较佳实施例,所述循环神经网络为长短期记忆网络,所述长短期记忆网络包括遗忘门、输入门、输出门,所述遗忘门为:
f t=σ(w t[h t-1,x t]+b t)
其中,f t为所述遗忘门的输出数据,x t为所述遗忘门的输入数据,t为所述问答词向量集的当前时间,t-1为所述问答词向量集当前时间的前一个时间,h t-1为所述输出门在所述问答词向量集当前时间的前一个时间的输出数据,w t为所述当前时间的权重,b t为所述当前时间的偏置,[]为矩阵乘法操作,σ表示所述sigmoid函数。
步骤五、接收用户问题,对所述用户问题进行所述预处理操作和所述词向量化操作后,输入至所述卷积神经网络判断情感属性类别,所述循环神经网络根据所述情感属性类别输出所述用户问题的答案。
可选地,在其他实施例中,智能化的情感问答程序还可以被分割为一个或者多个模块,一个或者多个模块被存储于存储器11中,并由一个或多个处理器(本实施例为处理器12)所执行以完成本申请,本申请所称的模块是指能够完成特定功能的一系列计算机程序指令段,用于描述智能化的情感问答程序在智能化的情感问答装置中的执行过程。
例如,参照图3所示,为本申请智能化的情感问答装置一实施例中的智能化的情感问答程序的程序模块示意图,该实施例中,所述智能化的情感问答程序可以被分割为数据接收模块10、数据处理模块20、模型训练模块30、问答结果输出模块40示例性地:
所述数据接收模块10用于:从互联网中获取问题数据集和与所述问题数据集对应的多种答案数据集,将所述问题数据集与所述多种答案数据集组成问答数据集,并对所述问答数据集进行情感属性标注,得到与所述问答数据集对应的情感属性标注集。
所述数据处理模块20用于:对所述问答数据集进行包括分词和关键字抽 取的预处理操作,并根据Word2Vec算法对所述预处理操作完成的问答数据集进行词向量化操作,得到问答词向量集,所述问答词向量集包括问题词向量集和答案词向量集。
所述模型训练模块30用于:将所述情感属性标注集输入至损失函数中,将所述问题词向量集输入至卷积神经网络模型中训练,所述卷积神经网络模型训练得到训练值,并将所述训练值输入至损失函数,所述损失函数根据所述情感属性标注集与所述训练值计算得到损失值,判断所述损失值与预设阈值的大小关系,直至所述损失值小于预设阈值时,所述卷积神经网络退出训练,当所述卷积神经网络退出训练后,所述卷积神经网络将所述问题词向量集输入至循环神经网络,同时提示所述循环神经网络接受所述答案词向量集进行训练,直至所述循环神经网络满足预设阈值要求时,退出训练。
所述问答结果输出模块40用于:接收用户问题,对所述用户问题进行所述预处理操作和所述词向量化操作后,输入至所述卷积神经网络判断情感属性类别,所述循环神经网络根据所述情感属性类别输出所述用户问题的答案。
上述数据接收模块10、数据处理模块20、模型训练模块30、问答结果输出模块40等程序模块被执行时所实现的功能或操作步骤与上述实施例大体相同,在此不再赘述。
此外,本申请实施例还提出一种计算机可读存储介质,所述计算机可读存储介质上存储有智能化的情感问答程序,所述智能化的情感问答程序可被一个或多个处理器执行,以实现如下操作:
从互联网中获取问题数据集和与所述问题数据集对应的多种答案数据集,将所述问题数据集与所述多种答案数据集组成问答数据集,并对所述问答数据集进行情感属性标注,得到与所述问答数据集对应的情感属性标注集。
对所述问答数据集进行包括分词和关键字抽取的预处理操作,并根据Word2Vec算法对所述预处理操作完成的问答数据集进行词向量化操作,得到问答词向量集,所述问答词向量集包括问题词向量集和答案词向量集。
将所述情感属性标注集输入至损失函数中,将所述问题词向量集输入至卷积神经网络模型中训练,所述卷积神经网络模型训练得到训练值,并将所 述训练值输入至损失函数,所述损失函数根据所述情感属性标注集与所述训练值计算得到损失值,判断所述损失值与预设阈值的大小关系,直至所述损失值小于预设阈值时,所述卷积神经网络退出训练,当所述卷积神经网络退出训练后,所述卷积神经网络将所述问题词向量集输入至循环神经网络,同时提示所述循环神经网络接受所述答案词向量集进行训练,直至所述循环神经网络满足预设阈值要求时,退出训练。
接收用户问题,对所述用户问题进行所述预处理操作和所述词向量化操作后,输入至所述卷积神经网络判断情感属性类别,所述循环神经网络根据所述情感属性类别输出所述用户问题的答案。
需要说明的是,上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。并且本文中的术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种智能化情感问答方法,其特征在于,所述方法包括:
    通过网络爬虫技术从互联网中获取问题数据集和与所述问题数据集对应的多种答案数据集,将所述问题数据集与所述多种答案数据集组成问答数据集,并对所述问答数据集进行情感属性标注,得到与所述问答数据集对应的情感属性标注集;
    对所述问答数据集进行包括分词和关键字抽取的预处理操作,并根据Word2Vec算法对所述预处理操作完成的问答数据集进行词向量化操作,得到问答词向量集,所述问答词向量集包括问题词向量集和答案词向量集;
    将所述情感属性标注集输入至损失函数中,将所述问题词向量集输入至卷积神经网络模型中,利用所述卷积神经网络模型训练得到训练值,并将所述训练值输入至损失函数,利用所述损失函数并根据所述情感属性标注集与所述训练值计算得到损失值,判断所述损失值与预设阈值的大小关系,直至所述损失值小于预设阈值时,所述卷积神经网络退出训练;
    当所述卷积神经网络退出训练后,所述卷积神经网络将所述问题词向量集输入至循环神经网络,同时提示所述循环神经网络接受所述答案词向量集进行训练,直至所述循环神经网络满足预设阈值要求时,退出训练;
    接收用户问题,对所述用户问题进行所述预处理操作和所述词向量化操作后,输入至所述卷积神经网络判断情感属性类别,所述循环神经网络根据所述情感属性类别输出所述用户问题的答案。
  2. 如权利要求1所述的智能化情感问答方法,其特征在于,所述损失值E为:
    Figure PCTCN2019102194-appb-100001
    其中,x为所述训练值,μ j为所述情感属性标注集,m为所述问答数据集的数量。
  3. 如权利要求1所述的智能化情感问答方法,其特征在于,通过网络爬虫技术从互联网中获取问题数据集和与所述问题数据集对应的多种答案数据集,包括:
    根据所述网络爬虫技术从URL页面内爬取以文本形式提问的问题,将所述以文本形式提问的问题组成问题数据集;
    遍历所述问题数据集内的问题,使用所述网络爬虫技术从所述URL页面内爬取与所述问题对应的多种答案,直至所述问题数据集遍历结束,得到与所述问题数据集对应的多种答案数据集。
  4. 如权利要求3所述的智能化情感问答方法,其特征在于,所述分词操作包括:
    根据所述问答数据集建立分词概率模型P(S),并最大化所述分词概率模型,完成分词操作,所述分词概率模型P(S)为:
    Figure PCTCN2019102194-appb-100002
    其中,W 1,W 2,…,W m为所述问答数据集内数据的词,m为所述问答数据集的数量;
    所述关键字抽取操作包括:
    构建所述词的相关度,并基于所述相关度提取关键字,所述相关度为:
    Figure PCTCN2019102194-appb-100003
    其中,f(W i,W j)为词W i和词W j的相关度,tfidf(W i)为词W i的词频与逆向频率值,tfidf(W j)为词W j的词频与逆向频率值,d为词W i和词W j关于词向量的欧式距离。
  5. 如权利要求4中的智能化情感问答方法,其特征在于,所述Word2Vec算法为CBOW模型;
    所述CBOW模型包括输入层、投影层和输出层;
    所述投影层ζ(ω,j)为:
    Figure PCTCN2019102194-appb-100004
    其中,
    Figure PCTCN2019102194-appb-100005
    表示在路径ω内,第j个结点对应的霍夫曼编码,θ为所述CBOW模型的迭代因子,σ表示sigmoid函数,X ω为所述预处理操作完成的问答数据集。
  6. 如权利要求1所述的智能化情感问答方法,其特征在于,所述卷积神经网络包括卷积层、池化层、Flatten层、Dropout层和全连接层。
  7. 如权利要求5所述的智能化情感问答方法,其特征在于,所述循环神经网络为长短期记忆网络,所述长短期记忆网络包括遗忘门、输入门、输出 门;
    所述遗忘门为:
    f t=σ(w t[h t-1,x t]+b t)
    其中,f t为所述遗忘门的输出数据,x t为所述遗忘门的输入数据,t为所述问答词向量集的当前时间,t-1为所述问答词向量集当前时间的前一个时间,h t-1为所述输出门在所述问答词向量集当前时间的前一个时间的输出数据,w t为所述当前时间的权重,b t为所述当前时间的偏置,[]为矩阵乘法操作,σ表示所述sigmoid函数。
  8. 一种智能化的情感问答装置,其特征在于,所述装置包括存储器和处理器,所述存储器上存储有可在所述处理器上运行的智能化的情感问答程序,所述智能化的情感问答程序被所述处理器执行时实现如下步骤:
    通过网络爬虫技术从互联网中获取问题数据集和与所述问题数据集对应的多种答案数据集,将所述问题数据集与所述多种答案数据集组成问答数据集,并对所述问答数据集进行情感属性标注,得到与所述问答数据集对应的情感属性标注集;
    对所述问答数据集进行包括分词和关键字抽取的预处理操作,并根据Word2Vec算法对所述预处理操作完成的问答数据集进行词向量化操作,得到问答词向量集,所述问答词向量集包括问题词向量集和答案词向量集;
    将所述情感属性标注集输入至损失函数中,将所述问题词向量集输入至卷积神经网络模型中,利用所述卷积神经网络模型训练得到训练值,并将所述训练值输入至损失函数,利用所述损失函数并根据所述情感属性标注集与所述训练值计算得到损失值,判断所述损失值与预设阈值的大小关系,直至所述损失值小于预设阈值时,所述卷积神经网络退出训练;
    当所述卷积神经网络退出训练后,所述卷积神经网络将所述问题词向量集输入至循环神经网络,同时提示所述循环神经网络接受所述答案词向量集进行训练,直至所述循环神经网络满足预设阈值要求时,退出训练;
    接收用户问题,对所述用户问题进行所述预处理操作和所述词向量化操作后,输入至所述卷积神经网络判断情感属性类别,所述循环神经网络根据所述情感属性类别输出所述用户问题的答案。
  9. 如权利要求8所述的智能化的情感问答装置,其特征在于,所述损失值E为:
    Figure PCTCN2019102194-appb-100006
    其中,x为所述训练值,μ j为所述情感属性标注集,m为所述问答数据集的数量。
  10. 如权利要求8所述的智能化的情感问答装置,其特征在于,通过网络爬虫技术从互联网中获取问题数据集和与所述问题数据集对应的多种答案数据集,包括:
    根据所述网络爬虫技术从URL页面内爬取以文本形式提问的问题,将所述以文本形式提问的问题组成问题数据集;
    遍历所述问题数据集内的问题,使用所述网络爬虫技术从所述URL页面内爬取与所述问题对应的多种答案,直至所述问题数据集遍历结束,得到与所述问题数据集对应的多种答案数据集。
  11. 如权利要求10所述的智能化的情感问答装置,其特征在于,所述分词操作包括:
    根据所述所述问答数据集建立分词概率模型P(S),并最大化所述分词概率模型,完成分词操作,所述分词概率模型P(S)为:
    Figure PCTCN2019102194-appb-100007
    其中,W 1,W 2,…,W m为所述问答数据集内数据的词,m为所述问答数据集的数量;
    所述关键字抽取操作包括:
    构建所述词的相关度并基于所述相关度提取关键字,所述相关度为:
    Figure PCTCN2019102194-appb-100008
    其中,f(W i,W j)为词W i和词W j的相关度,tfidf(W i)为词W i的词频与逆向频率值,tfidf(W j)为词W j的词频与逆向频率值,d为词W i和词W j关于词向量的欧式距离。
  12. 如权利要求11所述的智能化的情感问答装置,其特征在于,所述Word2Vec算法为CBOW模型;
    所述CBOW模型包括输入层、投影层和输出层;
    所述投影层ζ(ω,j)为:
    Figure PCTCN2019102194-appb-100009
    其中,
    Figure PCTCN2019102194-appb-100010
    表示在路径ω内,第j个结点对应的霍夫曼编码,θ为所述CBOW模型的迭代因子,σ表示sigmoid函数,X ω为所述预处理操作完成的问答数据集。
  13. 如权利要求8所述的智能化的情感问答装置,其特征在于,所述卷积神经网络包括卷积层、池化层、Flatten层、Dropout层和全连接层。
  14. 如权利要求12所述的智能化的情感问答装置,其特征在于,所述循环神经网络为长短期记忆网络,所述长短期记忆网络包括遗忘门、输入门、输出门;
    所述遗忘门为:
    f t=σ(w t[h t-1,x t]+b t)
    其中,f t为所述遗忘门的输出数据,x t为所述遗忘门的输入数据,t为所述问答词向量集的当前时间,t-1为所述问答词向量集当前时间的前一个时间,h t-1为所述输出门在所述问答词向量集当前时间的前一个时间的输出数据,w t为所述当前时间的权重,b t为所述当前时间的偏置,[]为矩阵乘法操作,σ表示所述sigmoid函数。
  15. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有智能化的情感问答程序,所述智能化的情感问答程序可被一个或者多个处理器执行,以实现如下步骤:
    通过网络爬虫技术从互联网中获取问题数据集和与所述问题数据集对应的多种答案数据集,将所述问题数据集与所述多种答案数据集组成问答数据集,并对所述问答数据集进行情感属性标注,得到与所述问答数据集对应的情感属性标注集;
    对所述问答数据集进行包括分词和关键字抽取的预处理操作,并根据Word2Vec算法对所述预处理操作完成的问答数据集进行词向量化操作,得到问答词向量集,所述问答词向量集包括问题词向量集和答案词向量集;
    将所述情感属性标注集输入至损失函数中,将所述问题词向量集输入至卷积神经网络模型中,利用所述卷积神经网络模型训练得到训练值,并将所述训练值输入至损失函数,利用所述损失函数并根据所述情感属性标注集与所述训练值计算得到损失值,判断所述损失值与预设阈值的大小关系,直至所述损失值小于预设阈值时,所述卷积神经网络退出训练;
    当所述卷积神经网络退出训练后,所述卷积神经网络将所述问题词向量 集输入至循环神经网络,同时提示所述循环神经网络接受所述答案词向量集进行训练,直至所述循环神经网络满足预设阈值要求时,退出训练;
    接收用户问题,对所述用户问题进行所述预处理操作和所述词向量化操作后,输入至所述卷积神经网络判断情感属性类别,所述循环神经网络根据所述情感属性类别输出所述用户问题的答案。
  16. 如权利要求15所述的计算机可读存储介质,其特征在于,所述损失值E为:
    Figure PCTCN2019102194-appb-100011
    其中,x为所述训练值,μ j为所述情感属性标注集,m为所述问答数据集的数量。
  17. 如权利要求15所述的计算机可读存储介质,其特征在于,通过网络爬虫技术从互联网中获取问题数据集和与所述问题数据集对应的多种答案数据集,包括:
    根据所述网络爬虫技术从URL页面内爬取以文本形式提问的问题,将所述以文本形式提问的问题组成问题数据集;
    遍历所述问题数据集内的问题,使用所述网络爬虫技术从所述URL页面内爬取与所述问题对应的多种答案,直至所述问题数据集遍历结束,得到与所述问题数据集对应的多种答案数据集。
  18. 如权利要求17所述的计算机可读存储介质,其特征在于,所述分词操作包括:
    根据所述所述问答数据集建立分词概率模型P(S),并最大化所述分词概率模型,完成分词操作,所述分词概率模型P(S)为:
    Figure PCTCN2019102194-appb-100012
    其中,W 1,W 2,…,W m为所述问答数据集内数据的词,m为所述问答数据集的数量;
    所述关键字抽取操作包括:
    构建所述词的相关度并基于所述相关度提取关键字,所述相关度为:
    Figure PCTCN2019102194-appb-100013
    其中,f(W i,W j)为词W i和词W j的相关度,tfidf(W i)为词W i的词频与逆向 频率值,tfidf(W j)为词W j的词频与逆向频率值,d为词W i和词W j关于词向量的欧式距离。
  19. 如权利要求18所述的计算机可读存储介质,其特征在于,所述Word2Vec算法为CBOW模型;
    所述CBOW模型包括输入层、投影层和输出层;
    所述投影层ζ(ω,j)为:
    Figure PCTCN2019102194-appb-100014
    其中,
    Figure PCTCN2019102194-appb-100015
    表示在路径ω内,第j个结点对应的霍夫曼编码,θ为所述CBOW模型的迭代因子,σ表示sigmoid函数,X ω为所述预处理操作完成的问答数据集。
  20. 如权利要求19所述的计算机可读存储介质,其特征在于,所述循环神经网络为长短期记忆网络,所述长短期记忆网络包括遗忘门、输入门、输出门;
    所述遗忘门为:
    f t=σ(w t[h t-1,x t]+b t)
    其中,f t为所述遗忘门的输出数据,x t为所述遗忘门的输入数据,t为所述问答词向量集的当前时间,t-1为所述问答词向量集当前时间的前一个时间,h t-1为所述输出门在所述问答词向量集当前时间的前一个时间的输出数据,w t为所述当前时间的权重,b t为所述当前时间的偏置,[]为矩阵乘法操作,σ表示所述sigmoid函数。
PCT/CN2019/102194 2019-05-09 2019-08-23 智能化情感问答方法、装置及计算机可读存储介质 Ceased WO2020224099A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910386282.6A CN110263134B (zh) 2019-05-09 2019-05-09 智能化情感问答方法、装置及计算机可读存储介质
CN201910386282.6 2019-05-09

Publications (1)

Publication Number Publication Date
WO2020224099A1 true WO2020224099A1 (zh) 2020-11-12

Family

ID=67914663

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/102194 Ceased WO2020224099A1 (zh) 2019-05-09 2019-08-23 智能化情感问答方法、装置及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN110263134B (zh)
WO (1) WO2020224099A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115563987A (zh) * 2022-10-17 2023-01-03 北京中科智加科技有限公司 一种评论文本分析处理方法

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111563152A (zh) * 2020-06-19 2020-08-21 平安科技(深圳)有限公司 智能问答语料分析方法、装置、电子设备及可读存储介质
CN115238057A (zh) * 2022-08-01 2022-10-25 中国银行股份有限公司 一种突发聚集性咨询应答方法和装置
CN116821303A (zh) * 2023-06-30 2023-09-29 平安科技(深圳)有限公司 对话信息生成方法、装置、服务器及存储介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140229417A1 (en) * 2013-02-13 2014-08-14 Lela, Inc Methods for and apparatus for providing advice based upon total personal values
CN107066446A (zh) * 2017-04-13 2017-08-18 广东工业大学 一种嵌入逻辑规则的循环神经网络文本情感分析方法
CN108427670A (zh) * 2018-04-08 2018-08-21 重庆邮电大学 一种基于语境词向量和深度学习的情感分析方法
CN108875074A (zh) * 2018-07-09 2018-11-23 北京慧闻科技发展有限公司 基于交叉注意力神经网络的答案选择方法、装置和电子设备
CN108932342A (zh) * 2018-07-18 2018-12-04 腾讯科技(深圳)有限公司 一种语义匹配的方法、模型的学习方法及服务器
WO2019000326A1 (en) * 2017-06-29 2019-01-03 Microsoft Technology Licensing, Llc Generating responses in automated chatting
CN109408633A (zh) * 2018-09-17 2019-03-01 中山大学 一种多层注意力机制的循环神经网络模型的构建方法

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10909329B2 (en) * 2015-05-21 2021-02-02 Baidu Usa Llc Multilingual image question answering
CN107168945B (zh) * 2017-04-13 2020-07-14 广东工业大学 一种融合多特征的双向循环神经网络细粒度意见挖掘方法
CN107544957A (zh) * 2017-07-05 2018-01-05 华北电力大学 一种面向商品目标词的情感倾向分析方法

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140229417A1 (en) * 2013-02-13 2014-08-14 Lela, Inc Methods for and apparatus for providing advice based upon total personal values
CN107066446A (zh) * 2017-04-13 2017-08-18 广东工业大学 一种嵌入逻辑规则的循环神经网络文本情感分析方法
WO2019000326A1 (en) * 2017-06-29 2019-01-03 Microsoft Technology Licensing, Llc Generating responses in automated chatting
CN108427670A (zh) * 2018-04-08 2018-08-21 重庆邮电大学 一种基于语境词向量和深度学习的情感分析方法
CN108875074A (zh) * 2018-07-09 2018-11-23 北京慧闻科技发展有限公司 基于交叉注意力神经网络的答案选择方法、装置和电子设备
CN108932342A (zh) * 2018-07-18 2018-12-04 腾讯科技(深圳)有限公司 一种语义匹配的方法、模型的学习方法及服务器
CN109408633A (zh) * 2018-09-17 2019-03-01 中山大学 一种多层注意力机制的循环神经网络模型的构建方法

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115563987A (zh) * 2022-10-17 2023-01-03 北京中科智加科技有限公司 一种评论文本分析处理方法

Also Published As

Publication number Publication date
CN110263134B (zh) 2023-06-27
CN110263134A (zh) 2019-09-20

Similar Documents

Publication Publication Date Title
US11893345B2 (en) Inducing rich interaction structures between words for document-level event argument extraction
US12430512B2 (en) Artificial intelligence-based named entity recognition method and apparatus, and electronic device
CN110334272B (zh) 基于知识图谱的智能问答方法、装置及计算机存储介质
US10534863B2 (en) Systems and methods for automatic semantic token tagging
CN110301117B (zh) 用于在会话中提供响应的方法和装置
CN110765765B (zh) 基于人工智能的合同关键条款提取方法、装置及存储介质
WO2020253042A1 (zh) 情感智能判断方法、装置及计算机可读存储介质
WO2020224097A1 (zh) 智能语义文档推荐方法、装置及计算机可读存储介质
CN108427722A (zh) 智能交互方法、电子装置及存储介质
CN112101041A (zh) 基于语义相似度的实体关系抽取方法、装置、设备及介质
CN112231569A (zh) 新闻推荐方法、装置、计算机设备及存储介质
CN111767375A (zh) 语义召回方法、装置、计算机设备及存储介质
CN113704460A (zh) 一种文本分类方法、装置、电子设备和存储介质
WO2020253043A1 (zh) 智能文本分类方法、装置及计算机可读存储介质
CN110263177A (zh) 用于事件预测的知识图构建方法与事件预测方法
CN115795007B (zh) 智能问答方法、智能问答装置、电子设备及存储介质
WO2020224099A1 (zh) 智能化情感问答方法、装置及计算机可读存储介质
CN111193657A (zh) 聊天表情回复方法、装置及存储介质
CN111581972A (zh) 文本中症状和部位对应关系识别方法、装置、设备及介质
WO2021000391A1 (zh) 文本智能化清洗方法、装置及计算机可读存储介质
CN115438149A (zh) 一种端到端模型训练方法、装置、计算机设备及存储介质
CN112131881A (zh) 信息抽取方法及装置、电子设备、存储介质
WO2023173554A1 (zh) 坐席违规话术识别方法、装置、电子设备、存储介质
CN117290478B (zh) 一种知识图谱问答方法、装置、设备和存储介质
CN117194616A (zh) 一种垂域知识图谱的知识查询方法、装置、计算机设备和存储介质

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: 19927966

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: 19927966

Country of ref document: EP

Kind code of ref document: A1