CN109558582A - Sentence sentiment analysis method and device based on visual angle - Google Patents

Sentence sentiment analysis method and device based on visual angle Download PDF

Info

Publication number
CN109558582A
CN109558582A CN201710889192.XA CN201710889192A CN109558582A CN 109558582 A CN109558582 A CN 109558582A CN 201710889192 A CN201710889192 A CN 201710889192A CN 109558582 A CN109558582 A CN 109558582A
Authority
CN
China
Prior art keywords
sentence
visual angle
word
analyzed
emotion
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710889192.XA
Other languages
Chinese (zh)
Other versions
CN109558582B (en
Inventor
韩旭红
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201710889192.XA priority Critical patent/CN109558582B/en
Publication of CN109558582A publication Critical patent/CN109558582A/en
Application granted granted Critical
Publication of CN109558582B publication Critical patent/CN109558582B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

Landscapes

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

Abstract

The sentence sentiment analysis method and device based on visual angle that the invention discloses a kind of can extract at least one visual angle word included in sentence to be analyzed;Parsing sentence, which is treated, according to default sentence matching rule carries out canonical matching;When it fails to match for sentence to be analyzed, judge whether the quantity of extracted at least one visual angle word is one;If it is not, successively carrying out canonical matching to each visual angle word according to default visual angle word matching rule;For canonical each visual angle word that it fails to match, contextual information of the Analysis perspective word in sentence to be analyzed obtains emotion of the sentence to be analyzed under the word of visual angle.The present invention can accurately calculate the emotion of different perspectives, improve the accuracy of sentence sentiment analysis.

Description

Sentence sentiment analysis method and device based on visual angle
Technical field
The present invention relates to natural language processing fields, more particularly to the sentence sentiment analysis method and device based on visual angle.
Background technique
Sentiment analysis has become the research hotspot of natural language processing field in recent years.With the development of e-commerce, Sentiment analysis increasingly refines, and the sentiment analysis demand of sentence is also continuously improved.
For different visual angles, the emotion of sentence also can be corresponding different, therefore sentence emotion has diversity.And it is existing Sentence visual angle affection computation is mostly directly using sentence emotion as the emotion of all visual angles word included in sentence, to have ignored Same sentence may have the case where different emotions for different perspectives, so that the sentiment analysis accuracy of sentence is very low.
Summary of the invention
In view of the above problems, it proposes on the present invention overcomes the above problem or at least be partially solved in order to provide one kind State the sentence sentiment analysis method and device based on visual angle of problem.
Specific technical solution is as follows:
A kind of sentence sentiment analysis method based on visual angle, comprising:
Extract at least one visual angle word included in sentence to be analyzed;
Canonical matching is carried out to the sentence to be analyzed according to default sentence matching rule;
When it fails to match for the sentence to be analyzed, judge extracted at least one visual angle word quantity whether be One;
When the quantity of extracted at least one visual angle word is not one, according to default visual angle word matching rule according to It is secondary that canonical matching is carried out to each visual angle word;
For canonical each described visual angle word that it fails to match, the visual angle word is analyzed in the sentence to be analyzed Contextual information obtains emotion of the sentence to be analyzed under the visual angle word.
Preferably, further includes:
It is when the sentence successful match to be analyzed, emotion of the sentence to be analyzed under each visual angle word is true It is set to the corresponding Sentiment orientation of default sentence matching rule being matched to.
Preferably, further includes:
When the quantity of extracted at least one visual angle word is one, the emotion of the sentence to be analyzed is calculated, And emotion of the sentence to be analyzed under the visual angle word is determined as to the emotion of the sentence to be analyzed.
Preferably, further includes:
For each described visual angle word of canonical successful match, by feelings of the sentence to be analyzed under the visual angle word Sense is determined as the corresponding Sentiment orientation of default visual angle word matching rule being matched to.
Preferably, contextual information of the analysis visual angle word in the sentence to be analyzed obtains described wait divide Analyse emotion of the sentence under the visual angle word, comprising:
At least one short sentence belonging to determining the visual angle word in the sentence to be analyzed, wherein the short sentence is located at Before and after the visual angle word between punctuate;
For short sentence described in each, whether judge in the short sentence comprising other canonicals in addition to the visual angle word Visual angle word with failure;
If so, emotion of the sentence to be analyzed under the visual angle word is determined as neutrality;
If it is not, calculate the emotion of the short sentence, and emotion of the short sentence under the visual angle word be determined as described short The emotion of sentence;
According to emotion of each short sentence under the visual angle word, determine the sentence to be analyzed under the visual angle word Emotion.
A kind of sentence sentiment analysis device based on visual angle, comprising: visual angle word extraction module, the first canonical matching module, Judgment module, the second canonical matching module and sentiment analysis module;
The visual angle word extraction module, for extracting at least one visual angle word included in sentence to be analyzed;
The first canonical matching module, for carrying out canonical to the sentence to be analyzed according to default sentence matching rule Matching;
The judgment module, for when it fails to match for the sentence to be analyzed, judge it is extracted described at least one Whether the quantity of visual angle word is one;
The second canonical matching module, for not being one when the quantity of extracted at least one visual angle word When, canonical matching successively is carried out to each visual angle word according to default visual angle word matching rule;
The sentiment analysis module, for analyzing the visual angle for canonical each described visual angle word that it fails to match Contextual information of the word in the sentence to be analyzed obtains emotion of the sentence to be analyzed under the visual angle word.
Preferably, further includes: the first emotion determining module;
The first emotion determining module is used for when the sentence successful match to be analyzed, by the sentence to be analyzed Emotion under each visual angle word is determined as the corresponding Sentiment orientation of default sentence matching rule being matched to.
Preferably, further includes: the second emotion determining module;
The second emotion determining module, for each described visual angle word for canonical successful match, will it is described to Emotion of the parsing sentence under the visual angle word is determined as the corresponding Sentiment orientation of default visual angle word matching rule being matched to.
A kind of storage medium, the storage medium include the program of storage, wherein in described program operation described in control Equipment executes such as the described in any item sentence sentiment analysis methods based on visual angle of above-mentioned technical proposal where storage medium.
A kind of processor, the processor is for running program, wherein such as above-mentioned technical side is executed when described program is run The described in any item sentence sentiment analysis methods based on visual angle of case.
By above-mentioned technical proposal, the present invention can be according to default sentence matching rule and default visual angle word matching rule Parsing sentence is treated respectively and multiple extracted visual angle words carry out canonical matching, this can be filtered out is inclined to comprising particular emotion Sentence and visual angle word to tentatively improve the accuracy of sentence sentiment analysis also correspondingly reduce data processing amount;Into One step obtains sentence to be analyzed at this by contextual information of the analysis canonical visual angle word that it fails to match in sentence to be analyzed Emotion under the word of visual angle, this can accurately calculate emotion of the sentence under different perspectives, to further improve sentence feelings Feel the accuracy of analysis.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention, And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the present invention Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows the method flow diagram of the sentence sentiment analysis method based on visual angle;
Fig. 2 shows single order chain type conditional random field models structure charts;
Fig. 3 shows the Part Methods flow chart of the sentence sentiment analysis method based on visual angle;
Fig. 4 shows the sentence sentiment analysis apparatus structure schematic diagram based on visual angle.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure It is fully disclosed to those skilled in the art.
As shown in Figure 1, the embodiment of the present invention provides a kind of sentence sentiment analysis method based on visual angle, it may include as follows Step:
S101 extracts at least one visual angle word included in sentence to be analyzed;
During executing step S101, using it is pre-set include that the dictionary of visual angle word extracts sentence to be analyzed Visual angle word included in son, can also be by treating the view in parsing sentence using the CRF (conditional random field models) after training Angle word extracts, and certainly, can be also situated between for the model after other training, the present embodiment with CRF (conditional random field models) It continues:
Fig. 2 shows a simple single order chain type conditional random field models structures, wherein and x is observation sequence, shown herein as Sentence participle after each node, y is flag sequence, shown herein as sentence participle posterior nodal point sequence label, stochastic variable it Between by indicating that the nonoriented edge of dependence is attached, output, which becomes, is expressed as a sequence, passes through and calculates given observation sequence X Under the conditions of={ x1, x2 ..., xn }, joint probability on flag sequence Y={ y1, y2 ..., yn } obtains the highest label of probability As annotation results, specifically, in the training process, characterized by individual character, in combination with context semantic feature, [part of speech+side Boundary] characteristic function of CRF that constitutes of assemblage characteristic and interdependent syntactic feature instructs single order chain type conditional random field models Practice.
S102 treats parsing sentence according to default sentence matching rule and carries out canonical matching;
During executing step S102, corresponding sentence matching rule can be pre-established for different clause, with filter Except the sentence being inclined to comprising particular emotion, for example, the partial feeling in sentence is it is assumed that cannot reflect true for conditional clause Emotion, Sentiment orientation are classified as neutrality, and for another example, for interrogative sentence, the partial feeling in sentence is conjecture, can not reflect true Truth sense, Sentiment orientation are classified as neutrality.Therefore, following conditional clause matching rule can be formulated --- " if [^,.!!] if + S [^,.!!]*;If ([^,.!!]+S) { 1,2 } [and ^,.!!] * just [^,.!!]+", can also formulate such as certainly Lower interrogative sentence matching rule --- " can or can not [^,.!!]+", can specifically be arranged according to actual needs sentence matching rule with And corresponding Sentiment orientation, the present embodiment are not specifically limited.
Parsing sentence is treated according to default sentence matching rule and carries out canonical matching, if matching, then it represents that sentence to be analyzed Son is the clause being inclined to comprising particular emotion, and the emotion of extracted whole visual angles word is determined as default sentence matching rule pair The Sentiment orientation answered;Conversely, if not matching, then it represents that sentence to be analyzed is positive reason sense clause, executes subsequent step.
S103, when it fails to match for sentence to be analyzed, judge extracted at least one visual angle word quantity whether It is one;
During executing step S103, by judging whether the visual angle word extracted is one, it may be determined that sentence to be analyzed Emotion of the son under each visual angle word whether be sentence to be analyzed emotion.
S104 is matched when the quantity of extracted at least one visual angle word is not one according to default visual angle word Rule successively carries out canonical matching to each visual angle word;
During executing step S104, when extracted visual angle word is multiple, indicate sentence to be analyzed each Emotion under the word of visual angle is not the emotion of sentence to be analyzed, since the emotion of each visual angle word may be different, for mentioning Each the visual angle word taken carries out canonical matching according to default visual angle word matching rule, includes that particular emotion is inclined to filter out Visual angle word therefore can be analysed to emotion of the sentence under the visual angle word of successful match and be determined as default visual angle word matching rule Then corresponding Sentiment orientation.
Corresponding visual angle word matching rule can be pre-established for different visual angle words, for example, for the ratio in comparative sentence Compared with object, the emotion that is included is mostly neutrality, for another example, for visual angle refer in visual angle word, only indicate that the visual angle word exists Mentioned by having in sentence, but without specific related elaboration, therefore, relatively Object matching rule --- " view as follows can be formulated With [^ (, |.|!|!|? |? )] { 0,3 } currentView compares ", visual angle word " currentView " Sentiment orientation in rule is Neutrality can also formulate downwards angle of visibility such as and refer to matching rule certainly --- " positioning is between view and currentView ", rule The Sentiment orientation of visual angle word " view " and visual angle word " currentView " in then is neutrality, in addition, for more objective as follows Body matching rule --- " view not as good as [^ (, |.|!|!|? |? )] { 0,3 } currentView ", rule in visual angle word " currentView " emotion is front, and it is reversed then can directly to carry out emotion for " view ", is taken as negative;
Specifically, the method that visual angle conversion can be used will be current to be matched in carrying out visual angle word canonical matching process Visual angle word replaces with " currentView ", other visual angle words replace with " view ", further, utilizes preset visual angle word Matching rule carries out canonical matching to visual angle word " currentView ".
S105, for canonical each visual angle word that it fails to match, context of the Analysis perspective word in sentence to be analyzed Information obtains emotion of the sentence to be analyzed under the word of visual angle;
During specific implementation, " contextual information of the Analysis perspective word in sentence to be analyzed, is obtained in step S105 Emotion of the sentence to be analyzed under the word of visual angle " can specifically use following steps, and method flow diagram is as shown in Figure 3:
S1001 determines visual angle word at least one short sentence affiliated in sentence to be analyzed, wherein the short sentence is located at view Before and after the word of angle between punctuate;
During executing step S1001, according to visual angle word in sentence to be analyzed before and after punctuate determine belonging to Short sentence, content is short sentence belonging to the visual angle word between the punctuate of front and back, front and back punctuate can for comma, branch, fullstop, question mark or Person's sentence head and the tail.
S1002, for each short sentence, judge in short sentence whether comprising other canonicals in addition to the word of visual angle it fails to match Visual angle word;If so, thening follow the steps S1003;If it is not, thening follow the steps S1004;
S1003 is analysed to emotion of the sentence under the word of visual angle and is determined as neutrality;
S1004 calculates the emotion of short sentence, and emotion of the short sentence under the word of visual angle is determined as to the emotion of short sentence;
It can also be it certainly using the svm supporting vector machine model after training during executing step S1004 Model after his training, the present embodiment are introduced with svm supporting vector machine model:
Word segmentation processing is carried out to the sentence in short sentence first and passes through instruction then using the short sentence after participle as input feature vector The emotion of svm supporting vector machine model output short sentence after white silk, specifically, in the training process, in advance to the feelings of training short sentence Sense is labeled, then, the word with dependence that the emotion of training short sentence, mark after participle, interdependent syntax are obtained Language binary combination is trained initial svm supporting vector machine model.
S1005 determines emotion of the sentence to be analyzed under the word of visual angle according to emotion of each short sentence under the word of visual angle;
During executing step S1005, since the same visual angle word possibly is present in multiple short sentences, can Emotion of the sentence to be analyzed under the visual angle word is determined in the emotion under the visual angle word according to each short sentence, for example, for visual angle Word A is respectively appeared in short sentence 1, short sentence 2 and short sentence 3, also, emotion of the visual angle word A in short sentence 1 is neutrality, in short sentence 2 Emotion be positive, the emotion in short sentence 3 is negative, then word A in visual angle is in the sentence being made of short sentence 1, short sentence 2 and short sentence 3 Emotion is just neutral, so that it is determined that the emotion of visual angle word A is neutrality.
Above step S1001~step S1005 is only " Analysis perspective word in step S105 that the embodiment of the present application discloses Contextual information in sentence to be analyzed obtains emotion of the sentence to be analyzed under the word of visual angle " a kind of preferred reality of process Existing mode, the specific implementation in relation to this process can be arbitrarily arranged according to their own needs, it is not limited here.
Sentence sentiment analysis method provided in an embodiment of the present invention based on visual angle, can be according to default sentence matching rule And default visual angle word matching rule treats parsing sentence respectively and multiple extracted visual angle words carry out canonical matching, this can To filter out the sentence and visual angle word that include particular emotion tendency, so that the accuracy of sentence sentiment analysis is tentatively improved, Correspondingly reduce data processing amount;Further, upper and lower in sentence to be analyzed by the analysis canonical visual angle word that it fails to match Literary information obtains emotion of the sentence to be analyzed under the visual angle word, this can accurately calculate feelings of the sentence under different perspectives Sense, to further improve the accuracy of sentence sentiment analysis.
The sentence sentiment analysis method based on visual angle provided based on the above embodiment, the embodiment of the present invention is then corresponding to be provided The device of the above-mentioned sentence sentiment analysis method based on visual angle is executed, structural schematic diagram is as shown in Figure 4, comprising: visual angle word mentions Modulus block 101, the first canonical matching module 102, judgment module 103, the second canonical matching module 104 and sentiment analysis module 105;
Visual angle word extraction module 101, for extracting at least one visual angle word included in sentence to be analyzed;
First canonical matching module 102 carries out canonical matching for treating parsing sentence according to default sentence matching rule;
Judgment module 103, for judging the number of at least one extracted visual angle word when it fails to match for sentence to be analyzed Whether amount is one;
Second canonical matching module 104, for when the quantity of at least one extracted visual angle word is not one, according to Default visual angle word matching rule successively carries out canonical matching to each visual angle word;
Sentiment analysis module 105, for for canonical each visual angle word that it fails to match, Analysis perspective word to be to be analyzed Contextual information in sentence obtains emotion of the sentence to be analyzed under the word of visual angle.
Optionally, further includes: the first emotion determining module;
First emotion determining module, for being analysed to sentence in each visual angle word when sentence successful match to be analyzed Under emotion be determined as the corresponding Sentiment orientation of default sentence matching rule being matched to.
Optionally, further includes: the second emotion determining module;
Second emotion determining module is analysed to sentence at visual angle in each visual angle word for canonical successful match Emotion under word is determined as the corresponding Sentiment orientation of default visual angle word matching rule being matched to.
Sentence sentiment analysis device provided in an embodiment of the present invention based on visual angle, can be according to default sentence matching rule And default visual angle word matching rule treats parsing sentence respectively and multiple extracted visual angle words carry out canonical matching, this can To filter out the sentence and visual angle word that include particular emotion tendency, so that the accuracy of sentence sentiment analysis is tentatively improved, Correspondingly reduce data processing amount;Further, upper and lower in sentence to be analyzed by the analysis canonical visual angle word that it fails to match Literary information obtains emotion of the sentence to be analyzed under the visual angle word, this can accurately calculate feelings of the sentence under different perspectives Sense, to further improve the accuracy of sentence sentiment analysis.
The embodiment of the present invention also provides a kind of sentence sentiment analysis device based on visual angle, should the sentence emotion based on visual angle Analytical equipment includes processor and memory, above-mentioned visual angle word extraction module, the first canonical matching module, judgment module, second Canonical matching module and sentiment analysis module etc. store in memory as program unit, are stored in by processor execution Above procedure unit in reservoir realizes corresponding function.
Include kernel in processor, is gone in memory to transfer corresponding program unit by kernel.Kernel can be set one Or more, carry out accurate parsing sentence emotion by adjusting kernel parameter.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/ Or the forms such as Nonvolatile memory, if read-only memory (ROM) or flash memory (flash RAM), memory include that at least one is deposited Store up chip.
The embodiment of the invention provides a kind of storage mediums, are stored thereon with program, real when which is executed by processor The existing sentence sentiment analysis method based on visual angle.
The embodiment of the invention provides a kind of processor, the processor is for running program, wherein described program operation Sentence sentiment analysis method described in Shi Zhihang based on visual angle.
The embodiment of the invention provides a kind of equipment, equipment include processor, memory and storage on a memory and can The program run on a processor, processor perform the steps of when executing program
Extract at least one visual angle word included in sentence to be analyzed;
Canonical matching is carried out to the sentence to be analyzed according to default sentence matching rule;
When it fails to match for the sentence to be analyzed, judge extracted at least one visual angle word quantity whether be One;
When the quantity of extracted at least one visual angle word is not one, according to default visual angle word matching rule according to It is secondary that canonical matching is carried out to each visual angle word;
For canonical each described visual angle word that it fails to match, the visual angle word is analyzed in the sentence to be analyzed Contextual information obtains emotion of the sentence to be analyzed under the visual angle word.
Wherein, further includes:
It is when the sentence successful match to be analyzed, emotion of the sentence to be analyzed under each visual angle word is true It is set to the corresponding Sentiment orientation of default sentence matching rule being matched to.
Wherein, further includes:
When the quantity of extracted at least one visual angle word is one, the emotion of the sentence to be analyzed is calculated, And emotion of the sentence to be analyzed under the visual angle word is determined as to the emotion of the sentence to be analyzed.
Wherein, further includes:
For each described visual angle word of canonical successful match, by feelings of the sentence to be analyzed under the visual angle word Sense is determined as the corresponding Sentiment orientation of default visual angle word matching rule being matched to.
Wherein, contextual information of the analysis visual angle word in the sentence to be analyzed, obtains described to be analyzed Emotion of the sentence under the visual angle word, comprising:
At least one short sentence belonging to determining the visual angle word in the sentence to be analyzed, wherein the short sentence is located at Before and after the visual angle word between punctuate;
For short sentence described in each, whether judge in the short sentence comprising other canonicals in addition to the visual angle word Visual angle word with failure;
If so, emotion of the sentence to be analyzed under the visual angle word is determined as neutrality;
If it is not, calculate the emotion of the short sentence, and emotion of the short sentence under the visual angle word be determined as described short The emotion of sentence;
According to emotion of each short sentence under the visual angle word, determine the sentence to be analyzed under the visual angle word Emotion.
Equipment herein can be server, PC, PAD, mobile phone etc..
Present invention also provides a kind of computer program products, when executing on data processing equipment, are adapted for carrying out just The program of beginningization there are as below methods step:
Extract at least one visual angle word included in sentence to be analyzed;
Canonical matching is carried out to the sentence to be analyzed according to default sentence matching rule;
When it fails to match for the sentence to be analyzed, judge extracted at least one visual angle word quantity whether be One;
When the quantity of extracted at least one visual angle word is not one, according to default visual angle word matching rule according to It is secondary that canonical matching is carried out to each visual angle word;
For canonical each described visual angle word that it fails to match, the visual angle word is analyzed in the sentence to be analyzed Contextual information obtains emotion of the sentence to be analyzed under the visual angle word.
Wherein, further includes:
It is when the sentence successful match to be analyzed, emotion of the sentence to be analyzed under each visual angle word is true It is set to the corresponding Sentiment orientation of default sentence matching rule being matched to.
Wherein, further includes:
When the quantity of extracted at least one visual angle word is one, the emotion of the sentence to be analyzed is calculated, And emotion of the sentence to be analyzed under the visual angle word is determined as to the emotion of the sentence to be analyzed.
Wherein, further includes:
For each described visual angle word of canonical successful match, by feelings of the sentence to be analyzed under the visual angle word Sense is determined as the corresponding Sentiment orientation of default visual angle word matching rule being matched to.
Wherein, contextual information of the analysis visual angle word in the sentence to be analyzed, obtains described to be analyzed Emotion of the sentence under the visual angle word, comprising:
At least one short sentence belonging to determining the visual angle word in the sentence to be analyzed, wherein the short sentence is located at Before and after the visual angle word between punctuate;
For short sentence described in each, whether judge in the short sentence comprising other canonicals in addition to the visual angle word Visual angle word with failure;
If so, emotion of the sentence to be analyzed under the visual angle word is determined as neutrality;
If it is not, calculate the emotion of the short sentence, and emotion of the short sentence under the visual angle word be determined as described short The emotion of sentence;
According to emotion of each short sentence under the visual angle word, determine the sentence to be analyzed under the visual angle word Emotion.
It should be understood by those skilled in the art that, embodiments herein can provide as method, system or computer program Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the application Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the application, which can be used in one or more, The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces The form of product.
The application is referring to method, the process of equipment (system) and computer program product according to the embodiment of the present application Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one The step of function of being specified in a box or multiple boxes.
In a typical configuration, calculating equipment includes one or more processors (CPU), input/output interface, net Network interface and memory.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/ Or the forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable Jie The example of matter.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data. The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM), Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates Machine readable medium does not include temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability It include so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also to wrap Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including element There is also other identical elements in process, method, commodity or equipment.
It will be understood by those skilled in the art that embodiments herein can provide as method, system or computer program product. Therefore, complete hardware embodiment, complete software embodiment or embodiment combining software and hardware aspects can be used in the application Form.It is deposited moreover, the application can be used to can be used in the computer that one or more wherein includes computer usable program code The shape for the computer program product implemented on storage media (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) Formula.
The above is only embodiments herein, are not intended to limit this application.To those skilled in the art, Various changes and changes are possible in this application.It is all within the spirit and principles of the present application made by any modification, equivalent replacement, Improve etc., it should be included within the scope of the claims of this application.

