WO2021027284A1 - 文本的评论性质确定方法及装置 - Google Patents

文本的评论性质确定方法及装置 Download PDF

Info

Publication number
WO2021027284A1
WO2021027284A1 PCT/CN2020/079696 CN2020079696W WO2021027284A1 WO 2021027284 A1 WO2021027284 A1 WO 2021027284A1 CN 2020079696 W CN2020079696 W CN 2020079696W WO 2021027284 A1 WO2021027284 A1 WO 2021027284A1
Authority
WO
WIPO (PCT)
Prior art keywords
text
review
comment
vector
nature
Prior art date
Application number
PCT/CN2020/079696
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 WO2021027284A1 publication Critical patent/WO2021027284A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • This application relates to the field of text processing, and in particular to methods and devices for determining the nature of text comments.
  • the prior art can only determine the nature of the comment by manually reading the comment, and the efficiency is low.
  • this application provides a method and device for determining the nature of reviews of texts that overcome the above-mentioned problems or at least partially solve the above-mentioned problems.
  • the solutions are as follows:
  • a method for determining the nature of text comments including:
  • the nature of the review of the text on the review object is determined according to the review feature vector.
  • the extracting multiple bottom-layer feature vectors of text from the vector matrix includes:
  • the first machine learning model obtained through training extracts a plurality of text bottom layer feature vectors from the vector matrix.
  • the obtaining a comment feature vector corresponding to at least one comment object according to the plurality of text bottom layer feature vectors includes:
  • At least one weight reorganization is used to perform a weighted summation of the multiple text high-level feature vectors based on a multi-head attention mechanism to obtain a comment feature vector corresponding to at least one comment object, each of the comment objects corresponding to the multi-head attention mechanism Of a head.
  • the determining the review nature of the text on the review object according to the review feature vector includes:
  • the comment feature vector is mapped to the probabilities of multiple comment properties to obtain the probability of each comment property of the text to the comment object.
  • the determining the review nature of the text on the review object according to the review feature vector further includes:
  • the review nature of the text is determined according to the probability of each review nature of the text for each review object.
  • a device for determining the nature of a text review includes: a vector matrix obtaining unit, a bottom-level feature vector obtaining unit, a comment feature vector obtaining unit, and a comment property determining unit,
  • the vector matrix obtaining unit is configured to obtain a vector matrix according to a text, the vector matrix including word vectors of each vocabulary in the text;
  • the bottom layer feature vector obtaining unit is configured to extract multiple bottom layer feature vectors of text from the vector matrix
  • the comment feature vector obtaining unit is configured to obtain a comment feature vector corresponding to at least one comment object according to the plurality of text bottom layer feature vectors;
  • the review nature determining unit is configured to determine the review nature of the text on the review object according to the review feature vector.
  • the bottom-level feature vector obtaining unit is specifically configured to extract multiple bottom-level text feature vectors from the vector matrix through the first machine learning model obtained through training.
  • the review feature vector obtaining unit includes: a first vector obtaining subunit and a second vector obtaining subunit,
  • the first vector obtaining subunit is configured to perform a weighted summation of the multiple text bottom-level feature vectors by using at least one weight reorganization to obtain multiple text high-level feature vectors;
  • the second vector obtaining subunit is configured to use at least one weight reorganization to perform a weighted summation of the multiple text high-level feature vectors based on a multi-head attention mechanism to obtain a comment feature vector corresponding to at least one comment object, each of which The comment object corresponds to one head in the multi-head attention mechanism.
  • the review property determining unit includes a probability obtaining subunit, and the probability obtaining subunit is configured to map the comment feature vector to the probabilities of a plurality of comment properties to obtain the effect of the text on the comment object The probability of the nature of each comment.
  • the review nature determining unit further includes: a text nature determining subunit, configured to determine the review nature of the text according to the probability of each review nature of each review object of the text.
  • a method and device for determining the review nature of a text can obtain a vector matrix according to the text, the vector matrix including the word vectors of each vocabulary in the text; extract from the vector matrix A plurality of text bottom-layer feature vectors; obtaining a comment feature vector corresponding to at least one review object according to the plurality of text bottom-layer feature vectors; and determining the comment nature of the text on the review object according to the comment feature vector.
  • a multi-head attention mechanism can simultaneously obtain comment feature vectors corresponding to multiple review objects from one text, and then determine the review properties of the text on the multiple review objects respectively according to the review feature vectors. It can be seen that the present application can simultaneously obtain the comment properties of the text on multiple review objects from one text, and realize a more fine-grained text analysis with higher accuracy and efficiency.
  • Fig. 1 shows a flowchart of a method for determining the nature of a text comment provided by an embodiment of the present application
  • Fig. 2 shows a flow chart of obtaining a vector matrix from text provided by an embodiment of the present application
  • FIG. 3 shows a schematic diagram of the processing process of feature vectors provided by an embodiment of the present application
  • FIG. 4 shows a schematic structural diagram of a device for determining the nature of a text comment provided by an embodiment of the present application
  • Fig. 5 shows a schematic structural diagram of a device provided by an embodiment of the present application.
  • an embodiment of the present application provides a method for determining the nature of a text comment, which may include:
  • the text may be a comment text of the user, and the comment text may be located in a webpage or an interface of an application program.
  • This application can crawl user comment text from applications or web pages.
  • this application can also obtain the review text in other ways, and this application is not limited here.
  • the vector matrix may also include part-of-speech vectors of each vocabulary in the text.
  • the word vector and the part-of-speech vector can form a vocabulary vector.
  • step S100 may specifically include:
  • the comment text can be part or all of the user's complete comment content. It is understandable that the comment text is the user's views, opinions, understanding, etc. on something.
  • this application can use multiple word segmentation tools for word segmentation to obtain a vocabulary sequence, such as Harbin Institute of Technology LTP, jieba, etc.
  • this application can also identify the part of speech of each vocabulary to obtain the part of speech sequence.
  • the word segmentation result returned by LTP can be [power, very, sufficient, but, fuel consumption, high], and the part-of-speech sequence is [n, adv, adj, conj, n , Adj].
  • step S120 may specifically include:
  • this application can obtain word vectors through wordvector technology. If the vocabulary is not in the vocabulary of wordvector, the specified preset word vector is used for expression.
  • a random vector of a certain dimension can be used to express the part of speech and characterize the part of speech. For example, for a total of 30 parts of speech [A1, A2,..., A30], the vector a1 can be used to represent A1, the vector a2 can be used to represent A2 and so on.
  • the dimensions of a1, a2, etc. are a specified fixed value, such as 20 dimensions, and each dimension is a randomly generated decimal close to 0.
  • the word vector and the part-of-speech vector After obtaining the word vector and the part-of-speech vector, they can be joined to form a vectorized expression of the vocabulary, namely: the vocabulary vector.
  • the dimension of the vocabulary vector is the dimension of the word vector + the dimension of the part of speech vector.
  • For each vocabulary in the review text its vocabulary vector is obtained, and then the vocabulary vectors of each vocabulary in the review text are spliced together to form a vector matrix.
  • the vector matrix can be expanded to a specific length in the direction of the number of words (for example, 600, forming a 600 ⁇ 120 vector matrix), and the expanded part is processed by adding zeros.
  • the above vector matrix contains the feature information of the review text.
  • the vector matrix includes vocabulary vectors.
  • the vector matrix may be composed of word vectors only, and does not include part of speech vectors.
  • step S200 may specifically include: extracting multiple bottom-level text feature vectors from the vector matrix through the first machine learning model obtained through training.
  • the characteristic vector of a vector matrix is one of the important concepts in matrix theory, and it has a wide range of applications.
  • the eigenvector (eigenvector) of linear transformation is a non-degenerate vector, and its direction is unchanged under the transformation. Since the vector matrix is obtained from the text, this application can extract multiple bottom-layer feature vectors of the text from the vector matrix.
  • the multiple text bottom layer feature vectors may be feature vectors with small granularity such as vocabulary, short sentence, sentence, etc.
  • the feature vector of the text bottom layer may be part of the feature vector in the vector matrix.
  • this application can extract multiple bottom-level text feature vectors from the vector matrix through a machine learning method. Specifically, this application can first train a machine learning model according to machine learning methods such as Transformer, LSTM, GRU, recurrent neural network RNN, and recurrent attention network, and then use the machine learning model to extract from the vector matrix to determine the nature of the review The underlying feature vectors of multiple texts.
  • machine learning methods such as Transformer, LSTM, GRU, recurrent neural network RNN, and recurrent attention network
  • S300 Obtain a review feature vector corresponding to at least one review object according to the multiple text bottom-level feature vectors
  • the present application may execute step S300 through the multi-head attention feature extraction layer in the machine learning model to obtain comment feature vectors corresponding to multiple comment objects.
  • the review objects can be objects, people, institutions, fictitious concepts and other objects that can be reviewed.
  • step S300 may specifically include:
  • At least one weight reorganization is used to perform a weighted summation of the multiple text high-level feature vectors based on a multi-head attention mechanism to obtain a comment feature vector corresponding to at least one comment object, each of the comment objects corresponding to the multi-head attention mechanism Of a head.
  • the present application can simultaneously obtain comment feature vectors corresponding to multiple review objects from one text through a multi-head attention mechanism, and then determine the review properties of the text on the multiple review objects respectively according to the review feature vectors. It can be seen that this application can simultaneously obtain the comment nature of the text for multiple review objects from one text, and the efficiency is high.
  • step S300 of the present application can be completed using a machine learning model, and the weight reorganization includes multiple weights, and the above weight reorganization can be obtained through the training process of the machine learning model.
  • each of the above-mentioned high-level text feature vectors can be obtained by weighted summation of the bottom-level text feature vectors according to a weight.
  • the weights used in the calculation process of the high-level feature vector of each text can be different.
  • the above x 11 , x 12 ... x 1n are one weight reorganization, and the above x 21 , x 22 ... x 2n are another weight reorganization.
  • the present application may first perform a weighted summation on the multiple bottom-level text feature vectors according to the first weight reorganization to obtain multiple high-level text feature vectors with larger granularity.
  • the high-level feature vector of the text can include the user's overall evaluation information on the review object and the user's evaluation information on various aspects of the review object. For example, when the object of the review is a car, the text high-level feature vector may include the user's evaluation information on the entire car and the user's evaluation information on the car's power, fuel consumption, appearance, interior and other aspects.
  • the size relationship between the low-level feature vector of the text and the high-level feature vector of the text can be relative.
  • the high-level feature vector of the text can be a feature vector of short sentence granularity.
  • the feature vector of sentence granularity, or the feature vector of paragraph granularity, or the feature vector of full text granularity can be a feature vector of sentence granularity, a feature vector of paragraph granularity, or a feature vector of full text granularity.
  • the high-level feature vector of the text can be a paragraph-granular feature vector or a full-text feature vector. And so on.
  • this application may generate a review feature vector corresponding to each review object.
  • Each comment feature vector is obtained by weighted summation according to the multiple text high-level feature vectors. Specifically, the weights used in the weighted summation of each review feature vector can be different.
  • the review feature vectors f 1 to f N corresponding to N review objects can be obtained according to the following weighted sum formula.
  • Each review feature vector corresponds to a review object A.
  • the above-mentioned y 11 , y 12 ??y 1N are one weight reorganization, and the above-mentioned y 21 , y 22 ...y 2N are another weight reorganization.
  • S400 Determine, according to the comment feature vector, the comment nature of the text on the comment object.
  • the step S400 may include:
  • the comment feature vector is mapped to the probabilities of multiple comment properties to obtain the probability of each comment property of the text to the comment object.
  • step S400 may be executed through the fully connected layer in the machine learning model.
  • the comment nature may include at least one of positive, negative, neutral, and unmentioned.
  • this application can map it to the probability that the text of the review object’s review properties are positive, negative, neutral, and unmentioned. For example, if the review object is A 1 , the review feature vector f 1 can be mapped to the four probabilities P 11 , P 12 , P 13 , and P 14 .
  • P 11 can be the probability that the text is positive for the review object A 1 ’s review nature
  • P 12 can be the probability that the text is neutral to the review object A 1 ’s review nature
  • P 13 can be the text to the review object A 1
  • the comment nature of is the probability of being negative
  • P 14 can be the probability that the text’s comment on the review object A 1 is not mentioned
  • Steps S200 to S400 in the method shown in FIG. 1 of the present application may be processed by a machine learning model.
  • the input of the machine learning model can be: a vector matrix
  • the output can be: the probability of the text to the review object's review nature.
  • the machine learning model may be a multi-head attention-based neural network model, and the structure of the multi-head attention-based neural network model may include: an input layer, a multi-head attention feature extraction layer, a fully connected layer, and an output layer.
  • the input layer is used to perform step S200
  • the multi-head attention feature extraction layer is used to perform step S300
  • the fully connected layer is used to perform step S400
  • the output layer is used to apply the determined text to the review object.
  • the comment nature output is used to apply the determined text to the review object.
  • this application can also quantify the nature of each review, for example, assign 1, 0, -1, and -2 to positive, neutral, negative, and unmentioned. Of course, this application can also use the assigned value as the comment nature mark of the comment object.
  • the review object in this application may be a review object in a preset review object group.
  • This application can collect multiple words in advance and construct at least one preset comment object group. For example: when it is necessary to determine the nature of a user’s comment on a certain car, this application can pre-collect vocabulary related to the car that the user may evaluate, such as: appearance, interior, fuel consumption, price, space, displacement, Safety, cost performance, quality, throttle, control, engine, acceleration, etc. This application can put these words into the review object group of the car as a preset review object group.
  • the probability that the text output by the neural network model based on the multi-head attention has the comment property of the comment object may include: the probability that the comment property of at least one comment object is positive, negative, neutral, and unmentioned.
  • the probability of commenting on the cost performance output by the neural network model based on multi-head attention is: positive 3%, negative 87%, neutral 10%, and 0% not mentioned.
  • step S400 may further include:
  • the review nature of the text is determined according to the probability of each review nature of the text for each review object.
  • the review objects include: interior, fuel consumption and power.
  • the probabilities of the text output by the neural network model based on the multi-head attention of the present application on the interior review properties are respectively: positive 3%, negative 87%, neutral 10%, and 0% not mentioned.
  • the probabilities of the fuel consumption comment nature of the text output by the multi-head attention-based neural network model of this application are respectively: positive 73%, negative 17%, neutral 10%, and 0% not mentioned.
  • the probabilities of the text-to-motivation comment nature of the text output by the multi-head attention-based neural network model of the present application are respectively: positive 3%, negative 8%, neutral 4%, and 85% not mentioned.
  • the text’s evaluation score for fuel consumption is 0.56
  • the text’s evaluation score for power is: -1.75.
  • this application can remove the evaluation scores that are not mentioned, and it is not used in the calculation process of the evaluation scores of the text.
  • An embodiment of the present application provides a method for determining the review nature of a text, which can obtain a vector matrix according to the text, the vector matrix including word vectors of each vocabulary in the text; extracting multiple underlying feature vectors of the text from the vector matrix Obtain a review feature vector corresponding to at least one review object according to the multiple text underlying feature vectors; determine the nature of the review of the text on the review object according to the review feature vector.
  • This application can automatically determine the nature of the text to the review object, and the efficiency is high.
  • this application can train a neural network model based on multi-head attention based on deep learning frameworks such as tensorflow, mxnet, and pytorch.
  • the embodiment of the present application also provides a method for obtaining a machine learning model, which may include:
  • Machine learning is performed on the vector matrix and comment property annotations to obtain a machine learning model.
  • the input of the machine learning model is a vector matrix
  • the output of the machine learning model is the comment property of the text to the review object.
  • an embodiment of the present application also provides a device for determining the nature of a text comment.
  • an apparatus for determining the nature of a text comment may include: a vector matrix obtaining unit 100, a bottom-level feature vector obtaining unit 200, a comment feature vector obtaining unit 300, and a comment property determining unit 400,
  • the vector matrix obtaining unit 100 is configured to obtain a vector matrix according to a text, the vector matrix including word vectors of each vocabulary in the text;
  • the bottom layer feature vector obtaining unit 200 is configured to extract multiple bottom layer feature vectors of text from the vector matrix
  • the comment feature vector obtaining unit 300 is configured to obtain a comment feature vector corresponding to at least one comment object according to the multiple text bottom layer feature vectors;
  • the review nature determining unit 400 is configured to determine the review nature of the text on the review object according to the review feature vector.
  • the bottom-level feature vector obtaining unit 200 may be specifically configured to extract multiple bottom-level text feature vectors from the vector matrix through the first machine learning model obtained through training.
  • the review feature vector obtaining unit 300 may include: a first vector obtaining subunit and a second vector obtaining subunit,
  • the first vector obtaining subunit is configured to perform a weighted summation of the multiple text bottom-level feature vectors by using at least one weight reorganization to obtain multiple text high-level feature vectors;
  • the second vector obtaining subunit is configured to use at least one weight reorganization to perform a weighted summation of the multiple text high-level feature vectors based on a multi-head attention mechanism to obtain a comment feature vector corresponding to at least one comment object, each of which The comment object corresponds to one head in the multi-head attention mechanism.
  • the present application can simultaneously obtain comment feature vectors corresponding to multiple review objects from one text through a multi-head attention mechanism, and then determine the review properties of the text on the multiple review objects respectively according to the review feature vectors. It can be seen that this application can simultaneously obtain the comment nature of the text for multiple review objects from one text, and the efficiency is high.
  • the review property determining unit 400 may include a probability obtaining subunit, and the probability obtaining subunit is configured to map the comment feature vector to the probabilities of multiple comment properties, and obtain the text to the The probability of each comment nature of the comment object.
  • the review nature determining unit 400 may further include: a text nature determining subunit, configured to determine the review nature of the text according to the probability of each review nature of each review object of the text.
  • An apparatus for determining the review nature of a text provided by an embodiment of the present application can obtain a vector matrix according to the text, the vector matrix including the word vector of each vocabulary in the text; extract a plurality of text bottom layer feature vectors from the vector matrix Obtain a review feature vector corresponding to at least one review object according to the multiple text underlying feature vectors; determine the nature of the review of the text on the review object according to the review feature vector.
  • This application can automatically determine the nature of the text to the review object, and the efficiency is high.
  • the device for determining the review nature of the text includes a processor and a memory.
  • the vector matrix obtaining unit, the underlying feature vector obtaining unit, the review feature vector obtaining unit, and the review property determining unit are all stored as program units in the memory and executed by the processor.
  • the above-mentioned program units stored in the memory implement the corresponding functions.
  • the processor contains the kernel, which calls the corresponding program unit from the memory.
  • the kernel can be set to one or more, by adjusting the kernel parameters to determine the nature of the text to the comment object.
  • the embodiment of the present application provides a storage medium on which a program is stored, and when the program is executed by a processor, a method for determining the comment nature of the text is realized.
  • An embodiment of the present application provides a processor configured to run a program, wherein the method for determining the comment nature of the text is executed when the program is running.
  • an embodiment of the present application provides a device 70.
  • the device 70 includes at least one processor 701, and at least one memory 702 and a bus 703 connected to the processor 701; wherein the processor 701 and the memory 702 pass through The bus 703 completes the mutual communication; the processor 701 is used to call the program instructions in the memory 702 to execute the above-mentioned method for determining the nature of the text comment.
  • the device 70 herein may be a server, PC, PAD, mobile phone, etc.
  • This application also provides a computer program product, which when executed on a data processing device, is suitable for executing a program that initializes the following method steps:
  • the nature of the review of the text on the review object is determined according to the review feature vector.
  • the extracting multiple bottom-layer feature vectors of text from the vector matrix includes:
  • the first machine learning model obtained through training extracts a plurality of text bottom layer feature vectors from the vector matrix.
  • the obtaining a comment feature vector corresponding to at least one comment object according to the plurality of text bottom layer feature vectors includes:
  • At least one weight reorganization is used to perform a weighted summation of the multiple text high-level feature vectors based on a multi-head attention mechanism to obtain a comment feature vector corresponding to at least one comment object, each of the comment objects corresponding to the multi-head attention mechanism Of a head.
  • the determining the review nature of the text on the review object according to the review feature vector includes:
  • the comment feature vector is mapped to the probabilities of multiple comment properties to obtain the probability of each comment property of the text to the comment object.
  • the determining the review nature of the text on the review object according to the review feature vector further includes:
  • the review nature of the text is determined according to the probability of each review nature of the text for each review object.
  • the device includes one or more processors (CPUs), memory, and buses.
  • the device may also include input/output interfaces, network interfaces, and so on.
  • the memory may include non-permanent memory in computer-readable media, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM), and the memory includes at least one Memory chip.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash memory
  • the memory is an example of a computer-readable medium.
  • Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology.
  • the information can be computer-readable instructions, data structures, program modules, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
  • this application can be provided as methods, systems, or computer program products. Therefore, this application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.

