Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Natural Language Processing (6) Semantics

Natural Language Processing (6) Semantics

自然言語処理研究室

October 25, 2013
Tweet

More Decks by 自然言語処理研究室

Other Decks in Education

Transcript

  1. 1 1 / 25 Natural Language Processing (6) Semantics Kazuhide

    Yamamoto Dept. of Electrical Engineering Nagaoka University of Technology
  2. 2 / 25 Semantic analysis • is one of the

    important modules in natural language processing, that analyzes a given expression semantically. • has also been discussed in the research field of artificial intelligence (AI), in a way of knowledge representation. • Although syntactic analysis (= parsing) and semantic analysis are two separated (and pipelined) processes, they are closely related each other. For instance, syntactic disambiguation sometimes requires semantic information.
  3. 3 / 25 What task is it? • Semantic analysis

    literally means determining the meaning (sense) of the input sentence (or other expression(s)). • But, in what situation can we say "yes, I understand it"? What should we give out as the result of semantic analysis? Human: Do you understand the meaning of "right" ? Machine: Yes. Human: Good. So tell me what you understand. Machine: ?????
  4. 4 / 25 What task is it actually? • In

    many cases, the term "semantic analysis" is used as sense disambiguation of given expression. • That is, candidates of the input sense are provided in advance, the task is to select the most appropriate one out of the candidates. (example) • exact figure (数字) / important figure (人物) / beautiful figure (容姿) – Senses of "figure" are all different. • bow, minute, close, live, tear, … – Sometimes different sense makes different pronunciation.
  5. 6 / 25 Semantic representation There are several ways proposed

    so far to represent meaning of a sentence. Below are some of the well-known representations. • First-order predicate calculus • Semantic network • Frame(-based representation) In the following four slides, the same sentence, I have a car, is represented in the above four kinds.
  6. 7 / 25 Example: I have a car. First Order

    Predicate Calculus x,y Having(x) Haver(Speaker, x) HadThing(y, x) Car(y) ∃ ∧ ∧ ∧ Semantic Network Having Haver Speaker Had-Thing Car Frame-based representation Having Haver: Speaker HadThing: Car
  7. 8 / 25 First-order predicate calculus / 一階述語論理 • also

    called as first-order logic, lower predicate calculus, and quantification theory. • is flexible, well-understood, and computationally tractable • The represented world consists of – objects, – properties of objects, and – relations among objects.
  8. 9 / 25 FOPC: other examples Nishoku is a restaurant.

      Restaurant(Nishoku) Nishoku serves spaghetti.   Serves(Nishoku, Spaghetti) Nishoku is near Barber.       Near(LocationOf(Nishoku), LocationOf(Barber)) A restaurant that serves spaghetti near Barber      ∃x Restaurant(x) Serves(x, Spaghetti) ∧      ∧Near((LocationOf(x), LocationOf(Barber)) I will arrive in New York.       ∃i,e,w,t ISA(w,Arriving) Arriver(w,speaker) ∧      ∧Destination(w,NewYork) IntervalOf(w,i) ∧       ∧Endpoint(i,e) Precedes(Now,e) ∧
  9. 10 / 25 FOPC: syntax Representation of First-order predicate calculus

    consists of the following components: – Connective: (and), (or), ∧ ∨ ¬ (not), (implies) ⇒ – Quantifier: (for all), (there exists) ∀ ∃ – Predicate: Restaurant(), Serves(), LocationOf(), ... – Constant: Nishoku, Barber, Spaghetti, ... – Variable: x, y, ...
  10. 11 / 25 Semantic Network • Objects are represented as

    nodes in a graph. • Relations between are represented by named links.
  11. 12 / 25 Frame-based approaches • also known as slot-filler

    representation. • Objects are represented as feature structures, that can be also represented as graphs. In this sense both representational schemes are same in essence. • Features are called slots, the values of these slots can either be atomic values or other embedded frames. BELIEVING Believer Believed Speaker EATING Eater Eaten Mary BritishFood I believe Mary ate British food.
  12. 14 / 25 Use of Selectional Restriction • Selectional restriction-based

    disambiguation is used with thesaurus to rule out inappropriate senses.   I should wash some dishes first. (dish = 皿)   I should roast some dishes first. (dish = 料理) • We usually wash devices for eating, so dish of the food sense conflicts with the object of washing. We can reduce sense of food in this sentence. • The following example is more complex where serve and dish are both ambiguous. However, the senses are correctly determined also by selectional restriction.   This restaurant only serves vegetarian dishes.
  13. 15 / 25 WordNet: hyponymy chains bass 3: an adult

    male singer entity > causal agent > life form > person, individual > entertainer > performing artist > musician, instrumentalist > singer, vocalist bass 7: a member of musical instruments entity > object > artifact > instrumentality > device > instrument > musical instrument http://wordnetweb.princeton.edu/perl/webwn http://www.omomimi.com/wnjpn/
  14. 16 / 25 Limitation of selectional restriction • What kind

    of dishes do you prefer? – too general to uniquely select a correct sense. • We know that we can't buy time. – negation (can't) makes possible to violate selectional restriction. • If you want to kill SoftBank, get it to try to eat Yahoo! Japan. – metaphoric (隠喩的な) and metonymic (換喩的な) expressions also make possible. One approach to alleviating this problem is to adopt the view of selectional restriction as preferences, rather than rigid requirements.
  15. 17 / 25 Vector Space Model • A model where

    features are represented as elements of a vector. This approach is widely used in NLP applications. • In word sense disambiguation task, features of a word is its context; in one implementation, its surrounding 5 or 10 words appeared just before and after the word. • In disambiguation, two vectors (i.e., feature vector and input vector) are compared to compute similarity. A sense that has most similar in comparison is judged to be its word sense.
  16. 18 / 25 Dictionary-Based Approach Use of machine-readable word dictionary

    (for human).  senses of pine   1. kinds of evergreen tree with needle-shaped leaves   2. waste away through sorrow or illness  senses of cone   1. solid body which narrows to a point   2. something of this shape whether solid or hollow   3. fruit of certain evergreen trees. "pine cone" should be pine1 cone3.
  17. 19 / 25 How many semantic classes are necessary? •

    Not easy to answer; it depends on the tasks. • WordNet has 115,000 synsets. • For example, it is reported that 3,000 Japanese classes are required for Japanese-English machine translation. But it is expected to be fewer for Japanese-Korean or Japanese- Chinese pairs. • (to be discussed more at the language resource lecture)
  18. 20 / 25 Example-based approach • List of examples (or

    instances) are described as alternatives of meaning. For example, instead of calling object names such as "vehicle", instances such as "car, bus, train, ..." are used to represent the meaning. • Similarity calculation is required between words; given two sets of instances such as – car, bus, train, ... – letter, note, ... • we need to compute semantically most similar one to a word such as "bicycle".
  19. 21 / 25 Example: disambiguation of "take" Examples: take a

    note/letter ; write down take drugs/pills/medicines ; swallow take a car/bus ; use it to move take coffee/milk ; eat take NewsWeek/Nikkei ; subscribe take pleasure/delight ; feel take three hours ; require time Input: We took the train to Tokyo. Let's take a tea there.
  20. 23 / 25 Other analysis (1) scope problem   Everyone

    solved one question. This means either   (a) There is one question in total and they solved it (together). or   (b) Each one solved his/her question. The scope of the expression “all,” “no,” have to be recognized. Any language has similar problem to this.
  21. 24 / 25 Other analysis (2) idioms  That's a piece

    of cake. This means, in many cases,   (a) That's very easy. but in some situations this should be interpreted literally, i.e.,   (b) You can see a piece of cake there. In order to understand the meaning correctly, we need to identify idioms as well as metaphors.
  22. 25 / 25 Summary: today's key words • semantic representation

    • word sense disambiguation • features and example-based • other difficulties