Claims (10)

1. a kind of sentence sentiment analysis method based on visual angle characterized by comprising
Extract at least one visual angle word included in sentence to be analyzed;
Canonical matching is carried out to the sentence to be analyzed according to default sentence matching rule;
When it fails to match for the sentence to be analyzed, judge whether the quantity of extracted at least one visual angle word is one It is a;
It is successively right according to default visual angle word matching rule when the quantity of extracted at least one visual angle word is not one Each visual angle word carries out canonical matching;
For canonical each described visual angle word that it fails to match, it is upper and lower in the sentence to be analyzed to analyze the visual angle word Literary information obtains emotion of the sentence to be analyzed under the visual angle word.
2. the method according to claim 1, wherein further include:
When the sentence successful match to be analyzed, emotion of the sentence to be analyzed under each visual angle word is determined as The corresponding Sentiment orientation of default sentence matching rule being matched to.
3. the method according to claim 1, wherein further include:
When the quantity of extracted at least one visual angle word is one, the emotion of the sentence to be analyzed is calculated, and will Emotion of the sentence to be analyzed under the visual angle word is determined as the emotion of the sentence to be analyzed.
4. the method according to claim 1, wherein further include:
It is for each described visual angle word of canonical successful match, emotion of the sentence to be analyzed under the visual angle word is true It is set to the corresponding Sentiment orientation of default visual angle word matching rule being matched to.
5. the method according to claim 1, wherein the analysis visual angle word is in the sentence to be analyzed Contextual information, obtain emotion of the sentence to be analyzed under the visual angle word, comprising:
At least one short sentence belonging to determining the visual angle word in the sentence to be analyzed, wherein the short sentence is located at described Before and after the word of visual angle between punctuate;
For short sentence described in each, judge whether lose comprising other canonicals matching in addition to the visual angle word in the short sentence The visual angle word lost;
If so, emotion of the sentence to be analyzed under the visual angle word is determined as neutrality;
If it is not, calculating the emotion of the short sentence, and emotion of the short sentence under the visual angle word is determined as the short sentence Emotion;
According to emotion of each short sentence under the visual angle word, feelings of the sentence to be analyzed under the visual angle word are determined Sense.
6. a kind of sentence sentiment analysis device based on visual angle characterized by comprising visual angle word extraction module, the first canonical Matching module, judgment module, the second canonical matching module and sentiment analysis module;
The visual angle word extraction module, for extracting at least one visual angle word included in sentence to be analyzed;
The first canonical matching module, for carrying out canonical to the sentence to be analyzed according to default sentence matching rule Match;
The judgment module, for when it fails to match for the sentence to be analyzed, judging at least one extracted described visual angle Whether the quantity of word is one;
The second canonical matching module, for pressing when the quantity of extracted at least one visual angle word is not one Canonical matching successively is carried out to each visual angle word according to default visual angle word matching rule;
The sentiment analysis module, for analyzing the visual angle word and existing for canonical each described visual angle word that it fails to match Contextual information in the sentence to be analyzed obtains emotion of the sentence to be analyzed under the visual angle word.
7. device according to claim 6, which is characterized in that further include: the first emotion determining module;
The first emotion determining module is used for when the sentence successful match to be analyzed, by the sentence to be analyzed each Emotion under a visual angle word is determined as the corresponding Sentiment orientation of default sentence matching rule being matched to.
8. device according to claim 6, which is characterized in that further include: the second emotion determining module;
The second emotion determining module will be described to be analyzed for each described visual angle word for canonical successful match Emotion of the sentence under the visual angle word is determined as the corresponding Sentiment orientation of default visual angle word matching rule being matched to.
9. a kind of storage medium, which is characterized in that the storage medium includes the program of storage, wherein run in described program When control the storage medium where equipment execute the sentence emotion according to any one of claims 1 to 5 based on visual angle point Analysis method.
10. a kind of processor, which is characterized in that the processor is for running program, wherein executed such as when described program is run Sentence sentiment analysis method of any of claims 1-5 based on visual angle.
CN201710889192.XA 2017-09-27 2017-09-27 Visual angle-based sentence emotion analysis method and device Active CN109558582B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710889192.XA CN109558582B (en) 2017-09-27 2017-09-27 Visual angle-based sentence emotion analysis method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710889192.XA CN109558582B (en) 2017-09-27 2017-09-27 Visual angle-based sentence emotion analysis method and device

