DisCoCat explained

DisCoCat (Categorical Compositional Distributional) is a mathematical framework for natural language processing which uses category theory to unify distributional semantics with the principle of compositionality. The grammatical derivations in a categorial grammar (usually a pregroup grammar) are interpreted as linear maps acting on the tensor product of word vectors to produce the meaning of a sentence or a piece of text. String diagrams are used to visualise information flow and reason about natural language semantics.

History

The framework was first introduced by Bob Coecke, Mehrnoosh Sadrzadeh, and Stephen Clark[1] as an application of categorical quantum mechanics to natural language processing. It started with the observation that pregroup grammars and quantum processes shared a common mathematical structure: they both form a rigid category (also known as a non-symmetric compact closed category). As such, they both benefit from a graphical calculus, which allows a purely diagrammatic reasoning. Although the analogy with quantum mechanics was kept informal at first, it eventually led to the development of quantum natural language processing.[2] [3] [4]

Definition

There are multiple definitions of DisCoCat in the literature, depending on the choice made for the compositional aspect of the model. The common denominator between all the existent versions, however, always involves a categorical definition of DisCoCat as a structure-preserving functor from a category of grammar to a category of semantics, which usually encodes the distributional hypothesis.

The original paper used the categorical product of FinVect with a pregroup seen as a posetal category. This approach has some shortcomings: all parallel arrows of a posetal category are equal, which means that pregroups cannot distinguish between different grammatical derivations for the same syntactically ambiguous sentence.[5] A more intuitive manner of saying the same is that one works with diagrams rather than with partial orders when describing grammar.

G

generated by the pregroup grammar.[6] That is,

G

has generating objects for the words and the basic types of the grammar, and generating arrows

w\tot

for the dictionary entries which assign a pregroup type

t

to a word

w

. The arrows

f:w1...wn\tos

are grammatical derivations for the sentence

w1...wn

which can be represented as string diagrams with cups and caps, i.e. adjunction units and counits.[7]

With this definition of pregroup grammars as free rigid categories, DisCoCat models can be defined as strong monoidal functors

F:G\toFinVect

. Spelling things out in detail, they assign a finite dimensional vector space

F(x)

to each basic type

x

and a vector

F(w)\inF(t)=F(t1)...F(tn)

in the appropriate tensor product space to each dictionary entry

w\tot

where

t=t1...tn

(objects for words are sent to the monoidal unit, i.e.

F(w)=1

). The meaning of a sentence

f:w1...wn\tos

is then given by a vector

F(f)\inF(s)

which can be computed as the contraction of a tensor network.[8]

The reason behind the choice of

FinVect

as the category of semantics is that vector spaces are the usual setting of distributional reading in computational linguistics and natural language processing. The underlying idea of distributional hypothesis "A word is characterized by the company it keeps" is particularly relevant when assigning meaning to words like adjectives or verbs, whose semantic connotation is strongly dependent on context.

Variations

Variations of DisCoCat have been proposed with a different choice for the grammar category. The main motivation behind this lies in the fact that pregroup grammars have been proved to be weakly equivalent to context-free grammars.[9] One example of variation[10] chooses Combinatory categorial grammar as the grammar category.

List of linguistic phenomena

The DisCoCat framework has been used to study the following phenomena from linguistics.

Applications in NLP

The DisCoCat framework has been applied to solve the following tasks in natural language processing.

See also

External links