Landscapes

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

Abstract

本申请公开了一种文本的评论性质确定方法及装置,可以根据文本获得向量矩阵,所述向量矩阵包括所述文本中各词汇的词向量;从所述向量矩阵中提取多个文本底层特征向量;根据所述多个文本底层特征向量获得至少一个评论对象对应的评论特征向量;根据所述评论特征向量确定所述文本对所述评论对象的评论性质。本申请可以自动确定文本对评论对象的评论性质,效率较高。

Description

文本的评论性质确定方法及装置
本申请要求于2019年08月12日提交中国专利局、申请号为201910741324.3、发明名称为“文本的评论性质确定方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及文本处理领域,尤其涉及文本的评论性质确定方法及装置。
背景技术
随着互联网的发展,越来越多的人在互联网上进行信息浏览、评论发表等行为。
通过收集和分析用户在互联网上发表的评论可以了解用户的观点。例如:从某汽车论坛上收集和分析用户对某款汽车的评论可以了解用户对该款汽车的各个方面的评论的性质,如:某评论中对该款汽车的外观持正面观点,但对该款汽车的内饰持负面观点。
现有技术只能通过人工读取评论的方式来确定评论的性质,效率较低。
发明内容
鉴于上述问题,本申请提供一种克服上述问题或者至少部分地解决上述问题的文本的评论性质确定方法及装置,方案如下:
一种文本的评论性质确定方法,包括:
根据文本获得向量矩阵,所述向量矩阵包括所述文本中各词汇的词向量;
从所述向量矩阵中提取多个文本底层特征向量;
根据所述多个文本底层特征向量获得至少一个评论对象对应的评论特征向量;
根据所述评论特征向量确定所述文本对所述评论对象的评论性质。
可选的,所述从所述向量矩阵中提取多个文本底层特征向量,包括:
通过训练得到的第一机器学习模型从所述向量矩阵中提取多个文本底层特征向量。
可选的,所述根据所述多个文本底层特征向量获得至少一个评论对象对应 的评论特征向量,包括:
使用至少一个权重组对所述多个文本底层特征向量进行加权求和,获得多个文本高层特征向量;
使用至少一个权重组,基于多头注意力机制对所述多个文本高层特征向量进行加权求和,获得至少一个评论对象对应的评论特征向量,每个所述评论对象对应所述多头注意力机制中的一个头。
可选的,所述根据所述评论特征向量确定所述文本对所述评论对象的评论性质,包括:
将所述评论特征向量映射到多个评论性质的概率上,获得所述文本对所述评论对象的各评论性质的概率。
可选的,所述根据所述评论特征向量确定所述文本对所述评论对象的评论性质,还包括:
根据所述文本对各所述评论对象的各评论性质的概率确定所述文本的评论性质。
一种文本的评论性质确定装置,包括:向量矩阵获得单元、底层特征向量获得单元、评论特征向量获得单元和评论性质确定单元,
所述向量矩阵获得单元,用于根据文本获得向量矩阵,所述向量矩阵包括所述文本中各词汇的词向量;
所述底层特征向量获得单元,用于从所述向量矩阵中提取多个文本底层特征向量;
所述评论特征向量获得单元,用于根据所述多个文本底层特征向量获得至少一个评论对象对应的评论特征向量;
所述评论性质确定单元,用于根据所述评论特征向量确定所述文本对所述评论对象的评论性质。
可选的,所述底层特征向量获得单元具体用于:通过训练得到的第一机器学习模型从所述向量矩阵中提取多个文本底层特征向量。
可选的,所述评论特征向量获得单元,包括:第一向量获得子单元和第二向量获得子单元,
所述第一向量获得子单元,用于使用至少一个权重组对所述多个文本底层特征向量进行加权求和,获得多个文本高层特征向量;
所述第二向量获得子单元,用于使用至少一个权重组,基于多头注意力机制对所述多个文本高层特征向量进行加权求和,获得至少一个评论对象对应的评论特征向量,每个所述评论对象对应所述多头注意力机制中的一个头。
可选的,所述评论性质确定单元包括概率获得子单元,所述概率获得子单元,用于将所述评论特征向量映射到多个评论性质的概率上,获得所述文本对所述评论对象的各评论性质的概率。
可选的,所述评论性质确定单元还包括:文本性质确定子单元,用于根据所述文本对各所述评论对象的各评论性质的概率确定所述文本的评论性质。
借由上述技术方案,本申请提供的一种文本的评论性质确定方法及装置,可以根据文本获得向量矩阵,所述向量矩阵包括所述文本中各词汇的词向量;从所述向量矩阵中提取多个文本底层特征向量;根据所述多个文本底层特征向量获得至少一个评论对象对应的评论特征向量;根据所述评论特征向量确定所述文本对所述评论对象的评论性质。本申请可以通过多头注意力机制从一个文本中同时获得多个评论对象对应的评论特征向量,然后根据评论特征向量确定所述文本分别对多个所述评论对象的评论性质。可见,本申请可以从一个文本中同时获得文本分别对多个评论对象的评论性质,实现了更细粒度的文本分析,具有较高的准确度和效率。
上述说明仅是本申请技术方案的概述,为了能够更清楚了解本申请的技术手段,而可依照说明书的内容予以实施,并且为了让本申请的上述和其它目的、特征和优点能够更明显易懂,以下特举本申请的具体实施方式。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1示出了本申请实施例提供的一种文本的评论性质确定方法的流程图;
图2示出了本申请实施例提供的根据文本获得向量矩阵的流程图;
图3示出了本申请实施例提供的特征向量的处理过程示意图;
图4示出了本申请实施例提供的一种文本的评论性质确定装置的结构示意图;
图5示出了本申请实施例提供的一种设备的结构示意图。
具体实施方式
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
如图1所示,本申请实施例提供了一种文本的评论性质确定方法,可以包括:
S100、根据文本获得向量矩阵,所述向量矩阵包括所述文本中各词汇的词向量;
其中,所述文本可以为用户的评论文本,该评论文本可以位于网页中,也可以在于应用程序的界面中。本申请可以从应用程序或网页中爬取用户的评论文本。当然,本申请还可以通过其他方式获得评论文本,本申请在此不做限定。其中,所述向量矩阵还可以包括所述文本中各词汇的词性向量。所述词向量和词性向量可以组成词汇向量。
可选的,如图2所示,步骤S100可以具体包括:
S110、获得评论文本,对所述评论文本进行分词,获得词汇序列;
其中,评论文本可以为用户完整评论内容的一部分或全部,可以理解的是,评论文本是用户对某事物的看法、意见、理解等。
可选的,本申请可以使用多种分词工具进行分词获得词汇序列,如哈工大LTP、jieba等。除获得词汇序列外,本申请还可以对各词汇的词性进行识别,从而获得词性序列。
例如采用哈工大LTP处理“动力很足,但是油耗高。”,LTP返回的分词结果可以为[动力,很,足,但是,油耗,高],词性序列为[n,adv,adj,conj, n,adj]。
S120、获得所述词汇序列中各词汇的词汇向量构成的向量矩阵。
其中,步骤S120可以具体包括:
对所述词汇序列中的每个词汇:获得该词汇的词向量及词性向量,将该词汇的词向量及词性向量拼接为该词汇的词汇向量;
按照所述词汇序列中各词汇的排列顺序对所述词汇序列中各词汇的词汇向量进行排列,获得所述词汇序列中各词汇的词汇向量构成的向量矩阵。
具体的,本申请可以通过wordvector技术获得词向量。如果词汇不在wordvector的词汇表中,则使用指定的预设词向量进行表达。
本申请可以使用一定维度的随机向量来表达词性,使词性特征化。例如对于共计30种词性[A1,A2,…,A30],可以用向量a1表示A1,向量a2表示A2等。其中a1、a2等的维度为一个指定的固定值,例如20维,每一个维度都是一个随机生成的接近于0的小数。
在获得词向量与词性向量后,将二者拼接即可形成词汇的向量化表达,即:词汇向量。词汇向量的维度为词向量的维度+词性向量的维度。对于评论文本中的每个词汇,都获得其词汇向量,再将评论文本中的每个词汇的词汇向量拼接起来,就形成一个向量矩阵。例如:当拼接后的词汇向量维度为120且评论文本中排列的词汇数量为200时,本申请可以生成一个维度为200×120的向量矩阵。本申请可以将这个向量矩阵在词汇数量方向扩充至一个特定长度(例如600,形成600×120的向量矩阵),扩充的部分通过补0进行处理。
可以理解的是,上述向量矩阵包含了评论文本的特征信息。
图2所示实施例中,向量矩阵包括词汇向量,在其他实施例中,向量矩阵可以仅由词向量构成,而不包括词性向量。
S200、从所述向量矩阵中提取多个文本底层特征向量;
其中,步骤S200可以具体包括:通过训练得到的第一机器学习模型从所述向量矩阵中提取多个文本底层特征向量。
可以理解的是,向量矩阵的特征向量是矩阵理论上的重要概念之一,它有着广泛的应用。数学上,线性变换的特征向量(本征向量)是一个非简并的向 量,其方向在该变换下不变。由于所述向量矩阵根据文本得到,因此本申请可以在所述向量矩阵中提取多个文本底层特征向量。所述多个文本底层特征向量可以为词汇、短句、句子等较小粒度的特征向量。文本底层特征向量可以为所述向量矩阵中的部分特征向量。
可以理解的是,由于向量矩阵中携带有大量的文本底层特征,因此本申请可以通过机器学习的方法来从所述向量矩阵中提取多个文本底层特征向量。具体的,本申请可以首先根据Transformer、LSTM、GRU、循环神经网络RNN、循环注意力网络等机器学习方法训练得到一个机器学习模型,然后使用该机器学习模型从向量矩阵中提取用于确定评论性质的多个文本底层特征向量。
S300、根据所述多个文本底层特征向量获得至少一个评论对象对应的评论特征向量;
具体的,本申请可以通过机器学习模型中的多头注意力特征提取层执行步骤S300,以获得多个评论对象对应的评论特征向量。
其中,评论对象可以有多种,评论对象可以为物、人、机构、虚构概念等一切可评论的对象。
可选的,步骤S300可以具体包括:
使用至少一个权重组对所述多个文本底层特征向量进行加权求和,获得多个文本高层特征向量;
使用至少一个权重组,基于多头注意力机制对所述多个文本高层特征向量进行加权求和,获得至少一个评论对象对应的评论特征向量,每个所述评论对象对应所述多头注意力机制中的一个头。
可以理解的是,本申请可以通过多头注意力机制从一个文本中同时获得多个评论对象对应的评论特征向量,然后根据评论特征向量确定所述文本分别对多个所述评论对象的评论性质。可见,本申请可以从一个文本中同时获得文本分别对多个评论对象的评论性质,效率较高。
具体的,本申请的步骤S300可以使用机器学习模型完成,权重组中包括多个权重,上述权重组可以通过该机器学习模型的训练过程得到。
可选的,上述每个文本高层特征向量都可以由各文本底层特征向量根据一 个权重组加权求和得到。各文本高层特征向量的计算过程所使用的权重组可以不同。
例如:如图3所示,设本申请获得的各文本底层特征向量分别为:h 1至h n,共n个文本底层特征向量。则本申请可以得到m个文本高层特征向量:e 1至e m。则e 1=x 11×h 1+x 12×h 2+…+x 1n×h n;e 2=x 21×h 1+x 22×h 2+…+x 2n×h n;以此类推。
上述x 11、x 12……x 1n为一个权重组,上述x 21、x 22……x 2n为另一个权重组。
可选的,由于文本底层特征向量的粒度较小,因此本申请可以首先根据第一权重组对所述多个文本底层特征向量进行加权求和,获得多个较大粒度的文本高层特征向量。文本高层特征向量可以包含用户对评论对象的整体评价信息以及用户对评论对象各方面的评价信息。例如当评论对象为汽车时,文本高层特征向量可以包含用户对汽车整体的评价信息以及用户对汽车的动力、油耗、外观、内饰等多个方面的评价信息。在实际应用中,文本底层特征向量和文本高层特征向量的粒度大小关系可以是相对的,例如:当文本底层特征向量为词汇粒度的特征向量时,文本高层特征向量可以为短句粒度的特征向量,或为句子粒度的特征向量,或为段落粒度的特征向量,或为全文粒度的特征向量。当文本底层特征向量为短句粒度的特征向量时,文本高层特征向量可以为句子粒度的特征向量,或为段落粒度的特征向量,或为全文粒度的特征向量。当文本底层特征向量为句子粒度的特征向量时,文本高层特征向量可以为段落粒度的特征向量,或为全文粒度的特征向量。以此类推。
可选的,本申请可以对每个评论对象都生成一个该评论对象对应的评论特征向量。每个评论特征向量均根据所述多个文本高层特征向量进行加权求和得到。具体的,各评论特征向量进行加权求和时使用的权重组可以不同。
例如:如图3所示,设本申请获得的m个文本高层特征向量为:e 1至e m。则本申请可以根据如下加权求和公式获得N个评论对象对应的评论特征向量f 1至f N。每一个评论特征向量均和一个评论对象A对应。
加权求和公式:
f 1=y 11×e 1+y 12×e 2+…+y 1N×e N;f 2=y 21×e 1+y 22×e 2+…+y 2N×e N;以此类推。
上述y 11、y 12……y 1N为一个权重组,上述y 21、y 22……y 2N为另一个权重组。
S400、根据所述评论特征向量确定所述文本对所述评论对象的评论性质。
其中步骤S400可以包括:
将所述评论特征向量映射到多个评论性质的概率上,获得所述文本对所述评论对象的各评论性质的概率。
具体的,本申请可以通过机器学习模型中的全连接层执行步骤S400。可选的,所述评论性质可以包括:正面、负面、中性和未提及中的至少一种。
如图3所示,对每一个评论对象A对应的评论特征向量f,本申请都可以将其映射到文本对该评论对象的评论性质分别为正面、负面、中性和未提及的概率。例如评论对象为A 1,则可以将评论特征向量f 1映射到P 11、P 12、P 13、P 14这四个概率上。具体的,P 11可以为文本对评论对象A 1的评论性质为正面的概率,P 12可以为文本对评论对象A 1的评论性质为中性的概率,P 13可以为文本对评论对象A 1的评论性质为负面的概率,P 14可以为文本对评论对象A 1的评论性质为未提及的概率,
本申请图1所示方法中的步骤S200至步骤S400可以通过机器学习模型进行处理。该机器学习模型的输入可以为:向量矩阵,输出可以为:文本对评论对象的评论性质的概率。该机器学习模型可以为基于多头注意力的神经网络模型,该基于多头注意力的神经网络模型的结构可以包括:输入层、多头注意力特征提取层、全连接层和输出层。其中,如图3所示,输入层用于执行步骤S200,多头注意力特征提取层用于执行步骤S300,全连接层用于执行步骤S400,输出层用于将确定的文本对所述评论对象的评论性质输出。
在实际应用中,本申请还可以将各评论性质进行量化处理,例如:为正面、中性、负面和未提及分别赋值1、0、-1和-2。当然,本申请也可以将所赋的值作为评论对象的评论性质标记。
本申请中的评论对象可以为预设评论对象组中的评论对象。本申请可以预先收集多个词汇并构建至少一个预设评论对象组。例如:当需要确定用户对某款汽车的评论性质时,本申请可以预先收集用户可能会评价到的该款汽车所涉及的词汇,如:外观、内饰、油耗、价格、空间、排量、安全性、性价比、质量、油门、操控、发动机、加速等。本申请可以将这些词汇放入该款汽车的评 论对象组中作为一个预设评论对象组。
例如,针对“我只能这样说用了7个月,感觉这款汽车的操控还是非常棒的。比我以前的那款要好很多,缺点就是很多内饰比较挫,刹车嘎吱嘎吱的,很多东西要自己慢慢习惯就是。看你银子多少,银子多就上另一款吧。”这个评论中,涉及的评论对象包括:操控、内饰和刹车,这三个评论对象的评论性质标记分别为1、-1、-1。而针对该款汽车的评论对象组中的其他评论对象,如性价比、发动机、油耗等,则未提及,可以这些评论对象的评论性质标记为-2。
其中,基于多头注意力的神经网络模型输出的文本对评论对象的评论性质的概率可以包括:至少一个评论对象的评论性质分别为正面、负面、中性和未提及的概率。例如:对性价比而言,基于多头注意力的神经网络模型输出的对性价比的评论性质概率为:正面3%,负面87%,中性10%,未提及0%。
在其他实施例中,所述评论对象为第一粒度的评论对象,步骤S400还可以包括:
根据所述文本对各所述评论对象的各评论性质的概率确定所述文本的评论性质。
可以理解的是,本申请可以根据各评论对象的评价得分获得文本的评价得分。例如:评论对象包括:内饰、油耗和动力。本申请的基于多头注意力的神经网络模型输出的文本对内饰的评论性质概率分别为:正面3%,负面87%,中性10%,未提及0%。本申请的基于多头注意力的神经网络模型输出的文本对油耗的评论性质概率分别为:正面73%,负面17%,中性10%,未提及0%。本申请的基于多头注意力的神经网络模型输出的文本对动力的评论性质概率分别为:正面3%,负面8%,中性4%,未提及85%。则当为正面、中性、负面和未提及分别赋值1、0、-1和-2时,则文本对内饰的评价得分为:1×0.03+(﹣1)×0.87+0×0.1+(﹣2)×0=﹣0.84。相应的,文本对油耗的评价得分为:0.56,文本对动力的评价得分为:﹣1.75。在实际应用中,本申请可以将未提及的评价得分去除,不用于对文本的评价得分的计算过程。则文本的评价得分为:﹣0.84+0.56=﹣0.28。则可以确定文本的评论性质为负面。
本申请实施例提供的一种文本的评论性质确定方法,可以根据文本获得向量矩阵,所述向量矩阵包括所述文本中各词汇的词向量;从所述向量矩阵中提取多个文本底层特征向量;根据所述多个文本底层特征向量获得至少一个评论对象对应的评论特征向量;根据所述评论特征向量确定所述文本对所述评论对象的评论性质。本申请可以自动确定文本对评论对象的评论性质,效率较高。
可选的,本申请可以基于tensorflow、mxnet、pytorch等深度学习框架训练基于多头注意力的神经网络模型。
本申请实施例还提供了一种机器学习模型获得方法,可以包括:
获得带有对多个评论对象的评论性质标注的训练语料;
根据所述训练语料获得向量矩阵;
对所述向量矩阵及评论性质标注进行机器学习,获得机器学习模型,所述机器学习模型的输入为:向量矩阵,所述机器学习模型的输出为:文本对评论对象的评论性质。
与图1所示方法相对应,本申请实施例还提供了一种文本的评论性质确定装置。
如图4所示,本申请实施例提供的一种文本的评论性质确定装置,可以包括:向量矩阵获得单元100、底层特征向量获得单元200、评论特征向量获得单元300和评论性质确定单元400,
所述向量矩阵获得单元100,用于根据文本获得向量矩阵,所述向量矩阵包括所述文本中各词汇的词向量;
所述底层特征向量获得单元200,用于从所述向量矩阵中提取多个文本底层特征向量;
所述评论特征向量获得单元300,用于根据所述多个文本底层特征向量获得至少一个评论对象对应的评论特征向量;
所述评论性质确定单元400,用于根据所述评论特征向量确定所述文本对所述评论对象的评论性质。
其中,所述底层特征向量获得单元200可以具体用于:通过训练得到的第一机器学习模型从所述向量矩阵中提取多个文本底层特征向量。
可选的,所述评论特征向量获得单元300,可以包括:第一向量获得子单元和第二向量获得子单元,
所述第一向量获得子单元,用于使用至少一个权重组对所述多个文本底层特征向量进行加权求和,获得多个文本高层特征向量;
所述第二向量获得子单元,用于使用至少一个权重组,基于多头注意力机制对所述多个文本高层特征向量进行加权求和,获得至少一个评论对象对应的评论特征向量,每个所述评论对象对应所述多头注意力机制中的一个头。
可以理解的是,本申请可以通过多头注意力机制从一个文本中同时获得多个评论对象对应的评论特征向量,然后根据评论特征向量确定所述文本分别对多个所述评论对象的评论性质。可见,本申请可以从一个文本中同时获得文本分别对多个评论对象的评论性质,效率较高。
可选的,所述评论性质确定单元400可以包括概率获得子单元,所述概率获得子单元,用于将所述评论特征向量映射到多个评论性质的概率上,获得所述文本对所述评论对象的各评论性质的概率。
可选的,所述评论性质确定单元400还可以包括:文本性质确定子单元,用于根据所述文本对各所述评论对象的各评论性质的概率确定所述文本的评论性质。
本申请实施例提供的一种文本的评论性质确定装置,可以根据文本获得向量矩阵,所述向量矩阵包括所述文本中各词汇的词向量;从所述向量矩阵中提取多个文本底层特征向量;根据所述多个文本底层特征向量获得至少一个评论对象对应的评论特征向量;根据所述评论特征向量确定所述文本对所述评论对象的评论性质。本申请可以自动确定文本对评论对象的评论性质,效率较高。
所述文本的评论性质确定装置包括处理器和存储器,上述向量矩阵获得单元、底层特征向量获得单元、评论特征向量获得单元和评论性质确定单元等均作为程序单元存储在存储器中,由处理器执行存储在存储器中的上述程序单元来实现相应的功能。
处理器中包含内核,由内核去存储器中调取相应的程序单元。内核可以设置一个或以上,通过调整内核参数来确定文本对评论对象的评论性质。
本申请实施例提供了一种存储介质,其上存储有程序,该程序被处理器执行时实现所述文本的评论性质确定方法。
本申请实施例提供了一种处理器,所述处理器用于运行程序,其中,所述程序运行时执行所述文本的评论性质确定方法。
如图5所示,本申请实施例提供了一种设备70,设备70包括至少一个处理器701、以及与处理器701连接的至少一个存储器702、总线703;其中,处理器701、存储器702通过总线703完成相互间的通信;处理器701用于调用存储器702中的程序指令,以执行上述的文本的评论性质确定方法。本文中的设备70可以是服务器、PC、PAD、手机等。
本申请还提供了一种计算机程序产品,当在数据处理设备上执行时,适于执行初始化有如下方法步骤的程序:
根据文本获得向量矩阵,所述向量矩阵包括所述文本中各词汇的词向量;
从所述向量矩阵中提取多个文本底层特征向量;
根据所述多个文本底层特征向量获得至少一个评论对象对应的评论特征向量;
根据所述评论特征向量确定所述文本对所述评论对象的评论性质。
可选的,所述从所述向量矩阵中提取多个文本底层特征向量,包括:
通过训练得到的第一机器学习模型从所述向量矩阵中提取多个文本底层特征向量。
可选的,所述根据所述多个文本底层特征向量获得至少一个评论对象对应的评论特征向量,包括:
使用至少一个权重组对所述多个文本底层特征向量进行加权求和,获得多个文本高层特征向量;
使用至少一个权重组,基于多头注意力机制对所述多个文本高层特征向量进行加权求和,获得至少一个评论对象对应的评论特征向量,每个所述评论对象对应所述多头注意力机制中的一个头。
可选的,所述根据所述评论特征向量确定所述文本对所述评论对象的评论性质,包括:
将所述评论特征向量映射到多个评论性质的概率上,获得所述文本对所述评论对象的各评论性质的概率。
可选的,所述根据所述评论特征向量确定所述文本对所述评论对象的评论性质,还包括:
根据所述文本对各所述评论对象的各评论性质的概率确定所述文本的评论性质。
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
在一个典型的配置中,设备包括一个或多个处理器(CPU)、存储器和总线。设备还可以包括输入/输出接口、网络接口等。
存储器可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM),存储器包括至少一个存储芯片。存储器是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、商品或者设备中还存在另外的相同要素。
本领域技术人员应明白,本申请的实施例可提供为方法、系统或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
以上仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。