Publications (2)

Publication Number Publication Date
CN109558582A true CN109558582A (en) 2019-04-02
CN109558582B CN109558582B (en) 2022-09-27

Family

ID=65863650

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710889192.XA Active CN109558582B (en) 2017-09-27 2017-09-27 Visual angle-based sentence emotion analysis method and device

Country Status (1)

Country Link
CN (1) CN109558582B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110362668A (en) * 2019-07-16 2019-10-22 阿里巴巴集团控股有限公司 For the classification method and device of user's question sentence

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080249764A1 (en) * 2007-03-01 2008-10-09 Microsoft Corporation Smart Sentiment Classifier for Product Reviews
CN104008091A (en) * 2014-05-26 2014-08-27 上海大学 Sentiment value based web text sentiment analysis method
CN106407236A (en) * 2015-08-03 2017-02-15 北京众荟信息技术有限公司 An emotion tendency detection method for comment data
CN106610990A (en) * 2015-10-22 2017-05-03 北京国双科技有限公司 Emotional tendency analysis method and apparatus

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080249764A1 (en) * 2007-03-01 2008-10-09 Microsoft Corporation Smart Sentiment Classifier for Product Reviews
CN104008091A (en) * 2014-05-26 2014-08-27 上海大学 Sentiment value based web text sentiment analysis method
CN106407236A (en) * 2015-08-03 2017-02-15 北京众荟信息技术有限公司 An emotion tendency detection method for comment data
CN106610990A (en) * 2015-10-22 2017-05-03 北京国双科技有限公司 Emotional tendency analysis method and apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110362668A (en) * 2019-07-16 2019-10-22 阿里巴巴集团控股有限公司 For the classification method and device of user's question sentence

