NLP_session-2

49
NLP Training Session 2 Dr. Alexandra M. Liguori Incubio The Big Data Academy Barcelona, March 25, 2015 Dr. Alexandra M. Liguori NLP Training Session 2

Transcript of NLP_session-2

Page 1: NLP_session-2

NLP Training – Session 2

Dr. Alexandra M. Liguori

Incubio – The Big Data Academy

Barcelona, March 25, 2015

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 2: NLP_session-2

Welcome back!!!

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 3: NLP_session-2

Outline

1 Recap:1 Natural Language Processing2 Typical NLP tasks → practical examples with GATE

2 Def. of semantics3 Frames approach

1 FrameNet2 GATE for semantic/content analysis

4 What next? Topics for the last session

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 4: NLP_session-2

Natural Language Processing

NLP: techniques that process written human language aslanguage.

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 5: NLP_session-2

Natural Language Processing

NLP: techniques that process written human language aslanguage.

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 6: NLP_session-2

Typical NLP tasks: Basic and simpler tasks

Tokenization RegEx

Sentence splitting RegEx

POS-tagging POS-tagging algorithms andtag sets

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 7: NLP_session-2

Typical NLP tasks: Basic and simpler tasks

Tokenization

RegEx

Sentence splitting RegEx

POS-tagging POS-tagging algorithms andtag sets

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 8: NLP_session-2

Typical NLP tasks: Basic and simpler tasks

Tokenization RegEx

Sentence splitting RegEx

POS-tagging POS-tagging algorithms andtag sets

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 9: NLP_session-2

Typical NLP tasks: Basic and simpler tasks

Tokenization RegEx

Sentence splitting

RegEx

POS-tagging POS-tagging algorithms andtag sets

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 10: NLP_session-2

Typical NLP tasks: Basic and simpler tasks

Tokenization RegEx

Sentence splitting RegEx

POS-tagging POS-tagging algorithms andtag sets

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 11: NLP_session-2

Typical NLP tasks: Basic and simpler tasks

Tokenization RegEx

Sentence splitting RegEx

POS-tagging

POS-tagging algorithms andtag sets

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 12: NLP_session-2

Typical NLP tasks: Basic and simpler tasks

Tokenization RegEx

Sentence splitting RegEx

POS-tagging POS-tagging algorithms andtag sets

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 13: NLP_session-2

Typical NLP tasks: Complex tasks

Lemmatization or StemmingImplementations of PorterStemmer (e.g. in Java),

Stanford NLP tool, GATE, ...

Topic extractionNERSemantic analysis...

Ad hoc tools, e.g.dictionaries, ontologies,Frames, GATE, NLTK, ...

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 14: NLP_session-2

Typical NLP tasks: Complex tasks

Lemmatization or Stemming

Implementations of PorterStemmer (e.g. in Java),

Stanford NLP tool, GATE, ...

Topic extractionNERSemantic analysis...

Ad hoc tools, e.g.dictionaries, ontologies,Frames, GATE, NLTK, ...

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 15: NLP_session-2

Typical NLP tasks: Complex tasks

Lemmatization or StemmingImplementations of PorterStemmer (e.g. in Java),

Stanford NLP tool, GATE, ...

Topic extractionNERSemantic analysis...

Ad hoc tools, e.g.dictionaries, ontologies,Frames, GATE, NLTK, ...

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 16: NLP_session-2

Typical NLP tasks: Complex tasks

Lemmatization or StemmingImplementations of PorterStemmer (e.g. in Java),

Stanford NLP tool, GATE, ...

Topic extractionNERSemantic analysis...

Ad hoc tools, e.g.dictionaries, ontologies,Frames, GATE, NLTK, ...

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 17: NLP_session-2

Typical NLP tasks: Complex tasks

Lemmatization or StemmingImplementations of PorterStemmer (e.g. in Java),

Stanford NLP tool, GATE, ...

Topic extractionNERSemantic analysis...

Ad hoc tools, e.g.dictionaries, ontologies,Frames, GATE, NLTK, ...

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 18: NLP_session-2

EX.: GATE

Concrete examples with GATE:1 Tokenizer2 Sentence-splitter3 POS-tagger4 Stemmer

GATEhttps://gate.ac.uk/

development at the University of Sheffield, UK.

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 19: NLP_session-2

EX.: GATE

Concrete examples with GATE:1 Tokenizer2 Sentence-splitter3 POS-tagger4 Stemmer

GATEhttps://gate.ac.uk/

development at the University of Sheffield, UK.

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 20: NLP_session-2

Semantics

’Then you should say what you mean,’the March Hare went on.’I do,’ Alice hastily replied;

’at least, I mean what I say –that’s the same thing, you know.’

’Not the same thing a bit!’ said the Hatter. ’You might just aswell say that

”I see what I eat” is the same thing as ”I eat what I see”! ’

Lewis Carroll,Alice in Wonderland

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 21: NLP_session-2

Frames and FrameNet