Claims (10)

  1. 一种文本的评论性质确定方法,其特征在于,包括:
    根据文本获得向量矩阵,所述向量矩阵包括所述文本中各词汇的词向量;
    从所述向量矩阵中提取多个文本底层特征向量;
    根据所述多个文本底层特征向量获得至少一个评论对象对应的评论特征向量;
    根据所述评论特征向量确定所述文本对所述评论对象的评论性质。
  2. 根据权利要求1所述的方法,其特征在于,所述从所述向量矩阵中提取多个文本底层特征向量,包括:
    通过训练得到的第一机器学习模型从所述向量矩阵中提取多个文本底层特征向量。
  3. 根据权利要求1所述的方法,其特征在于,所述根据所述多个文本底层特征向量获得至少一个评论对象对应的评论特征向量,包括:
    使用至少一个权重组对所述多个文本底层特征向量进行加权求和,获得多个文本高层特征向量;
    使用至少一个权重组,基于多头注意力机制对所述多个文本高层特征向量进行加权求和,获得至少一个评论对象对应的评论特征向量,每个所述评论对象对应所述多头注意力机制中的一个头。
  4. 根据权利要求1所述的方法,其特征在于,所述根据所述评论特征向量确定所述文本对所述评论对象的评论性质,包括:
    将所述评论特征向量映射到多个评论性质的概率上,获得所述文本对所述评论对象的各评论性质的概率。
  5. 根据权利要求4所述的方法,其特征在于,所述根据所述评论特征向量确定所述文本对所述评论对象的评论性质,还包括:
    根据所述文本对各所述评论对象的各评论性质的概率确定所述文本的评论性质。
  6. 一种文本的评论性质确定装置,其特征在于,包括:向量矩阵获得单元、底层特征向量获得单元、评论特征向量获得单元和评论性质确定单元,
    所述向量矩阵获得单元,用于根据文本获得向量矩阵,所述向量矩阵包括所述文本中各词汇的词向量;
    所述底层特征向量获得单元,用于从所述向量矩阵中提取多个文本底层特征向量;
    所述评论特征向量获得单元,用于根据所述多个文本底层特征向量获得至少一个评论对象对应的评论特征向量;
    所述评论性质确定单元,用于根据所述评论特征向量确定所述文本对所述评论对象的评论性质。
  7. 根据权利要求6所述的装置,其特征在于,所述底层特征向量获得单元具体用于:通过训练得到的第一机器学习模型从所述向量矩阵中提取多个文本底层特征向量。
  8. 根据权利要求6所述的装置,其特征在于,所述评论特征向量获得单元,包括:第一向量获得子单元和第二向量获得子单元,
    所述第一向量获得子单元,用于使用至少一个权重组对所述多个文本底层特征向量进行加权求和,获得多个文本高层特征向量;
    所述第二向量获得子单元,用于使用至少一个权重组,基于多头注意力机制对所述多个文本高层特征向量进行加权求和,获得至少一个评论对象对应的评论特征向量,每个所述评论对象对应所述多头注意力机制中的一个头。
  9. 根据权利要求6所述的装置,其特征在于,所述评论性质确定单元包括概率获得子单元,所述概率获得子单元,用于将所述评论特征向量映射到多个评论性质的概率上,获得所述文本对所述评论对象的各评论性质的概率;
    并且,所述评论性质确定单元还包括:文本性质确定子单元,用于根据所述文本对各所述评论对象的各评论性质的概率确定所述文本的评论性质。
  10. 一种存储介质,其特征在于,所述存储介质包括存储的程序,其中,在所述程序运行时控制所述存储介质所在设备执行如权利要求1-5中任一所述的文本的评论性质确定方法。
