Text analysis method and device

By updating the entity information and attribute information vectors in the target text, and using other products' information to enhance representation learning, the accuracy problem of sentiment analysis when training data is insufficient is solved, and more efficient sentiment analysis is achieved.

CN112446202BActive Publication Date: 2025-02-14ALIBABA GROUP HOLDING LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201910759849.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-08-16
Publication Date
2025-02-14
Estimated Expiration
2039-08-16

AI Technical Summary

Technical Problem

The prior art has inaccurate sentiment analysis of texts when there is less training data for emotion prediction models, which fails to effectively solve the problem of ‘cold start’.

Method used

By obtaining vectors of entity information and attribute information in the target text, and updating these vectors based on entity information and attribute information of other products, we then conduct sentiment analysis.

Benefits of technology

Improves sentiment analysis accuracy with less training data, solves the ‘cold start’ problem, and provides a scalable framework for handling sentiment analysis tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112446202B_ABST
    Figure CN112446202B_ABST
Patent Text Reader

Abstract

This invention discloses a method and apparatus for text analysis. The method includes: acquiring a first vector and a second vector from a target text, wherein the first vector represents entity information of a first product, and the second vector represents attribute information of the first product, and the first product is the product described in the target text; updating the first vector based on the entity information of the second product to obtain a first updated vector, wherein the second product is the product described in a preset text; updating the second vector based on the attribute information of the second product to obtain a second updated vector; and analyzing the target text based on the first and second updated vectors to obtain the sentiment information included in the target text. This invention solves the technical problem in existing technologies where sentiment analysis of text is inaccurate when the training data for sentiment prediction models is limited.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information processing, and in particular to a text analysis method and device. Background Art

[0002] Sentiment analysis, also known as tendency analysis, is the process of analyzing, processing, summarizing and reasoning about subjective texts with emotional colors. It divides texts into two or more types: positive or negative, based on the meaning and emotional information expressed in the text.

[0003] The purpose of sentiment analysis is usually to find out the attitude of the speaker or author towards a certain topic, which is the emotional state of the speaker or author. The Internet has generated a large amount of valuable comments on tasks, time, products, etc., which are participated by users. These comments express people's various emotional colors and emotional tendencies, such as joy, anger, sadness, happiness, criticism, and praise. Based on this, potential users can understand the public opinion on a certain event or product by browsing these subjective comments.

[0004] In current sentiment analysis methods, various types of object information have been successfully applied. Typical objects include entities (such as product names) and aspects (such as product attributes). However, in real scenarios, there is often insufficient training data for the target object, which may make it difficult to learn the representation of the object, thereby reducing the prediction performance. This phenomenon is called the "cold start" problem.

[0005] With respect to the problem in the prior art of inaccurate sentiment analysis of texts when there is little training data for sentiment prediction models, no effective solution has been proposed so far. Summary of the invention

[0006] The embodiments of the present invention provide a text analysis method and device to at least solve the technical problem in the prior art that sentiment analysis of text is inaccurate when there is less training data for a sentiment prediction model.

[0007] According to one aspect of an embodiment of the present invention, a text analysis method is provided, comprising: obtaining a first vector and a second vector in a target text, wherein the first vector is used to represent entity information of a first product, and the second vector is used to represent attribute information of the first product, and the first product is a product recorded in the target text; updating the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector, wherein the second product is a product recorded in a preset text; updating the second vector according to the attribute information of the second product to obtain a second update vector corresponding to the second vector; analyzing the target text according to the first update vector and the second update vector to obtain the emotional information included in the target text.

[0008] According to another aspect of an embodiment of the present invention, a text analysis method is also provided, including: displaying an acquired target text, wherein the target text includes entity information of a first product and attribute information of the product, and the first product is a product recorded in the target text; acquiring a first vector and a second vector in the target text, wherein the first vector is used to represent the entity information of the first product, and the second vector is used to represent the attribute information of the first product; updating the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector, wherein the second product is a product recorded in a preset text; updating the second vector according to the attribute information of the second product to obtain a second update vector corresponding to the second vector; analyzing the target text according to the first update vector and the second update vector, and outputting the emotional information included in the target text.

[0009] According to another aspect of an embodiment of the present invention, a text analysis method is also provided, including: obtaining evaluation information of a first product, wherein the evaluation information includes entity information of the first product and attribute information of the first product, and the first product is the product evaluated by the evaluation information; obtaining a first vector and a second vector in the evaluation information, wherein the first vector is used to represent the entity information of the first product, and the second vector is used to represent the attribute information of the first product; updating the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector, wherein the second product is a product recorded in a preset text; updating the second vector according to the attribute information of the second product to obtain a second update vector corresponding to the second vector; analyzing the evaluation information according to the first update vector and the second update vector to obtain the emotional information included in the evaluation information.

[0010] According to another aspect of an embodiment of the present invention, a storage medium is also provided, the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to perform the following steps: obtaining a first vector and a second vector in a target text, wherein the first vector is used to represent entity information of a first product, and the second vector is used to represent attribute information of the first product, and the first product is a product recorded in the target text; updating the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector, wherein the second product is a product recorded in a preset text; updating the second vector according to the attribute information of the second product to obtain a second update vector corresponding to the second vector; analyzing the target text according to the first update vector and the second update vector to obtain the emotional information included in the target text.

[0011] According to another aspect of an embodiment of the present invention, a processor is also provided, and the processor is used to run a program, wherein the following steps are performed when the program is running: obtaining a first vector and a second vector in a target text, wherein the first vector is used to represent entity information of a first product, and the second vector is used to represent attribute information of the first product, and the first product is a product recorded in the target text; updating the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector, wherein the second product is a product recorded in a preset text; updating the second vector according to the attribute information of the second product to obtain a second update vector corresponding to the second vector; analyzing the target text according to the first update vector and the second update vector to obtain the emotional information included in the target text.

[0012] In an embodiment of the present invention, a first vector for representing entity information and a second vector for representing attribute information are obtained in the target text, and the first vector and the second vector are updated based on the entity information and attribute information of other products, respectively. Finally, sentiment analysis is performed on the target text based on the updated result to obtain the sentiment analysis result of the target text. The above scheme takes into account the impact of the cold start problem on sentiment analysis, and proposes an extensible framework to solve the sentiment analysis task. By introducing the entity information and attribute information of other products to enhance the representation learning of entities and attributes in the target text, the accuracy of sentiment analysis can be improved when there is less training data, which solves the technical problem of inaccurate sentiment analysis of text in the prior art when there is less training data for the sentiment prediction model. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0014] Figure 1aA hardware structure block diagram of a computer device (or mobile device) for implementing a text analysis method is shown;

[0015] Figure 1b A block diagram showing the results of sentiment analysis on text.

[0016] Figure 2 is a flowchart of a text analysis method according to Example 1 of the present application;

[0017] Figure 3 is a schematic diagram of an optional sentiment analysis according to Example 1 of the present application;

[0018] Figure 4 is a flowchart of a text analysis method according to Example 2 of the present application;

[0019] Figure 5 is a flowchart of a text analysis method according to Example 3 of the present application;

[0020] Figure 6 is a schematic diagram of a text analysis device according to Example 4 of the present application;

[0021] Figure 7 is a schematic diagram of a text analysis device according to Example 5 of the present application;

[0022] Figure 8 is a schematic diagram of a text analysis device according to Example 6 of the present application; and

[0023] Fig. 9 This is a structural block diagram of a computer device according to Example 7 of the present application. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] Example 1

[0027] According to an embodiment of the present invention, an embodiment of a text analysis method is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0028] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer device or a similar computing device. Figure 1a FIG. 1 shows a hardware structure block diagram of a computer device (or mobile device) for implementing a text analysis method. Figure 1a As shown, the computer device 10 (or mobile device 10) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal bus (BUS) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1a The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1a More or fewer components as shown, or with Figure 1a Different configurations are shown.

[0029] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer device 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0030] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the text analysis method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the above-mentioned text analysis method is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer device 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0031] The transmission module 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer device 10. In one example, the transmission module 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission module 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0032] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer device 10 (or mobile device).

[0033] It should be noted that, in some optional embodiments, the above Figure 1a The computer device (or mobile device) shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. It should be noted that Figure 1aThis is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the above-described computer device (or mobile device).

[0034] Under the above operating environment, this application provides Figure 2 The analysis method of the text shown. Figure 2 It is a flowchart of a text analysis method according to Example 1 of the present application.

[0035] Step S21, obtaining a first vector and a second vector in the target text, wherein the first vector is used to represent entity information of a first product, and the second vector is used to represent attribute information of the first product, and the first product is a product recorded in the target text.

[0036] Specifically, the target text may be comments in forums, shopping websites, or e-commerce platforms. For example, the target text may be user reviews of products on shopping websites, user reviews of cars on car forums, and user reviews of restaurants on review websites.

[0037] The first product is the object evaluated by the target text. The target text has entity information and attribute information. The entity information is used to represent the name or brand of the first product, and the attribute information is used to represent the characteristics of the first product itself or the brand of the first product in a certain attribute in the target text. The above-mentioned first vector is the vector corresponding to the entity information, and the second vector is the vector corresponding to the attribute information. In an optional embodiment, entity words used to represent entity information and attribute words used to represent attribute information can be determined in the target text, and the first vector and the second vector of the target text are obtained by vectorizing the entity words and the attribute words.

[0038] by Figure 1b Take the example to illustrate the sentiment analysis of the text. Figure 1b As shown, in an optional embodiment, taking the scenario of an e-commerce platform as an example, the target text may be a comment of a user on an entity in the platform. In a comment, the subject of the comment may be the entity of the text. For example, for comment 1, "I like XXX, very dry, but a little expensive", the entity in the text is "XXX", and the attribute information is "dryness" and "price". In this example, there is only one entity. In some optional embodiments, the target text may include multiple entities. For example, for comment 2, "I like XXX, very dry, but a little expensive. YY is not good enough, but cheap", the entities in the text are "XXX" and "YY", and the attribute information is "dryness" and "price".

[0039] Figure 3 is a schematic diagram of an optional sentiment analysis according to Example 1 of the present application, combined with Figure 3As shown, the first vector v can be obtained from the entity memory module e1 、v e2 、v e3 ……v eN , and obtain the above second vector v from the attribute memory module a1 、v a2 、v a3 ……v aM .

[0040] Step S23, updating the first vector according to the entity information of the second product to obtain a first updated vector corresponding to the first vector, wherein the second product is the product recorded in the preset text.

[0041] Specifically, the above-mentioned preset text can be a text used as a training sample. In an optional embodiment, a test data set can be constructed based on the preset text, and then a second product can be determined based on the test data set, wherein the second product can be other products in the test data set except the first product.

[0042] Step S25: updating the second vector according to the attribute information of the second product to obtain a second updated vector corresponding to the second vector.

[0043] The above steps S23 and S25 are used to update the vector of the first product in the target text according to the vectors of other products, so as to further enhance the first vector and the second vector of the first product with the help of the vectors of other products, that is, to introduce additional information into the first vector and the second vector, thereby alleviating the problem of inaccurate sentiment analysis of the target text caused by insufficient training data related to the first product in the target text.

[0044] In an optional embodiment, the information that needs to be additionally introduced can be determined in the training data set, and then the first vector and the second vector can be updated using the information that needs to be additionally introduced. For example, an entity vector whose similarity with the first vector is higher than a preset value can be searched in the training data set, and an attribute vector whose similarity with the second vector is higher than a preset value can be searched in the training data set, and then the found entity vector is superimposed on the first vector to obtain a first update vector, and the found attribute vector is superimposed on the second vector to obtain a second update vector. The method of superimposing the found entity vector on the first vector can be to weight the first vector and the found entity vector according to a preset weight value to obtain a first update vector, and the method of superimposing the found attribute vector on the second vector can be the same.

[0045] Step S27, analyzing the target text according to the first update vector and the second update vector to obtain the emotional information included in the target text.

[0046] The above-mentioned sentiment information can be used to express the user's attitude towards a certain attribute of the brand or product represented by the entity, thereby obtaining the defects of the brand or product so that the merchant can make improvements. Sentiment information can include positive, negative and neutral. In an optional embodiment, a classifier softmax can be used to implement the analysis of sentiment information. Taking the classifier softmax as an example, softmax outputs the relative probability that the text belongs to different sentiment information, and finally determines that the sentiment information with the largest relative probability is the sentiment information to which the target text belongs.

[0047] Specifically, the target text may be processed by a multi-view sentiment analysis model and the processing result may be outputted. The sentiment information included in the target text is used to represent the sentiment tendency of the product in the target text in terms of preset attributes.

[0048] Still Figure 1b In the example, taking the target text as comment 1 "I like XXX, very dry, but a little expensive" as an example, the obtained sentiment information and sentiment analysis results include [XXX, positive] and [XXX, negative], where [XXX, positive] is used to indicate that the evaluation of the text on the attribute of dryness is positive, and [XXX, negative] is used to indicate that the evaluation of the text on the attribute of price is negative. For another example, taking the target text as comment 2 "I like XXX, very dry, but a little expensive. YY is not good enough, but cheap" as an example, the obtained sentiment information includes [(XXX, dryness), positive], [(XXX, price), negative], [(YY, dryness), negative], [(YY, price), positive].

[0049] It can be seen that based on the above-mentioned text analysis method, the target text can be subjected to multi-faceted sentiment analysis. Taking the target text as the evaluation information of the product as an example, the user's sentiment information on the product price, quality, after-sales service, etc. can be obtained, thereby guiding the merchant to improve the product itself, or improve the product sales strategy, thereby promoting the merchant's sales of the product.

[0050] The above embodiment of the present application obtains a first vector for representing entity information and a second vector for representing attribute information in the target text, and updates the first vector and the second vector based on the entity information and attribute information of other products, respectively, and finally performs sentiment analysis on the target text based on the updated result to obtain the sentiment analysis result of the target text. The above scheme takes into account the impact of the cold start problem on sentiment analysis, and proposes an extensible framework to solve the sentiment analysis task. By introducing the entity information and attribute information of other products to enhance the representation learning of entities and attributes in the target text, it can improve the accuracy of sentiment analysis when there is less training data, and solves the technical problem of inaccurate sentiment analysis of text in the prior art when there is less training data for the sentiment prediction model.

[0051] Furthermore, in order to solve the "cold start" problem by introducing additional information, additional attribute description information of the product included in the target text can also be introduced, but it is difficult to obtain such information. Even if such information is obtained, it is difficult for the sentiment analysis model to generalize and use such information. The additional information introduced by the above scheme of the present application is entity information or attribute information of other products, so it is easy to obtain and also convenient for the use of the model.

[0052] As an optional embodiment, obtaining a first vector and a second vector in a target text includes: segmenting the target text to obtain a plurality of words; determining entity words for representing entity information and attribute words for representing attribute information among the plurality of words; vectorizing the entity words to obtain a first vector; and vectorizing the attribute words to obtain a second vector.

[0053] Specifically, the above steps can be performed by a data collection and preprocessing module. The data collection module directly collects comments as target texts, and the preprocessing module preprocesses the target texts.

[0054] The above-mentioned word segmentation processing is used to divide the target text into multiple words. The target text can be segmented by bigram word segmentation. After the target text is segmented, root restoration can be performed to restore words with word forms to roots. Then, noise removal can be used to remove noise words such as special characters and special symbols from the word segmentation results.

[0055] After obtaining the entity words and attribute words, the entity words and vector words can be vectorized by means of word2vec or the like, thereby obtaining the first vector and the second vector mentioned above.

[0056] As an optional embodiment, updating the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector includes: iteratively updating the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector; wherein, iteratively updating the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector includes: determining an input vector corresponding to the first vector in this iteration; determining a weight of the first vector in the first update vector according to the entity information of the second product; determining a supplementary vector corresponding to the first vector in this iteration according to the entity information of the second product; and updating the corresponding input vector in this iteration according to the supplementary vector and the weight to obtain the first update vector.

[0057] In the iterative process of the above steps, the input vector in each iteration is not necessarily the same. In an optional embodiment, in the first iteration, the input vector corresponding to the first vector can be the initial vector of the first vector, and in the non-first iteration, the input vector corresponding to the first vector can be determined by the first update vector obtained in the previous iteration.

[0058] The entity information may include information about the entity vector of the second product, for example, the number of occurrences and frequency of the entity vector in the training data set, etc. The supplementary vector is a vector obtained from other products, namely the second product, to enhance the performance of the first vector during "cold start".

[0059] In the above steps, the final first update vector can be obtained by the input vector and the supplementary vector, and a weighting process is added during the addition process. Since the first update vector only includes the input vector and the supplementary vector, when the weight of the first vector in the update vector is q, the weight of the supplementary vector is (1-q). In an optional embodiment, the input vector and the supplementary vector corresponding to the first vector are weighted according to the corresponding weights to obtain the first update vector.

[0060] It is worth noting that the above scheme actually uses the attention mechanism to find a set of objects similar to the objects (entities or attributes) in the target text, and enhances the performance learning of the "cold start" objects through the representation of similar objects. The above attention mechanism includes the following two layers: (1) The first layer is implemented in the process of determining the weight of the first vector in the first update vector, and the second layer is implemented in the process of determining the supplementary vector.