FrameA schematic representation of a situation involving various

participants, and other conceptual roles.E.g.:

Abby bought a car from Robin for $5,000.Robin sold a car to Abby for $5,000.

English FrameNet

https://framenet.icsi.berkeley.edu/fndrupal/development at the International Computer Science Institute in

Berkeley, California.

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 22: NLP_session-2

Frames and FrameNet

FrameA schematic representation of a situation involving various

participants, and other conceptual roles.E.g.:

Abby bought a car from Robin for $5,000.Robin sold a car to Abby for $5,000.

English FrameNet

https://framenet.icsi.berkeley.edu/fndrupal/development at the International Computer Science Institute in

Berkeley, California.

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 23: NLP_session-2

English FrameNet Example

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 24: NLP_session-2

English FrameNet Example

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 25: NLP_session-2

English FrameNet Example

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 26: NLP_session-2

English FrameNet Example

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 27: NLP_session-2

English FrameNet Example

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 28: NLP_session-2

Frame Relations

FrameNet additionally captures relationships between differentframes using relations. These include the following:

Inheritance: When one frame is a more specific version ofanother, more abstract parent frame. Anything that is trueabout the parent frame must also be true about the childframe, and a mapping is specified between the frameelements of the parent and the frame elements of the child.Perspectivized-in: A neutral frame (likeCommerce-transfer-goods) is connected to a frame with aspecific perspective of the same scenario (e.g. theCommerce-sell frame, which assumes the perspective ofthe seller or the Commerce-buy frame, which assumes theperspective of the buyer)Subframe: Some frames like the Criminal-process framerefer to complex scenarios that consist of several individualstates or events that can be described by separate frameslike Arrest, Trial, and so on.

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 29: NLP_session-2

Frame Relations

Precedes: The Precedes relation captures a temporalorder that holds between subframes of a complex scenario.Causative-of and Inchoative-of : There is a fairly systematicrelationship between stative descriptions (e.g. thePosition-on-a-scale frame, "She had a high salary") andcausative descriptions (Cause-change-of-scalar-position,"She raised his salary") or inchoative descriptions(Change-position-on-a-scale, e.g. "Her salary increased").Using: A relationship that holds between a frame that insome way involves another frame. For instance, theJudgment-communication frame uses both the Judgmentframe and the Statement frame, but does not inherit fromeither of them because there is no clear correspondence ofthe frame elements.See-also: Connects frames that bear some resemblancebut need to be distinguished carefully.

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 30: NLP_session-2

English FrameNet Example

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 31: NLP_session-2

English FrameNet Example

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 32: NLP_session-2

English FrameNet Example

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 33: NLP_session-2

English FrameNet Example

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 34: NLP_session-2

English FrameNet Example

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 35: NLP_session-2

Spanish FrameNet

FrameA schematic representation of a situation involving various

participants, and other conceptual roles. E.g.:El rock influye en los artistas de hoy en díapara sus producciones artísticas.Los artistas de hoy en día se inspiran al rockpara sus producciones artísticas.

Spanish FrameNethttp://sfn.uab.es:8080/SFN

development at the Universidad Autónoma de Barcelona andInternational Computer Science Institute in Berkeley, California.

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 36: NLP_session-2

Spanish FrameNet

FrameA schematic representation of a situation involving various

participants, and other conceptual roles. E.g.:El rock influye en los artistas de hoy en díapara sus producciones artísticas.Los artistas de hoy en día se inspiran al rockpara sus producciones artísticas.

Spanish FrameNethttp://sfn.uab.es:8080/SFN

development at the Universidad Autónoma de Barcelona andInternational Computer Science Institute in Berkeley, California.

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 37: NLP_session-2

Spanish FrameNet Example

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 38: NLP_session-2

Spanish FrameNet Example

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 39: NLP_session-2

Spanish FrameNet Example

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 40: NLP_session-2

Spanish FrameNet Example

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 41: NLP_session-2

Spanish FrameNet Example

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 42: NLP_session-2

Spanish FrameNet Example

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 43: NLP_session-2

Spanish FrameNet Example

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 44: NLP_session-2

Spanish FrameNet Example

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 45: NLP_session-2

Spanish FrameNet Example

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 46: NLP_session-2

Spanish FrameNet Example

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 47: NLP_session-2

Frames and GATE

And now...Ex. in English implementing FRAMES, LUs, and FEs with

GATE !!!

GATEhttps://gate.ac.uk/

development at the University of Sheffield, UK.

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 48: NLP_session-2

Frames and GATE

And now...Ex. in English implementing FRAMES, LUs, and FEs with

GATE !!!

GATEhttps://gate.ac.uk/

development at the University of Sheffield, UK.

Dr. Alexandra M. Liguori NLP Training – Session 2

Page 49: NLP_session-2

What next?

Topics for the last session:1 Question answering2 Reference resolution3 Named Entity Recognition (NER)4 Keyword / topic / information extraction

Dr. Alexandra M. Liguori NLP Training – Session 2