Relation Extraction and Sentiment Analysis

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/20

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 9:13 PM on 7/15/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

21 Terms

1
New cards

Rule-based Relation Extraction

If the mention of a hyponym and a hyperonym in a sentence are connected in a clearly distinguishable pattern, we can construct a rule to extract the relation.

<p>If the mention of a hyponym and a hyperonym in a sentence are connected in a clearly distinguishable pattern, we can construct a rule to extract the relation.</p><p></p>
2
New cards

Hand-written Rules Pros & Cons

+ Manually curated rules tend to have a high precision

+ Can be tailored to specific domains

-Manually curated rules often have low recall

-A lot of manual work is required to maintain rulesets

3
New cards

Bootstrap sampling

simulate having multiple different data sets (although you only have one) by repeatedly sub-sampling a single data set, for example to derive confidence intervals

4
New cards

Knowledge Base

In a knowledge base, relations are typically Encoded as triples

We can use such templates to identify patterns in which relations may occur in a corpus

Entity types can help us create pattern templates.

5
New cards

Distantly Supervised Relation Extraction

Starting with a few seed entities, find cooccurrences of these entities to identify patterns.

Use the patterns as templates for discovering new entities. Repeat.

6
New cards

Distantly Supervised Relation Extraction Pros and Cons

+ minimal manual input (a few seed entities or patterns) → semi-supervised approach (also called distant supervision)

+ System learns to extract new relations on its own

+ Improved recall

- A trade-off between precision and recall becomes necessary

- Recall is still not perfect - not all relations (always) occur in obvious patterns

7
New cards

Supervised Relation Extraction

Setup and design:

● Defining a set of relations for extraction

● Selecting a set of relevant named entities

Data:

● Compiling a representative training corpus

● Labeling named entities in the corpus

● Annotating relations between these entities (manually or pattern-based)

Training a classifier:

● Naïve Bayes

● SVM

8
New cards

Neural Language Models for Relation Extraction

Pre-trained contextual language models can be used to build relation extraction pipelines by leveraging what the model has learned about word relations (e.g. via attention).

● This is transfer learning. The model is

○ trained on an unsupervised task, and

○ fine-tuned for relation extraction.

● Adaptation of an annotation task:

○ Given a sentence with masked entities, the model is trained to label tokens with relation types.

● Adaptation of extractive question answering:

○ Given a sentence and the question the model outputs begin and end token indices of the relation in the sentence

9
New cards

Supervised Relation Extraction Pros and Cons

+high accuracy (both precision and recall) as long as we have sufficient labeled data

- Data hungry: requires a lot of labeled training data

- Often poor performance when adapting from one domain to another

10
New cards

Sentiment Analysis

Broadly speaking, sentiment analysis describes the tasks of identifying, extracting, quantifying, and studying affective states of the authors and expressed subjective information in text

11
New cards

Sentiment Analysis Applications

● Movies

● Products

● Public sentiment

● Politics

● Prediction

● Feedback:

12
New cards

Related detection / classification tasks for Sentiment Analysis

● Subjectivity

● Bias

● Stance

● Hate-speech

● Sarcasm

● Deception and betrayal

● Online trolling

● Polarization

● Politeness

● Linguistic alignment

13
New cards

Scherer Typology of Affective States

  • Emotion: brief organically synchronized [...] evaluation of a major event

  • Mood: diffuse non-caused low-intensity long-duration change in subjective feeling

  • Interpersonal stances: affective stance toward another person in a specific interaction

  • Attitudes: enduring, affectively colored beliefs, dispositions towards objects or persons

  • Personality traits: stable personality dispositions and typical behavior tendencies

14
New cards

Sentiment Analysis: Method Overview

● holder of the attitude

● target of the attitude

● type of attitude: From a set of types, More commonly: simple weighted polarity

● Text containing the attitude

15
New cards

Challenges in the extraction of features

● Tokenization

● Stemming

● Negation

● Subtleties

16
New cards

Tokenization

Punctuation is typically removed or collapsed in preprocessing. But for sentiment analysis, it may contain valuable signals.

● Repetition of punctuation for emphasis

● Masking of expletives

● Emoticons may carry more sentiment signal than most words

17
New cards

Stemming

Stemmers heuristically identify word suffixes and strip them, with some regularization of the endings. This runs the risk of merging tokens with positive or negative connotation.

Stemming can be helpful for pooling the signal

18
New cards

Negation

Negation reverses the polarity of certain words

Workaround: Simple negation marking: append a _NEG suffix to every word that occurs between a negation and the next punctuation mark at the level of the current clause.

Drawback: The vocabulary size just doubled.

19
New cards

Subtlety

sarcasm,

thwarted expectations

subtlety

20
New cards

Sentiment Lexica

Some words or phrases can be clearly identified as carriers of a strong sentiment signal: positive, negative, neutral.

They are typically compiled

● manually in a dictionary, or

● automatically from a corpus.

21
New cards

Sentiment Analysis with Neural Language Models

pre-trained contextual language models can be fine-tuned for sentiment analysis:

● This is transfer learning. The model is

○ trained on an unsupervised task, and

○ fine-tuned for sentiment analysis.

● Adaptation of a classification task:

○ Given a sentence determine to which sentiment class it belongs.

● Adaptation of a regression task:

○ Given a sentence output a sentiment score