Also Published As

Publication number Publication date
CN109558582B (en) 2022-09-27

Similar Documents

Publication Publication Date Title
CN111859960B (en) Semantic matching method, device, computer equipment and medium based on knowledge distillation
US10664660B2 (en) Method and device for extracting entity relation based on deep learning, and server
Haidar et al. Textkd-gan: Text generation using knowledge distillation and generative adversarial networks
CN108806671B (en) Semantic analysis, device and electronic equipment
CN109271493A (en) A kind of language text processing method, device and storage medium
CN109582948B (en) Method and device for extracting evaluation viewpoints
CN111858843B (en) Text classification method and device
CN111428493A (en) Entity relationship acquisition method, device, equipment and storage medium
CN111738016A (en) Multi-intention recognition method and related equipment
CN111309910A (en) Text information mining method and device
CN108304376B (en) Text vector determination method and device, storage medium and electronic device
Sridhar et al. Fake news detection and analysis using multitask learning with BiLSTM CapsNet model
CN106649250A (en) Method and device for identifying emotional new words
CN111401065A (en) Entity identification method, device, equipment and storage medium
CN113836303A (en) Text type identification method and device, computer equipment and medium
CN113408282B (en) Method, device, equipment and storage medium for topic model training and topic prediction
CN114707487A (en) Text processing method, text processing device, storage medium and electronic device
CN113723077A (en) Sentence vector generation method and device based on bidirectional characterization model and computer equipment
CN111680514B (en) Information processing and model training method, device, equipment and storage medium
CN109558582A (en) Sentence sentiment analysis method and device based on visual angle
CN115879450B (en) Gradual text generation method, system, computer equipment and storage medium
CN116070642A (en) Text emotion analysis method and related device based on expression embedding
CN110362734A (en) Text recognition method, device, equipment and computer readable storage medium
CN112347150B (en) Method and device for labeling academic label of student and electronic equipment
CN109558580A (en) A kind of text analyzing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 100080 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing

Applicant after: BEIJING GRIDSUM TECHNOLOGY Co.,Ltd.

Address before: 100086 Beijing city Haidian District Shuangyushu Area No. 76 Zhichun Road cuigongfandian 8 layer A

Applicant before: BEIJING GRIDSUM TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant