COMPUTER ARRANGEMENT FOR AND COMPUTER IMPLEMENTED METHOD OF DETECTING POLARITY IN A MESSAGE
First Claim
1. Computer arrangement provided with a processor and memory, the memory storing a computer program comprising instructions and data, the processor being arranged to read said instructions and data from said memory and to run said computer program, said memory comprising a set of patterns, each pattern including a combination of one or more words and one or more part-of-speech tags, said set of patterns including at least:
- Positive patterns which are associated with positive sentiment when taken out of context,Negative patterns which are associated with negative sentiment when taken out of context.Amplifier patterns which strengthen positive and negative sentiment of n entities to their right and left in a message,Attenuator patterns which weaken positive and negative sentiment of n entities to their right and left in a message,Right Flip patterns which flip positive and negative sentiment of n entities to their right in a message,Left Flip patterns which flip positive and negative sentiment of n entities to their left in a message,Continuator patterns which continue emission of positive and negative sentiment,Stop patterns which interrupt emission of positive and negative sentiment,wherein said processor is arranged to perform the following actions when running said program in order to detect polarity of a sentiment in a message;
Receiving said message m with a number of words,Representing said message as a list of tuples, each tuple comprising a word and an associated part-of-speech tag, each tuple having an initial sentiment emission value,Comparing all tuples of said list of tuples with said set of patterns and producing a set of matching patterns, each matching pattern comprising a start position in said message, an end position in said message and a pattern selected from said set of patterns that matches a tuple,Setting stops in said message, stops being defined as sentiment emission boundaries in said message, by setting a stop at a starting position of each left flip pattern and at the starting position of each stop pattern,Updating for each tuple its sentiment emission value based on positive patterns present in said message by applying a first decaying function on each sentiment emission value which first decaying function takes distance between each positive pattern and each tuple of said message into account, rendering a first updated set of sentiment emission values,Updating said first updated set of sentiment emission values based on negative patterns present in said message by applying a second decaying function on each sentiment emission value of said first updated set of sentiment emission values which second decaying function takes distance between each negative pattern and each tuple of said message into account, rendering a second updated set of sentiment emission values,Updating said second updated set of sentiment emission values based on amplifier patterns present in said message by applying an amplifying function on each sentiment emission value of said second updated set of sentiment emission values which amplifying function takes distance between each amplifier pattern and each tuple of said message into account, rendering a third updated set of sentiment emission values,Updating said third updated set of sentiment emission values based on attenuation patterns present in said message by applying an attenuation function on each sentiment emission value of said third updated set of sentiment emission values which attenuation function takes distance between each amplifier pattern and each tuple of said message into account, rendering a fourth updated set of sentiment emission values,Updating said fourth updated set of sentiment emission values based on right flip patterns present in said message by flipping each sentiment emission value of said fourth updated set of sentiment emission values of those tuples of said message that are within a certain distance to the right of said right flip patterns, rendering a fifth updated set of sentiment emission values,Updating said fifth updated set of sentiment emission values based on left flip patterns present in said message by flipping each sentiment emission value of said fifth updated set of sentiment emission values of those tuples of said message that are within a certain distance to the left of said left flip patterns, rendering a sixth updated set of sentiment emission values,Calculating a final polarity of said message by adding all sentiment emission values of said sixth updated set of sentiment emission values.
1 Assignment
0 Petitions
Accused Products
Abstract
The present invention relates to automatic sentiment analysis by a computer arrangement and a computer implemented method. A message is presented to the computer arrangement which stores a set of patterns. Each pattern has a word and an associated part-of-speech tag. The message is compared against the patterns as stored in memory rendering a set of matching patterns. The set of matching patterns is then processed in accordance with a set of rules taking into account presence of patterns in the message that may add to a positive polarity and negative polarity, and patterns that may amplify, attenuate or flip such positive polarity or negative polarity.
-
Citations
8 Claims
-
1. Computer arrangement provided with a processor and memory, the memory storing a computer program comprising instructions and data, the processor being arranged to read said instructions and data from said memory and to run said computer program, said memory comprising a set of patterns, each pattern including a combination of one or more words and one or more part-of-speech tags, said set of patterns including at least:
-
Positive patterns which are associated with positive sentiment when taken out of context, Negative patterns which are associated with negative sentiment when taken out of context. Amplifier patterns which strengthen positive and negative sentiment of n entities to their right and left in a message, Attenuator patterns which weaken positive and negative sentiment of n entities to their right and left in a message, Right Flip patterns which flip positive and negative sentiment of n entities to their right in a message, Left Flip patterns which flip positive and negative sentiment of n entities to their left in a message, Continuator patterns which continue emission of positive and negative sentiment, Stop patterns which interrupt emission of positive and negative sentiment, wherein said processor is arranged to perform the following actions when running said program in order to detect polarity of a sentiment in a message; Receiving said message m with a number of words, Representing said message as a list of tuples, each tuple comprising a word and an associated part-of-speech tag, each tuple having an initial sentiment emission value, Comparing all tuples of said list of tuples with said set of patterns and producing a set of matching patterns, each matching pattern comprising a start position in said message, an end position in said message and a pattern selected from said set of patterns that matches a tuple, Setting stops in said message, stops being defined as sentiment emission boundaries in said message, by setting a stop at a starting position of each left flip pattern and at the starting position of each stop pattern, Updating for each tuple its sentiment emission value based on positive patterns present in said message by applying a first decaying function on each sentiment emission value which first decaying function takes distance between each positive pattern and each tuple of said message into account, rendering a first updated set of sentiment emission values, Updating said first updated set of sentiment emission values based on negative patterns present in said message by applying a second decaying function on each sentiment emission value of said first updated set of sentiment emission values which second decaying function takes distance between each negative pattern and each tuple of said message into account, rendering a second updated set of sentiment emission values, Updating said second updated set of sentiment emission values based on amplifier patterns present in said message by applying an amplifying function on each sentiment emission value of said second updated set of sentiment emission values which amplifying function takes distance between each amplifier pattern and each tuple of said message into account, rendering a third updated set of sentiment emission values, Updating said third updated set of sentiment emission values based on attenuation patterns present in said message by applying an attenuation function on each sentiment emission value of said third updated set of sentiment emission values which attenuation function takes distance between each amplifier pattern and each tuple of said message into account, rendering a fourth updated set of sentiment emission values, Updating said fourth updated set of sentiment emission values based on right flip patterns present in said message by flipping each sentiment emission value of said fourth updated set of sentiment emission values of those tuples of said message that are within a certain distance to the right of said right flip patterns, rendering a fifth updated set of sentiment emission values, Updating said fifth updated set of sentiment emission values based on left flip patterns present in said message by flipping each sentiment emission value of said fifth updated set of sentiment emission values of those tuples of said message that are within a certain distance to the left of said left flip patterns, rendering a sixth updated set of sentiment emission values, Calculating a final polarity of said message by adding all sentiment emission values of said sixth updated set of sentiment emission values. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
4. Computer arrangement according to claim 1, wherein said amplifying function is
1+e− - x and said attenuation function is 1−
e−
x.
- x and said attenuation function is 1−
-
5. Computer arrangement according to claim 1, wherein said message is derived from a social media source on the internet.
-
6. Computer arrangement according to claim 1, wherein said computer program allows said processor to perform said actions on messages from several languages.
-
7. A computer readable medium embodying instructions executable by a processor to perform a method for detecting a polarity of a sentiment in a message, by using a set of patterns stored in a memory, each pattern including a combination of one or more words and one or more part-of-speech tags, said set of patterns including at least:
-
Positive patterns which are associated with positive sentiment when taken out of context, Negative patterns which are associated with negative sentiment when taken out of context. Amplifier patterns which strengthen positive and negative sentiment of n entities to their right and left in a message, Attenuator patterns which weaken positive and negative sentiment of n entities to their right and left in a message, Right Flip patterns which flip positive and negative sentiment of n entities to their right in a message, Left Flip patterns which flip positive and negative sentiment of n entities to their left in a message, Continuator patterns which continue emission of positive and negative sentiment, Stop patterns which interrupt emission of positive and negative sentiment, wherein said method includes the following actions to detect said polarity of said sentiment in said message; Receiving said message m with a number of words, Representing said message as a list of tuples, each tuple comprising a word and an associated part-of-speech tag, each tuple having an initial sentiment emission value, Comparing all tuples of said list of tuples with said set of patterns and producing a set of matching patterns, each matching pattern comprising a start position in said message, an end position in said message and a pattern selected from said set of patterns matching a tuple, Setting stops in said message, stops being defined as sentiment emission boundaries in said message, by setting a stop at a starting position of each left flip pattern and at the starting position of each stop pattern, Updating for each tuple its sentiment emission value based on positive patterns present in said message by applying a first decaying function on each sentiment emission value which first decaying function takes distance between each positive pattern and each tuple of said message into account, rendering a first updated set of sentiment emission values, Updating said first updated set of sentiment emission values based on negative patterns present in said message by applying a second decaying function on each sentiment emission value of said first updated set of sentiment emission values which second decaying function takes distance between each negative pattern and each tuple of said message into account, rendering a second updated set of sentiment emission values, Updating said second updated set of sentiment emission values based on amplifier patterns present in said message by applying an amplifying function on each sentiment emission value of said second updated set of sentiment emission values which amplifying function takes distance between each amplifier pattern and each tuple of said message into account, rendering a third updated set of sentiment emission values, Updating said third updated set of sentiment emission values based on attenuation patterns present in said message by applying an attenuation function on each sentiment emission value of said third updated set of sentiment emission values which attenuation function takes distance between each amplifier pattern and each tuple of said message into account, rendering a fourth updated set of sentiment emission values, Updating said fourth updated set of sentiment emission values based on right flip patterns present in said message by flipping each sentiment emission value of said fourth updated set of sentiment emission values of those tuples of said message that are within a certain distance to the right of said right flip patterns, rendering a fifth updated set of sentiment emission values, Updating said fifth updated set of sentiment emission values based on left flip patterns present in said message by flipping each sentiment emission value of said fifth updated set of sentiment emission values of those tuples of said message that are within a certain distance to the left of said left flip patterns, rendering a sixth updated set of sentiment emission values, Calculating a final polarity of said message by adding all sentiment emission values of said sixth updated set of sentiment emission values.
-
-
8. Computer implemented method as executed by a processor for detecting a polarity of a sentiment in a message, by using a set of patterns stored in a memory, each pattern including a combination of one or more words and one or more part-of-speech tags, said set of patterns including at least:
-
Positive patterns which are associated with positive sentiment when taken out of context, Negative patterns which are associated with negative sentiment when taken out of context. Amplifier patterns which strengthen positive and negative sentiment of n entities to their right and left in a message, Attenuator patterns which weaken positive and negative sentiment of n entities to their right and left in a message, Right Flip patterns which flip positive and negative sentiment of n entities to their right in a message, Left Flip patterns which flip positive and negative sentiment of n entities to their left in a message, Continuator patterns which continue emission of positive and negative sentiment, Stop patterns which interrupt emission of positive and negative sentiment, wherein said computer implemented method includes the following actions to detect said polarity of said sentiment in said message; Receiving said message m with a number of words, Representing said message as a list of tuples, each tuple comprising a word and an associated part-of-speech tag, each tuple having an initial sentiment emission value, Comparing all tuples of said list of tuples with said set of patterns and producing a set of matching patterns, each matching pattern comprising a start position in said message, an end position in said message and a pattern selected from said set of patterns matching a tuple, Setting stops in said message, stops being defined as sentiment emission boundaries in said message, by setting a stop at a starting position of each left flip pattern and at the starting position of each stop pattern, Updating for each tuple its sentiment emission value based on positive patterns present in said message by applying a first decaying function on each sentiment emission value which first decaying function takes distance between each positive pattern and each tuple of said message into account, rendering a first updated set of sentiment emission values, Updating said first updated set of sentiment emission values based on negative patterns present in said message by applying a second decaying function on each sentiment emission value of said first updated set of sentiment emission values which second decaying function takes distance between each negative pattern and each tuple of said message into account, rendering a second updated set of sentiment emission values, Updating said second updated set of sentiment emission values based on amplifier patterns present in said message by applying an amplifying function on each sentiment emission value of said second updated set of sentiment emission values which amplifying function takes distance between each amplifier pattern and each tuple of said message into account, rendering a third updated set of sentiment emission values, Updating said third updated set of sentiment emission values based on attenuation patterns present in said message by applying an attenuation function on each sentiment emission value of said third updated set of sentiment emission values which attenuation function takes distance between each amplifier pattern and each tuple of said message into account, rendering a fourth updated set of sentiment emission values, Updating said fourth updated set of sentiment emission values based on right flip patterns present in said message by flipping each sentiment emission value of said fourth updated set of sentiment emission values of those tuples of said message that are within a certain distance to the right of said right flip patterns, rendering a fifth updated set of sentiment emission values, Updating said fifth updated set of sentiment emission values based on left flip patterns present in said message by flipping each sentiment emission value of said fifth updated set of sentiment emission values of those tuples of said message that are within a certain distance to the left of said left flip patterns, rendering a sixth updated set of sentiment emission values, Calculating a final polarity of said message by adding all sentiment emission values of said sixth updated set of sentiment emission values.
-
Specification