open system categorical quantum semantics in natural
play

Open System Categorical Quantum Semantics in Natural Language - PowerPoint PPT Presentation

Open System Categorical Quantum Semantics in Natural Language Processing R. Piedeleu 1 D. Kartsaklis 2 B. Coecke 1 M. Sadrzadeh 2 1 Department of Computer Science University of Oxford 2 School of Electronic Engineering and Computer Science Queen


  1. Open System Categorical Quantum Semantics in Natural Language Processing R. Piedeleu 1 D. Kartsaklis 2 B. Coecke 1 M. Sadrzadeh 2 1 Department of Computer Science University of Oxford 2 School of Electronic Engineering and Computer Science Queen Mary University of London CALCO 2015 d.kartsaklis@qmul.ac.uk Open System Categorical Quantum Semantics in NLP 1/28

  2. In a nutshell Categorical compositional distributional semantics unifies two orthogonal semantic paradigms: The type-logical compositional approach of formal semantics The quantitative perspective of vector space models of meaning The goal is to represent sentences as points in some high dimensional metric space In this work: Inspired by categorical quantum mechanics, we extend the model in order to explicitly take into account lexical ambiguity during the compositional process. d.kartsaklis@qmul.ac.uk Open System Categorical Quantum Semantics in NLP 2/28

  3. Outline Categorical compositional distributional models 1 Composition and lexical ambiguity 2 Open system quantum semantics 3 From theory to practice 4 d.kartsaklis@qmul.ac.uk Open System Categorical Quantum Semantics in NLP 3/28

  4. The meaning of words Distributional hypothesis Words that occur in similar contexts have similar meanings [Harris, 1958]. The functional interplay of philosophy and ? should, as a minimum, guarantee... ...and among works of dystopian ? fiction... The rapid advance in ? today suggests... ...calculus, which are more popular in ? -oriented schools. But because ? is based on mathematics... ? ...the value of opinions formed in as well as in the religions... ...if ? can discover the laws of human nature.... ...is an art, not an exact ? . ...factors shaping the future of our civilization: ? and religion. ...certainty which every new discovery in ? either replaces or reshapes. ...if the new technology of computer ? is to grow significantly He got a ? scholarship to Yale. ...frightened by the powers of destruction ? has given... ...but there is also specialization in ? and technology... d.kartsaklis@qmul.ac.uk Open System Categorical Quantum Semantics in NLP 4/28

  5. The meaning of words Distributional hypothesis Words that occur in similar contexts have similar meanings [Harris, 1958]. The functional interplay of philosophy and science should, as a minimum, guarantee... ...and among works of dystopian science fiction... The rapid advance in science today suggests... ...calculus, which are more popular in science -oriented schools. But because science is based on mathematics... ...the value of opinions formed in science as well as in the religions... ...if science can discover the laws of human nature.... ...is an art, not an exact science . ...factors shaping the future of our civilization: science and religion. ...certainty which every new discovery in science either replaces or reshapes. ...if the new technology of computer science is to grow significantly He got a science scholarship to Yale. ...frightened by the powers of destruction science has given... ...but there is also specialization in science and technology... d.kartsaklis@qmul.ac.uk Open System Categorical Quantum Semantics in NLP 4/28

  6. Distributional models of meaning A word is a vector of co-occurrence statistics with every other word in a selected subset of the vocabulary: cat pet cat milk 12 dog cute 8 dog 5 bank 0 account money 1 money Semantic relatedness is usually based on cosine similarity: u = �− → v · − → u � sim( − → v , − → u ) = cos θ − → v , − → �− → v ��− → u � d.kartsaklis@qmul.ac.uk Open System Categorical Quantum Semantics in NLP 5/28

  7. Moving to phrases and sentences We would like to generalize this idea to phrases and sentences However, it’s not clear how There are practical problems—there is not enough data: But even if we had a very large corpus, what the context of a sentence would be? d.kartsaklis@qmul.ac.uk Open System Categorical Quantum Semantics in NLP 6/28

  8. Moving to phrases and sentences We would like to generalize this idea to phrases and sentences However, it’s not clear how There are practical problems—there is not enough data: But even if we had a very large corpus, what the context of a sentence would be? A solution: For a sentence w 1 w 2 . . . w n , find a function f such that: − → s = f ( − → w 1 , − w 2 , . . . , − → → w n ) d.kartsaklis@qmul.ac.uk Open System Categorical Quantum Semantics in NLP 6/28

  9. Categorical compositional distributional semantics Coecke, Sadrzadeh and Clark (2010): Let syntax drive the semantic derivation, as in formal semantics. Pregroup grammars are structurally homomorphic with the category of finite-dimensional Hilbert spaces and linear maps (both share compact closure) In abstract terms, there exists a structure-preserving passage from grammar to meaning: F : Grammar → Meaning The meaning of a sentence w 1 w 2 . . . w n with grammatical derivation α is defined as: w 1 w 2 . . . w n := F ( α )( − − − − − − − − → w 1 ⊗ − → w 2 ⊗ . . . ⊗ − → → w n ) d.kartsaklis@qmul.ac.uk Open System Categorical Quantum Semantics in NLP 7/28

  10. A multi-linear model The grammatical type of a word defines the vector space in which the word lives: Nouns are vectors in N ; adjectives are linear maps N → N , i.e elements in N ⊗ N ; intransitive verbs are linear maps N → S , i.e. elements in N ⊗ S ; transitive verbs are bi-linear maps N ⊗ N → S , i.e. elements of N ⊗ S ⊗ N ; and so on. The composition operation is tensor contraction, based on inner product. d.kartsaklis@qmul.ac.uk Open System Categorical Quantum Semantics in NLP 8/28

  11. Categorical composition: example S happy kids play games n r s n l n n l NP VP n n Adj N V N happy kids play games Type reduction morphism: n ) : n · n l · n · n r · s · n l · n → s ( ǫ r n · 1 s ) ◦ (1 n · ǫ l n · 1 n r · s · ǫ l happy ⊗ − − → � � � kids ⊗ play ⊗ − − − − → � ( ǫ r n · 1 s ) ◦ (1 n · ǫ l n · 1 n r · s · ǫ l F n ) = games happy ⊗ − − → � kids ⊗ play ⊗ − − − − → � ( ǫ N ⊗ 1 S ) ◦ (1 N ⊗ ǫ N ⊗ 1 N ⊗ S ⊗ ǫ N ) games = happy × − − → kids × play × − − − − → games − − → kids , − − − − → games ∈ N happy ∈ N ⊗ N play ∈ N ⊗ S ⊗ N d.kartsaklis@qmul.ac.uk Open System Categorical Quantum Semantics in NLP 9/28

  12. Outline Categorical compositional distributional models 1 Composition and lexical ambiguity 2 Open system quantum semantics 3 From theory to practice 4 d.kartsaklis@qmul.ac.uk Open System Categorical Quantum Semantics in NLP 10/28

  13. Ambiguity in word spaces Compositional distributional models of meaning are mainly based on ambiguous semantic spaces: 0.8 transplantation organ (medicine) 0.6 donor transplant liver 0.4 kidney 0.2 organ lung 0.0 concert 0.2 recital organ (music) accompaniment 0.4 bass hymn violin 0.6 orchestra 0.8 0.8 0.6 0.4 0.2 0.0 0.2 0.4 0.6 0.8 ∗ real vectors projected onto a 2-dimensional space using MDS d.kartsaklis@qmul.ac.uk Open System Categorical Quantum Semantics in NLP 11/28

  14. Homonymy and polysemy (1/2) We distinguish between two types of lexical ambiguity: In cases of homonymy ( organ , bank , vessel etc.), due to some historical accident the same word is used to describe two (or more) completely unrelated concepts. Polysemy relates to subtle deviations between the different senses of the same word. Example: The distinction between the financial sense and the river sense of bank is a case of homonymy; Within the financial sense, a distinction between the abstract concept of bank as an institution and the concrete building is a case of polysemy. d.kartsaklis@qmul.ac.uk Open System Categorical Quantum Semantics in NLP 12/28

  15. Homonymy and polysemy (2/2) Example #1: “ I went to the bank to open a savings account ” The word bank is used with its financial sense The sayer refers to both of the polysemous meanings of bank fin ( institution and building ) at the same time Example #2: “ I went to the bank ” The word bank is probably used with the financial sense in mind (because most of the time this is the case) However, a small possibility that the sayer has actually visited a river bank still exists d.kartsaklis@qmul.ac.uk Open System Categorical Quantum Semantics in NLP 13/28

  16. Homonymy and polysemy (2/2) Example #1: “ I went to the bank to open a savings account ” The word bank is used with its financial sense The sayer refers to both of the polysemous meanings of bank fin ( institution and building ) at the same time Example #2: “ I went to the bank ” The word bank is probably used with the financial sense in mind (because most of the time this is the case) However, a small possibility that the sayer has actually visited a river bank still exists Main point: Polysemy: Relatively coherent and self-contained concepts Homonymy: Lack of specification d.kartsaklis@qmul.ac.uk Open System Categorical Quantum Semantics in NLP 13/28

Recommend


More recommend