[0061] It should be noted that after one iteration ends, it is necessary to determine whether the preset number of iterations has been reached. If the preset number of iterations has been reached, emotion prediction is performed based on the output first update vector and the second update vector, otherwise it is necessary to continue to the next iteration.

[0062] Combination Figure 3 As shown, the entity and the attribute have a shared module, and the judgment module in the shared module is used to determine whether the iteration is stopped. If it is stopped, the first update vector and the second update vector obtained after the update are output to the emotion prediction module for emotion prediction, otherwise the result of this iteration is input to the context representation module for the next iteration.

[0063] It should also be noted that the updating of the second vector according to the attribute information of the second product is the same as the updating of the first vector according to the entity information of the second product, which will not be repeated here.

[0064] As an optional embodiment, determining the input vector corresponding to the first vector in this iteration includes: determining the context vector used to represent the context information of the target text in the previous iteration based on the first update vector obtained in the previous iteration, the second update vector obtained in the previous iteration, and the set of word vectors in the target text; determining the sum of the first update vector obtained in the previous iteration and the context vector in the previous iteration as the input vector corresponding to the first vector in this iteration.

[0065] The above steps obtain the input vector corresponding to the first vector in this iteration through the result obtained in the previous iteration.

[0066] In an optional embodiment, the context vector c=ContextEncoding(v e , v a ,{w s}), where v e Used to represent the first update vector, v a Used to represent the second update vector, w s It is used to represent the word vector set corresponding to the words in the target text. The context vector used in the current iteration is the context information obtained in the previous iteration, that is, c (l-1) , in, Used to represent the first update vector obtained in the previous iteration, Used to represent the second update vector obtained in the previous iteration.

[0067] After obtaining the context information in the previous iteration through the above steps, the first update vector obtained in the previous iteration is added to the context vector in the previous iteration to obtain the input vector of the first vector in this iteration.

[0068] Still in the above embodiment, in this iteration process, the input vector corresponding to the first vector is

[0069] Combination Figure 3As shown, if the loop is not stopped, the first update vector obtained in the previous iteration will be and the context vector c in the previous iteration output by the context representation module (l-1) By adding ∑, we can get the input vector corresponding to the first vector in this iteration, and then input the input vector into the fusion gate mechanism in the entity update module ( Figure 3 The symbol G in is used to represent the fusion gate mechanism) to perform another update iteration of the first vector.

[0070] As an optional embodiment, when performing the first iteration, determining the input vector corresponding to the first vector in this iteration includes: when the target text includes multiple first vectors, determining the average of the multiple first vectors as the input vector.

[0071] Specifically, in the above steps, when the target text includes a first vector, the first vector included in the target text is used as the input vector in the first iteration; when the target text includes multiple first vectors, the average of the multiple first vectors is determined as the input vector in the first iteration.

[0072] In an optional embodiment, the word vectors corresponding to the words contained in the target text may be averaged to initialize the representation. For example, the attribute word "food quality" may be obtained by adding the word vectors corresponding to the words "food" and "quality" obtained after word segmentation and then averaging them to obtain the input vector corresponding to the first vector.

[0073] As an optional embodiment, determining the weight of the first vector in the first update vector based on the entity information of the second product includes: obtaining the number of times the first vector appears in the training data set; determining the average number of times the entity vector appears in the training data set; determining a first value with a natural constant as the base and the ratio of the number of times the first vector appears in the training data set to the average number of times as the exponent; determining the ratio of a preset value to the first value as a second value; and determining the difference between the preset value and the second value as the weight of the first vector in the first update vector.

[0074] Specifically, the above preset value may be 1.

[0075] It should be noted that the above steps implement the first level of attention mechanism, namely the frequency attention mechanism. Figure 3 As shown in Figure 2, this can be achieved by the frequency attention mechanism in the entity update module. Similarly, the attribute update module also has a frequency attention mechanism with the same function.

[0076] Before selecting similar objects, we first need to select objects with accurate vector representations. Objects that appear frequently in the training dataset usually have a sufficient number of review data, so these objects can usually be more accurately represented as ve and v a In order to select as many well-represented entity vectors and attribute vectors as possible from the entity memory module E and the attribute memory module A, the statistical feature of the frequency of occurrence of entities and attributes can be used to characterize each v in E and A. e and v a of different importance.

[0077] The above-mentioned second product represents other products in the test data set except the first product in the target text. In this embodiment, the entity information of the second product is used to represent the information of the entity word corresponding to the second product, for example, the number of occurrences and frequency of the entity vector corresponding to the entity word.

[0078] Specifically, the training data set is pre-constructed. In an optional embodiment, after the sample data is obtained, the sample data is divided into two parts, one of which is used as a test data set and the other is used as a training data set.

[0079] To determine the average number of times an entity vector appears in a training data set, we can first obtain the number of times each entity vector appears in the training data set and the number of entity vectors in the training data set, and then divide the total number of times the entity vector appears in the training data set by the number of entity vectors to obtain the average number of times the entity vector appears in the training data set.

[0080] In an optional embodiment, the entity information of the second product is the number of times the entity vector of the second product appears in the training data set. The process of obtaining the weight in the first update vector can be expressed by the following formula: Among them, q e It is used to represent the weight of the first vector, f(e) is used to represent the number of times the first vector appears in the training data set, and Avg({e}) is used to represent the average number of times the entity vector appears in the training data set.

[0081] Still in the above embodiment, the weight of the second update vector can be obtained in the same way as follows:

[0082] As an optional embodiment, determining the supplementary vector corresponding to the first vector in this iteration based on the entity information of the second product includes: obtaining a similarity parameter of each entity vector in the training data set, wherein the similarity parameter is used to represent the degree of similarity between the entity vector and the first vector; obtaining a first product of each entity vector and the corresponding similarity parameter; and determining the sum of the first products corresponding to each entity vector in the training data set as a supplementary vector.

[0083] The above scheme is used to implement the object attention layer. Similar objects are often used in similar contexts, including similar contextual word usage, similar product attributes and features, etc. Therefore, similar subsets can be automatically found from a set of objects with good representations, which can be automatically obtained through the attention mechanism. Figure 3 As shown, this step is performed by the fusion gate mechanism G in the entity update module.

[0084] In the above steps, the similarity parameter between each entity vector and the first vector is obtained, and the entity vector is multiplied by the similarity parameter corresponding to it, and then the result of multiplying each entity vector by the similarity parameter corresponding to it is added to obtain the supplementary vector used in this iteration. In this scheme, the similarity parameter between the entity vector and the first vector can be considered as the weight of the entity vector, that is, the entity vector with higher similarity to the first vector has a higher weight, and in this way, the similarity attention layer is realized.

[0085] In an optional embodiment, assuming that there is an output vector of the l-1th layer: the entity vector and the context vector c (l-1) , we can get the entity vector representation of layer l Similarly, there is an aspect vector representation The similarity-based attention mechanism can be implemented as follows: First, E is calculated by the softmax function. i Importance of β i , the importance β i That is, it is used to represent the similarity parameter between the entity vector and the first vector, and then through β i Weighted E i You can get the entity supplement vector Similarly, we can also obtain the aspect supplement vector

[0086] As an optional embodiment, the similarity parameters of each entity vector in the training data set are obtained, including: determining the weight of the entity vector in the training data set and the second product of the entity vector; concatenating the second product with the input vector of this iteration and passing it through a preset perceptron to obtain a perception result; and determining the similarity parameter corresponding to the entity vector based on the perception result.

[0087] In an optional embodiment, the output q of the frequency attention layer i *E i , and with the entity vector After splicing, it passes through a single-layer perceptron MLP (Multi-Layer Perception); then the entity vector E is determined based on the output of the perception layer through the softmax function iSimilarity parameter with the first vector. ;

[0088] As an optional embodiment, the corresponding input vector in this iteration is updated according to the supplementary vector and the weight to obtain a first update vector, including: obtaining the third product of the weight and the input vector of this iteration; obtaining the difference between the preset value and the weight, and obtaining the fourth product of the difference and the supplementary vector; determining the sum of the third product and the fourth product as the first update vector.

[0089] In the above steps, the difference between 1 and the weight of the first vector is the weight of the supplementary vector. Therefore, the above steps weight the input vector and the supplementary vector with the corresponding weights respectively to obtain the first update vector.

[0090] In an optional embodiment, the first update vector may be expressed by the following formula: Among them, l is used to represent the preset number of iterations, is used to represent the first update vector, q e Used to represent the weight of the first vector, (1-q e ) is used to represent the weight of the supplementary vector, The input vector used to represent this iteration, The complement vector to use for this iteration.