Notes and References

  1. Coecke . Bob . Sadrzadeh . Mehrnoosh . Clark . Stephen . 2010-03-23 . Mathematical Foundations for a Compositional Distributional Model of Meaning . cs.CL . 1003.4394 .
  2. Zeng . William . Coecke . Bob . 2016-08-02 . Quantum Algorithms for Compositional Natural Language Processing . 1608.01406 . Electronic Proceedings in Theoretical Computer Science . 221 . 67–75 . 10.4204/EPTCS.221.8 . 14897915 . 2075-2180.
  3. Coecke . Bob . de Felice . Giovanni . Meichanetzidis . Konstantinos . Toumi . Alexis . 2020-12-07 . Foundations for Near-Term Quantum Natural Language Processing . quant-ph . 2012.03755 .
  4. Rai . Anshuman . 2022-01-31 . A Review Article on Quantum Natural Language Processing . International Journal for Research in Applied Science and Engineering Technology . 10 . 1 . 1588–1594 . 10.22214/ijraset.2022.40103 . 2321-9653. free .
  5. Preller . Anne . 2014-12-27 . From Logical to Distributional Models . 1412.8527 . Electronic Proceedings in Theoretical Computer Science . 171 . 113–131 . 10.4204/EPTCS.171.11 . 18631267 . 2075-2180.
  6. Preller . Anne . Lambek . Joachim . 2007-01-18 . Free Compact 2-Categories . Mathematical Structures in Computer Science . en . 17 . doi: 10.1017/S0960129506005901 . 309 . 10.1017/S0960129506005901. 10763735 .
  7. Book: Selinger, Peter . New Structures for Physics . A survey of graphical languages for monoidal categories . Lecture Notes in Physics . 2010 . 0908.3347 . 813 . 289–355 . 10.1007/978-3-642-12821-9_4. 978-3-642-12820-2 . 8477212 .
  8. de Felice . Giovanni . Meichanetzidis . Konstantinos . Toumi . Alexis . 2020-09-15 . Functorial Question Answering . 1905.07408 . Electronic Proceedings in Theoretical Computer Science . 323 . 84–94 . 10.4204/EPTCS.323.6 . 195874109 . 2075-2180.
  9. Wojciech . Buszkowski . 2001 . Lambek grammars based on pregroups. . In International Conference on Logical Aspects of Computational Linguistics.
  10. 2105.07720 . Richie . Yeung . Dimitri . Kartsaklis . A CCG-based version of the DisCoCat framework. . 2021. cs.CL .
  11. Sadrzadeh . Mehrnoosh . Kartsaklis . Dimitri . Balkır . Esma . 2018 . Sentence entailment in compositional distributional semantics . Annals of Mathematics and Artificial Intelligence . 82 . 4 . 189–218. 10.1007/s10472-017-9570-x . 5038840 . free . 1512.04419 .
  12. 1606.01515 . Dimitri . Kartsaklis . Coordination in Categorical Compositional Distributional Semantics . Electronic Proceedings in Theoretical Computer Science . 2016. 221 . 29–38 . 10.4204/EPTCS.221.4 . 10842035 .
  13. Bankova . Dea . Coecke . Bob . Lewis . Martha . Marsden . Dan . 2018 . Graded hyponymy for compositional distributional semantics . Journal of Language Modelling . 6 . 2 . 225–260.
  14. Meyer . Francois . Lewis . Martha . 2020-10-12 . Modelling Lexical Ambiguity with Density Matrices . cs.CL . 2010.05670 .
  15. Coecke . Bob . de Felice . Giovanni . Marsden . Dan . Toumi . Alexis . 2018-11-08 . Towards Compositional Distributional Discourse Analysis . Electronic Proceedings in Theoretical Computer Science . 283 . 1–12 . 10.4204/EPTCS.283.1 . 1811.03277 . 2075-2180. free .
  16. Wijnholds . Gijs . Sadrzadeh . Mehrnoosh . 2019 . A type-driven vector semantics for ellipsis with anaphora using lambek calculus with limited contraction . Journal of Logic, Language and Information . 28 . 2 . 331–358. 10.1007/s10849-019-09293-4 . 146120631 . free . 1905.01647 .
  17. 1811.11041 . Tai-Danae . Bradley . Martha . Lewis . Translating and Evolving: Towards a Model of Language Change in DisCoCat . 2018 . Master . Jade . Theilman . Brad. Electronic Proceedings in Theoretical Computer Science . 283 . 50–61 . 10.4204/EPTCS.283.4 . 53775637 .
  18. Grefenstette . Edward . Sadrzadeh . Mehrnoosh . 2011-06-20 . Experimental Support for a Categorical Compositional Distributional Model of Meaning . cs.CL . 1106.4058 .
  19. Kartsaklis . Dimitri . Sadrzadeh . Mehrnoosh . 2013 . Prior disambiguation of word tensors for constructing sentence vectors .
  20. Grefenstette . Edward . Dinu . Georgiana . Zhang . Yao-Zhong . Sadrzadeh . Mehrnoosh . Baroni . Marco . 2013-01-30 . Multi-Step Regression Learning for Compositional Distributional Semantics . cs.CL . 1301.6939 .
  21. 1905.07408 . Giovanni . de Felice . Konstantinos . Meichanetzidis . Functorial Question Answering . 2019 . Toumi . Alexis. Electronic Proceedings in Theoretical Computer Science . 323 . 84–94 . 10.4204/EPTCS.323.6 . 195874109 .
  22. Tyrrell . Brian . 2018-11-08 . Applying Distributional Compositional Categorical Models of Meaning to Language Translation . Electronic Proceedings in Theoretical Computer Science . 283 . 28–49 . 10.4204/EPTCS.283.3 . 1811.03274 . 2075-2180. free .
  23. Coecke . Bob . de Felice . Giovanni . Marsden . Dan . Toumi . Alexis . 2018-11-08 . Towards Compositional Distributional Discourse Analysis . Electronic Proceedings in Theoretical Computer Science . 283 . 1–12 . 10.4204/EPTCS.283.1 . 1811.03277 . 2075-2180. free .