download

Matakuliah
Tahun
Versi
: T0264/Intelijensia Semu
: Juli 2006
: 2/3
Pertemuan 23
Natural Language Processing
Semantic Analysis
1
Learning Outcomes
Pada akhir pertemuan ini, diharapkan mahasiswa
akan mampu :
• << TIK-99 >>
• << TIK-99>>
2
Outline Materi
•
•
•
•
•
Materi 1
Materi 2
Materi 3
Materi 4
Materi 5
3
15.3. Semantic Analysis
• Producing a syntactic parse of sentence is only the
first step toward understanding it.
• Still produce a representation of the meaning of the
sentence.
• Because understanding is a mapping process, we
must first define the language into which we are
trying to map.
4
Lexical Processing
• The first step in any semantic processing
system is to look up the individual words in
a dictionary (or lexicon) and extract their
meaning.
• The process of determining the correct
meaning of the individual word is called
word sense disambiguation or lexical
disambiguation.
5
Lexical Processing
Word sense disambiguation using features such as:
–
–
–
•
•
PHYSICAL-OBJECT
ANIMATE-OBJECT
ABSTRACT-OBJECT
Examples:
“ Pop hates the cold.”
“John saw Susan’s diamond shimmering from
across the room.”
“ My lawn hates the cold.”
Word sense disambiguation using reasoning.
6
Sentence-Level Processing
Several approach to the problem to creating a
semantic representation of a sentence have
been developed, including the following:
•
Semantic grammars
•
Case grammars
•
Conceptual parsing
•
Approximately compositional semantic
interpretation
7
15.3.1. A Semantic Grammar
• A semantic grammar is a context-free
grammar in which the choice of nonterminals
and production rules is governed by
semantic as well as syntactic function.
• There is usually a semantic action
associated with each grammar rule.
• The result of the parsing and applying all the
associated semantic actions is meaning of
the sentence.
8
A Semantic Grammar
S  what is FILE-PROPERTY of FILE ?
{query FILE.FILE-PROPERTY}
S  I want to ACTION
{command ACTION}
FILE-PROPERTY  the FILE-PROP
{FILE-PROP}
FILE-PROP  extensionprotectioncreation dateowner
{value}
9
A Semantic Grammar contd’
FILE  FILE-NAME FILE1
{value}
FILE1  USER’s FILE2
{FILE2.owner : USER}
FILE1  FILE2
{FILE2}
FILE2  EXT file
{instance : file-struct
extension : EXT}
10
A Semantic Grammar contd’
EXT  .init.txt.lsp.for.ps.mss
{value}
ACTION  print FILE
{instance : printing
object : FILE}
ACTION  print FILE on PRINTER
{instance : printing
object : FILE
printer : PRINTER}
USER  Bill Susan
{value}
11
The Result of Parsing with a Semantic Grammar
12
15.3.2. Case Grammars
• Case grammar provide a different approach to the
problem of how syntactic interpretation can be
combined
• Syntactic Parses of an
Active and a Passive Sentences
13
Case Grammars
• Syntactic Parses of Two Similar Sentences
14
Case Grammars
Case grammars capture surface semantic roles.
Example :
– “Mother baked for three hours.”
(baked (agent Mother)
(timeperiod 3-hours))
– “The pie baked for three hours.”
(baked (object Pie)
(timeperiod 3-hours))
15
Case Grammars
•
•
•
•
•
•
•
•
•
•
(A) Agent  Instigator of the action
(I) Instrument  Cause of the event or object used in
causing the event
(D) Dative  Entity affected by the action
(F) Factitive  Object or being resulting from the event
(L) Locative  Place of the event
(S) Source  Place from which something moves
(G) Goal  Place to which something moves
(B) Beneficiary  Being on whose behalf the event
occurred
(T) Time  Time at which the event occurred
(O) Object  Entity that is acted upon or that changes,
the most general case
16
Some Verb Case Frames
open [ _ _ O (I) (A)]
The door opened.
John opened the door.
The wind opened the door.
John opened the door with a chisel.
die
kill
run
want
[ _ _ D]
John died.
[_ _ D (I) A]
Bill killed John.
[ _ _ A]
John ran.
[ _ _ AO]
John wanted some ice cream.
John wanted Mary to go to the store.
17
15.3.3. Conceptual Parsing
• Conceptual Parsing is strategy for finding
both the structure and the meaning of a
sentence in one step.
• Conceptual Parsing is driven by a
dictionary that describes the meaning of
word as conceptual dependency (CD)
structure.
18
Two CD Interpretations of a Sentence
19
15.3.4. Approximately Compositional Semantic
Interpretation
• Montague Semantics
• Extended Reasoning with a Knowledge
• The Interaction between Syntax and
Semantics
20
<< Closing >>
End of Pertemuan 23
Good Luck
21