[0091] Similarly, the second update vector can be expressed as follows: Among them, l is used to represent the preset number of iterations, is used to represent the second update vector, q a Used to represent the weight of the second vector, (1-q a ) is used to represent the weight of the supplementary vector, The input vector used to represent this iteration, The supplementary vector used to represent this iteration.

[0092] In an optional embodiment, the target text includes at least one or more of the following: user original content, evaluation information on a preset object, and instructions for use of the preset object.

[0093] Specifically, the above user-generated content is UGC (User Generated Content), which is user-generated content, such as videos and short articles shared by users on social networks. Analyzing user-generated content to obtain its emotional information is conducive to products such as applications to push different content to each user based on their different emotional information, thereby making users more sticky to products such as applications.

[0094] In addition to comments on products in forums, shopping websites, and e-commerce platforms, the evaluation information on the preset objects can also be user evaluation information, such as user evaluation of new electronic products. Product evaluation information is usually more professional and fair, and plays a guiding role for a large number of other users. Therefore, analyzing product evaluation information has greater guiding significance.

[0095] The above-mentioned instructions for use of the preset object may be the user's experience in using the product. The experience in using the product may be information in a good product sharing application. Compared with ordinary product reviews, this type of usage experience is longer and can include a more comprehensive evaluation of the product. This type of information is usually issued by users with a certain influence on the Internet. Therefore, analyzing this type of information is also of great guiding significance for the sales of the product.

[0096] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0097] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of various embodiments of the present invention.

[0098] Example 2

[0099] According to an embodiment of the present invention, there is also provided an embodiment of a text analysis method. Figure 4 is a flowchart of a text analysis method according to Example 2 of the present application, combined with Figure 4 As shown, the method comprises the following steps:

[0100] Step S41, displaying the acquired target text, wherein the target text includes entity information of the first product and attribute information of the product, and the first product is the product recorded in the target text.

[0101] Specifically, the target text may be comments in forums, shopping websites, or e-commerce platforms. For example, the target text may be user reviews of products on shopping websites, user reviews of cars on car forums, and user reviews of restaurants on review websites.

[0102] Step S43, obtaining a first vector and a second vector in the target text, wherein the first vector is used to represent entity information of the first product, and the second vector is used to represent attribute information of the first product.

[0103] The first product mentioned above is the object evaluated by the target text. The target text has entity information and attribute information. The entity information is used to represent the name or brand of the first product, and the attribute information is used to represent the characteristics of the first product itself or the brand of the first product in a certain attribute in the target text. The first vector mentioned above is the vector corresponding to the entity information, and the second vector is the vector corresponding to the attribute information. In an optional embodiment, entity words used to represent entity information and attribute words used to represent attribute information can be determined in the target text, and the first vector and the second vector of the target text are obtained by vectorizing the entity words and the attribute words.

[0104] Figure 3 is a schematic diagram of an optional sentiment analysis according to an embodiment of the present application, combined with Figure 3 As shown, the first vector v can be obtained from the entity memory module e1 、v e2 、v e3 ……v eN , and obtain the above second vector v from the attribute memory module a1 、v a2 、v a3 ……v aN .

[0105] Step S45, updating the first vector according to the entity information of the second product to obtain a first updated vector corresponding to the first vector, wherein the second product is the product recorded in the preset text.

[0106] Step S47, updating the second vector according to the attribute information of the second product to obtain a second updated vector corresponding to the second vector.

[0107] The above steps S45 and S47 are used to update the vector of the first product in the target text according to the vectors of other products, so as to further enhance the first vector and the second vector of the first product with the help of the vectors of other products, that is, to introduce additional information into the first vector and the second vector, thereby alleviating the problem of inaccurate sentiment analysis of the target text caused by insufficient training data related to the first product in the target text.

[0108] In an optional embodiment, the information that needs to be additionally introduced can be determined in the training data set, and then the first vector and the second vector can be updated using the information that needs to be additionally introduced. For example, an entity vector whose similarity with the first vector is higher than a preset value can be searched in the training data set, and an attribute vector whose similarity with the second vector is higher than a preset value can be searched in the training data set, and then the found entity vector is superimposed on the first vector to obtain a first update vector, and the found attribute vector is superimposed on the second vector to obtain a second update vector. The method of superimposing the found entity vector on the first vector can be to weight the first vector and the found entity vector according to a preset weight value to obtain a first update vector, and the method of superimposing the found attribute vector on the second vector can be the same.

[0109] Step S49: Analyze the target text according to the first update vector and the second update vector, and output the emotion information included in the target text.

[0110] The above-mentioned sentiment information can be used to express the user's attitude towards a certain attribute of the brand or product represented by the entity, thereby obtaining the defects of the brand or product so that the merchant can make improvements. Sentiment information can include positive, negative and neutral. In an optional embodiment, a classifier softmax can be used to implement the analysis of sentiment information. Taking the classifier softmax as an example, softmax outputs the relative probability that the text belongs to different sentiment information, and finally determines that the sentiment information with the largest relative probability is the sentiment information to which the target text belongs.

[0111] Specifically, the target text may be processed by a multi-view sentiment analysis model and the processing result may be outputted. The sentiment information included in the target text is used to represent the sentiment tendency of the product in the target text in terms of preset attributes.

[0112] The above embodiment of the present application obtains a first vector for representing entity information and a second vector for representing attribute information in the target text, and updates the first vector and the second vector based on the entity information and attribute information of other products, respectively, and finally performs sentiment analysis on the target text based on the updated result to obtain the sentiment analysis result of the target text. The above scheme takes into account the impact of the cold start problem on sentiment analysis, and proposes an extensible framework to solve the sentiment analysis task. By introducing the entity information and attribute information of other products to enhance the representation learning of entities and attributes in the target text, it can improve the accuracy of sentiment analysis when there is less training data, and solves the technical problem of inaccurate sentiment analysis of text in the prior art when there is less training data for the sentiment prediction model.

[0113] Furthermore, in order to solve the "cold start" problem by introducing additional information, additional attribute description information of the product included in the target text can also be introduced, but it is difficult to obtain such information. Even if such information is obtained, it is difficult for the sentiment analysis model to generalize and use such information. The additional information introduced by the above scheme of the present application is entity information or attribute information of other products, so it is easy to obtain and also convenient for the use of the model.

[0114] As an optional embodiment, updating the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector includes: iteratively updating the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector;

[0115] Among them, iteratively updating the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector includes: determining the input vector corresponding to the first vector in this iteration; determining the weight of the first vector in the first update vector according to the entity information of the second product; determining the supplementary vector corresponding to the first vector in this iteration according to the entity information of the second product; and updating the corresponding input vector in this iteration according to the supplementary vector and the weight to obtain the first update vector.

[0116] In the iterative process of the above steps, the input vector in each iteration is not necessarily the same. In an optional embodiment, in the first iteration, the input vector corresponding to the first vector can be the initial vector of the first vector, and in the non-first iteration, the input vector corresponding to the first vector can be determined by the first update vector obtained in the previous iteration.

[0117] The entity information may include information about the entity vector of the second product, for example, the number of occurrences and frequency of the entity vector in the training data set, etc. The supplementary vector is a vector obtained from other products, namely the second product, to enhance the performance of the first vector during "cold start".

[0118] In the above steps, the final first update vector can be obtained by the input vector and the supplementary vector, and a weighting process is added during the addition process. Since the first update vector only includes the input vector and the supplementary vector, when the weight of the first vector in the update vector is q, the weight of the supplementary vector is (1-q). In an optional embodiment, the input vector and the supplementary vector corresponding to the first vector are weighted according to the corresponding weights to obtain the first update vector.

[0119] It is worth noting that the above scheme actually uses the attention mechanism to find a set of objects similar to the objects (entities or attributes) in the target text, and enhances the performance learning of the "cold start" objects through the representation of similar objects. The above attention mechanism includes the following two layers: (1) The first layer is implemented in the process of determining the weight of the first vector in the first update vector, and the second layer is implemented in the process of determining the supplementary vector.

[0120] It should be noted that after one iteration ends, it is necessary to determine whether the preset number of iterations has been reached. If the preset number of iterations has been reached, emotion prediction is performed based on the output first update vector and the second update vector, otherwise it is necessary to continue to the next iteration.

[0121] Combination Figure 3 As shown, the entity and the attribute have a shared module, and the judgment module in the shared module is used to determine whether the iteration is stopped. If it is stopped, the first update vector and the second update vector obtained after the update are output to the emotion prediction module for emotion prediction, otherwise the result of this iteration is input to the context representation module for the next iteration.

