Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computing Science, University of Aberdeen1 CS4025: Semantics l Representing meaning l Semantic interpretation l Word meaning For more information: J&M,

Similar presentations

Presentation on theme: "Computing Science, University of Aberdeen1 CS4025: Semantics l Representing meaning l Semantic interpretation l Word meaning For more information: J&M,"— Presentation transcript:

1 Computing Science, University of Aberdeen1 CS4025: Semantics l Representing meaning l Semantic interpretation l Word meaning For more information: J&M, chap 14, 16 in 1 st ed; 17, 19 in 2 nd

2 Computing Science, University of Aberdeen2 NL Understanding l Understanding written text »Which books are bestsellers »Who wrote them For now, focus on “ AI ” approach »explicit models of grammar, meaning, etc

3 Computing Science, University of Aberdeen3 Stages l Morphology: analyse word inflection l Syntax: determine grammatical structure l Semantics: convert to a form that is meaningful to a computer »eg, SQL query l Pragmatics: influence of context »eg, what them refers to

4 Computing Science, University of Aberdeen4 Example l Original: Who wrote them l morph: who write/past them l Grammar: [verb=write, subject=who, object=them] l semantics: Select title, firstname, lastname from [X] l pragmatics: »Select title, firstname, lastname from books »Where salesthisyear >10000

5 Computing Science, University of Aberdeen5 Definition Semantic interpretation rewrites a parse tree into a “ meaning representation ” »Logic, SQL, knowledge base l Poorly understood compared to syntax »apps that need complex semantics, like database front ends or high-quality MT, have had limited success in the past

6 Computing Science, University of Aberdeen6 Meaning l How can we represent the meaning of an English sentence? Programming languages: “ meaning ” is the equivalent machine code a = b +c meansload a add b store c We could represent meaning as programs in some language, in which case NLU would be a kind of “ compilation ”

7 Computing Science, University of Aberdeen7 Meaning Representation in NL l Many possibilities –executable programs –logical formulas –AI knowledge representation –nothing l No consensus on what is best - basic problem in philosophy and psychology

8 Computing Science, University of Aberdeen8 Criteria for an ideal MRL l Unambiguous l Able to express all necessary shades of meaning for the application domain l Verifiability – system can tell whether a statement is true according to a knowledge base l Canonical – different sentences with the same meaning are mapped to the same representation l Support of inference

9 Computing Science, University of Aberdeen9 Example: John passed CS1001 l Different representations »Program: C (or SQL) code to add an appropriate entry to a student database »Logic: pass(John, CS1001) »AI Semantic Net PassCS1001John AgentObject

10 Computing Science, University of Aberdeen10 Program as representation l Translate English into SQL (C,...) »MS English Query / AccessELF –“ List the bestsellers ” translated into “ Select titles from books where sales>10000 ” »Usually need a different translator for each application –Good authoring environments for semantic rules are essential

11 Computing Science, University of Aberdeen11 Logic as a Representation l Translate into (first-order) logic John is a man man(John) John eats spinach eat(John,spinach) John sold all of his stocks (  X)(stock(X) & own(John,X))  sell(John, X)) John sold Peter all of his stocks (  X)(stock(X) & own(John,X))  sell(John,X,Peter))

12 Computing Science, University of Aberdeen12 Logic as Representation (2) l Good points »Can represent any meaning (if you are inventive enough about predicates etc.) »Good support for compositionality, arbitrarily complex statements »Good support for quantifiers (all, some,...) l Bad points »Doesn ’ t seem to really match the way people think. –does  really mean some?

13 Computing Science, University of Aberdeen13 Case Frames as a Representation l Form of (AI) semantic network l Assume verbs (and other words) are objects with relations AGENT - the person/thing acting THEME - the person/thing acted upon BENEFICARY - [of action] AT-LOC - where action happened

14 Computing Science, University of Aberdeen14 Example John gave Peter the ball John gave the ball to Peter The ball was given to Peter by John are all interpreted as GIVE agent = John theme = ball beneficiary = Peter

15 Computing Science, University of Aberdeen15 Meaning Primitives l Meaning primitives are a fixed set of concepts/ roles etc. in terms of which any meaning can be expressed l Makes reasoning, e.g. about whether two meanings are the same, simpler. l Example: PURCHASE act John bought the book from Sam Sam sold the book to John l Difficult to define small set of primitives »Conceptual Dependency was one serious attempt

16 Computing Science, University of Aberdeen16 l Primitives »ATRANS - abstract transfer »PTRANS - physical transfer »MTRANS - mental transfer »PROPEL - apply force to an object »INGEST - eat, drink, etc »CON - conceptualise »etc Conceptual Dependency