PCT/CN2020/079696 2019-08-12 2020-03-17 文本的评论性质确定方法及装置 WO2021027284A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910741324.3A CN112446201A (zh) 2019-08-12 2019-08-12 文本的评论性质确定方法及装置
CN201910741324.3 2019-08-12

Publications (1)

Publication Number Publication Date
WO2021027284A1 true WO2021027284A1 (zh) 2021-02-18

Family

ID=74569746

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/079696 WO2021027284A1 (zh) 2019-08-12 2020-03-17 文本的评论性质确定方法及装置

Country Status (2)

Country Link
CN (1) CN112446201A (zh)
WO (1) WO2021027284A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107863147A (zh) * 2017-10-24 2018-03-30 清华大学 基于深度卷积神经网络的医疗诊断的方法
US20180189559A1 (en) * 2016-12-29 2018-07-05 Ncsoft Corporation Apparatus and method for detecting debatable document
CN109284506A (zh) * 2018-11-29 2019-01-29 重庆邮电大学 一种基于注意力卷积神经网络的用户评论情感分析系统及方法

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130268457A1 (en) * 2012-04-05 2013-10-10 Fujitsu Limited System and Method for Extracting Aspect-Based Ratings from Product and Service Reviews
CN107291696A (zh) * 2017-06-28 2017-10-24 达而观信息科技(上海)有限公司 一种基于深度学习的评论词情感分析方法及系统
CN107862343B (zh) * 2017-11-28 2021-07-13 南京理工大学 基于规则和神经网络的商品评论属性级情感分类方法
CN108647205B (zh) * 2018-05-02 2022-02-15 深圳前海微众银行股份有限公司 细粒度情感分析模型构建方法、设备及可读存储介质
CN108664632B (zh) * 2018-05-15 2021-09-21 华南理工大学 一种基于卷积神经网络和注意力机制的文本情感分类算法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180189559A1 (en) * 2016-12-29 2018-07-05 Ncsoft Corporation Apparatus and method for detecting debatable document
CN107863147A (zh) * 2017-10-24 2018-03-30 清华大学 基于深度卷积神经网络的医疗诊断的方法
CN109284506A (zh) * 2018-11-29 2019-01-29 重庆邮电大学 一种基于注意力卷积神经网络的用户评论情感分析系统及方法