[0122] It should also be noted that the updating of the second vector according to the attribute information of the second product is the same as the updating of the first vector according to the entity information of the second product, which will not be repeated here.

[0123] The text analysis method in this embodiment also includes other steps in Embodiment 1, which will not be described again here.

[0124] Example 3

[0125] According to an embodiment of the present invention, there is also provided an embodiment of a text analysis method. Figure 5 is a flowchart of a text analysis method according to Example 3 of the present application, combined with Figure 5 As shown, the method comprises the following steps:

[0126] Step S51, obtaining evaluation information of a first product, wherein the evaluation information includes entity information of the first product and attribute information of the first product, and the first product is the product evaluated by the evaluation information.

[0127] Specifically, the above evaluation information may be comments in forums, shopping websites, and e-commerce platforms. For example, the evaluation information may be user evaluations of products on shopping websites, user evaluations of cars on car forums, and user evaluations of restaurants on review websites.

[0128] Step S53, obtaining a first vector and a second vector in the evaluation information, wherein the first vector is used to represent the entity information of the first product, and the second vector is used to represent the attribute information of the first product.

[0129] The first product mentioned above is the object evaluated by the evaluation information. The evaluation information has entity information and attribute information. The entity information is used to represent the name or brand of the first product, and the attribute information is used to represent the characteristics of the first product itself or the brand of the first product in the evaluation information in a certain attribute. The first vector mentioned above is the vector corresponding to the entity information, and the second vector is the vector corresponding to the attribute information. In an optional embodiment, entity words used to represent the entity information and attribute words used to represent the attribute information can be determined in the evaluation information, and the first vector and the second vector of the evaluation information are obtained by vectorizing the entity words and the attribute words.

[0130] Figure 3 is a schematic diagram of an optional sentiment analysis according to an embodiment of the present application, combined with Figure 3 As shown, the first vector v can be obtained from the entity memory module e1 、v e2 、v e3 ……v eN , and obtain the above second vector v from the attribute memory module a1 、v a2 、v a3 ……v aN .

[0131] Step S55, updating the first vector according to the entity information of the second product to obtain a first updated vector corresponding to the first vector, wherein the second product is the product recorded in the preset text.

[0132] Step S57: Update the second vector according to the attribute information of the second product to obtain a second updated vector corresponding to the second vector.

[0133] The above steps S55 and S57 are used to update the vector of the first product in the evaluation information according to the vectors of other products, so as to further enhance the first vector and the second vector of the first product with the help of the vectors of other products, that is, to introduce additional information into the first vector and the second vector, thereby alleviating the problem of inaccurate sentiment analysis of the evaluation information caused by insufficient training data related to the first product in the evaluation information.

[0134] In an optional embodiment, the information that needs to be additionally introduced can be determined in the training data set, and then the first vector and the second vector can be updated using the information that needs to be additionally introduced. For example, an entity vector whose similarity with the first vector is higher than a preset value can be searched in the training data set, and an attribute vector whose similarity with the second vector is higher than a preset value can be searched in the training data set, and then the found entity vector is superimposed on the first vector to obtain a first update vector, and the found attribute vector is superimposed on the second vector to obtain a second update vector. The method of superimposing the found entity vector on the first vector can be to weight the first vector and the found entity vector according to a preset weight value to obtain a first update vector, and the method of superimposing the found attribute vector on the second vector can be the same.

[0135] Step S59: Analyze the evaluation information according to the first update vector and the second update vector to obtain the emotion information included in the evaluation information.

[0136] The above-mentioned sentiment information can be used to express the user's attitude towards a certain attribute of the brand or product represented by the entity, thereby obtaining the defects of the brand or product so that the merchant can make improvements. Sentiment information can include positive, negative and neutral. In an optional embodiment, a classifier softmax can be used to implement the analysis of sentiment information. Taking the classifier softmax as an example, softmax outputs the relative probability that the text belongs to different sentiment information, and finally determines that the sentiment information with the largest relative probability is the sentiment information to which the evaluation information belongs.

[0137] Specifically, the evaluation information may be processed by a multi-view sentiment analysis model and the processing result may be outputted. The sentiment information included in the evaluation information is used to represent the sentiment tendency of the product in the evaluation information in terms of preset attributes.

[0138] The above embodiment of the present application obtains a first vector for representing entity information and a second vector for representing attribute information in the evaluation information, and updates the first vector and the second vector based on the entity information and attribute information of other products, respectively, and finally performs sentiment analysis on the evaluation information based on the updated result to obtain the sentiment analysis result of the evaluation information. The above scheme takes into account the impact of the cold start problem on sentiment analysis, and proposes an extensible framework to solve the sentiment analysis task. By introducing the entity information and attribute information of other products to enhance the representation learning of entities and attributes in the evaluation information, it can improve the accuracy of sentiment analysis when there is less training data, and solves the technical problem of inaccurate sentiment analysis of text in the prior art when there is less training data for the sentiment prediction model.

[0139] Furthermore, in order to solve the "cold start" problem by introducing additional information, additional attribute description information of the product included in the evaluation information can also be introduced, but it is difficult to obtain such information. Even if this information is obtained, it is difficult for the sentiment analysis model to generalize and use this information. The additional information introduced by the above scheme of the present application is the entity information or attribute information of other products, so it is easy to obtain and also convenient for the use of the model.

[0140] As an optional embodiment, updating the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector includes: iteratively updating the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector;

[0141] Among them, iteratively updating the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector includes: determining the input vector corresponding to the first vector in this iteration; determining the weight of the first vector in the first update vector according to the entity information of the second product; determining the supplementary vector corresponding to the first vector in this iteration according to the entity information of the second product; and updating the corresponding input vector in this iteration according to the supplementary vector and the weight to obtain the first update vector.

[0142] In the iterative process of the above steps, the input vector in each iteration is not necessarily the same. In an optional embodiment, in the first iteration, the input vector corresponding to the first vector can be the initial vector of the first vector, and in the non-first iteration, the input vector corresponding to the first vector can be determined by the first update vector obtained in the previous iteration.

[0143] The entity information may include information about the entity vector of the second product, for example, the number of occurrences and frequency of the entity vector in the training data set, etc. The supplementary vector is a vector obtained from other products, namely the second product, to enhance the performance of the first vector during "cold start".

[0144] In the above steps, the final first update vector can be obtained by the input vector and the supplementary vector, and a weighting process is added during the addition process. Since the first update vector only includes the input vector and the supplementary vector, when the weight of the first vector in the update vector is q, the weight of the supplementary vector is (1-q). In an optional embodiment, the input vector and the supplementary vector corresponding to the first vector are weighted according to the corresponding weights to obtain the first update vector.

[0145] It is worth noting that the above scheme actually uses the attention mechanism to find a set of objects similar to the objects (entities or attributes) in the evaluation information, and enhances the performance learning of the "cold start" objects through the representation of similar objects. The above attention mechanism includes the following two layers: (1) The first layer is implemented in the process of determining the weight of the first vector in the first update vector, and the second layer is implemented in the process of determining the supplementary vector.

[0146] It should be noted that after one iteration ends, it is necessary to determine whether the preset number of iterations has been reached. If the preset number of iterations has been reached, emotion prediction is performed based on the output first update vector and the second update vector, otherwise it is necessary to continue to the next iteration.

[0147] Combination Figure 3 As shown, the entity and the attribute have a shared module, and the judgment module in the shared module is used to determine whether the iteration is stopped. If it is stopped, the first update vector and the second update vector obtained after the update are output to the emotion prediction module for emotion prediction, otherwise the result of this iteration is input to the context representation module for the next iteration.

[0148] It should also be noted that the updating of the second vector according to the attribute information of the second product is the same as the updating of the first vector according to the entity information of the second product, which will not be repeated here.

[0149] The text analysis method in this embodiment also includes other steps in Embodiment 1, which will not be described again here.

[0150] Example 4

[0151] According to an embodiment of the present invention, there is also provided a text analysis device for implementing the text analysis method in the above embodiment 1. Figure 6 is a schematic diagram of a text analysis device according to Example 4 of the present application, such as Figure 6 As shown, the device 600 includes:

[0152] The acquisition module 602 is used to acquire a first vector and a second vector in the target text, wherein the first vector is used to represent entity information of a first product, and the second vector is used to represent attribute information of the first product, and the first product is a product recorded in the target text.

[0153] The first updating module 604 is used to update the first vector according to the entity information of the second product to obtain a first updated vector corresponding to the first vector, wherein the second product is a product recorded in the preset text.

[0154] The second updating module 606 is used to update the second vector according to the attribute information of the second product to obtain a second updated vector corresponding to the second vector.

