Download presentation
Presentation is loading. Please wait.
Published byCoralie Brisson Modified over 6 years ago
1
Unit-4 Lexical Semantics M.B.Chandak, HoD CSE,
2
Contents Semantics Word Sense Ambiguity Basic Logic Form Language
Encoding Ambiguity in Logic Form Verb and States in Logic Form Thematic roles Selection preferences and restriction
3
Contents and Outcome Lexical semantics and word-sense disambiguation. Compositional semantics. Semantic Role Labeling and Semantic Parsing. Outcome Ability to perform semantic parsing and word sense disambiguation.
4
Lexical Semantics Study of Word meaning
Lexicon: Word, Token or smallest unit of language: Lemma or Stem Majorly for understanding lexical semantics, words are represented using “Lemma”. The process of mapping word to lemma is called as Lemmatization.
5
Lexical Semantics To understand semantics/meaning of lexicon, context reference is important. For example: Word “Bank” Organization or sloping mound. Homonyms: Word Sense: One word with multiple sense. Two types of relationship between senses: Synonyms and Antonyms
6
Lexical Semantics Synonyms and Antonyms
Synonyms are words having same meaning in some or all context. They can replace each other. Antonyms: Words having opposite meaning.
7
Thematic Roles It is data structure used to represent semantic constructs of any sentence. Thematic roles identifies major activities of any sentence to remove ambiguity. Thematic roles are useful in answering questions related to sentence or group of sentences. Example: Who, What, How, When, Where, Which etc. The main use of Thematic roles in is designing question-answer systems.
8
Thematic Roles: Types Consider Examples:
John broke the window with hammer The hammer broke the window The window broke Three types of Semantic/Thematic Roles: AGENT, THEME, INSTRUMENT Agent=Noun John Theme=Entity Window Instrument Mean by which action is performed.
9
Thematic Roles Agent Participant, which initiate the action Generally Noun The Tiger jumped on deer John baked the cake Theme Answer to question “What” The entity moved by action or whose location is described. The “thing” affected by event David kicked the ball high The book is in the library rack The cloud appeared over the horizon
10
Thematic Roles Instrument Mean by which action is performed
John broke window with hammer John wrote letter with blue pen It is a force/tool causing an event Generally subject of preposition “with” Result The entity undergoing effect of some action or change of state. The sun melted the ice
11
Thematic Roles Beneficiary [For Whom]
The entity for “whose” benefit action was performed. David brought car for Mary I gave book to John for Susan Experiencer Person involved in perception Physical / psychological state David saw the tiger Henry believes that France will win
12
Thematic Roles Goal The destination of an object of transfer event.
I want to go to movie Susan was awarded with prize Source The origin of object of transfer event. David saw tiger in forest. Henry got Ipad from his friend
13
Using Wordnet Step1: To Import Wordnet
>>> from nltk.corpus import wordnet Step2: To pass the word for finding senses >>> syns=wordnet.synsets("program”) >>> print(syns) [Synset('plan.n.01'), Synset('program.n.02'), Synset('broadcast.n.02'), Synset(‘platform.n.02'), Synset('program.n.05'), Synset('course_of_study.n.01'), Synset('program.n.07'), Synset('program.n.08'), Synset('program.v.01'), Synset('program.v.02')] >>> print(syns[0].lemmas()) [Lemma('plan.n.01.plan'), Lemma('plan.n.01.program'), Lemma('plan.n.01.programme')]
14
Using Wordnet >>> syns=wordnet.synsets("book")
>>> print(syns1) [Synset('book.n.01'), Synset('book.n.02'), Synset('record.n.05'), Synset('script.n.01'), Synset('ledger.n.01'), Synset('book.n.06'), Synset('book.n.07'), Synset('koran.n.01'), Synset('bible.n.01'), Synset('book.n.10'), Synset('book.n.11'),Synset('book.v.01'), Synset('reserve.v.04'), Synset('book.v.03'), Synset('book.v.04')] print(syns[0].lemmas()[0].name()) print(syns[0].defintion())
15
Using Lemmatizer and stemmer
from nltk.stem import WordNetLemmatizer lemmatizer=WordNetLemmatizer() print(lemmatizer.lemmatize("better", pos='a')) print(lemmatizer.lemmatize("celebrating", pos='v')) from nltk.stem import PorterStemmer stm = PorterStemmer() stm.stem('buses') lemmatizer.lemmatize('buses) lemmatizer.lemmatize('making', pos='v‘) make
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.