Also Published As

Publication number Publication date
CN112446201A (zh) 2021-03-05

Similar Documents

Publication Publication Date Title
Vu et al. An experiment in integrating sentiment features for tech stock prediction in twitter
JP6661790B2 (ja) テキストタイプを識別する方法、装置及びデバイス
CN107315759A (zh) 归类关键字的方法、装置和处理系统、分类模型生成方法
US20180158078A1 (en) Computer device and method for predicting market demand of commodities
CN107729937A (zh) 用于确定用户兴趣标签的方法及装置
CN110619044B (zh) 一种情感分析方法、系统、存储介质及设备
US20230274332A1 (en) Method and apparatus for generating recommendation reason, and storage medium
CN110795572B (zh) 一种实体对齐方法、装置、设备及介质
CN109800292A (zh) 问答匹配度的确定方法、装置及设备
CN113255328B (zh) 语言模型的训练方法及应用方法
WO2021127982A1 (zh) 语音情感识别方法、智能装置和计算机可读存储介质
CN113222022A (zh) 一种网页分类识别方法及装置
CN116821372A (zh) 基于知识图谱的数据处理方法、装置、电子设备及介质
CN113626576A (zh) 远程监督中关系特征抽取方法、装置、终端及存储介质
WO2021027284A1 (zh) 文本的评论性质确定方法及装置
CN110851600A (zh) 基于深度学习的文本数据处理方法及装置
CN115878761A (zh) 事件脉络生成方法、设备及介质
Powell et al. Applying analytics to artist provided text to model prices of fine art
Narasiman et al. IndQuery-An Online Portal for Registering E-Complaints Integrated with Smart Chatbot
CN112926737A (zh) 一种模型训练方法、数据处理方法、装置及电子设备
AlShammari et al. Aspect-based sentiment analysis and location detection for Arabic language Tweets
Chhabra et al. Exploring Hugging Face Transformer Library Impact on Sentiment Analysis: A Case Study
CN114579860B (zh) 用户行为画像生成方法、装置、电子设备及存储介质
WO2020192237A1 (zh) 基于人工智能的语义识别的方法、装置系统及存储介质
Kavitha et al. Study of Natural Language Processing for Sentiment Analysis

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

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

Country of ref document: EP

Kind code of ref document: A1