[0155] The analysis module 608 is used to analyze the target text according to the first update vector and the second update vector to obtain the emotional information included in the target text.

[0156] It should be noted that the acquisition module 602, the first update module 604, the second update module 606 and the analysis module 608 correspond to steps S21 to S27 in Embodiment 1, and the four modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in Embodiment 1. It should be noted that the above modules, as part of the apparatus, can be run in the computer device 10 provided in Embodiment 1.

[0157] As an optional embodiment, the acquisition module includes: a word segmentation submodule, used to segment the target text to obtain multiple words; a determination submodule, used to determine entity words used to represent entity information and attribute words used to represent attribute information among the multiple words; a first processing submodule, used to vectorize the entity words to obtain a first vector; and a second processing submodule, used to vectorize the attribute words to obtain a second vector.

[0158] As an optional embodiment, the first updating module includes: a first updating submodule, configured to iteratively update the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector;

[0159] Among them, the first updating submodule includes: a first determination unit, used to determine the input vector corresponding to the first vector in this iteration; a second determination unit, used to determine the weight of the first vector in the first update vector according to the entity information of the second product; a third determination unit, used to determine the supplementary vector corresponding to the first vector in this iteration according to the entity information of the second product; an updating unit, used to update the corresponding input vector in this iteration according to the supplementary vector and the weight to obtain the first update vector.

[0160] As an optional embodiment, the first determination unit includes: a sixth determination subunit, used to determine the context vector used to represent the context information of the target text in the previous iteration based on the first update vector obtained in the previous iteration, the second update vector obtained in the previous iteration and the set of word vectors in the target text; a seventh determination subunit, used to determine that the sum of the first update vector obtained in the previous iteration and the context vector in the previous iteration is the input vector corresponding to the first vector in this iteration.

[0161] As an optional embodiment, when performing the first iteration, the first determination unit includes: an eighth determination subunit, configured to determine, when the target text includes multiple first vectors, a mean value of the multiple first vectors as the input vector.

[0162] As an optional embodiment, the second determination unit includes: a first acquisition subunit, used to obtain the number of times the first vector appears in the training data set; a first determination subunit, used to determine the average number of times the entity vector appears in the training data set; a second determination subunit, used to determine the first numerical value with a natural constant as the base and the ratio of the number of times the first vector appears in the training data set to the average number of times as the exponent; a third determination subunit, used to determine the ratio of a preset value to the first numerical value as a second numerical value; and a fourth determination subunit, used to determine the difference between the preset value and the second numerical value as the weight of the first vector in the first update vector.

[0163] As an optional embodiment, the third determination unit includes: a second acquisition subunit, used to obtain a similarity parameter of each entity vector in the training data set, wherein the similarity parameter is used to represent the degree of similarity between the entity vector and the first vector; a third acquisition subunit, used to obtain a first product of each entity vector and the corresponding similarity parameter; and a fifth determination subunit, used to determine the sum of the first products corresponding to each entity vector in the training data set as a supplementary vector.

[0164] As an optional embodiment, the second acquisition subunit includes: an eighth determination subunit, used to determine the weight of the entity vector in the training data set and the second product of the entity vector; a perception subunit, used to concatenate the second product with the input vector of this iteration and obtain a perception result through a preset perceptron; and a ninth determination subunit, used to determine the similarity parameter corresponding to the entity vector based on the perception result.

[0165] As an optional embodiment, the update unit includes: a fourth acquisition subunit, used to obtain the third product of the weight and the input vector of this iteration; a fifth acquisition subunit, used to obtain the difference between the preset value and the weight, and obtain the fourth product of the difference and the supplementary vector; and a tenth determination subunit, used to determine that the sum of the third product and the fourth product is the first update vector.

[0166] As an optional embodiment, the target text includes at least one or more of the following: user original content, evaluation information on the preset object, and instructions for use of the preset object.

[0167] Example 5

[0168] According to an embodiment of the present invention, there is also provided a text analysis device for implementing the text analysis method in the above-mentioned embodiment 2. Figure 7 is a schematic diagram of a text analysis device according to Example 5 of the present application, such as Figure 7 As shown, the device 700 includes:

[0169] The display module 702 is used to display the acquired target text, wherein the target text includes entity information of the first product and attribute information of the product, and the first product is the product recorded in the target text.

[0170] The acquisition module 704 is used to acquire a first vector and a second vector in the target text, wherein the first vector is used to represent the entity information of the first product, and the second vector is used to represent the attribute information of the first product.

[0171] The first updating module 706 is used to update the first vector according to the entity information of the second product to obtain a first updated vector corresponding to the first vector, wherein the second product is a product recorded in the preset text.

[0172] The second updating module 708 is used to update the second vector according to the attribute information of the second product to obtain a second updated vector corresponding to the second vector.

[0173] The analysis module 7010 is used to analyze the target text according to the first update vector and the second update vector, and output the sentiment information included in the target text.

[0174] It should be noted that the display module 702, the acquisition module 704, the first update module 706, the second update module 708 and the second update module 709 correspond to steps S41 to S49 in Embodiment 2, and the five modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above-mentioned Embodiment 1. It should be noted that the above-mentioned modules as part of the apparatus can be run in the computer device 10 provided in Embodiment 1.

[0175] As an optional embodiment, the first updating module includes: an updating iteration module, configured to iteratively update the first vector according to the entity information of the second product to obtain a first updated vector corresponding to the first vector;

[0176] The update iteration module includes: a first determination submodule, used to determine the input vector corresponding to the first vector in this iteration; a second determination submodule, used to determine the weight of the first vector in the first update vector based on the entity information of the second product; a third determination submodule, used to determine the supplementary vector corresponding to the first vector in this iteration based on the entity information of the second product; an update submodule, used to update the corresponding input vector in this iteration according to the supplementary vector and the weight to obtain the first update vector.

[0177] Example 6

[0178] According to an embodiment of the present invention, there is also provided a text analysis device for implementing the text analysis method in the above-mentioned embodiment 3. Figure 8is a schematic diagram of a text analysis device according to Example 6 of the present application, such as Figure 8 As shown, the device 800 includes:

[0179] The first acquisition module 802 is used to acquire evaluation information of a first product, wherein the evaluation information includes entity information of the first product and attribute information of the first product, and the first product is the product evaluated by the evaluation information.

[0180] The second acquisition module 804 is used to acquire a first vector and a second vector in the evaluation information, wherein the first vector is used to represent the entity information of the first product, and the second vector is used to represent the attribute information of the first product.

[0181] The first updating module 806 is used to update the first vector according to the entity information of the second product to obtain a first updated vector corresponding to the first vector, wherein the second product is the product recorded in the preset text.

[0182] The second updating module 808 is used to update the second vector according to the attribute information of the second product to obtain a second updated vector corresponding to the second vector.

[0183] The analysis module 8010 is used to analyze the evaluation information according to the first update vector and the second update vector to obtain the emotion information included in the evaluation information.

[0184] As an optional embodiment, the first updating module includes: an updating iteration module, configured to iteratively update the first vector according to the entity information of the second product to obtain a first updated vector corresponding to the first vector;

[0185] The update iteration module includes: a first determination submodule, used to determine the input vector corresponding to the first vector in this iteration; a second determination submodule, used to determine the weight of the first vector in the first update vector based on the entity information of the second product; a third determination submodule, used to determine the supplementary vector corresponding to the first vector in this iteration based on the entity information of the second product; an update submodule, used to update the corresponding input vector in this iteration according to the supplementary vector and the weight to obtain the first update vector.

[0186] Example 7

[0187] The embodiment of the present invention may provide a computer device, which may be any computer device in a computer device group. Optionally, in this embodiment, the computer device may also be replaced by a terminal device such as a mobile terminal.

[0188] Optionally, in this embodiment, the computer device may be located in at least one network device among a plurality of network devices of a computer network.

[0189] In this embodiment, the above-mentioned computer device can execute the program code of the following steps in the text analysis method: obtain the first vector and the second vector in the target text, wherein the first vector is used to represent the entity information of the first product, and the second vector is used to represent the attribute information of the first product, and the first product is the product recorded in the target text; update the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector, wherein the second product is the product recorded in the preset text; update the second vector according to the attribute information of the second product to obtain a second update vector corresponding to the second vector; analyze the target text according to the first update vector and the second update vector to obtain the emotional information included in the target text.

[0190] Optionally, Fig. 9 is a structural block diagram of a computer device according to Embodiment 7 of the present application. Fig. 9 As shown, the computer device A may include: one or more (only one is shown in the figure) processors 902, a memory 904, and a peripheral interface 906.

[0191] Among them, the memory can be used to store software programs and modules, such as program instructions / modules corresponding to the text analysis method and device in the embodiment of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned text analysis method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory may further include a memory remotely arranged relative to the processor, and these remote memories can be connected to the terminal A via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0192] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: obtain the first vector and the second vector in the target text, wherein the first vector is used to represent the entity information of the first product, and the second vector is used to represent the attribute information of the first product, and the first product is the product recorded in the target text; update the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector, wherein the second product is the product recorded in the preset text; update the second vector according to the attribute information of the second product to obtain a second update vector corresponding to the second vector; analyze the target text according to the first update vector and the second update vector to obtain the emotional information included in the target text.

[0193] Optionally, the processor may also execute the following program code steps: segmenting the target text to obtain multiple words; determining entity words for representing entity information and attribute words for representing attribute information among the multiple words; vectorizing the entity words to obtain a first vector; and vectorizing the attribute words to obtain a second vector.

[0194] Optionally, the processor may also execute the following program code steps: determining the input vector corresponding to the first vector in this iteration; determining the weight of the first vector in the first update vector based on the entity information of the second product; determining the supplementary vector corresponding to the first vector in this iteration based on the entity information of the second product; and updating the corresponding input vector in this iteration based on the supplementary vector and the weight to obtain a first update vector.

[0195] Optionally, the processor may also execute the following program code steps: determining a context vector used to represent the context information of the target text in the previous iteration based on the first update vector obtained in the previous iteration, the second update vector obtained in the previous iteration, and a set of word vectors in the target text; determining the sum of the first update vector obtained in the previous iteration and the context vector in the previous iteration as the input vector corresponding to the first vector in this iteration.

[0196] Optionally, the processor may further execute a program code of the following steps: during the first iteration, when the target text includes a plurality of first vectors, determining a mean value of the plurality of first vectors as the input vector.

[0197] Optionally, the processor may also execute program code for the following steps: obtaining the number of times the first vector appears in a training data set; determining the average number of times the entity vector appears in the training data set; determining a first numerical value with a natural constant as the base and the ratio of the number of times the first vector appears in the training data set to the average number of times as the exponent; determining the ratio of a preset value to the first numerical value as a second numerical value; and determining the difference between the preset value and the second numerical value as the weight of the first vector in the first update vector.

[0198] Optionally, the processor may also execute the following program code steps: obtaining a similarity parameter for each entity vector in a training data set, wherein the similarity parameter is used to indicate the degree of similarity between the entity vector and the first vector; obtaining a first product of each entity vector and the corresponding similarity parameter; and determining the sum of the first products corresponding to each entity vector in the training data set as a supplementary vector.

[0199] Optionally, the processor may also execute the following program code steps: determining the weight of the entity vector in the training data set and the second product of the entity vector; concatenating the second product with the input vector of this iteration and passing it through a preset perceptron to obtain a perception result; and determining a similarity parameter corresponding to the entity vector based on the perception result.

[0200] Optionally, the processor may also execute the following program code steps: obtaining a third product of the weight and the input vector of this iteration; obtaining a difference between the preset value and the weight, and obtaining a fourth product of the difference and the supplementary vector; and determining the sum of the third product and the fourth product as the first update vector.

[0201] Optionally, the target text includes at least one or more of the following: user original content, evaluation information on a preset object, and instructions for use of the preset object.

[0202] By adopting the embodiment of the present invention, a scheme for sentiment analysis of text is provided. A first vector for representing entity information and a second vector for representing attribute information in the target text are obtained, and the first vector and the second vector are respectively updated based on the entity information and attribute information of other products, and finally the target text is subjected to sentiment analysis based on the updated result to obtain the sentiment analysis result of the target text. The above scheme takes into account the impact of the cold start problem on sentiment analysis, and proposes an extensible framework to solve the sentiment analysis task. By introducing the entity information and attribute information of other products to enhance the representation learning of entities and attributes in the target text, the accuracy of sentiment analysis can be improved when there is less training data, which solves the technical problem of inaccurate sentiment analysis of text in the prior art when there is less training data for the sentiment prediction model.

[0203] It can be understood by those skilled in the art that Fig. 9 The structure shown is for illustration only, and the computer device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a handheld computer, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Fig. 9 The structure of the electronic device is not limited. For example, the computer device 90 may also include Fig. 9 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Fig. 9 Different configurations are shown.

[0204] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0205] Example 8

[0206] The embodiment of the present invention further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the text analysis method provided in the first embodiment.

[0207] Optionally, in this embodiment, the above storage medium may be located in any one of the computer devices in the computer device group in the computer network, or in any one of the mobile terminals in the mobile terminal group.

[0208] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: obtaining a first vector and a second vector in a target text, wherein the first vector is used to represent entity information of a first product, and the second vector is used to represent attribute information of the first product, and the first product is a product recorded in the target text; updating the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector, wherein the second product is a product recorded in a preset text; updating the second vector according to the attribute information of the second product to obtain a second update vector corresponding to the second vector; analyzing the target text according to the first update vector and the second update vector to obtain the emotional information included in the target text.

[0209] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0210] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0211] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0212] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0213] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0214] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0215] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A text analysis method, characterized in that: include: Acquire a first vector and a second vector in the target text, wherein the first vector is used to represent entity information of a first product, and the second vector is used to represent attribute information of the first product, and the first product is a product recorded in the target text; The first vector is updated according to the entity information of the second product to obtain a first update vector corresponding to the first vector, wherein the second product is a product recorded in the preset text; updating the second vector according to the attribute information of the second product to obtain a second updated vector corresponding to the second vector; Analyzing the target text according to the first update vector and the second update vector to obtain sentiment information included in the target text; The updating of the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector includes: superimposing the entity vector of the second product on the first vector to obtain the first update vector, wherein the entity vector is used to represent the entity information of the second product; The second vector is updated according to the attribute information of the second product to obtain a second update vector corresponding to the second vector, including: superimposing the attribute vector of the second product to the second vector to obtain the second update vector, wherein the attribute vector is used to represent the attribute information of the second product.

2. The method according to claim 1, characterized in that Get the first vector and the second vector in the target text, including: Segmenting the target text to obtain multiple words; Determining an entity word for representing the entity information and an attribute word for representing the attribute information among the plurality of words; Performing vectorization processing on the entity word to obtain the first vector; The attribute word is vectorized to obtain the second vector.

3. The method according to claim 1, characterized in that Updating the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector includes: iteratively updating the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector; The iterative updating of the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector includes: Determine an input vector corresponding to the first vector in this iteration, wherein the input vector is an initial vector of the first vector, or is determined based on a first update vector obtained in a previous iteration; determining a weight of the first vector in the first update vector according to the entity information of the second product; Determine a supplementary vector corresponding to the first vector in this iteration according to the entity information of the second product, wherein the supplementary vector is the sum of the products of each entity vector and the corresponding similarity parameter; The input vector corresponding to this iteration is updated according to the supplementary vector and the weight to obtain the first updated vector.

4. The method according to claim 3, characterized in that Determining an input vector corresponding to the first vector in this iteration includes: Determine a context vector used to represent context information of the target text in the previous iteration according to the first update vector obtained in the previous iteration, the second update vector obtained in the previous iteration, and the word vector set in the target text; It is determined that the sum of the first update vector obtained in the previous iteration and the context vector in the previous iteration is the input vector corresponding to the first vector in this iteration.

5. The method according to claim 3, characterized in that: When performing the first iteration, determining the input vector corresponding to the first vector in this iteration includes: In the case that the target text includes a plurality of first vectors, a mean value of the plurality of first vectors is determined as the input vector.

6. The method according to claim 3, characterized in that Determining the weight of the first vector in the first update vector according to the entity information of the second product includes: Obtaining the number of times the first vector appears in the training data set; Determine the average number of occurrences of entity vectors in the training dataset; Determine a first value by taking the natural constant as the base and the ratio of the number of times the first vector appears in the training data set to the average number of times as the exponent; Determine a ratio of a preset value to the first value as a second value; A difference between a preset value and the second value is determined as a weight of the first vector in the first update vector.

7. The method according to claim 3, characterized in that Determining a supplementary vector corresponding to the first vector in this iteration according to the entity information of the second product includes: Obtaining a similarity parameter of each entity vector in the training data set, wherein the similarity parameter is used to indicate the degree of similarity between the entity vector and the first vector; Obtaining a first product of each entity vector and a corresponding similarity parameter; The sum of the first products corresponding to each entity vector in the training data set is determined as the supplementary vector.

8. The method according to claim 7, characterized in that Get the similarity parameters of each entity vector in the training dataset, including: Determine a second product of a weight of an entity vector in the training data set and the entity vector; The second product is concatenated with the input vector of this iteration and then passed through a preset perceptron to obtain a perception result; A similarity parameter corresponding to the entity vector is determined based on the perception result.

9. The method according to claim 3, characterized in that: The step of updating the input vector corresponding to the iteration according to the supplementary vector and the weight to obtain the first updated vector includes: Obtaining a third product of the weight and the input vector of this iteration; Obtaining a difference between a preset value and the weight, and obtaining a fourth product of the difference and the supplemental vector; A sum of the third product and the fourth product is determined as the first update vector.

10. The method according to claim 1, characterized in that The target text includes at least one or more of the following: user original content, evaluation information on a preset object, and instructions for use of the preset object.

11. A text analysis method comprising: Displaying the acquired target text, wherein the target text includes entity information of a first product and attribute information of the product, and the first product is the product recorded in the target text; Acquire a first vector and a second vector in the target text, wherein the first vector is used to represent entity information of the first product, and the second vector is used to represent attribute information of the first product; The first vector is updated according to the entity information of the second product to obtain a first update vector corresponding to the first vector, wherein the second product is a product recorded in the preset text; updating the second vector according to the attribute information of the second product to obtain a second updated vector corresponding to the second vector; Analyzing the target text according to the first update vector and the second update vector, and outputting the sentiment information included in the target text; The updating of the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector includes: superimposing the entity vector of the second product on the first vector to obtain the first update vector, wherein the entity vector is used to represent the entity information of the second product; The second vector is updated according to the attribute information of the second product to obtain a second update vector corresponding to the second vector, including: superimposing the attribute vector of the second product to the second vector to obtain the second update vector, wherein the attribute vector is used to represent the attribute information of the second product.

12. The method according to claim 11, characterized in that Updating the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector includes: iteratively updating the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector; The iterative updating of the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector includes: Determine an input vector corresponding to the first vector in this iteration, wherein the input vector is an initial vector of the first vector, or is determined based on a first update vector obtained in a previous iteration; determining a weight of the first vector in the first update vector according to the entity information of the second product; Determine a supplementary vector corresponding to the first vector in this iteration according to the entity information of the second product, wherein the supplementary vector is the sum of the products of each entity vector and the corresponding similarity parameter; The input vector corresponding to this iteration is updated according to the supplementary vector and the weight to obtain the first updated vector.

13. A text analysis method, characterized in that: include: Acquire evaluation information of a first product, wherein the evaluation information includes entity information of the first product and attribute information of the first product, and the first product is the product evaluated by the evaluation information; Acquire a first vector and a second vector in the evaluation information, wherein the first vector is used to represent entity information of the first product, and the second vector is used to represent attribute information of the first product; The first vector is updated according to the entity information of the second product to obtain a first update vector corresponding to the first vector, wherein the second product is a product recorded in the preset text; updating the second vector according to the attribute information of the second product to obtain a second updated vector corresponding to the second vector; Analyzing the evaluation information according to the first update vector and the second update vector to obtain the emotion information included in the evaluation information; The updating of the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector includes: superimposing the entity vector of the second product on the first vector to obtain the first update vector, wherein the entity vector is used to represent the entity information of the second product; The second vector is updated according to the attribute information of the second product to obtain a second update vector corresponding to the second vector, including: superimposing the attribute vector of the second product to the second vector to obtain the second update vector, wherein the attribute vector is used to represent the attribute information of the second product.

14. The method according to claim 13, characterized in that Updating the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector includes: iteratively updating the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector; The iterative updating of the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector includes: Determine an input vector corresponding to the first vector in this iteration, wherein the input vector is an initial vector of the first vector, or is determined based on a first update vector obtained in a previous iteration; determining a weight of the first vector in the first update vector according to the entity information of the second product; Determine a supplementary vector corresponding to the first vector in this iteration according to the entity information of the second product, wherein the supplementary vector is the sum of the products of each entity vector and the corresponding similarity parameter; The input vector corresponding to this iteration is updated according to the supplementary vector and the weight to obtain the first updated vector.

15. A text analysis device, characterized in that: include: An acquisition module, used to acquire a first vector and a second vector in a target text, wherein the first vector is used to represent entity information of a first product, and the second vector is used to represent attribute information of the first product, and the first product is a product recorded in the target text; A first updating module, configured to update the first vector according to entity information of a second product to obtain a first update vector corresponding to the first vector, wherein the second product is a product recorded in a preset text; A second updating module, configured to update the second vector according to the attribute information of the second product to obtain a second updated vector corresponding to the second vector; An analysis module, configured to analyze the target text according to the first update vector and the second update vector to obtain the sentiment information included in the target text; The first updating module is further used for: superimposing the entity vector of the second product onto the first vector to obtain the first updated vector, wherein the entity vector is used to represent the entity information of the second product; The second updating module is further used for: superimposing the attribute vector of the second product onto the second vector to obtain the second updated vector, wherein the attribute vector is used to represent the attribute information of the second product.

16. The device according to claim 15, characterized in that The first updating module includes: a first updating submodule, configured to iteratively update the first vector according to the entity information of the second product to obtain a first update vector corresponding to the first vector; Wherein, the first updating submodule includes: A first determining unit, configured to determine an input vector corresponding to the first vector in this iteration, wherein the input vector is an initial vector of the first vector, or is determined based on a first update vector obtained in a previous iteration; a second determining unit, configured to determine a weight of the first vector in the first update vector according to the entity information of the second product; A third determining unit, configured to determine a supplementary vector corresponding to the first vector in this iteration according to the entity information of the second product, wherein the supplementary vector is the sum of the products of each entity vector and the corresponding similarity parameter; An updating unit is used to update the input vector corresponding to this iteration according to the supplementary vector and the weight to obtain the first updated vector.

17. The device according to claim 16, characterized in that The second determining unit includes: A first acquisition subunit, used to acquire the number of times the first vector appears in the training data set; A first determination subunit is used to determine the average number of occurrences of entity vectors in the training data set; A second determining subunit is used to determine a first value with a natural constant as a base and a ratio of the number of times the first vector appears in the training data set to the average number of times as an exponent; A third determining subunit, configured to determine that a ratio of a preset value to the first value is a second value; The fourth determining subunit is used to determine the difference between a preset value and the second value as the weight of the first vector in the first update vector.

18. The device according to claim 16, characterized in that The third determining unit includes: A second acquisition subunit is used to acquire a similarity parameter of each entity vector in the training data set, wherein the similarity parameter is used to represent the degree of similarity between the entity vector and the first vector; A third acquisition subunit, configured to acquire a first product of each entity vector and a corresponding similarity parameter; The fifth determining subunit is used to determine the sum of the first products corresponding to each entity vector in the training data set as the supplementary vector.

19. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to perform the following steps: Acquire a first vector and a second vector in the target text, wherein the first vector is used to represent entity information of a first product, and the second vector is used to represent attribute information of the first product, and the first product is a product recorded in the target text; The first vector is updated according to the entity information of the second product to obtain a first update vector corresponding to the first vector, wherein the second product is a product recorded in the preset text; updating the second vector according to the attribute information of the second product to obtain a second updated vector corresponding to the second vector; Analyzing the target text according to the first update vector and the second update vector to obtain sentiment information included in the target text; Wherein, when the program is running, the device where the storage medium is located is also controlled to execute the following steps: superimposing the entity vector of the second product to the first vector to obtain the first update vector, wherein the entity vector is used to represent the entity information of the second product; superimposing the attribute vector of the second product to the second vector to obtain the second update vector, wherein the attribute vector is used to represent the attribute information of the second product.

20. A processor, characterized in that: The processor is used to run a program, wherein the following steps are performed when the program is run: Acquire a first vector and a second vector in the target text, wherein the first vector is used to represent entity information of a first product, and the second vector is used to represent attribute information of the first product, and the first product is a product recorded in the target text; The first vector is updated according to the entity information of the second product to obtain a first update vector corresponding to the first vector, wherein the second product is a product recorded in the preset text; updating the second vector according to the attribute information of the second product to obtain a second updated vector corresponding to the second vector; Analyzing the target text according to the first update vector and the second update vector to obtain sentiment information included in the target text; When the program is running, the following steps are also performed: superimposing the entity vector of the second product to the first vector to obtain the first update vector, wherein the entity vector is used to represent the entity information of the second product; superimposing the attribute vector of the second product to the second vector to obtain the second update vector, wherein the attribute vector is used to represent the attribute information of the second product.

Citation Information

Patent Citations

  • Internet product research system based on data mining

    CN103678564A

  • Analytic method, apparatus and system for internet comments of household electrical appliance products

    CN105354183A