17 Computing Science, University of Aberdeen17 Example: "John bought a book from Mary." (BI-CAUSE (SOURCE (ATRANS (ACTOR MARY) (OBJECT BOOK) (FROM MARY) (TO JOHN) (TIME PAST))) (TARGET (ATRANS (ACTOR JOHN) (OBJECT MONEY) (FROM JOHN) (TO MARY) (TIME PAST))))

18 Computing Science, University of Aberdeen18 Example: "Bob threw the ball to Bill." (PTRANS (ACTOR BOB) (OBJECT BALL) (FROM BOB) (TO BILL) (TIME PAST) (INSTRUMENT (PROPEL (ACTOR BOB) (OBJECT BALL) (FROM BOB) (TO BILL) (TIME PAST)))

19 Computing Science, University of Aberdeen19 Knowledge Bases l Represent meaning using objects in a large AI knowledge base »CYC project - 15-year project to build a knowledge base which holds the kind of general world knowledge that people have »Use Cyc primitives and KR language to represent meaning?

20 Computing Science, University of Aberdeen20 MRLs and Logic l Most existing meaning representation languages (frames, semantic nets, case frames etc). can be viewed as subsets of First Order Logic (where the expressive power is restricted or the set of predicates etc. is partially determined) l Main deficiencies of first order logic – inability to express default inferences and inferences based on partial information

21 Computing Science, University of Aberdeen21 Choosing an MRL: What is the Task? l Why are we processing this sentence? This could influence the kind of meaning representation chosen »database interface - perhaps use SQL rep? »AI system which reasons about John ’ s problems - perhaps use logic or AI KR? »Information retrieval, speech dictation, grammar checking - don ’ t build any meaning representation?

22 Computing Science, University of Aberdeen22 Semantic Interpretation l Rewriting the parse tree into the target representation l May be based on rewrite rules that insert a semantic structure X if the parse tree contains syntactic structure Y l For generality/coverage, needs to be compositional, that is the meaning of the whole is some fixed function of the meanings of the parts l More on this in the next lecture

23 Computing Science, University of Aberdeen23 Ex: List the books S: imperative V: List NP: X mapped into Select X. from X There are also cheaper/simpler approaches to semantic interpretation in use…

24 Computing Science, University of Aberdeen24 An attempt to reduce the “ distance ” between syntactic and semantic representations l Grammar is defined in terms of semantic categories »TIMEQ-> When does FLIGHT-NP FLIGHT-VP »FLIGHT-NP -> Flight NUMBER »FLIGHT-NP -> Flight to CITY »FLIGHT-NP -> TIME flight to CITY »FLIGHT-VP -> depart »FLIGHT-VP -> leave Semantic interpretation: Semantic grammar

25 Computing Science, University of Aberdeen25 l Look for patterns (either in text or parse tree) which identify meaning fragments »Example: How much is a ticket to London? »How much specifies cost query »a ticket specifies a single one-way ticket »to London specifies destination l Must be in limited domain l Patterns looked for can be informed by knowledge about how words relate to underlying concepts and what syntactic properties words have. Semantic Interpretation: Template spotting

26 Computing Science, University of Aberdeen26 Doctor-on-Board Problem l Simple rewriting may not be sufficient. Example: –Is there a doctor within 200 miles of the Enterprise »Database doesn ’ t have Doctor entities, instead it has DoctorOnBoard attr for ships »Need to rephrase this as –Is there a ship within 200 miles of the Enterprise which has a doctor on board? »Restructure query from human ’ s data model to database ’ s data model l Distance between syntactic and semantic structure significant in this example

27 Computing Science, University of Aberdeen27 Lexical (Word) Meaning l Logic (classical) model »bachelor(X) = male(X) & adult(X) & ¬married(X) –But: the pope? Divorcee? Muslim with 3 wives? »Father(X) = male(X)&parent(X) –Man who adopts a child? –Sperm-bank donor? –Unmarried partner to woman raising a child? –Unmarried (gay) partner to man raising a child? Prototype/exemplar models may be better when words don ’ t have formal “ definitions ”

28 Computing Science, University of Aberdeen28 Word meaning for time-series data l Weather reports »Saturday will be yet another generally dull day with early morning mist or fog and mainly cloudy skies being prevalent. There will be the odd bright spell here and there, but it will feel rather damp with patches of mainly light rain to be found across many parts, especially the west and south. l Ongoing research project in CS Dept

29 Computing Science, University of Aberdeen29 Converting sentences to a “ meaning representation ” is hard »No agreement on best meaning-rep »Word meaning is hard to pin down Limited success in small domains, but we can ’ t semantically interpret general text »but we can parse general text Conclusion

Download ppt "Computing Science, University of Aberdeen1 CS4025: Semantics l Representing meaning l Semantic interpretation l Word meaning For more information: J&M,"

Similar presentations

Ads by Google