More Text Analytics National Center for Supercomputing Applications University of Illinois at Urbana-Champaign
Outline Emotion Tracking Hands-On
Work – Emotion Tracking Goal is to have this type of Visualization to track emotions across a text document (Leveraging flare.prefuse.org)
UIMA Structured data Two SEASR examples using UIMA POS data –Frequent patterns (rule associations) of nouns (fpgrowth) –Sentiment analysis of adjectives
UIMA Unstructured Information Management Applications
UIMA + P.O.S. tagging Analysis Engines to analyze document to record Part Of Speech information. OpenNLP Tokenizer OpenNLP PosTagger OpenNLP SentanceDetector POSWriter Serialization of the UIMA CAS
UIMA to SEASR: Experiment I Finding patterns
SEASR + UIMA: Frequent Patterns Frequent Pattern Analysis on nouns Goal: –Discover a cast of characters within the text –Discover nouns that frequently occur together character relationships
Frequent Patterns: visualization Analysis of Tom Sawyer 10 paragraph window Support set to 10% Analysis of Tom Sawyer 10 paragraph window Support set to 10%
UIMA to SEASR: Experiment II Sentiment Analysis
UIMA + SEASR: Sentiment Analysis Classifying text based on its sentiment –Determining the attitude of a speaker or a writer –Determining whether a review is positive/negative Ask: What emotion is being conveyed within a body of text? –Look at only adjectives (UIMA POS) lots of issues and challenges Need to Answer: –What emotions to track? –How to measure/classify an adjective to one of the selected emotions? –How to visualize the results?
Sentiment Analysis: Emotion Selection Which emotions: – – %20emotions.htmhttp://changingminds.org/explanations/emotions/basic %20emotions.htm – mhttp:// m Parrot’s classification (2001) –six core emotions –Love, Joy, Surprise, Anger, Sadness, Fear
Sentiment Analysis: Emotions
Sentiment Analysis: Using Adjectives How to classify adjectives: –Lots of metrics we could use … Lists of adjectives already classified – ds/ewords.htmlhttp:// ds/ewords.html –Need a “nearness” metric for missing adjectives –How about the thesaurus game ?
Ontological Association (WordNet) As of 2006, the database contains about 150,000 words organized in over 115,000 synsets for a total of 207,000 word-sense pairs POSUnique Strings SynsetsTotal Strings Word-Sense Pairs Noun Verb Adjective Adverb Totals
Ontological Association (WordNet) Search for table Noun –S: (n) table, tabular array (a set of data arranged in rows and columns) "see table 1” –S: (n) table (a piece of furniture having a smooth flat top that is usually supported by one or more vertical legs) "it was a sturdy table” –S: (n) table (a piece of furniture with tableware for a meal laid out on it) "I reserved a table at my favorite restaurant” –S: (n) mesa, table (flat tableland with steep edges) "the tribe was relatively safe on the mesa but they had to descend into the valley for water” –S: (n) table (a company of people assembled at a table for a meal or game) "he entertained the whole table with his witty remarks” –S: (n) board, table (food or meals in general) "she sets a fine table"; "room and board” Verb –S: (v) postpone, prorogue, hold over, put over, table, shelve, set back, defer, remit, put off (hold back to a later time) "let's postpone the exam” –S: (v) table, tabularize, tabularise, tabulate (arrange or enter in tabular form)
SEASR: Sentiment Analysis Using only a thesaurus, find a path between two words –no antonyms –no colloquialisms or slang
SEASR: Sentiment Analysis For example, how would you get from delightful to rainy? (answer coming soon, unless you find it first)
SEASR: Sentiment Analysis How to get from delightful to rainy ? ['delightful', 'fair', 'balmy', 'moist', 'rainy']. ['sexy', 'provocative', 'blue', 'joyless’] ['bitter', 'acerbic', 'tangy', 'sweet', 'lovable’] sexy to joyless? bitter to lovable?
SEASR: Sentiment Analysis Use this game as a metric for measuring a given adjective to one of the six emotions. Assume the longer the path, the “farther away” the two words are.
SEASR: Sentiment Analysis Introducing SynNet: a traversable graph of synonyms (adjectives)
Thesaurus Network (SynNet) Used thesaurus.com, create link between every term and its synonyms Created a large network Determine a metric to use to assign the adjectives to one of our selected terms –Is there a path? –How to evaluate best paths?
SynNet: rainy to pleasant
SynNet Metrics Path length Number of Paths Common nodes Symmetric: a b b a Unique nodes in all paths
SynNet Metrics: Path Length Rainy to Pleasant –Shortest path length is 4 (blue) Rainy, Moist, Watery, Bland, Pleasant –Green path has length of 3 but is not reachable via symmetry –Blue nodes are nodes 2 hops away
SynNet Metrics: Common Nodes Common Nodes –depth of common nodes Example –Top shows happy –Bottom shows delightful –Common nodes shown in center cluster
SynNet Metrics: Symmetry Symmetry of path in common nodes
SynNet: Sentiment Analysis Step 1: list your sentiments/concepts –joy, sad, anger, surprise, love, fear Step 2: for each concept, list adjectives –joy: joyful, happy, hopeful –surprise:surprising,amazing, wonderful, unbelievable Step 3: for each adjective in the text, calculate all the paths to each adjective in step 2 Step 4: pick the best adjective (using metrics)
SynNet: Sentiment Analysis Example: the adjective to score is incredible
SynNet: Sentiment Analysis Incredible to loving (concept: love) Blue paths are symmetric paths
SynNet: Sentiment Analysis Incredible to surprising (concept: surprise) Blue paths are symmetric paths
SynNet: Sentiment Analysis Incredible to joyful (concept: joy)
SynNet: Sentiment Analysis Incredible to joyless (concept: sad)
SynNet: Sentiment Analysis Incredible to fearful (concept: fear) Winner!
SynNet: Sentiment Analysis Try it yourself: – /synnet/path/white/afraid – /synnet/path/white/afraid?format=xml – /synnet/path/white/afraid?format=json – /synnet/path/white/afraid?format=flash –Database is only adjectives –More api coming soon, visualizations
Sentiment Analysis: Issues Not a perfect solution –still need context to get quality Vain –['vain', 'insignificant', 'contemptible', 'hateful'] –['vain', 'misleading', 'puzzling', 'surprising’] Animal –['animal', 'sensual', 'pleasing', 'joyful'] –['animal', 'bestial', 'vile', 'hateful'] –['animal', 'gross', 'shocking', 'fearful'] –['animal', 'gross', 'grievous', 'sorrowful'] Negation –“My mother was not a hateful person.”
Sentiment Analysis: Process Process Overview –Extract the adjectives (SEASR, POS analysis) –Read in adjectives (SEASR) –Label each adjective (SEASR, SynNet) –Summarize windows of adjectives lots of experimentation here –Visualize the windows
Sentiment Analysis: Visualization SEASR visualization component –Based on flash using the flare ActionScript Library e.org/ e.org/ /data/viewer/emotions.html
Visualization Components JavaScript –GIS: GoogleMaps –Temporal: Simile –InfoVis: Prototvis – Parallel Coordinates, Link Node, Arcs GWT –Dendogram –Table Viewer Flash –InfoVis: Flare Applets –Data Mining Results: Decision Tree, Naïve Bayes, Rule Association Html –Reports
Demonstration Entity Extraction for timelines, maps, and social networks Emotion Tracking Concept Tracking
Learning Exercises Construct flow for performing entity extraction and review results. –Determine what you want to do with these results. Open the flow for tracking concepts –Modify the flow to load your data –Modify the flow to track concepts of interest to you
Attendee Project Plan Study/Project Title Team Members and their Affiliation Procedural Outline of Study/Project –Research Question/Purpose of Study –Data Sources –Analysis Tools Activity Timeline or Milestones Report or Project Outcome(s) Ideas on what your team needs from SEASR staff to help you achieve your goal. Identify Analytics
Discussion Questions What part of these applications can be useful to your research?