WO2022141861A1 - Emotion classification method and apparatus, electronic device, and storage medium - Google Patents
Emotion classification method and apparatus, electronic device, and storage medium Download PDFInfo
- Publication number
- WO2022141861A1 WO2022141861A1 PCT/CN2021/083713 CN2021083713W WO2022141861A1 WO 2022141861 A1 WO2022141861 A1 WO 2022141861A1 CN 2021083713 W CN2021083713 W CN 2021083713W WO 2022141861 A1 WO2022141861 A1 WO 2022141861A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- word vector
- preset
- semantic
- value
- initial
- Prior art date
Links
- 230000008451 emotion Effects 0.000 title claims abstract description 57
- 238000000034 method Methods 0.000 title claims abstract description 43
- 239000013598 vector Substances 0.000 claims abstract description 231
- 238000012545 processing Methods 0.000 claims abstract description 58
- 230000002457 bidirectional effect Effects 0.000 claims abstract description 39
- 238000004364 calculation method Methods 0.000 claims abstract description 36
- 230000006403 short-term memory Effects 0.000 claims abstract description 26
- 238000007781 pre-processing Methods 0.000 claims abstract description 25
- 230000007246 mechanism Effects 0.000 claims abstract description 19
- 238000012216 screening Methods 0.000 claims abstract description 5
- 238000012549 training Methods 0.000 claims description 26
- 230000015654 memory Effects 0.000 claims description 22
- 230000004913 activation Effects 0.000 claims description 21
- 230000006870 function Effects 0.000 claims description 19
- 230000007787 long-term memory Effects 0.000 claims description 17
- 239000011159 matrix material Substances 0.000 claims description 14
- 230000008569 process Effects 0.000 claims description 13
- 238000004458 analytical method Methods 0.000 claims description 8
- 238000004590 computer program Methods 0.000 claims description 7
- 230000011218 segmentation Effects 0.000 claims description 6
- 230000007935 neutral effect Effects 0.000 claims description 4
- 238000001914 filtration Methods 0.000 claims 1
- 238000005516 engineering process Methods 0.000 abstract description 4
- 230000000630 rising effect Effects 0.000 description 6
- 238000007726 management method Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 238000013528 artificial neural network Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 230000000306 recurrent effect Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000002996 emotional effect Effects 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000012552 review Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/35—Clustering; Classification
- G06F16/353—Clustering; Classification into predefined classes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/20—Natural language analysis
- G06F40/279—Recognition of textual entities
- G06F40/284—Lexical analysis, e.g. tokenisation or collocates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/30—Semantic analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/044—Recurrent networks, e.g. Hopfield networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
Definitions
- the present application relates to the technical field of intelligent decision-making, and in particular, to an emotion classification method, apparatus, electronic device, and computer-readable storage medium.
- the inventor realizes that the existing sentiment classification methods are based on traditional machine learning methods, which cannot extract deeper contextual semantics and structural features, resulting in incomplete or incomplete keyword extraction, thereby reducing the accuracy of sentiment classification.
- a sentiment classification method including:
- An emotion classification device includes:
- a text preprocessing module used to obtain original text data, perform text preprocessing on the original text data, and obtain an initial word set
- a vectorization module configured to perform encoding processing on the initial word set to obtain an integer code, and perform vectorization processing on the initial word set according to the integer encoding to obtain a standard word vector set;
- a bidirectional semantic module used for performing bidirectional semantic processing on the standard word vector set by using a preset text training model to obtain a semantic word vector set
- a classification module used for screening the semantic word vector set by using a preset long-term and short-term memory network to obtain a target text sequence, and performing probability calculation on the target text sequence according to a preset attention mechanism to obtain a probability value, A sentiment classification result is obtained by analyzing the probability value.
- An electronic device comprising:
- a processor that executes the instructions stored in the memory to achieve the following steps:
- a computer-readable storage medium having at least one instruction stored in the computer-readable storage medium, the at least one instruction being executed by a processor in an electronic device to implement the following steps:
- This application can solve the problem of low accuracy of sentiment classification.
- FIG. 1 is a schematic flowchart of an emotion classification method provided by an embodiment of the present application.
- FIG. 2 is a functional block diagram of an emotion classification device provided by an embodiment of the present application.
- FIG. 3 is a schematic structural diagram of an electronic device implementing the emotion classification method according to an embodiment of the present application.
- the embodiment of the present application provides an emotion classification method.
- the execution subject of the emotion classification method includes, but is not limited to, at least one of electronic devices that can be configured to execute the method provided by the embodiments of the present application, such as a server, a terminal, and the like.
- the emotion classification method can be executed by software or hardware installed in a terminal device or a server device, and the software can be a blockchain platform.
- the server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
- the emotion classification method includes:
- the original text data may be chapter-level text.
- the original text data is real estate-related news articles.
- the news articles can be crawled from real estate-related news sites by using python technology.
- the original text data may also be news articles in other fields, for example, news articles related to e-commerce, news articles related to the medical field.
- performing text preprocessing on the original text data to obtain an initial set of words including:
- a word segmentation process is performed on the stop-removing sentence set to obtain an initial word set.
- the key sentences in the original text data include at least two of the title, the first sentence, the last sentence, and the middle key sentence in the original text data.
- the intermediate key sentence may be the sentence after the conjunction, for example, if the conjunction "then" is detected, the sentence after the conjunction is used as the key sentence.
- the key sentences in the original text data are the first and last sentences and the middle key sentences of real estate-related news articles.
- the process of removing stop words is to use a preset stop word table to remove words that have no actual meaning in the key sentences in the key sentence set. For example, words such as "ah” and "de” in each key sentence in the key sentence set are deleted.
- the stop word table may be the obtained "HIT stop word database” and "Sichuan University machine learning intelligent laboratory stop word database", or the stop word table may also be preset.
- one of the embodiments of the present application may use the Jieba tool to perform word segmentation on each sentence in the stop-stop sentence set, and split each sentence into multiple words to obtain an initial word set.
- the encoding process performed on the initial word set to obtain an integer code includes:
- Encoding and naming processing is performed on the categorical variables to obtain integer codes.
- the classification variable of the initial word refers to the category to which the initial word belongs, and determining the classification variable of the initial word set is to analyze the category to which the initial word in the initial word set belongs.
- the coding process for the categorical variable is to perform coding and identification according to different categories of the categorical variable. For example, the first categorical variable is identified as 0, and the second categorical variable is identified as 1, to identify the third categorical variable as 2.
- the initial word set includes ["house price”, “rising”, “falling”, “rising”], and it is determined that the classification variables in the initial word set are house price, rising and falling, a total of three categories, Integer encoding is performed on the classification vector, so that the house price is 0, the increase is 1, and the decrease is 2, and the standard word vector set can be obtained as [1, 0, 0], [0, 1, 0], [0, 0, 1], [0, 1, 0].
- the initial word set is vectorized according to the integer code to obtain a standard word vector set, including:
- the initial words in the initial word set are arranged vertically with the target point as the benchmark, and the categorical variables are arranged horizontally in the order of the integer coding based on the target point;
- intersection points between the words corresponding to the horizontally arranged categorical variables and the vertically arranged initial words are the same, let the intersection be the first value.
- the intersections between words are not the same, let the intersection be the second value to obtain the result matrix;
- a vector formed by the first numerical value and the second numerical value in the result matrix is extracted to obtain a standard word vector set.
- the resulting matrix is Then extract values from the result matrix in row or column order to obtain multiple vectors [1, 0, 0], [0, 1, 0], [0, 0, 1], then the standard word vector set consists of the multiple vectors. composed of vectors.
- a preset text training model is used to perform bidirectional semantic processing on the standard word vector set, wherein the structure of the text training model consists of a three-layer Bi-LSTM (Bi-directional Long Short-Term Memory, bidirectional long short-term memory) network.
- Bi-LSTM Bi-directional Long Short-Term Memory, bidirectional long short-term memory
- the forward vector formula and the backward vector formula include:
- the bidirectional semantic calculation formula includes:
- h t is the semantic word vector, represents the forward vector, Represents the backward vector, U is the second variable in the Bi-LSTM network, and c is the preset parameter.
- the text training model contains three layers of Bi-LSTM networks
- the same standard word vector can be extracted layer by layer in the text training model to three word vectors and added as new features to subsequent tasks to participate in training. , so as to realize the dynamic update of the word vector.
- the input value of the first layer of Bi-LSTM network is a standard word vector
- the input of the second and third layers of Bi-LSTM network corresponds to the word vector output by the corresponding position of the previous layer.
- S4 Use a preset long-term and short-term memory network to screen the semantic word vector set to obtain a target text sequence, and perform probability calculation on the target text sequence according to a preset attention mechanism to obtain a probability value.
- the probability value is analyzed to obtain the sentiment classification result.
- the LSTM network Long Short-Term Memory, long short-term memory network
- the LSTM network is a time recurrent neural network, including: an input gate, a forget gate, and an output gate.
- the use of the preset long-term and short-term memory network to screen the semantic word vector set to obtain the target text sequence including:
- Step A Calculate the state value of the semantic word vector in the semantic word vector set through the input gate
- Step B calculating the activation value of the semantic word vector in the semantic word vector set through the forgetting gate
- Step C Calculate the state update value of the semantic word vector according to the state value and the activation value
- Step D using the output gate to calculate the initial text sequence corresponding to the state update value
- Step E Calculate the loss value of the initial text sequence and the preset real label according to a preset loss function, and when the loss value is less than a preset threshold, determine that the initial text sequence is the target text of the semantic word vector sequence.
- the calculation method of the state value includes:
- i t represents the state value, represents the bias of the cell unit in the input gate
- w i represents the activation factor of the input gate
- h t-1 represents the peak value of the semantic word vector at time t-1 of the input gate
- x t represents the semantic word vector at time t
- b i Represents the weights of the cell units in the input gate.
- the calculation method of the activation value includes:
- f t represents the activation value
- w f represents the activation factor of the forget gate
- x t represents the semantic word vector input at time t
- b f represents the weight of the cell unit in the forgetting gate
- the method for calculating the state update value includes:
- c t represents the state update value
- h t-1 represents the peak value of the semantic word vector at the time of input gate t-1
- the calculating the initial text sequence corresponding to the state update value by using the output gate includes: calculating the initial text sequence by using the following formula:
- o t represents the initial text sequence
- tan h represents the activation function of the output gate
- c t represents the state update value
- performing probability calculation on the target text sequence according to the preset attention mechanism and obtaining a probability value, and analyzing the probability value to obtain a sentiment classification result including:
- the probability value is less than a preset first probability value and greater than a preset second probability value, determine that the emotion classification result is a negative emotion
- the probability value is less than a preset second probability value, it is determined that the emotion classification result is a neutral emotion.
- the preset weight coefficient formula includes:
- h t is the hidden unit in the LSTM network
- W, V and U are the variables in the LSTM
- tanh is the activation function
- exp is the exponential function
- t is the number of texts in the target sequence
- s is the preset parameter in the LSTM network
- o t is the target text sequence.
- weight coefficient to calculate the context sequence of the target text sequence, including:
- ct is the context sequence
- ats is the weight coefficient
- o t is the target text sequence
- s is the preset parameter in the LSTM network.
- calculating the probability value corresponding to the target text sequence according to the context sequence and a preset probability calculation formula includes:
- the probability calculation formula is:
- y t is the probability value
- c t is the state update value
- the present application obtains a standard word vector set by preprocessing and vectorizing the original text data, and then performs bidirectional semantic processing on the standard word vector set to obtain a semantic word vector set.
- the bidirectional semantic processing can capture standard words
- the forward information and backward information of the vector make the obtained semantic word vector contain the semantic information of the context, which enhances the comprehensiveness and richness of the extracted semantic information, which is beneficial to improve the accuracy of text sentiment classification. Therefore, the emotion classification method proposed in this application can solve the problem of low accuracy of emotion classification.
- FIG. 2 it is a functional block diagram of an emotion classification apparatus provided by an embodiment of the present application.
- the emotion classification apparatus 100 described in this application may be installed in an electronic device. According to the implemented functions, the emotion classification apparatus 100 may include a text preprocessing module 101 , a vectorization module 102 , a bidirectional semantic module 103 and a classification module 104 .
- the modules described in this application may also be referred to as units, which refer to a series of computer program segments that can be executed by the processor of the electronic device and can perform fixed functions, and are stored in the memory of the electronic device.
- each module/unit is as follows:
- the text preprocessing module 101 is used for acquiring original text data, and performing text preprocessing on the original text data to obtain an initial word set;
- the vectorization module 102 is configured to perform encoding processing on the initial word set to obtain an integer code, and perform vectorization processing on the initial word set according to the integer encoding to obtain a standard word vector set;
- the bidirectional semantic module 103 is configured to perform bidirectional semantic processing on the standard word vector set by using a preset text training model to obtain a semantic word vector set;
- the classification module 104 is used for screening the semantic word vector set by using a preset long-term and short-term memory network to obtain a target text sequence, and performing probability calculation on the target text sequence according to a preset attention mechanism and obtaining The probability value is analyzed to obtain a sentiment classification result. .
- the text preprocessing module 101 is used for acquiring original text data, and performing text preprocessing on the original text data to obtain an initial word set.
- the original text data may be chapter-level text.
- the original text data is real estate-related news articles.
- the news articles can be crawled from real estate-related news sites by using python technology.
- the original text data may also be news articles in other fields, for example, news articles related to e-commerce, news articles related to the medical field.
- the text preprocessing module 101 is specifically used for:
- a word segmentation process is performed on the stop-removing sentence set to obtain an initial word set.
- the key sentences in the original text data include at least two of the title, the first sentence, the last sentence, and the middle key sentence in the original text data.
- the intermediate key sentence may be the sentence after the conjunction, for example, if the conjunction "then" is detected, the sentence after the conjunction is used as the key sentence.
- the key sentences in the original text data are the first and last sentences and the middle key sentences of real estate-related news articles.
- the process of removing stop words is to use a preset stop word table to remove words that have no actual meaning in the key sentences in the key sentence set. For example, words such as "ah” and "de” in each key sentence in the key sentence set are deleted.
- the stop word table may be the obtained "HIT stop word database” and "Sichuan University machine learning intelligent laboratory stop word database", or the stop word table may also be preset.
- one of the embodiments of the present application may use the Jieba tool to perform word segmentation on each sentence in the stop-stop sentence set, and split each sentence into multiple words to obtain an initial word set.
- the vectorization module 102 is configured to perform encoding processing on the initial word set to obtain an integer code, and perform vectorization processing on the initial word set according to the integer encoding to obtain a standard word vector set.
- the vectorization module 102 is specifically configured to:
- Encoding and naming processing is performed on the categorical variables to obtain integer codes.
- the classification variable of the initial word refers to the category to which the initial word belongs, and determining the classification variable of the initial word set is to analyze the category to which the initial word in the initial word set belongs.
- the coding process for the categorical variable is to perform coding and identification according to different categories of the categorical variable, for example, the first categorical variable is identified as 0, and the second categorical variable is identified as 1, to identify the third categorical variable as 2.
- the initial word set includes ["house price”, “rising”, “falling”, “rising”], and it is determined that the classification variables in the initial word set are house price, rising and falling, a total of three categories, Integer encoding is performed on the classification vector, so that the house price is 0, the increase is 1, and the decrease is 2, and the standard word vector set can be obtained as [1, 0, 0], [0, 1, 0], [0, 0, 1], [0, 1, 0].
- performing vectorization on the initial word set according to the integer code to obtain a standard word vector set including:
- the initial words in the initial word set are arranged vertically with the target point as a benchmark, and the categorical variables are arranged horizontally according to the order of the integer coding on the basis of the target point;
- intersection points between the words corresponding to the horizontally arranged categorical variables and the vertically arranged initial words are the same, let the intersection be the first value.
- the intersections between words are not the same, let the intersection be the second value to obtain the result matrix;
- a vector formed by the first numerical value and the second numerical value in the result matrix is extracted to obtain a standard word vector set.
- the resulting matrix is Then extract values from the result matrix in row or column order to obtain multiple vectors [1, 0, 0], [0, 1, 0], [0, 0, 1], then the standard word vector set consists of the multiple vectors. composed of vectors.
- the bidirectional semantic module 103 is configured to perform bidirectional semantic processing on the standard word vector set by using a preset text training model to obtain a semantic word vector set.
- a preset text training model is used to perform bidirectional semantic processing on the standard word vector set, wherein the structure of the text training model consists of a three-layer Bi-LSTM (Bi-directional Long Short-Term Memory, bidirectional long short-term memory) network.
- Bi-LSTM Bi-directional Long Short-Term Memory, bidirectional long short-term memory
- the bidirectional semantic module 103 is specifically used for:
- the forward vector formula and the backward vector formula include:
- the bidirectional semantic calculation formula includes:
- h t is the semantic word vector, represents the forward vector, Represents the backward vector, U is the second variable in the Bi-LSTM network, and c is the preset parameter.
- the text training model contains three layers of Bi-LSTM networks
- the same standard word vector can be extracted layer by layer in the text training model to three word vectors and added as new features to subsequent tasks to participate in training. , so as to realize the dynamic update of the word vector.
- the input value of the first layer of Bi-LSTM network is a standard word vector
- the input of the second and third layers of Bi-LSTM network corresponds to the word vector output by the corresponding position of the previous layer.
- the classification module 104 is configured to perform screening processing on the semantic word vector set by using a preset long and short-term memory network to obtain a target text sequence, and perform probability calculation on the target text sequence according to a preset attention mechanism and obtain the target text sequence. The probability value is analyzed to obtain a sentiment classification result.
- the LSTM (Long Short-Term Memory, long short-term memory network) network is a time recurrent neural network, including: an input gate, a forget gate, and an output gate.
- the classification module 104 is specifically used for:
- the loss value of the initial text sequence and the preset real label is calculated, and when the loss value is less than the preset threshold, it is determined that the initial text sequence is the target text sequence of the semantic word vector.
- the calculation method of the state value includes:
- i t represents the state value, represents the bias of the cell unit in the input gate
- w i represents the activation factor of the input gate
- h t-1 represents the peak value of the semantic word vector at time t-1 of the input gate
- x t represents the semantic word vector at time t
- b i Represents the weights of the cell units in the input gate.
- the calculation method of the activation value includes:
- f t represents the activation value
- w f represents the activation factor of the forget gate
- x t represents the semantic word vector input at time t
- b f represents the weight of the cell unit in the forgetting gate
- the method for calculating the state update value includes:
- c t represents the state update value
- h t-1 represents the peak value of the semantic word vector at the time of input gate t-1
- the calculating the initial text sequence corresponding to the state update value by using the output gate includes: calculating the initial text sequence by using the following formula:
- o t represents the initial text sequence
- tan h represents the activation function of the output gate
- c t represents the state update value
- performing probability calculation on the target text sequence according to the preset attention mechanism and obtaining a probability value, and analyzing the probability value to obtain a sentiment classification result including:
- the probability value is less than a preset first probability value and greater than a preset second probability value, determine that the emotion classification result is a negative emotion
- the probability value is less than a preset second probability value, it is determined that the emotion classification result is a neutral emotion.
- the preset weight coefficient formula includes:
- h t is the hidden unit in the LSTM network
- W, V and U are the variables in the LSTM
- tanh is the activation function
- exp is the exponential function
- t is the number of texts in the target sequence
- s is the preset parameter in the LSTM network
- o t is the target text sequence.
- weight coefficient to calculate the context sequence of the target text sequence, including:
- ct is the context sequence
- ats is the weight coefficient
- o t is the target text sequence
- s is the preset parameter in the LSTM network.
- calculating the probability value corresponding to the target text sequence according to the context sequence and a preset probability calculation formula includes:
- the probability calculation formula is:
- y t is the probability value
- c t is the state update value
- the present application obtains a standard word vector set by preprocessing and vectorizing the original text data, and then performs bidirectional semantic processing on the standard word vector set to obtain a semantic word vector set.
- the bidirectional semantic processing can capture standard words
- the forward information and backward information of the vector make the obtained semantic word vector contain the semantic information of the context, which enhances the comprehensiveness and richness of the extracted semantic information, which is beneficial to improve the accuracy of text sentiment classification. Therefore, the emotion classification device proposed in this application can solve the problem of low accuracy of emotion classification.
- FIG. 3 it is a schematic structural diagram of an electronic device for implementing an emotion classification method provided by an embodiment of the present application.
- the electronic device 1 may include a processor 10, a memory 11 and a bus, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as an emotion classification program 12.
- the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, magnetic disk, CD etc.
- the memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, such as a mobile hard disk of the electronic device 1 .
- the memory 11 may also be an external storage device of the electronic device 1, such as a pluggable mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital) equipped on the electronic device 1. , SD) card, flash memory card (Flash Card), etc.
- the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
- the memory 11 can not only be used to store application software installed in the electronic device 1 and various types of data, such as the code of the emotion classification program 12, etc., but also can be used to temporarily store data that has been output or will be output.
- the processor 10 may be composed of integrated circuits, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits packaged with the same function or different functions, including one or more integrated circuits.
- Central Processing Unit CPU
- microprocessor digital processing chip
- graphics processor and combination of various control chips, etc.
- the processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect the various components of the entire electronic device, by running or executing the programs or modules (such as emotion) stored in the memory 11. classification programs, etc.), and call data stored in the memory 11 to perform various functions of the electronic device 1 and process data.
- the bus may be a peripheral component interconnect (PCI for short) bus or an extended industry standard architecture (Extended industry standard architecture, EISA for short) bus or the like.
- PCI peripheral component interconnect
- EISA Extended industry standard architecture
- the bus can be divided into address bus, data bus, control bus and so on.
- the bus is configured to implement connection communication between the memory 11 and at least one processor 10 and the like.
- FIG. 3 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 3 does not constitute a limitation on the electronic device 1, and may include fewer or more components than those shown in the figure. components, or a combination of certain components, or a different arrangement of components.
- the electronic device 1 may also include a power supply (such as a battery) for powering the various components, preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that the power management
- the device implements functions such as charge management, discharge management, and power consumption management.
- the power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and any other components.
- the electronic device 1 may further include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
- the electronic device 1 may also include a network interface, optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
- a network interface optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
- the electronic device 1 may further include a user interface, and the user interface may be a display (Display), an input unit (eg, a keyboard (Keyboard)), optionally, the user interface may also be a standard wired interface or a wireless interface.
- the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, and the like.
- the display may also be appropriately called a display screen or a display unit, which is used for displaying information processed in the electronic device 1 and for displaying a visual user interface.
- the emotion classification program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions, and when running in the processor 10, it can realize:
- the modules/units integrated in the electronic device 1 may be stored in a computer-readable storage medium.
- the computer-readable storage medium may be volatile or non-volatile.
- the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a removable hard disk, a magnetic disk, an optical disc, a computer memory, a read-only memory (ROM, Read-Only). Memory).
- the present application also provides a computer-readable storage medium.
- the computer-readable storage medium may be volatile or non-volatile.
- the readable storage medium stores a computer program, and the computer program is stored in the When executed by the processor of the electronic device, it can achieve:
- modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
- each functional module in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
- the above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of hardware plus software function modules.
- the blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
- Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block.
- the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Biomedical Technology (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Evolutionary Computation (AREA)
- Biophysics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Life Sciences & Earth Sciences (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Databases & Information Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Machine Translation (AREA)
Abstract
An emotion classification method, comprising: acquiring original text data, and performing text preprocessing on the original text data to obtain an initial word set (S1); performing encoding processing on the initial word set to obtain an integer code, and performing vectorization processing on the initial word set according to the integer code to obtain a standard word vector set (S2); performing bidirectional semantic processing on the standard word vector set to obtain a semantic word vector set (S3); performing screening processing on the semantic word vector set using a preset long short-term memory network to obtain a target text sequence, performing probability calculation on the target text sequence according to a preset attention mechanism to obtain a probability value, and analyzing the probability value to obtain an emotion classification result (S4). In addition, the present invention further relates to blockchain technology, and the initial word set can be stored in a node of a blockchain. Further provided are an emotion classification apparatus, an electronic device, and a computer-readable storage medium, capable of solving the problem of low accuracy in emotion classification.
Description
本申请要求于2020年12月31日提交中国专利局、申请号为CN202011640369.0,发明名称为“情感分类方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number CN202011640369.0 and the invention titled "Emotion Classification Method, Device, Electronic Device and Storage Medium", which was submitted to the China Patent Office on December 31, 2020, the entire content of which is approved by Reference is incorporated in this application.
本申请涉及智能决策技术领域,尤其涉及一种情感分类方法、装置、电子设备及计算机可读存储介质。The present application relates to the technical field of intelligent decision-making, and in particular, to an emotion classification method, apparatus, electronic device, and computer-readable storage medium.
随着社交网络的不断兴起,互联网已不仅仅是人们获取日常信息的来源,同时也成为人们表达自己观点不可或缺的平台。人们在网络社区评论热点事件、抒写影评观点以及描述产品体验等,都会产生大量的带有情感色彩的文本信息,而对这些文本信息进行有效的情感分析,可以更好地了解用户的兴趣倾向和关注程度。With the continuous rise of social networks, the Internet has become not only a source for people to obtain daily information, but also an indispensable platform for people to express their opinions. People commenting on hot events, expressing movie reviews, and describing product experience in online communities will generate a large amount of textual information with emotional color. level of attention.
发明人意识到现有的情感分类方法是基于传统机器学习的方法来分类,无法提取到更深层的上下文语义和结构特征,导致关键词提取不全面或不完整进而降低情感分类的准确性。The inventor realizes that the existing sentiment classification methods are based on traditional machine learning methods, which cannot extract deeper contextual semantics and structural features, resulting in incomplete or incomplete keyword extraction, thereby reducing the accuracy of sentiment classification.
发明内容SUMMARY OF THE INVENTION
一种情感分类方法,包括:A sentiment classification method including:
获取原始文本数据,对所述原始文本数据进行文本预处理,得到初始字词集;Obtain original text data, and perform text preprocessing on the original text data to obtain an initial word set;
对所述初始字词集进行编码处理,得到整数编码,根据所述整数编码对所述初始字词集进行向量化处理,得到标准词向量集;Encoding the initial word set to obtain an integer code, and performing vectorization processing on the initial word set according to the integer encoding to obtain a standard word vector set;
利用预设的文本训练模型对所述标准词向量集进行双向语义处理,得到语义词向量集;Use a preset text training model to perform bidirectional semantic processing on the standard word vector set to obtain a semantic word vector set;
利用预设的长短期记忆网络对所述语义词向量集进行筛选处理,得到目标文本序列,根据预设的注意力机制对所述目标文本序列进行概率计算并得到概率值,对所述概率值进行分析得到情感分类结果。Use a preset long-term and short-term memory network to screen the semantic word vector set to obtain a target text sequence, and perform probability calculation on the target text sequence according to a preset attention mechanism to obtain a probability value. Perform analysis to obtain sentiment classification results.
一种情感分类装置,所述装置包括:An emotion classification device, the device includes:
文本预处理模块,用于获取原始文本数据,对所述原始文本数据进行文本预处理,得到初始字词集;a text preprocessing module, used to obtain original text data, perform text preprocessing on the original text data, and obtain an initial word set;
向量化模块,用于对所述初始字词集进行编码处理,得到整数编码,根据所述整数编码对所述初始字词集进行向量化处理,得到标准词向量集;A vectorization module, configured to perform encoding processing on the initial word set to obtain an integer code, and perform vectorization processing on the initial word set according to the integer encoding to obtain a standard word vector set;
双向语义模块,用于利用预设的文本训练模型对所述标准词向量集进行双向语义处理,得到语义词向量集;a bidirectional semantic module, used for performing bidirectional semantic processing on the standard word vector set by using a preset text training model to obtain a semantic word vector set;
分类模块,用于利用预设的长短期记忆网络对所述语义词向量集进行筛选处理,得到目标文本序列,根据预设的注意力机制对所述目标文本序列进行概率计算并得到概率值,对所述概率值进行分析得到情感分类结果。a classification module, used for screening the semantic word vector set by using a preset long-term and short-term memory network to obtain a target text sequence, and performing probability calculation on the target text sequence according to a preset attention mechanism to obtain a probability value, A sentiment classification result is obtained by analyzing the probability value.
一种电子设备,所述电子设备包括:An electronic device comprising:
存储器,存储至少一个指令;及a memory that stores at least one instruction; and
处理器,执行所述存储器中存储的指令以实现如下步骤:A processor that executes the instructions stored in the memory to achieve the following steps:
获取原始文本数据,对所述原始文本数据进行文本预处理,得到初始字词集;Obtain original text data, and perform text preprocessing on the original text data to obtain an initial word set;
对所述初始字词集进行编码处理,得到整数编码,根据所述整数编码对所述初始字词集进行向量化处理,得到标准词向量集;Encoding the initial word set to obtain an integer code, and performing vectorization processing on the initial word set according to the integer encoding to obtain a standard word vector set;
利用预设的文本训练模型对所述标准词向量集进行双向语义处理,得到语义词向量集;Use a preset text training model to perform bidirectional semantic processing on the standard word vector set to obtain a semantic word vector set;
利用预设的长短期记忆网络对所述语义词向量集进行筛选处理,得到目标文本序列,根据预设的注意力机制对所述目标文本序列进行概率计算并得到概率值,对所述概率值进行分析得到情感分类结果。Use a preset long-term and short-term memory network to screen the semantic word vector set to obtain a target text sequence, and perform probability calculation on the target text sequence according to a preset attention mechanism to obtain a probability value. Perform analysis to obtain sentiment classification results.
一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一个指令,所述至少一个指令被电子设备中的处理器执行以实现如下步骤:A computer-readable storage medium having at least one instruction stored in the computer-readable storage medium, the at least one instruction being executed by a processor in an electronic device to implement the following steps:
获取原始文本数据,对所述原始文本数据进行文本预处理,得到初始字词集;Obtain original text data, and perform text preprocessing on the original text data to obtain an initial word set;
对所述初始字词集进行编码处理,得到整数编码,根据所述整数编码对所述初始字词集进行向量化处理,得到标准词向量集;Encoding the initial word set to obtain an integer code, and performing vectorization processing on the initial word set according to the integer encoding to obtain a standard word vector set;
利用预设的文本训练模型对所述标准词向量集进行双向语义处理,得到语义词向量集;Use a preset text training model to perform bidirectional semantic processing on the standard word vector set to obtain a semantic word vector set;
利用预设的长短期记忆网络对所述语义词向量集进行筛选处理,得到目标文本序列,根据预设的注意力机制对所述目标文本序列进行概率计算并得到概率值,对所述概率值进行分析得到情感分类结果。Use a preset long-term and short-term memory network to screen the semantic word vector set to obtain a target text sequence, and perform probability calculation on the target text sequence according to a preset attention mechanism to obtain a probability value. Perform analysis to obtain sentiment classification results.
本申请可以解决情感分类的准确性不高的问题。This application can solve the problem of low accuracy of sentiment classification.
图1为本申请一实施例提供的情感分类方法的流程示意图;1 is a schematic flowchart of an emotion classification method provided by an embodiment of the present application;
图2为本申请一实施例提供的情感分类装置的功能模块图;FIG. 2 is a functional block diagram of an emotion classification device provided by an embodiment of the present application;
图3为本申请一实施例提供的实现所述情感分类方法的电子设备的结构示意图。FIG. 3 is a schematic structural diagram of an electronic device implementing the emotion classification method according to an embodiment of the present application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics and advantages of the purpose of the present application will be further described with reference to the accompanying drawings in conjunction with the embodiments.
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.
本申请实施例提供一种情感分类方法。所述情感分类方法的执行主体包括但不限于服务端、终端等能够被配置为执行本申请实施例提供的该方法的电子设备中的至少一种。换言之,所述情感分类方法可以由安装在终端设备或服务端设备的软件或硬件来执行,所述软件可以是区块链平台。所述服务端包括但不限于:单台服务器、服务器集群、云端服务器或云端服务器集群等。The embodiment of the present application provides an emotion classification method. The execution subject of the emotion classification method includes, but is not limited to, at least one of electronic devices that can be configured to execute the method provided by the embodiments of the present application, such as a server, a terminal, and the like. In other words, the emotion classification method can be executed by software or hardware installed in a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
参照图1所示,为本申请一实施例提供的情感分类方法的流程示意图。在本实施例中,所述情感分类方法包括:Referring to FIG. 1 , a schematic flowchart of an emotion classification method provided by an embodiment of the present application is shown. In this embodiment, the emotion classification method includes:
S1、获取原始文本数据,对所述原始文本数据进行文本预处理,得到初始字词集。S1. Obtain original text data, and perform text preprocessing on the original text data to obtain an initial word set.
本申请实施例中,所述原始文本数据可以为篇章级文本。In this embodiment of the present application, the original text data may be chapter-level text.
例如,原始文本数据为不动产相关的新闻文章,具体的,可以从不动产相关的新闻站点上利用python技术爬取新闻文章。For example, the original text data is real estate-related news articles. Specifically, the news articles can be crawled from real estate-related news sites by using python technology.
在本申请其他实施例中,所述原始文本数据还可以是其他领域的新闻文章,例如,电子商务相关的新闻文章,医学领域相关的新闻文章。In other embodiments of the present application, the original text data may also be news articles in other fields, for example, news articles related to e-commerce, news articles related to the medical field.
具体地,所述对所述原始文本数据进行文本预处理,得到初始字词集,包括:Specifically, performing text preprocessing on the original text data to obtain an initial set of words, including:
抽取所述原始文本数据中的关键语句,得到关键语句集;Extracting key sentences in the original text data to obtain a key sentence set;
对所述关键语句集进行去停用词处理,得到去停语句集;Performing stopword removal processing on the key sentence set to obtain a stoppage-removing sentence set;
对所述去停语句集进行分词处理,得到初始字词集。A word segmentation process is performed on the stop-removing sentence set to obtain an initial word set.
优选的,所述原始文本数据中的关键语句包括原始文本数据中的标题、首句、尾句、中间关键句之中的至少两项。Preferably, the key sentences in the original text data include at least two of the title, the first sentence, the last sentence, and the middle key sentence in the original text data.
其中,中间关键句可以为连接词之后的语句,例如,检测到连接词“然后”,则将该连接词之后的语句作为关键语句。例如,所述原始文本数据中的关键语句是不动产相关新闻文章的首尾句及中间关键句。Wherein, the intermediate key sentence may be the sentence after the conjunction, for example, if the conjunction "then" is detected, the sentence after the conjunction is used as the key sentence. For example, the key sentences in the original text data are the first and last sentences and the middle key sentences of real estate-related news articles.
详细地,所述去停用词处理是利用预设的停用词表去掉所述关键语句集中关键语句中 没有实际含义的词语。例如,将关键语句集中每个关键语句中的“啊”,“的”等词语进行删除。Specifically, the process of removing stop words is to use a preset stop word table to remove words that have no actual meaning in the key sentences in the key sentence set. For example, words such as "ah" and "de" in each key sentence in the key sentence set are deleted.
其中,所述停用词表可以为获取到的“哈工大停用词词库”和“四川大学机器学习智能实验室停用词词库”,或者停用词表也可以为预设的。Wherein, the stop word table may be the obtained "HIT stop word database" and "Sichuan University machine learning intelligent laboratory stop word database", or the stop word table may also be preset.
进一步地,本申请其中一个实施例可以利用Jieba工具对所述去停语句集中每个句子进行分词处理,将每个句子拆分成多个词语,得到初始字词集。Further, one of the embodiments of the present application may use the Jieba tool to perform word segmentation on each sentence in the stop-stop sentence set, and split each sentence into multiple words to obtain an initial word set.
S2、对所述初始字词集进行编码处理,得到整数编码,根据所述整数编码对所述初始字词集进行向量化处理,得到标准词向量集。S2. Perform encoding processing on the initial word set to obtain an integer code, and perform vectorization processing on the initial word set according to the integer encoding to obtain a standard word vector set.
本申请实施例中,所述对所述初始字词集进行编码处理,得到整数编码,包括:In the embodiment of the present application, the encoding process performed on the initial word set to obtain an integer code includes:
确定所述初始字词集中每个初始字词的分类变量;determining a categorical variable for each initial word in the initial word set;
对所述分类变量进行编码命名处理,得到整数编码。Encoding and naming processing is performed on the categorical variables to obtain integer codes.
其中,初始字词的分类变量是指初始字词所属的类别,确定所述初始字词集的分类变量即为分析所述初始字词集中初始字词所属的类别。Wherein, the classification variable of the initial word refers to the category to which the initial word belongs, and determining the classification variable of the initial word set is to analyze the category to which the initial word in the initial word set belongs.
具体地,本申请实施例中,对所述分类变量进行编码处理是按照所述分类变量的不同类别进行编码标识,例如,将第一个分类变量标识为0,将第二个分类变量标识为1,将第三个分类变量标识为2。Specifically, in the embodiment of the present application, the coding process for the categorical variable is to perform coding and identification according to different categories of the categorical variable. For example, the first categorical variable is identified as 0, and the second categorical variable is identified as 1, to identify the third categorical variable as 2.
其中,例如,所述初始字词集中包括[“房价”,“上涨”,“下降”,“上涨”],确定所述初始字词集中的分类变量为房价、上涨、下降共三个类别,对所述分类向量进行整数编码,令房价为0,上涨为1,下降为2,可得到标准词向量集为[1,0,0],[0,1,0],[0,0,1],[0,1,0]。Wherein, for example, the initial word set includes ["house price", "rising", "falling", "rising"], and it is determined that the classification variables in the initial word set are house price, rising and falling, a total of three categories, Integer encoding is performed on the classification vector, so that the house price is 0, the increase is 1, and the decrease is 2, and the standard word vector set can be obtained as [1, 0, 0], [0, 1, 0], [0, 0, 1], [0, 1, 0].
进一步地,所述根据所述整数编码对所述初始字词集进行向量化,得到标准词向量集,包括:Further, the initial word set is vectorized according to the integer code to obtain a standard word vector set, including:
在二维直角坐标系中选择任意一个目标点;Select any target point in the two-dimensional Cartesian coordinate system;
将所述初始字词集中的初始字词以所述目标点为基准进行纵向排列,将所述分类变量以所述目标点为基准按照所述整数编码的顺序进行横向排列;The initial words in the initial word set are arranged vertically with the target point as the benchmark, and the categorical variables are arranged horizontally in the order of the integer coding based on the target point;
若横向排列的分类变量对应的字词和纵向排列的初始字词之间的交叉点相同,令所述交叉点为第一数值,若横向排列的分类变量对应的字词和纵向排列的初始字词之间的交叉点不相同,令所述交叉点为第二数值,得到结果矩阵;If the intersection points between the words corresponding to the horizontally arranged categorical variables and the vertically arranged initial words are the same, let the intersection be the first value. The intersections between words are not the same, let the intersection be the second value to obtain the result matrix;
提取所述结果矩阵中所述第一数值和所述第二数值构成的向量,得到标准词向量集。A vector formed by the first numerical value and the second numerical value in the result matrix is extracted to obtain a standard word vector set.
例如,结果矩阵为
则从该结果矩阵中按照行或列的顺序提取数值得到多个向量[1,0,0],[0,1,0],[0,0,1],则标准词向量集由该多个向量构成。
For example, the resulting matrix is Then extract values from the result matrix in row or column order to obtain multiple vectors [1, 0, 0], [0, 1, 0], [0, 0, 1], then the standard word vector set consists of the multiple vectors. composed of vectors.
S3、利用预设的文本训练模型对所述标准词向量集进行双向语义处理,得到语义词向量集。S3. Use a preset text training model to perform bidirectional semantic processing on the standard word vector set to obtain a semantic word vector set.
本申请实施例中,利用预设的文本训练模型对所述标准词向量集进行双向语义处理,其中,所述文本训练模型的结构由三层Bi-LSTM(Bi-directional Long Short-Term Memory,双向长短期记忆)网络构成。In the embodiment of the present application, a preset text training model is used to perform bidirectional semantic processing on the standard word vector set, wherein the structure of the text training model consists of a three-layer Bi-LSTM (Bi-directional Long Short-Term Memory, bidirectional long short-term memory) network.
具体地,所述对所述标准词向量集进行双向语义处理,得到语义词向量集,包括:Specifically, performing bidirectional semantic processing on the standard word vector set to obtain a semantic word vector set, including:
获取所述标准词向量集中多个目标向量;obtaining multiple target vectors in the standard word vector set;
计算所述多个目标向量的多个前向向量和多个后向向量;calculating a plurality of forward vectors and a plurality of backward vectors of the plurality of target vectors;
利用预设的双向语义计算公式、所述多个前向向量和所述多个后向向量进行计算,得到所述多个目标向量的多个语义词向量;Calculate by using a preset bidirectional semantic calculation formula, the plurality of forward vectors and the plurality of backward vectors, to obtain a plurality of semantic word vectors of the plurality of target vectors;
汇总所述多个语义词向量,得到所述语义词向量集。Summarize the plurality of semantic word vectors to obtain the semantic word vector set.
详细地,In detail,
所述前向向量公式和所述后向向量公式包括:The forward vector formula and the backward vector formula include:
其中,
表示前向向量,
表示后向向量,
和
为Bi-LSTM网络中的第一变量,
为前向向量的前一个词汇,
为后向向量的前一个词汇。
in, represents the forward vector, represents the backward vector, and is the first variable in the Bi-LSTM network, is the previous word of the forward vector, is the previous word of the backward vector.
具体地,所述双向语义计算公式包括:Specifically, the bidirectional semantic calculation formula includes:
其中,h
t为语义词向量,
表示前向向量,
表示后向向量,U为Bi-LSTM网络中的第二变量,c为预设的参数。
Among them, h t is the semantic word vector, represents the forward vector, Represents the backward vector, U is the second variable in the Bi-LSTM network, and c is the preset parameter.
详细地,由于所述文本训练模型中含有三层Bi-LSTM网络,同一个标准词向量在所述文本训练模型中可以逐层提取到三个词向量并作为新特征补充到后续的任务参与训练,从而实现词向量的动态更新,其中,第一层Bi-LSTM网络的输入值为标准词向量,第二、三层Bi-LSTM网络的输入分别对应前一层对应位置输出的词向量,随着网络深度的增加,词向量中包含的句法信息、语义信息都会更加丰富。In detail, since the text training model contains three layers of Bi-LSTM networks, the same standard word vector can be extracted layer by layer in the text training model to three word vectors and added as new features to subsequent tasks to participate in training. , so as to realize the dynamic update of the word vector. The input value of the first layer of Bi-LSTM network is a standard word vector, and the input of the second and third layers of Bi-LSTM network corresponds to the word vector output by the corresponding position of the previous layer. With the increase of network depth, the syntactic and semantic information contained in the word vector will be more abundant.
S4、利用预设的长短期记忆网络对所述语义词向量集进行筛选处理,得到目标文本序列,根据预设的注意力机制对所述目标文本序列进行概率计算并得到概率值,对所述概率值进行分析得到情感分类结果。S4. Use a preset long-term and short-term memory network to screen the semantic word vector set to obtain a target text sequence, and perform probability calculation on the target text sequence according to a preset attention mechanism to obtain a probability value. The probability value is analyzed to obtain the sentiment classification result.
本申请实施例中,所述LSTM网络(Long Short-Term Memory,长短期记忆网络)是一种时间循环神经网络,包括:输入门、遗忘门以及输出门。In the embodiments of the present application, the LSTM network (Long Short-Term Memory, long short-term memory network) is a time recurrent neural network, including: an input gate, a forget gate, and an output gate.
具体地,所述利用预设的长短期记忆网络对所述语义词向量集进行筛选处理,得到目标文本序列,包括:Specifically, the use of the preset long-term and short-term memory network to screen the semantic word vector set to obtain the target text sequence, including:
步骤A:通过所述输入门计算所述语义词向量集中语义词向量的状态值;Step A: Calculate the state value of the semantic word vector in the semantic word vector set through the input gate;
步骤B:通过所述遗忘门计算所述语义词向量集中语义词向量的激活值;Step B: calculating the activation value of the semantic word vector in the semantic word vector set through the forgetting gate;
步骤C:根据所述状态值和所述激活值计算所述语义词向量的状态更新值;Step C: Calculate the state update value of the semantic word vector according to the state value and the activation value;
步骤D:利用所述输出门计算所述状态更新值对应的初始文本序列;Step D: using the output gate to calculate the initial text sequence corresponding to the state update value;
步骤E:根据预设的损失函数计算所述初始文本序列与预设的真实标签的损失值,当所述损失值小于预设阈值,确定所述初始文本序列为所述语义词向量的目标文本序列。Step E: Calculate the loss value of the initial text sequence and the preset real label according to a preset loss function, and when the loss value is less than a preset threshold, determine that the initial text sequence is the target text of the semantic word vector sequence.
一可选实施例中,所述状态值的计算方法包括:In an optional embodiment, the calculation method of the state value includes:
其中,i
t表示状态值,
表示输入门中细胞单元的偏置,w
i表示输入门的激活因子,h
t-1表示语义词向量在输入门t-1时刻的峰值,x
t表示在t时刻的语义词向量,b
i表示输入门中细胞单元的权重。
Among them, i t represents the state value, represents the bias of the cell unit in the input gate, w i represents the activation factor of the input gate, h t-1 represents the peak value of the semantic word vector at time t-1 of the input gate, x t represents the semantic word vector at time t, b i Represents the weights of the cell units in the input gate.
一可选实施例中,所述激活值的计算方法包括:In an optional embodiment, the calculation method of the activation value includes:
其中,f
t表示激活值,
表示遗忘门中细胞单元的偏置,w
f表示遗忘门的激活因子,
表示语义词向量在所述遗忘门t-1时刻的峰值,x
t表示在t时刻输入的语义词向量,b
f表示遗忘门中细胞单元的权重。
where f t represents the activation value, represents the bias of the cell unit in the forget gate, w f represents the activation factor of the forget gate, represents the peak value of the semantic word vector at time t-1 of the forgetting gate, x t represents the semantic word vector input at time t, and b f represents the weight of the cell unit in the forgetting gate.
一可选实施例中,所述状态更新值的计算方法包括:In an optional embodiment, the method for calculating the state update value includes:
其中,c
t表示状态更新值,h
t-1表示语义词向量在输入门t-1时刻的峰值,
表示语义词向量在遗忘门t-1时刻的峰值。
Among them, c t represents the state update value, h t-1 represents the peak value of the semantic word vector at the time of input gate t-1, Represents the peak value of the semantic word vector at the forget gate time t-1.
一可选实施例中,所述利用输出门计算状态更新值对应的初始文本序列包括:利用如下公式计算初始文本序列:In an optional embodiment, the calculating the initial text sequence corresponding to the state update value by using the output gate includes: calculating the initial text sequence by using the following formula:
o
t=tan h(c
t)
o t =tan h(c t )
其中,o
t表示初始文本序列,tan h表示输出门的激活函数,c
t表示状态更新值。
where o t represents the initial text sequence, tan h represents the activation function of the output gate, and c t represents the state update value.
进一步地,所述根据预设的注意力机制对所述目标文本序列进行概率计算并得到概率值,对所述概率值进行分析得到情感分类结果,包括:Further, performing probability calculation on the target text sequence according to the preset attention mechanism and obtaining a probability value, and analyzing the probability value to obtain a sentiment classification result, including:
根据预设的权重系数公式计算所述目标文本序列的权重系数;Calculate the weight coefficient of the target text sequence according to a preset weight coefficient formula;
利用所述权重系数计算所述目标文本序列的上下文序列;Calculate the context sequence of the target text sequence by using the weight coefficient;
根据所述上下文序列和预设的概率计算公式计算所述目标文本序列对应的概率值;Calculate the probability value corresponding to the target text sequence according to the context sequence and a preset probability calculation formula;
若所述概率值大于预设的第一概率值,判定所述情感分类结果为正面情感;If the probability value is greater than a preset first probability value, determine that the emotion classification result is a positive emotion;
若所述概率值小于预设的第一概率值且大于预设的第二概率值,判定所述情感分类结果为负面情感;If the probability value is less than a preset first probability value and greater than a preset second probability value, determine that the emotion classification result is a negative emotion;
若所述概率值小于预设的第二概率值,判定所述情感分类结果为中性情感。If the probability value is less than a preset second probability value, it is determined that the emotion classification result is a neutral emotion.
具体地,所述预设的权重系数公式包括:Specifically, the preset weight coefficient formula includes:
其中,a
ts为权重系数,h
t为所述LSTM网络中的隐藏单元,W、V和U为LSTM中的变量,tanh为激活函数,exp为指数函数,t为所述目标序列文本个数,s为LSTM网络中的预设参数,o
t为目标文本序列。
where at is the weight coefficient, h t is the hidden unit in the LSTM network, W, V and U are the variables in the LSTM, tanh is the activation function, exp is the exponential function, and t is the number of texts in the target sequence , s is the preset parameter in the LSTM network, and o t is the target text sequence.
进一步地,利用所述权重系数计算出所述目标文本序列的上下文序列,包括:Further, using the weight coefficient to calculate the context sequence of the target text sequence, including:
其中,c
t为上下文序列,a
ts为权重系数,o
t为目标文本序列,s为LSTM网络中的预设参数。
Among them, ct is the context sequence, ats is the weight coefficient, o t is the target text sequence, and s is the preset parameter in the LSTM network.
具体地,所述根据所述上下文序列和预设的概率计算公式计算所述目标文本序列对应的概率值,包括:Specifically, calculating the probability value corresponding to the target text sequence according to the context sequence and a preset probability calculation formula includes:
所述概率计算公式为:The probability calculation formula is:
y
t=f(c
t,o
t)=σ(W
c[c
t;o
t])
y t =f(c t ,o t )=σ(W c [c t ;o t ])
其中,y
t为概率值,c
t表示状态更新值。
Among them, y t is the probability value, and c t is the state update value.
本申请通过对原始文本数据进行预处理和向量化处理,得到标准词向量集,再对所述标准词向量集进行双向语义处理,得到语义词向量集,所述双向语义处理可以捕捉到标准词向量的前向信息和后向信息,令得到的语义词向量包含上下文的语义信息,增强了提取到的语义信息的全面性和丰富性,进而有利于提高对文本进行情感分类的准确性。因此本申请提出的情感分类方法可以解决情感分类的准确性不高的问题。The present application obtains a standard word vector set by preprocessing and vectorizing the original text data, and then performs bidirectional semantic processing on the standard word vector set to obtain a semantic word vector set. The bidirectional semantic processing can capture standard words The forward information and backward information of the vector make the obtained semantic word vector contain the semantic information of the context, which enhances the comprehensiveness and richness of the extracted semantic information, which is beneficial to improve the accuracy of text sentiment classification. Therefore, the emotion classification method proposed in this application can solve the problem of low accuracy of emotion classification.
如图2所示,是本申请一实施例提供的情感分类装置的功能模块图。As shown in FIG. 2 , it is a functional block diagram of an emotion classification apparatus provided by an embodiment of the present application.
本申请所述情感分类装置100可以安装于电子设备中。根据实现的功能,所述情感分类装置100可以包括文本预处理模块101、向量化模块102、双向语义模块103及分类模块104。本申请所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。The emotion classification apparatus 100 described in this application may be installed in an electronic device. According to the implemented functions, the emotion classification apparatus 100 may include a text preprocessing module 101 , a vectorization module 102 , a bidirectional semantic module 103 and a classification module 104 . The modules described in this application may also be referred to as units, which refer to a series of computer program segments that can be executed by the processor of the electronic device and can perform fixed functions, and are stored in the memory of the electronic device.
在本实施例中,关于各模块/单元的功能如下:In this embodiment, the functions of each module/unit are as follows:
所述文本预处理模块101,用于获取原始文本数据,对所述原始文本数据进行文本预处理,得到初始字词集;The text preprocessing module 101 is used for acquiring original text data, and performing text preprocessing on the original text data to obtain an initial word set;
所述向量化模块102,用于对所述初始字词集进行编码处理,得到整数编码,根据所述整数编码对所述初始字词集进行向量化处理,得到标准词向量集;The vectorization module 102 is configured to perform encoding processing on the initial word set to obtain an integer code, and perform vectorization processing on the initial word set according to the integer encoding to obtain a standard word vector set;
所述双向语义模块103,用于利用预设的文本训练模型对所述标准词向量集进行双向语义处理,得到语义词向量集;The bidirectional semantic module 103 is configured to perform bidirectional semantic processing on the standard word vector set by using a preset text training model to obtain a semantic word vector set;
所述分类模块104,用于利用预设的长短期记忆网络对所述语义词向量集进行筛选处理,得到目标文本序列,根据预设的注意力机制对所述目标文本序列进行概率计算并得到概率值,对所述概率值进行分析得到情感分类结果。。The classification module 104 is used for screening the semantic word vector set by using a preset long-term and short-term memory network to obtain a target text sequence, and performing probability calculation on the target text sequence according to a preset attention mechanism and obtaining The probability value is analyzed to obtain a sentiment classification result. .
所述文本预处理模块101,用于获取原始文本数据,对所述原始文本数据进行文本预处理,得到初始字词集。The text preprocessing module 101 is used for acquiring original text data, and performing text preprocessing on the original text data to obtain an initial word set.
本申请实施例中,所述原始文本数据可以为篇章级文本。In this embodiment of the present application, the original text data may be chapter-level text.
例如,原始文本数据为不动产相关的新闻文章,具体的,可以从不动产相关的新闻站点上利用python技术爬取新闻文章。For example, the original text data is real estate-related news articles. Specifically, the news articles can be crawled from real estate-related news sites by using python technology.
在本申请其他实施例中,所述原始文本数据还可以是其他领域的新闻文章,例如,电子商务相关的新闻文章,医学领域相关的新闻文章。In other embodiments of the present application, the original text data may also be news articles in other fields, for example, news articles related to e-commerce, news articles related to the medical field.
具体地,所述所述文本预处理模块101具体用于:Specifically, the text preprocessing module 101 is specifically used for:
获取原始文本数据;Get raw text data;
抽取所述原始文本数据中的关键语句,得到关键语句集;Extracting key sentences in the original text data to obtain a key sentence set;
对所述关键语句集进行去停用词处理,得到去停语句集;Performing stopword removal processing on the key sentence set to obtain a stoppage-removing sentence set;
对所述去停语句集进行分词处理,得到初始字词集。A word segmentation process is performed on the stop-removing sentence set to obtain an initial word set.
优选的,所述原始文本数据中的关键语句包括原始文本数据中的标题、首句、尾句、中间关键句之中的至少两项。Preferably, the key sentences in the original text data include at least two of the title, the first sentence, the last sentence, and the middle key sentence in the original text data.
其中,中间关键句可以为连接词之后的语句,例如,检测到连接词“然后”,则将该连接词之后的语句作为关键语句。例如,所述原始文本数据中的关键语句是不动产相关新闻文章的首尾句及中间关键句。Wherein, the intermediate key sentence may be the sentence after the conjunction, for example, if the conjunction "then" is detected, the sentence after the conjunction is used as the key sentence. For example, the key sentences in the original text data are the first and last sentences and the middle key sentences of real estate-related news articles.
详细地,所述去停用词处理是利用预设的停用词表去掉所述关键语句集中关键语句中没有实际含义的词语。例如,将关键语句集中每个关键语句中的“啊”,“的”等词语进行删除。Specifically, the process of removing stop words is to use a preset stop word table to remove words that have no actual meaning in the key sentences in the key sentence set. For example, words such as "ah" and "de" in each key sentence in the key sentence set are deleted.
其中,所述停用词表可以为获取到的“哈工大停用词词库”和“四川大学机器学习智能实验室停用词词库”,或者停用词表也可以为预设的。Wherein, the stop word table may be the obtained "HIT stop word database" and "Sichuan University machine learning intelligent laboratory stop word database", or the stop word table may also be preset.
进一步地,本申请其中一个实施例可以利用Jieba工具对所述去停语句集中每个句子进行分词处理,将每个句子拆分成多个词语,得到初始字词集。Further, one of the embodiments of the present application may use the Jieba tool to perform word segmentation on each sentence in the stop-stop sentence set, and split each sentence into multiple words to obtain an initial word set.
所述向量化模块102,用于对所述初始字词集进行编码处理,得到整数编码,根据所述整数编码对所述初始字词集进行向量化处理,得到标准词向量集。The vectorization module 102 is configured to perform encoding processing on the initial word set to obtain an integer code, and perform vectorization processing on the initial word set according to the integer encoding to obtain a standard word vector set.
本申请实施例中,所述所述向量化模块102具体用于:In this embodiment of the present application, the vectorization module 102 is specifically configured to:
确定所述初始字词集中每个初始字词的分类变量;determining a categorical variable for each initial word in the initial word set;
对所述分类变量进行编码命名处理,得到整数编码。Encoding and naming processing is performed on the categorical variables to obtain integer codes.
其中,初始字词的分类变量是指初始字词所属的类别,确定所述初始字词集的分类变量即为分析所述初始字词集中初始字词所属的类别。Wherein, the classification variable of the initial word refers to the category to which the initial word belongs, and determining the classification variable of the initial word set is to analyze the category to which the initial word in the initial word set belongs.
具体地,本申请实施例中,对所述分类变量进行编码处理是按照所述分类变量的不同类别进行编码标识,例如,将第一个分类变量标识为0,将第二个分类变量标识为1,将第三个分类变量标识为2。Specifically, in the embodiment of the present application, the coding process for the categorical variable is to perform coding and identification according to different categories of the categorical variable, for example, the first categorical variable is identified as 0, and the second categorical variable is identified as 1, to identify the third categorical variable as 2.
其中,例如,所述初始字词集中包括[“房价”,“上涨”,“下降”,“上涨”],确定所述初始字词集中的分类变量为房价、上涨、下降共三个类别,对所述分类向量进行整数编码,令房价为0,上涨为1,下降为2,可得到标准词向量集为[1,0,0],[0,1,0],[0,0,1],[0,1,0]。Wherein, for example, the initial word set includes ["house price", "rising", "falling", "rising"], and it is determined that the classification variables in the initial word set are house price, rising and falling, a total of three categories, Integer encoding is performed on the classification vector, so that the house price is 0, the increase is 1, and the decrease is 2, and the standard word vector set can be obtained as [1, 0, 0], [0, 1, 0], [0, 0, 1], [0, 1, 0].
进一步地,所述根据所述整数编码对所述初始字词集进行向量化,得到标准词向量集,包括:Further, performing vectorization on the initial word set according to the integer code to obtain a standard word vector set, including:
在二维直角坐标系中选择任意一个目标点;Select any target point in the two-dimensional Cartesian coordinate system;
将所述初始字词集中的初始字词以所述目标点为基准进行纵向排列,将所述分类变量 以所述目标点为基准按照所述整数编码的顺序进行横向排列;The initial words in the initial word set are arranged vertically with the target point as a benchmark, and the categorical variables are arranged horizontally according to the order of the integer coding on the basis of the target point;
若横向排列的分类变量对应的字词和纵向排列的初始字词之间的交叉点相同,令所述交叉点为第一数值,若横向排列的分类变量对应的字词和纵向排列的初始字词之间的交叉点不相同,令所述交叉点为第二数值,得到结果矩阵;If the intersection points between the words corresponding to the horizontally arranged categorical variables and the vertically arranged initial words are the same, let the intersection be the first value. The intersections between words are not the same, let the intersection be the second value to obtain the result matrix;
提取所述结果矩阵中所述第一数值和所述第二数值构成的向量,得到标准词向量集。A vector formed by the first numerical value and the second numerical value in the result matrix is extracted to obtain a standard word vector set.
例如,结果矩阵为
则从该结果矩阵中按照行或列的顺序提取数值得到多个向量[1,0,0],[0,1,0],[0,0,1],则标准词向量集由该多个向量构成。
For example, the resulting matrix is Then extract values from the result matrix in row or column order to obtain multiple vectors [1, 0, 0], [0, 1, 0], [0, 0, 1], then the standard word vector set consists of the multiple vectors. composed of vectors.
所述双向语义模块103,用于利用预设的文本训练模型对所述标准词向量集进行双向语义处理,得到语义词向量集。The bidirectional semantic module 103 is configured to perform bidirectional semantic processing on the standard word vector set by using a preset text training model to obtain a semantic word vector set.
本申请实施例中,利用预设的文本训练模型对所述标准词向量集进行双向语义处理,其中,所述文本训练模型的结构由三层Bi-LSTM(Bi-directional Long Short-Term Memory,双向长短期记忆)网络构成。In the embodiment of the present application, a preset text training model is used to perform bidirectional semantic processing on the standard word vector set, wherein the structure of the text training model consists of a three-layer Bi-LSTM (Bi-directional Long Short-Term Memory, bidirectional long short-term memory) network.
具体地,所述所述双向语义模块103具体用于:Specifically, the bidirectional semantic module 103 is specifically used for:
获取所述标准词向量集中多个目标向量;obtaining multiple target vectors in the standard word vector set;
计算所述多个目标向量的多个前向向量和多个后向向量;calculating a plurality of forward vectors and a plurality of backward vectors of the plurality of target vectors;
利用预设的双向语义计算公式、所述多个前向向量和所述多个后向向量进行计算,得到所述多个目标向量的多个语义词向量;Calculate by using a preset bidirectional semantic calculation formula, the plurality of forward vectors and the plurality of backward vectors, to obtain a plurality of semantic word vectors of the plurality of target vectors;
汇总所述多个语义词向量,得到所述语义词向量集。Summarize the plurality of semantic word vectors to obtain the semantic word vector set.
详细地,所述前向向量公式和所述后向向量公式包括:In detail, the forward vector formula and the backward vector formula include:
其中,
表示前向向量,
表示后向向量,
和
为Bi-LSTM网络中的第一变量,
为前向向量的前一个词汇,
为后向向量的前一个词汇。
in, represents the forward vector, represents the backward vector, and is the first variable in the Bi-LSTM network, is the previous word of the forward vector, is the previous word of the backward vector.
具体地,所述双向语义计算公式包括:Specifically, the bidirectional semantic calculation formula includes:
其中,h
t为语义词向量,
表示前向向量,
表示后向向量,U为Bi-LSTM网络中的第二变量,c为预设的参数。
Among them, h t is the semantic word vector, represents the forward vector, Represents the backward vector, U is the second variable in the Bi-LSTM network, and c is the preset parameter.
详细地,由于所述文本训练模型中含有三层Bi-LSTM网络,同一个标准词向量在所述文本训练模型中可以逐层提取到三个词向量并作为新特征补充到后续的任务参与训练,从而实现词向量的动态更新,其中,第一层Bi-LSTM网络的输入值为标准词向量,第二、三层Bi-LSTM网络的输入分别对应前一层对应位置输出的词向量,随着网络深度的增加,词向量中包含的句法信息、语义信息都会更加丰富。In detail, since the text training model contains three layers of Bi-LSTM networks, the same standard word vector can be extracted layer by layer in the text training model to three word vectors and added as new features to subsequent tasks to participate in training. , so as to realize the dynamic update of the word vector. The input value of the first layer of Bi-LSTM network is a standard word vector, and the input of the second and third layers of Bi-LSTM network corresponds to the word vector output by the corresponding position of the previous layer. With the increase of network depth, the syntactic and semantic information contained in the word vector will be more abundant.
所述分类模块104,用于利用预设的长短期记忆网络对所述语义词向量集进行筛选处理,得到目标文本序列,根据预设的注意力机制对所述目标文本序列进行概率计算并得到概率值,对所述概率值进行分析得到情感分类结果。The classification module 104 is configured to perform screening processing on the semantic word vector set by using a preset long and short-term memory network to obtain a target text sequence, and perform probability calculation on the target text sequence according to a preset attention mechanism and obtain the target text sequence. The probability value is analyzed to obtain a sentiment classification result.
本申请实施例中,所述LSTM(Long Short-Term Memory,长短期记忆网络)网络是一种时间循环神经网络,包括:输入门、遗忘门以及输出门。In the embodiment of the present application, the LSTM (Long Short-Term Memory, long short-term memory network) network is a time recurrent neural network, including: an input gate, a forget gate, and an output gate.
具体地,所所述所述分类模块104具体用于:Specifically, the classification module 104 is specifically used for:
通过所述输入门计算所述语义词向量集中语义词向量的状态值;Calculate the state value of the semantic word vector in the semantic word vector set through the input gate;
通过所述遗忘门计算所述语义词向量集中语义词向量的激活值;Calculate the activation value of the semantic word vector in the semantic word vector set through the forgetting gate;
根据所述状态值和所述激活值计算所述语义词向量的状态更新值;Calculate the state update value of the semantic word vector according to the state value and the activation value;
利用所述输出门计算所述状态更新值对应的初始文本序列;Calculate the initial text sequence corresponding to the state update value by using the output gate;
根据预设的损失函数计算所述初始文本序列与预设的真实标签的损失值,当所述损失 值小于预设阈值,确定所述初始文本序列为所述语义词向量的目标文本序列。According to the preset loss function, the loss value of the initial text sequence and the preset real label is calculated, and when the loss value is less than the preset threshold, it is determined that the initial text sequence is the target text sequence of the semantic word vector.
一可选实施例中,所述状态值的计算方法包括:In an optional embodiment, the calculation method of the state value includes:
其中,i
t表示状态值,
表示输入门中细胞单元的偏置,w
i表示输入门的激活因子,h
t-1表示语义词向量在输入门t-1时刻的峰值,x
t表示在t时刻的语义词向量,b
i表示输入门中细胞单元的权重。
Among them, i t represents the state value, represents the bias of the cell unit in the input gate, w i represents the activation factor of the input gate, h t-1 represents the peak value of the semantic word vector at time t-1 of the input gate, x t represents the semantic word vector at time t, b i Represents the weights of the cell units in the input gate.
一可选实施例中,所述激活值的计算方法包括:In an optional embodiment, the calculation method of the activation value includes:
其中,f
t表示激活值,
表示遗忘门中细胞单元的偏置,w
f表示遗忘门的激活因子,
表示语义词向量在所述遗忘门t-1时刻的峰值,x
t表示在t时刻输入的语义词向量,b
f表示遗忘门中细胞单元的权重。
where f t represents the activation value, represents the bias of the cell unit in the forget gate, w f represents the activation factor of the forget gate, represents the peak value of the semantic word vector at time t-1 of the forgetting gate, x t represents the semantic word vector input at time t, and b f represents the weight of the cell unit in the forgetting gate.
一可选实施例中,所述状态更新值的计算方法包括:In an optional embodiment, the method for calculating the state update value includes:
其中,c
t表示状态更新值,h
t-1表示语义词向量在输入门t-1时刻的峰值,
表示语义词向量在遗忘门t-1时刻的峰值。
Among them, c t represents the state update value, h t-1 represents the peak value of the semantic word vector at the time of input gate t-1, Represents the peak value of the semantic word vector at the forget gate time t-1.
一可选实施例中,所述利用输出门计算状态更新值对应的初始文本序列包括:利用如下公式计算初始文本序列:In an optional embodiment, the calculating the initial text sequence corresponding to the state update value by using the output gate includes: calculating the initial text sequence by using the following formula:
o
t=tan h(c
t)
o t =tan h(c t )
其中,o
t表示初始文本序列,tan h表示输出门的激活函数,c
t表示状态更新值。
where o t represents the initial text sequence, tan h represents the activation function of the output gate, and c t represents the state update value.
进一步地,所述根据预设的注意力机制对所述目标文本序列进行概率计算并得到概率值,对所述概率值进行分析得到情感分类结果,包括:Further, performing probability calculation on the target text sequence according to the preset attention mechanism and obtaining a probability value, and analyzing the probability value to obtain a sentiment classification result, including:
根据预设的权重系数公式计算所述目标文本序列的权重系数;Calculate the weight coefficient of the target text sequence according to a preset weight coefficient formula;
利用所述权重系数计算所述目标文本序列的上下文序列;Calculate the context sequence of the target text sequence by using the weight coefficient;
根据所述上下文序列和预设的概率计算公式计算所述目标文本序列对应的概率值;Calculate the probability value corresponding to the target text sequence according to the context sequence and a preset probability calculation formula;
若所述概率值大于预设的第一概率值,判定所述情感分类结果为正面情感;If the probability value is greater than a preset first probability value, determine that the emotion classification result is a positive emotion;
若所述概率值小于预设的第一概率值且大于预设的第二概率值,判定所述情感分类结果为负面情感;If the probability value is less than a preset first probability value and greater than a preset second probability value, determine that the emotion classification result is a negative emotion;
若所述概率值小于预设的第二概率值,判定所述情感分类结果为中性情感。If the probability value is less than a preset second probability value, it is determined that the emotion classification result is a neutral emotion.
具体地,所述预设的权重系数公式包括:Specifically, the preset weight coefficient formula includes:
其中,a
ts为权重系数,h
t为所述LSTM网络中的隐藏单元,W、V和U为LSTM中的变量,tanh为激活函数,exp为指数函数,t为所述目标序列文本个数,s为LSTM网络中的预设参数,o
t为目标文本序列。
where at is the weight coefficient, h t is the hidden unit in the LSTM network, W, V and U are the variables in the LSTM, tanh is the activation function, exp is the exponential function, and t is the number of texts in the target sequence , s is the preset parameter in the LSTM network, and o t is the target text sequence.
进一步地,利用所述权重系数计算出所述目标文本序列的上下文序列,包括:Further, using the weight coefficient to calculate the context sequence of the target text sequence, including:
其中,c
t为上下文序列,a
ts为权重系数,o
t为目标文本序列,s为LSTM网络中的预设参数。
Among them, ct is the context sequence, ats is the weight coefficient, o t is the target text sequence, and s is the preset parameter in the LSTM network.
具体地,所述根据所述上下文序列和预设的概率计算公式计算所述目标文本序列对应的概率值,包括:Specifically, calculating the probability value corresponding to the target text sequence according to the context sequence and a preset probability calculation formula includes:
所述概率计算公式为:The probability calculation formula is:
y
t=f(c
t,o
t)=σ(W
c[c
t;o
t])
y t =f(c t ,o t )=σ(W c [c t ;o t ])
其中,y
t为概率值,c
t表示状态更新值。
Among them, y t is the probability value, and c t is the state update value.
本申请通过对原始文本数据进行预处理和向量化处理,得到标准词向量集,再对所述标准词向量集进行双向语义处理,得到语义词向量集,所述双向语义处理可以捕捉到标准词向量的前向信息和后向信息,令得到的语义词向量包含上下文的语义信息,增强了提取到的语义信息的全面性和丰富性,进而有利于提高对文本进行情感分类的准确性。因此本申请提出的情感分类装置可以解决情感分类的准确性不高的问题。The present application obtains a standard word vector set by preprocessing and vectorizing the original text data, and then performs bidirectional semantic processing on the standard word vector set to obtain a semantic word vector set. The bidirectional semantic processing can capture standard words The forward information and backward information of the vector make the obtained semantic word vector contain the semantic information of the context, which enhances the comprehensiveness and richness of the extracted semantic information, which is beneficial to improve the accuracy of text sentiment classification. Therefore, the emotion classification device proposed in this application can solve the problem of low accuracy of emotion classification.
如图3所示,是本申请一实施例提供的实现情感分类方法的电子设备的结构示意图。As shown in FIG. 3 , it is a schematic structural diagram of an electronic device for implementing an emotion classification method provided by an embodiment of the present application.
所述电子设备1可以包括处理器10、存储器11和总线,还可以包括存储在所述存储器11中并可在所述处理器10上运行的计算机程序,如情感分类程序12。The electronic device 1 may include a processor 10, a memory 11 and a bus, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as an emotion classification program 12.
其中,所述存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、移动硬盘、多媒体卡、卡型存储器(例如:SD或DX存储器等)、磁性存储器、磁盘、光盘等。所述存储器11在一些实施例中可以是电子设备1的内部存储单元,例如该电子设备1的移动硬盘。所述存储器11在另一些实施例中也可以是电子设备1的外部存储设备,例如电子设备1上配备的插接式移动硬盘、智能存储卡(Smart Media Card,SMC)、安全数字(Secure Digital,SD)卡、闪存卡(Flash Card)等。进一步地,所述存储器11还可以既包括电子设备1的内部存储单元也包括外部存储设备。所述存储器11不仅可以用于存储安装于电子设备1的应用软件及各类数据,例如情感分类程序12的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。Wherein, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, magnetic disk, CD etc. The memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, such as a mobile hard disk of the electronic device 1 . In other embodiments, the memory 11 may also be an external storage device of the electronic device 1, such as a pluggable mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital) equipped on the electronic device 1. , SD) card, flash memory card (Flash Card), etc. Further, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can not only be used to store application software installed in the electronic device 1 and various types of data, such as the code of the emotion classification program 12, etc., but also can be used to temporarily store data that has been output or will be output.
所述处理器10在一些实施例中可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(Central Processing unit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。所述处理器10是所述电子设备的控制核心(Control Unit),利用各种接口和线路连接整个电子设备的各个部件,通过运行或执行存储在所述存储器11内的程序或者模块(例如情感分类程序等),以及调用存储在所述存储器11内的数据,以执行电子设备1的各种功能和处理数据。In some embodiments, the processor 10 may be composed of integrated circuits, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits packaged with the same function or different functions, including one or more integrated circuits. Central Processing Unit (CPU), microprocessor, digital processing chip, graphics processor and combination of various control chips, etc. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect the various components of the entire electronic device, by running or executing the programs or modules (such as emotion) stored in the memory 11. classification programs, etc.), and call data stored in the memory 11 to perform various functions of the electronic device 1 and process data.
所述总线可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。所述总线被设置为实现所述存储器11以及至少一个处理器10等之间的连接通信。The bus may be a peripheral component interconnect (PCI for short) bus or an extended industry standard architecture (Extended industry standard architecture, EISA for short) bus or the like. The bus can be divided into address bus, data bus, control bus and so on. The bus is configured to implement connection communication between the memory 11 and at least one processor 10 and the like.
图3仅示出了具有部件的电子设备,本领域技术人员可以理解的是,图3示出的结构并不构成对所述电子设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。FIG. 3 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 3 does not constitute a limitation on the electronic device 1, and may include fewer or more components than those shown in the figure. components, or a combination of certain components, or a different arrangement of components.
例如,尽管未示出,所述电子设备1还可以包括给各个部件供电的电源(比如电池),优选地,电源可以通过电源管理装置与所述至少一个处理器10逻辑相连,从而通过电源管理装置实现充电管理、放电管理、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、再充电装置、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。所述电子设备1还可以包括多种传感器、蓝牙模块、Wi-Fi模块等,在此不再赘述。For example, although not shown, the electronic device 1 may also include a power supply (such as a battery) for powering the various components, preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that the power management The device implements functions such as charge management, discharge management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and any other components. The electronic device 1 may further include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
进一步地,所述电子设备1还可以包括网络接口,可选地,所述网络接口可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该电子设备1与其他电子设备之间建立通信连接。Further, the electronic device 1 may also include a network interface, optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
可选地,该电子设备1还可以包括用户接口,用户接口可以是显示器(Display)、输入单元(比如键盘(Keyboard)),可选地,用户接口还可以是标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在电子设备1中处理的信息以及用于显示可视 化的用户界面。Optionally, the electronic device 1 may further include a user interface, and the user interface may be a display (Display), an input unit (eg, a keyboard (Keyboard)), optionally, the user interface may also be a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, and the like. Among them, the display may also be appropriately called a display screen or a display unit, which is used for displaying information processed in the electronic device 1 and for displaying a visual user interface.
应该了解,所述实施例仅为说明之用,在专利申请范围上并不受此结构的限制。It should be understood that the embodiments are only used for illustration, and are not limited by this structure in the scope of the patent application.
所述电子设备1中的所述存储器11存储的情感分类程序12是多个指令的组合,在所述处理器10中运行时,可以实现:The emotion classification program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions, and when running in the processor 10, it can realize:
获取原始文本数据,对所述原始文本数据进行文本预处理,得到初始字词集;Obtain original text data, and perform text preprocessing on the original text data to obtain an initial word set;
对所述初始字词集进行编码处理,得到整数编码,根据所述整数编码对所述初始字词集进行向量化处理,得到标准词向量集;Encoding the initial word set to obtain an integer code, and performing vectorization processing on the initial word set according to the integer encoding to obtain a standard word vector set;
利用预设的文本训练模型对所述标准词向量集进行双向语义处理,得到语义词向量集;Use a preset text training model to perform bidirectional semantic processing on the standard word vector set to obtain a semantic word vector set;
利用预设的长短期记忆网络对所述语义词向量集进行筛选处理,得到目标文本序列,根据预设的注意力机制对所述目标文本序列进行概率计算并得到概率值,对所述概率值进行分析得到情感分类结果。Use a preset long-term and short-term memory network to screen the semantic word vector set to obtain a target text sequence, and perform probability calculation on the target text sequence according to a preset attention mechanism to obtain a probability value. Perform analysis to obtain sentiment classification results.
具体地,所述处理器10对上述指令的具体实现方法可参考图1至图3对应实施例中相关步骤的描述,在此不赘述。Specifically, for the specific implementation method of the above-mentioned instruction by the processor 10, reference may be made to the description of the relevant steps in the corresponding embodiments of FIG. 1 to FIG. 3 , which will not be repeated here.
进一步地,所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读存储介质中。所述计算机可读存储介质可以是易失性的,也可以是非易失性的。例如,所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)。Further, if the modules/units integrated in the electronic device 1 are implemented in the form of software functional units and sold or used as independent products, they may be stored in a computer-readable storage medium. The computer-readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a removable hard disk, a magnetic disk, an optical disc, a computer memory, a read-only memory (ROM, Read-Only). Memory).
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质可以是易失性的,也可以是非易失性的,所述可读存储介质存储有计算机程序,所述计算机程序在被电子设备的处理器所执行时,可以实现:The present application also provides a computer-readable storage medium. The computer-readable storage medium may be volatile or non-volatile. The readable storage medium stores a computer program, and the computer program is stored in the When executed by the processor of the electronic device, it can achieve:
获取原始文本数据,对所述原始文本数据进行文本预处理,得到初始字词集;Obtain original text data, and perform text preprocessing on the original text data to obtain an initial word set;
对所述初始字词集进行编码处理,得到整数编码,根据所述整数编码对所述初始字词集进行向量化处理,得到标准词向量集;Encoding the initial word set to obtain an integer code, and performing vectorization processing on the initial word set according to the integer encoding to obtain a standard word vector set;
利用预设的文本训练模型对所述标准词向量集进行双向语义处理,得到语义词向量集;Use a preset text training model to perform bidirectional semantic processing on the standard word vector set to obtain a semantic word vector set;
利用预设的长短期记忆网络对所述语义词向量集进行筛选处理,得到目标文本序列,根据预设的注意力机制对所述目标文本序列进行概率计算并得到概率值,对所述概率值进行分析得到情感分类结果。Use a preset long-term and short-term memory network to screen the semantic word vector set to obtain a target text sequence, and perform probability calculation on the target text sequence according to a preset attention mechanism to obtain a probability value. Perform analysis to obtain sentiment classification results.
在本申请所提供的几个实施例中,应该理解到,所揭露的设备,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided in this application, it should be understood that the disclosed apparatus, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the modules is only a logical function division, and there may be other division manners in actual implementation.
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of hardware plus software function modules.
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。It will be apparent to those skilled in the art that the present application is not limited to the details of the above-described exemplary embodiments, but that the present application can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application.
因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图标记视为限制所涉及的权利要求。Accordingly, the embodiments are to be regarded in all respects as illustrative and not restrictive, and the scope of the application is to be defined by the appended claims rather than the foregoing description, which is therefore intended to fall within the scope of the claims. All changes within the meaning and scope of the equivalents of , are included in this application. Any reference signs in the claims shall not be construed as limiting the involved claim.
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密 码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。The blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain, essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block. The blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。系统权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第二等词语用来表示名称,而并不表示任何特定的顺序。Furthermore, it is clear that the word "comprising" does not exclude other units or steps and the singular does not exclude the plural. Several units or means recited in the system claims can also be realized by one unit or means by means of software or hardware. Second-class terms are used to denote names and do not denote any particular order.
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and not to limit them. Although the present application has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present application can be Modifications or equivalent substitutions can be made without departing from the spirit and scope of the technical solutions of the present application.
Claims (20)
- 一种情感分类方法,其中,所述方法包括:A sentiment classification method, wherein the method comprises:获取原始文本数据,对所述原始文本数据进行文本预处理,得到初始字词集;Obtain original text data, and perform text preprocessing on the original text data to obtain an initial word set;对所述初始字词集进行编码处理,得到整数编码,根据所述整数编码对所述初始字词集进行向量化处理,得到标准词向量集;Encoding the initial word set to obtain an integer code, and performing vectorization processing on the initial word set according to the integer encoding to obtain a standard word vector set;利用预设的文本训练模型对所述标准词向量集进行双向语义处理,得到语义词向量集;Use a preset text training model to perform bidirectional semantic processing on the standard word vector set to obtain a semantic word vector set;利用预设的长短期记忆网络对所述语义词向量集进行筛选处理,得到目标文本序列,根据预设的注意力机制对所述目标文本序列进行概率计算并得到概率值,对所述概率值进行分析得到情感分类结果。Use a preset long-term and short-term memory network to screen the semantic word vector set to obtain a target text sequence, and perform probability calculation on the target text sequence according to a preset attention mechanism to obtain a probability value. Perform analysis to obtain sentiment classification results.
- 如权利要求1所述的情感分类方法,其中,所述对所述初始字词集进行编码处理,得到整数编码,包括:The emotion classification method according to claim 1, wherein the encoding process on the initial word set to obtain an integer code, comprising:确定所述初始字词集中每个初始字词的分类变量;determining a categorical variable for each initial word in the initial word set;对所述分类变量进行编码命名处理,得到整数编码。Encoding and naming processing is performed on the categorical variables to obtain integer codes.
- 如权利要求1所述的情感分类方法,其中,所述根据所述整数编码对所述初始字词集进行向量化,得到标准词向量集,包括:The sentiment classification method according to claim 1, wherein the vectorizing the initial word set according to the integer code to obtain a standard word vector set, comprising:在二维直角坐标系中选择任意一个目标点;Select any target point in the two-dimensional Cartesian coordinate system;将所述初始字词集中的初始字词以所述目标点为基准进行纵向排列,将所述分类变量以所述目标点为基准按照所述整数编码的顺序进行横向排列;The initial words in the initial word set are arranged vertically with the target point as the benchmark, and the categorical variables are arranged horizontally in the order of the integer coding based on the target point;若横向排列的分类变量对应的字词和纵向排列的初始字词之间的交叉点相同,令所述交叉点为第一数值,若横向排列的分类变量对应的字词和纵向排列的初始字词之间的交叉点不相同,令所述交叉点为第二数值,得到由所述第一数值和所述第二数值构成的结果矩阵;If the intersection points between the words corresponding to the horizontally arranged categorical variables and the vertically arranged initial words are the same, let the intersection be the first value. The intersections between words are different, let the intersection be a second value, and obtain a result matrix composed of the first value and the second value;从所述结果矩阵中提取所述第一数值或所述第二数值构成多个向量,得到标准词向量集。The first numerical value or the second numerical value is extracted from the result matrix to form a plurality of vectors to obtain a standard word vector set.
- 如权利要求1所述的情感分类方法,其中,所述利用预设的文本训练模型对所述标准词向量集进行双向语义处理,得到语义词向量集,包括:The sentiment classification method according to claim 1, wherein the bidirectional semantic processing is performed on the standard word vector set by using a preset text training model to obtain a semantic word vector set, comprising:获取所述标准词向量集中多个目标向量;obtaining multiple target vectors in the standard word vector set;计算所述多个目标向量的多个前向向量和多个后向向量;calculating a plurality of forward vectors and a plurality of backward vectors of the plurality of target vectors;利用预设的双向语义计算公式、所述多个前向向量和所述多个后向向量进行计算,得到所述多个目标向量的多个语义词向量;Calculate by using a preset bidirectional semantic calculation formula, the plurality of forward vectors and the plurality of backward vectors, to obtain a plurality of semantic word vectors of the plurality of target vectors;汇总所述多个语义词向量,得到所述语义词向量集。Summarize the plurality of semantic word vectors to obtain the semantic word vector set.
- 如权利要求1所述的情感分类方法,其中,所述利用预设的长短期记忆网络对所述语义词向量集进行筛选处理,得到目标文本序列,包括:The emotion classification method according to claim 1, wherein the selection of the semantic word vector set by using a preset long-term and short-term memory network to obtain a target text sequence, comprising:通过所述输入门计算所述语义词向量集中语义词向量的状态值;Calculate the state value of the semantic word vector in the semantic word vector set through the input gate;通过所述遗忘门计算所述语义词向量集中语义词向量的激活值;Calculate the activation value of the semantic word vector in the semantic word vector set through the forgetting gate;根据所述状态值和所述激活值计算所述语义词向量的状态更新值;Calculate the state update value of the semantic word vector according to the state value and the activation value;利用所述输出门计算所述状态更新值对应的初始文本序列;Calculate the initial text sequence corresponding to the state update value by using the output gate;根据预设的损失函数计算所述初始文本序列与预设的真实标签的损失值,当所述损失值小于预设阈值,确定所述初始文本序列为所述语义词向量的目标文本序列。The loss value between the initial text sequence and the preset real label is calculated according to a preset loss function, and when the loss value is less than a preset threshold, it is determined that the initial text sequence is the target text sequence of the semantic word vector.
- 如权利要求5所述的情感分类方法,其中,所述根据预设的注意力机制对所述目标文本序列进行概率计算,得到概率值,对所述概率值进行分析得到情感分类结果,包括:The emotion classification method according to claim 5, wherein the probability calculation is performed on the target text sequence according to a preset attention mechanism to obtain a probability value, and the emotion classification result is obtained by analyzing the probability value, comprising:根据预设的权重系数公式计算所述目标文本序列的权重系数;Calculate the weight coefficient of the target text sequence according to a preset weight coefficient formula;利用所述权重系数计算所述目标文本序列的上下文序列;Calculate the context sequence of the target text sequence by using the weight coefficient;根据所述上下文序列和预设的概率计算公式计算所述目标文本序列对应的概率值;Calculate the probability value corresponding to the target text sequence according to the context sequence and a preset probability calculation formula;若所述概率值大于预设的第一概率值,判定所述情感分类结果为正面情感;If the probability value is greater than a preset first probability value, determine that the emotion classification result is a positive emotion;若所述概率值小于预设的第一概率值且大于预设的第二概率值,判定所述情感分类结果为负面情感;If the probability value is less than a preset first probability value and greater than a preset second probability value, determine that the emotion classification result is a negative emotion;若所述概率值小于预设的第二概率值,判定所述情感分类结果为中性情感。If the probability value is less than a preset second probability value, it is determined that the emotion classification result is a neutral emotion.
- 如权利要求1至6中任一项所述的情感分类方法,其中,所述对所述原始文本数据进行文本预处理,得到初始字词集,包括:The sentiment classification method according to any one of claims 1 to 6, wherein the text preprocessing is performed on the original text data to obtain an initial word set, comprising:抽取所述原始文本数据中的关键语句,得到关键语句集;Extracting key sentences in the original text data to obtain a key sentence set;对所述关键语句集进行去停用词处理,得到去停语句集;Performing stopword removal processing on the key sentence set to obtain a stoppage-removing sentence set;对所述去停语句集进行分词处理,得到初始字词集。A word segmentation process is performed on the stop-removing sentence set to obtain an initial word set.
- 一种情感分类装置,其中,所述装置包括:An emotion classification device, wherein the device comprises:文本预处理模块,用于获取原始文本数据,对所述原始文本数据进行文本预处理,得到初始字词集;a text preprocessing module, used to obtain original text data, perform text preprocessing on the original text data, and obtain an initial word set;向量化模块,用于对所述初始字词集进行编码处理,得到整数编码,根据所述整数编码对所述初始字词集进行向量化处理,得到标准词向量集;a vectorization module, configured to perform encoding processing on the initial word set to obtain an integer code, and perform vectorization processing on the initial word set according to the integer encoding to obtain a standard word vector set;双向语义模块,用于利用预设的文本训练模型对所述标准词向量集进行双向语义处理,得到语义词向量集;a bidirectional semantic module, used for performing bidirectional semantic processing on the standard word vector set by using a preset text training model to obtain a semantic word vector set;分类模块,用于利用预设的长短期记忆网络对所述语义词向量集进行筛选处理,得到目标文本序列,根据预设的注意力机制对所述目标文本序列进行概率计算并得到概率值,对所述概率值进行分析得到情感分类结果。a classification module, used for screening the semantic word vector set by using a preset long-term and short-term memory network to obtain a target text sequence, and performing probability calculation on the target text sequence according to a preset attention mechanism to obtain a probability value, A sentiment classification result is obtained by analyzing the probability value.
- 一种电子设备,其中,所述电子设备包括:An electronic device, wherein the electronic device comprises:至少一个处理器;以及,at least one processor; and,与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如下步骤:The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the steps of:获取原始文本数据,对所述原始文本数据进行文本预处理,得到初始字词集;Obtain original text data, and perform text preprocessing on the original text data to obtain an initial word set;对所述初始字词集进行编码处理,得到整数编码,根据所述整数编码对所述初始字词集进行向量化处理,得到标准词向量集;Encoding the initial word set to obtain an integer code, and performing vectorization processing on the initial word set according to the integer encoding to obtain a standard word vector set;利用预设的文本训练模型对所述标准词向量集进行双向语义处理,得到语义词向量集;Use a preset text training model to perform bidirectional semantic processing on the standard word vector set to obtain a semantic word vector set;利用预设的长短期记忆网络对所述语义词向量集进行筛选处理,得到目标文本序列,根据预设的注意力机制对所述目标文本序列进行概率计算并得到概率值,对所述概率值进行分析得到情感分类结果。Use a preset long-term and short-term memory network to screen the semantic word vector set to obtain a target text sequence, and perform probability calculation on the target text sequence according to a preset attention mechanism to obtain a probability value. Perform analysis to obtain sentiment classification results.
- 如权利要求9所述的电子设备,其中,所述对所述初始字词集进行编码处理,得到整数编码,包括:The electronic device according to claim 9, wherein the encoding process on the initial word set to obtain an integer code comprises:确定所述初始字词集中每个初始字词的分类变量;determining a categorical variable for each initial word in the initial word set;对所述分类变量进行编码命名处理,得到整数编码。Encoding and naming processing is performed on the categorical variables to obtain integer codes.
- 如权利要求9所述的电子设备,其中,所述根据所述整数编码对所述初始字词集进行向量化,得到标准词向量集,包括:The electronic device according to claim 9, wherein the vectorizing the initial word set according to the integer code to obtain a standard word vector set, comprising:在二维直角坐标系中选择任意一个目标点;Select any target point in the two-dimensional Cartesian coordinate system;将所述初始字词集中的初始字词以所述目标点为基准进行纵向排列,将所述分类变量以所述目标点为基准按照所述整数编码的顺序进行横向排列;The initial words in the initial word set are arranged vertically with the target point as the benchmark, and the categorical variables are arranged horizontally in the order of the integer coding based on the target point;若横向排列的分类变量对应的字词和纵向排列的初始字词之间的交叉点相同,令所述交叉点为第一数值,若横向排列的分类变量对应的字词和纵向排列的初始字词之间的交叉点不相同,令所述交叉点为第二数值,得到由所述第一数值和所述第二数值构成的结果矩阵;If the intersection points between the words corresponding to the horizontally arranged categorical variables and the vertically arranged initial words are the same, let the intersection be the first value. The intersections between words are different, let the intersection be a second value, and obtain a result matrix composed of the first value and the second value;从所述结果矩阵中提取所述第一数值或所述第二数值构成多个向量,得到标准词向量 集。The first numerical value or the second numerical value is extracted from the result matrix to form a plurality of vectors to obtain a standard word vector set.
- 如权利要求9所述的电子设备,其中,所述利用预设的文本训练模型对所述标准词向量集进行双向语义处理,得到语义词向量集,包括:The electronic device according to claim 9, wherein the bidirectional semantic processing is performed on the standard word vector set by using a preset text training model to obtain a semantic word vector set, comprising:获取所述标准词向量集中多个目标向量;obtaining multiple target vectors in the standard word vector set;计算所述多个目标向量的多个前向向量和多个后向向量;calculating a plurality of forward vectors and a plurality of backward vectors of the plurality of target vectors;利用预设的双向语义计算公式、所述多个前向向量和所述多个后向向量进行计算,得到所述多个目标向量的多个语义词向量;Calculate by using a preset bidirectional semantic calculation formula, the plurality of forward vectors and the plurality of backward vectors, to obtain a plurality of semantic word vectors of the plurality of target vectors;汇总所述多个语义词向量,得到所述语义词向量集。Summarize the plurality of semantic word vectors to obtain the semantic word vector set.
- 如权利要求9所述的电子设备,其中,所述利用预设的长短期记忆网络对所述语义词向量集进行筛选处理,得到目标文本序列,包括:The electronic device according to claim 9, wherein the selection of the semantic word vector set by using a preset long-term and short-term memory network to obtain a target text sequence, comprising:通过所述输入门计算所述语义词向量集中语义词向量的状态值;Calculate the state value of the semantic word vector in the semantic word vector set through the input gate;通过所述遗忘门计算所述语义词向量集中语义词向量的激活值;Calculate the activation value of the semantic word vector in the semantic word vector set through the forgetting gate;根据所述状态值和所述激活值计算所述语义词向量的状态更新值;Calculate the state update value of the semantic word vector according to the state value and the activation value;利用所述输出门计算所述状态更新值对应的初始文本序列;Calculate the initial text sequence corresponding to the state update value by using the output gate;根据预设的损失函数计算所述初始文本序列与预设的真实标签的损失值,当所述损失值小于预设阈值,确定所述初始文本序列为所述语义词向量的目标文本序列。The loss value between the initial text sequence and the preset real label is calculated according to a preset loss function, and when the loss value is less than a preset threshold, it is determined that the initial text sequence is the target text sequence of the semantic word vector.
- 如权利要求13所述的电子设备,其中,所述根据预设的注意力机制对所述目标文本序列进行概率计算,得到概率值,对所述概率值进行分析得到情感分类结果,包括:The electronic device according to claim 13, wherein the performing probability calculation on the target text sequence according to a preset attention mechanism to obtain a probability value, and analyzing the probability value to obtain a sentiment classification result, comprising:根据预设的权重系数公式计算所述目标文本序列的权重系数;Calculate the weight coefficient of the target text sequence according to a preset weight coefficient formula;利用所述权重系数计算所述目标文本序列的上下文序列;Calculate the context sequence of the target text sequence by using the weight coefficient;根据所述上下文序列和预设的概率计算公式计算所述目标文本序列对应的概率值;Calculate the probability value corresponding to the target text sequence according to the context sequence and a preset probability calculation formula;若所述概率值大于预设的第一概率值,判定所述情感分类结果为正面情感;If the probability value is greater than a preset first probability value, determine that the emotion classification result is a positive emotion;若所述概率值小于预设的第一概率值且大于预设的第二概率值,判定所述情感分类结果为负面情感;If the probability value is less than a preset first probability value and greater than a preset second probability value, determine that the emotion classification result is a negative emotion;若所述概率值小于预设的第二概率值,判定所述情感分类结果为中性情感。If the probability value is less than a preset second probability value, it is determined that the emotion classification result is a neutral emotion.
- 如权利要求9至14中任一项所述的电子设备,其中,所述对所述原始文本数据进行文本预处理,得到初始字词集,包括:The electronic device according to any one of claims 9 to 14, wherein, performing text preprocessing on the original text data to obtain an initial word set, comprising:抽取所述原始文本数据中的关键语句,得到关键语句集;Extracting key sentences in the original text data to obtain a key sentence set;对所述关键语句集进行去停用词处理,得到去停语句集;Performing stopword removal processing on the key sentence set to obtain a stoppage-removing sentence set;对所述去停语句集进行分词处理,得到初始字词集。A word segmentation process is performed on the stop-removing sentence set to obtain an initial word set.
- 一种计算机可读存储介质,存储有计算机程序,其中,所述计算机程序被处理器执行时实现如下步骤:A computer-readable storage medium storing a computer program, wherein the computer program implements the following steps when executed by a processor:获取原始文本数据,对所述原始文本数据进行文本预处理,得到初始字词集;Obtain original text data, and perform text preprocessing on the original text data to obtain an initial word set;对所述初始字词集进行编码处理,得到整数编码,根据所述整数编码对所述初始字词集进行向量化处理,得到标准词向量集;Encoding the initial word set to obtain an integer code, and performing vectorization processing on the initial word set according to the integer encoding to obtain a standard word vector set;利用预设的文本训练模型对所述标准词向量集进行双向语义处理,得到语义词向量集;Use a preset text training model to perform bidirectional semantic processing on the standard word vector set to obtain a semantic word vector set;利用预设的长短期记忆网络对所述语义词向量集进行筛选处理,得到目标文本序列,根据预设的注意力机制对所述目标文本序列进行概率计算并得到概率值,对所述概率值进行分析得到情感分类结果。Use a preset long-term and short-term memory network to screen the semantic word vector set to obtain a target text sequence, and perform probability calculation on the target text sequence according to a preset attention mechanism to obtain a probability value. Perform analysis to obtain sentiment classification results.
- 如权利要求16所述的计算机可读存储介质,其中,所述对所述初始字词集进行编码处理,得到整数编码,包括:The computer-readable storage medium according to claim 16, wherein the encoding process on the initial word set to obtain an integer code comprises:确定所述初始字词集中每个初始字词的分类变量;determining a categorical variable for each initial word in the initial word set;对所述分类变量进行编码命名处理,得到整数编码。Encoding and naming processing is performed on the categorical variables to obtain integer codes.
- 如权利要求16所述的计算机可读存储介质,其中,所述根据所述整数编码对所述初始字词集进行向量化,得到标准词向量集,包括:The computer-readable storage medium according to claim 16, wherein the vectorizing the initial word set according to the integer code to obtain a standard word vector set, comprising:在二维直角坐标系中选择任意一个目标点;Select any target point in the two-dimensional Cartesian coordinate system;将所述初始字词集中的初始字词以所述目标点为基准进行纵向排列,将所述分类变量以所述目标点为基准按照所述整数编码的顺序进行横向排列;The initial words in the initial word set are arranged vertically with the target point as the benchmark, and the categorical variables are arranged horizontally in the order of the integer coding based on the target point;若横向排列的分类变量对应的字词和纵向排列的初始字词之间的交叉点相同,令所述交叉点为第一数值,若横向排列的分类变量对应的字词和纵向排列的初始字词之间的交叉点不相同,令所述交叉点为第二数值,得到由所述第一数值和所述第二数值构成的结果矩阵;If the intersection points between the words corresponding to the horizontally arranged categorical variables and the vertically arranged initial words are the same, let the intersection be the first value. The intersections between words are different, let the intersection be a second value, and obtain a result matrix composed of the first value and the second value;从所述结果矩阵中提取所述第一数值或所述第二数值构成多个向量,得到标准词向量集。The first numerical value or the second numerical value is extracted from the result matrix to form a plurality of vectors to obtain a standard word vector set.
- 如权利要求16所述的计算机可读存储介质,其中,所述利用预设的文本训练模型对所述标准词向量集进行双向语义处理,得到语义词向量集,包括:The computer-readable storage medium according to claim 16, wherein the bidirectional semantic processing is performed on the standard word vector set by using a preset text training model to obtain a semantic word vector set, comprising:获取所述标准词向量集中多个目标向量;obtaining multiple target vectors in the standard word vector set;计算所述多个目标向量的多个前向向量和多个后向向量;calculating a plurality of forward vectors and a plurality of backward vectors of the plurality of target vectors;利用预设的双向语义计算公式、所述多个前向向量和所述多个后向向量进行计算,得到所述多个目标向量的多个语义词向量;Calculate by using a preset bidirectional semantic calculation formula, the plurality of forward vectors and the plurality of backward vectors, to obtain a plurality of semantic word vectors of the plurality of target vectors;汇总所述多个语义词向量,得到所述语义词向量集。Summarize the plurality of semantic word vectors to obtain the semantic word vector set.
- 如权利要求16所述的计算机可读存储介质,其中,所述利用预设的长短期记忆网络对所述语义词向量集进行筛选处理,得到目标文本序列,包括:The computer-readable storage medium according to claim 16 , wherein the filtering of the semantic word vector set by using a preset long-term and short-term memory network to obtain a target text sequence, comprising:通过所述输入门计算所述语义词向量集中语义词向量的状态值;Calculate the state value of the semantic word vector in the semantic word vector set through the input gate;通过所述遗忘门计算所述语义词向量集中语义词向量的激活值;Calculate the activation value of the semantic word vector in the semantic word vector set through the forgetting gate;根据所述状态值和所述激活值计算所述语义词向量的状态更新值;Calculate the state update value of the semantic word vector according to the state value and the activation value;利用所述输出门计算所述状态更新值对应的初始文本序列;Calculate the initial text sequence corresponding to the state update value by using the output gate;根据预设的损失函数计算所述初始文本序列与预设的真实标签的损失值,当所述损失值小于预设阈值,确定所述初始文本序列为所述语义词向量的目标文本序列。The loss value between the initial text sequence and the preset real label is calculated according to a preset loss function, and when the loss value is less than a preset threshold, it is determined that the initial text sequence is the target text sequence of the semantic word vector.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011640369.0 | 2020-12-31 | ||
CN202011640369.0A CN112732915A (en) | 2020-12-31 | 2020-12-31 | Emotion classification method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022141861A1 true WO2022141861A1 (en) | 2022-07-07 |
Family
ID=75609016
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2021/083713 WO2022141861A1 (en) | 2020-12-31 | 2021-03-30 | Emotion classification method and apparatus, electronic device, and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN112732915A (en) |
WO (1) | WO2022141861A1 (en) |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115714002A (en) * | 2022-09-06 | 2023-02-24 | 湖南工商大学 | Depression risk detection model training method, depression state early warning method and related equipment |
CN115994217A (en) * | 2022-11-29 | 2023-04-21 | 南京审计大学 | Financial report fraud detection method and system |
CN116011447A (en) * | 2023-03-28 | 2023-04-25 | 杭州实在智能科技有限公司 | E-commerce comment analysis method, system and computer readable storage medium |
CN116257488A (en) * | 2023-02-21 | 2023-06-13 | 深圳市勘察测绘院(集团)有限公司 | Geotechnical engineering investigation big data archiving method, device, electronic equipment and medium |
CN116540790A (en) * | 2023-07-05 | 2023-08-04 | 深圳市保凌影像科技有限公司 | Tripod head stability control method and device, electronic equipment and storage medium |
CN116662556A (en) * | 2023-08-02 | 2023-08-29 | 天河超级计算淮海分中心 | Text data processing method integrating user attributes |
CN116805039A (en) * | 2023-08-21 | 2023-09-26 | 腾讯科技(深圳)有限公司 | Feature screening method, device, computer equipment and data disturbance method |
CN117521652A (en) * | 2024-01-05 | 2024-02-06 | 一站发展(北京)云计算科技有限公司 | Intelligent matching system and method based on natural language model |
CN117789971A (en) * | 2024-02-13 | 2024-03-29 | 长春职业技术学院 | Mental health intelligent evaluation system and method based on text emotion analysis |
CN118134529A (en) * | 2024-05-06 | 2024-06-04 | 南昌理工学院 | Big data-based computer data processing method and system |
CN118468848A (en) * | 2024-07-12 | 2024-08-09 | 北京珊瑚礁科技有限公司 | Text emotion analysis method and system integrating long-term and short-term memory network and word embedding |
CN118503363A (en) * | 2024-07-19 | 2024-08-16 | 北京衔远有限公司 | Emotion analysis method and device, electronic equipment and storage medium |
CN118644869A (en) * | 2024-08-15 | 2024-09-13 | 贵州白山云科技股份有限公司 | Method and device for detecting interaction recognition intention based on dual-channel attention network |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113342933B (en) * | 2021-05-31 | 2022-11-08 | 淮阴工学院 | Multi-feature interactive network recruitment text classification method similar to double-tower model |
CN113722483B (en) * | 2021-08-31 | 2023-08-22 | 平安银行股份有限公司 | Topic classification method, device, equipment and storage medium |
CN113808577A (en) * | 2021-09-18 | 2021-12-17 | 平安银行股份有限公司 | Intelligent extraction method and device of voice abstract, electronic equipment and storage medium |
CN114462411B (en) * | 2022-02-14 | 2023-05-16 | 平安科技(深圳)有限公司 | Named entity recognition method, device, equipment and storage medium |
CN116756306A (en) * | 2022-03-03 | 2023-09-15 | 腾讯科技(深圳)有限公司 | Object classification method, device, computer equipment and computer readable storage medium |
CN115238683B (en) * | 2022-08-09 | 2023-06-20 | 平安科技(深圳)有限公司 | Method, device, equipment and medium for recognizing stop words of circulating self-attention |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170228414A1 (en) * | 2016-02-05 | 2017-08-10 | Google Inc. | Generating feature embeddings from a co-occurrence matrix |
CN110472042A (en) * | 2019-07-02 | 2019-11-19 | 桂林电子科技大学 | A kind of fine granularity sensibility classification method |
CN110517121A (en) * | 2019-09-23 | 2019-11-29 | 重庆邮电大学 | Method of Commodity Recommendation and the device for recommending the commodity based on comment text sentiment analysis |
CN111651593A (en) * | 2020-05-08 | 2020-09-11 | 河南理工大学 | Text emotion analysis method based on word vector and word vector mixed model |
CN111930940A (en) * | 2020-07-30 | 2020-11-13 | 腾讯科技(深圳)有限公司 | Text emotion classification method and device, electronic equipment and storage medium |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10817650B2 (en) * | 2017-05-19 | 2020-10-27 | Salesforce.Com, Inc. | Natural language processing using context specific word vectors |
CN109697285B (en) * | 2018-12-13 | 2022-06-21 | 中南大学 | Hierarchical BilSt Chinese electronic medical record disease coding and labeling method for enhancing semantic representation |
CN110766073B (en) * | 2019-10-22 | 2023-10-27 | 湖南科技大学 | Mobile application classification method for strengthening topic attention mechanism |
CN111341386B (en) * | 2020-02-17 | 2022-09-20 | 大连理工大学 | Attention-introducing multi-scale CNN-BilSTM non-coding RNA interaction relation prediction method |
CN112085012B (en) * | 2020-09-04 | 2024-03-08 | 泰康保险集团股份有限公司 | Project name and category identification method and device |
-
2020
- 2020-12-31 CN CN202011640369.0A patent/CN112732915A/en active Pending
-
2021
- 2021-03-30 WO PCT/CN2021/083713 patent/WO2022141861A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170228414A1 (en) * | 2016-02-05 | 2017-08-10 | Google Inc. | Generating feature embeddings from a co-occurrence matrix |
CN110472042A (en) * | 2019-07-02 | 2019-11-19 | 桂林电子科技大学 | A kind of fine granularity sensibility classification method |
CN110517121A (en) * | 2019-09-23 | 2019-11-29 | 重庆邮电大学 | Method of Commodity Recommendation and the device for recommending the commodity based on comment text sentiment analysis |
CN111651593A (en) * | 2020-05-08 | 2020-09-11 | 河南理工大学 | Text emotion analysis method based on word vector and word vector mixed model |
CN111930940A (en) * | 2020-07-30 | 2020-11-13 | 腾讯科技(深圳)有限公司 | Text emotion classification method and device, electronic equipment and storage medium |
Cited By (21)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115714002A (en) * | 2022-09-06 | 2023-02-24 | 湖南工商大学 | Depression risk detection model training method, depression state early warning method and related equipment |
CN115714002B (en) * | 2022-09-06 | 2023-08-11 | 湖南工商大学 | Training method for depression risk detection model, depression symptom early warning method and related equipment |
CN115994217A (en) * | 2022-11-29 | 2023-04-21 | 南京审计大学 | Financial report fraud detection method and system |
CN115994217B (en) * | 2022-11-29 | 2024-01-23 | 南京审计大学 | Financial report fraud detection method and system |
CN116257488A (en) * | 2023-02-21 | 2023-06-13 | 深圳市勘察测绘院(集团)有限公司 | Geotechnical engineering investigation big data archiving method, device, electronic equipment and medium |
CN116257488B (en) * | 2023-02-21 | 2023-08-25 | 深圳市勘察测绘院(集团)有限公司 | Geotechnical engineering investigation big data archiving method, device, electronic equipment and medium |
CN116011447A (en) * | 2023-03-28 | 2023-04-25 | 杭州实在智能科技有限公司 | E-commerce comment analysis method, system and computer readable storage medium |
CN116540790A (en) * | 2023-07-05 | 2023-08-04 | 深圳市保凌影像科技有限公司 | Tripod head stability control method and device, electronic equipment and storage medium |
CN116540790B (en) * | 2023-07-05 | 2023-09-08 | 深圳市保凌影像科技有限公司 | Tripod head stability control method and device, electronic equipment and storage medium |
CN116662556B (en) * | 2023-08-02 | 2023-10-20 | 天河超级计算淮海分中心 | Text data processing method integrating user attributes |
CN116662556A (en) * | 2023-08-02 | 2023-08-29 | 天河超级计算淮海分中心 | Text data processing method integrating user attributes |
CN116805039A (en) * | 2023-08-21 | 2023-09-26 | 腾讯科技(深圳)有限公司 | Feature screening method, device, computer equipment and data disturbance method |
CN116805039B (en) * | 2023-08-21 | 2023-12-05 | 腾讯科技(深圳)有限公司 | Feature screening method, device, computer equipment and data disturbance method |
CN117521652A (en) * | 2024-01-05 | 2024-02-06 | 一站发展(北京)云计算科技有限公司 | Intelligent matching system and method based on natural language model |
CN117521652B (en) * | 2024-01-05 | 2024-04-12 | 一站发展(北京)云计算科技有限公司 | Intelligent matching system and method based on natural language model |
CN117789971A (en) * | 2024-02-13 | 2024-03-29 | 长春职业技术学院 | Mental health intelligent evaluation system and method based on text emotion analysis |
CN117789971B (en) * | 2024-02-13 | 2024-05-24 | 长春职业技术学院 | Mental health intelligent evaluation system and method based on text emotion analysis |
CN118134529A (en) * | 2024-05-06 | 2024-06-04 | 南昌理工学院 | Big data-based computer data processing method and system |
CN118468848A (en) * | 2024-07-12 | 2024-08-09 | 北京珊瑚礁科技有限公司 | Text emotion analysis method and system integrating long-term and short-term memory network and word embedding |
CN118503363A (en) * | 2024-07-19 | 2024-08-16 | 北京衔远有限公司 | Emotion analysis method and device, electronic equipment and storage medium |
CN118644869A (en) * | 2024-08-15 | 2024-09-13 | 贵州白山云科技股份有限公司 | Method and device for detecting interaction recognition intention based on dual-channel attention network |
Also Published As
Publication number | Publication date |
---|---|
CN112732915A (en) | 2021-04-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2022141861A1 (en) | Emotion classification method and apparatus, electronic device, and storage medium | |
CN112417096B (en) | Question-answer pair matching method, device, electronic equipment and storage medium | |
CN113449187B (en) | Product recommendation method, device, equipment and storage medium based on double images | |
CN107704512A (en) | Financial product based on social data recommends method, electronic installation and medium | |
CN112380859A (en) | Public opinion information recommendation method and device, electronic equipment and computer storage medium | |
CN111666415A (en) | Topic clustering method and device, electronic equipment and storage medium | |
CN104778283B (en) | A kind of user's occupational classification method and system based on microblogging | |
CN114387061A (en) | Product pushing method and device, electronic equipment and readable storage medium | |
WO2022222942A1 (en) | Method and apparatus for generating question and answer record, electronic device, and storage medium | |
CN115391669A (en) | Intelligent recommendation method and device and electronic equipment | |
CN115392237B (en) | Emotion analysis model training method, device, equipment and storage medium | |
WO2023272862A1 (en) | Risk control recognition method and apparatus based on network behavior data, and electronic device and medium | |
CN115018588A (en) | Product recommendation method and device, electronic equipment and readable storage medium | |
CN112507230A (en) | Webpage recommendation method and device based on browser, electronic equipment and storage medium | |
CN113886708A (en) | Product recommendation method, device, equipment and storage medium based on user information | |
CN114398560B (en) | Marketing interface setting method, device, equipment and medium based on WEB platform | |
CN113688239A (en) | Text classification method and device under few samples, electronic equipment and storage medium | |
CN116450829A (en) | Medical text classification method, device, equipment and medium | |
CN113591881B (en) | Intention recognition method and device based on model fusion, electronic equipment and medium | |
CN113850643A (en) | Product recommendation method and device, electronic equipment and readable storage medium | |
CN116628162A (en) | Semantic question-answering method, device, equipment and storage medium | |
CN116703515A (en) | Recommendation method and device based on artificial intelligence, computer equipment and storage medium | |
CN116521867A (en) | Text clustering method and device, electronic equipment and storage medium | |
CN113705692B (en) | Emotion classification method and device based on artificial intelligence, electronic equipment and medium | |
CN112328752B (en) | Course recommendation method and device based on search content, computer equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21912631 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 21912631 Country of ref document: EP Kind code of ref document: A1 |