SlideShare uma empresa Scribd logo
1 de 26
Encoding	
  syntac-c	
  dependencies	
  
    by	
  vector	
  permuta-on	
  
Pierpaolo	
  Basile,	
  Annalina	
  Caputo	
  and	
  Giovanni	
  Semeraro	
  
                  Department	
  of	
  Computer	
  Science	
  
                 University	
  of	
  Bari	
  “Aldo	
  Moro”	
  (Italy)	
  



              GEMS	
  2011:	
  GEometrical	
  Models	
  of	
  Natural	
  Language	
  Seman-cs	
  
                                               Edinburgh,	
  Scotland	
  -­‐	
  July	
  31st,	
  2011	
  
Mo-va-on	
  
•  meaning	
  is	
  its	
  use	
  
•  the	
  meaning	
  of	
  a	
  word	
  
   is	
  determined	
  by	
  the	
  set	
  
   of	
  textual	
  contexts	
  in	
  
   which	
  it	
  appears	
  
•  one	
  defini-on	
  of	
  
   context	
  at	
  a	
  -me	
  




                                              2	
  
Building	
  Blocks	
  
•  Random	
  Indexing	
  
•  Dependency	
  Parser	
  
•  Vector	
  Permuta-on	
  




                                         3	
  
Random	
  Indexing	
  
•  assign	
  a	
  context	
  vector	
  to	
  each	
  context	
  
   element	
  (e.g.	
  document,	
  passage,	
  term,	
  …)	
  
•  term	
  vector	
  is	
  the	
  sum	
  of	
  the	
  context	
  vectors	
  
   in	
  which	
  the	
  term	
  occurs	
  
    –  some-mes	
  the	
  context	
  vector	
  could	
  be	
  boosted	
  
       by	
  a	
  score	
  (e.g.	
  term	
  frequency,	
  PMI,	
  …)	
  	
  




                                                                               4	
  
Context	
  Vector	
  

     0	
  0	
  0	
  0	
  0	
  0	
  0	
  -­‐1	
  0	
  0	
  0	
  0	
  1	
  0	
  0	
  -­‐1	
  0	
  1	
  0	
  0	
  0	
  0	
  1	
  0	
  0	
  0	
  0	
  -­‐1	
  	
  



•     sparse	
  
•     high	
  dimensional	
  
•     ternary	
  {-­‐1,	
  0,	
  +1}	
  
•     small	
  number	
  of	
  randomly	
  distributed	
  non-­‐
      zero	
  elements	
  
                                                                                                                                                                 5	
  
Random	
  Indexing	
  (formal)	
  

                     n,k        n,m       m,k
                 B         =A         R         k << m
                 B	
  preserves	
  the	
  distance	
  
                 between	
  points	
  
                 (Johnson-­‐Lindenstrauss	
  lemma)	
  
                 dr = c ! d


                                                         6	
  
Dependency	
  parser	
  

               John	
  eats	
  a	
  red	
  apple.	
  
           subject	
                          object	
  



John	
                        eats	
                           apple	
  


                                                 modifier	
  
                               red	
  

                                                                           7	
  
Vector	
  permuta-on	
  
•  using	
  permuta-on	
  of	
  elements	
  in	
  random	
  
   vector	
  to	
  encode	
  several	
  contexts	
  
    –  right	
  shib	
  of	
  n	
  elements	
  to	
  encode	
  dependents	
  
       (permuta-on)	
  
    –  leb	
  shib	
  of	
  n	
  elements	
  to	
  encode	
  heads	
  (inverse	
  
       permuta-on)	
  
•  choose	
  a	
  different	
  n	
  for	
  each	
  kind	
  of	
  
   dependency	
  

                                                                                     8	
  
Method	
  
•  assign	
  a	
  context	
  vector	
  to	
  each	
  term	
  
•  assign	
  a	
  shib	
  func-on	
  (Πn)	
  to	
  each	
  kind	
  of	
  
   dependency	
  
•  each	
  term	
  is	
  represented	
  by	
  a	
  vector	
  which	
  is	
  
    –  the	
  sum	
  of	
  the	
  permuted	
  vectors	
  of	
  all	
  the	
  
       dependent	
  terms	
  
    –  the	
  sum	
  of	
  the	
  inverse	
  permuted	
  vectors	
  of	
  all	
  the	
  
       head	
  terms	
  

                                                                                      9	
  
Example	
  
                                         John	
  -­‐>	
  (0,	
  0,	
  0,	
  0,	
  0,	
  0,	
  1,	
  0,	
  -­‐1,	
  0)	
  
                                         eat	
  -­‐>	
  (1,	
  0,	
  0,	
  0,	
  -­‐1,	
  0,	
  0	
  ,0	
  ,0	
  ,0)	
  
 John	
  eats	
  a	
  red	
  apple	
     red-­‐>	
  (0,	
  0,	
  0,	
  1,	
  0,	
  0,	
  0,	
  -­‐1,	
  0,	
  0)	
  
                                         apple	
  -­‐>	
  (1,	
  0,	
  0,	
  0,	
  0,	
  0,	
  0,	
  -­‐1,	
  0,	
  0)	
  
                                         mod-­‐>Π3;	
  obj-­‐>Π7	
  	
  


(apple)=Π3(red)+Π-­‐7(eat)=…	
  




                                                                                                                  10	
  
Example	
  
                                                                      John	
  -­‐>	
  (0,	
  0,	
  0,	
  0,	
  0,	
  0,	
  1,	
  0,	
  -­‐1,	
  0)	
  
                                                                      eat	
  -­‐>	
  (1,	
  0,	
  0,	
  0,	
  -­‐1,	
  0,	
  0	
  ,0	
  ,0	
  ,0)	
  
  John	
  eats	
  a	
  red	
  apple	
                                 red-­‐>	
  (0,	
  0,	
  0,	
  1,	
  0,	
  0,	
  0,	
  -­‐1,	
  0,	
  0)	
  
                                                                      apple	
  -­‐>	
  (1,	
  0,	
  0,	
  0,	
  0,	
  0,	
  0,	
  -­‐1,	
  0,	
  0)	
  
                                                                      mod-­‐>Π3;	
  obj-­‐>Π7	
  	
  	
  


(apple)=Π3(red)+Π-­‐7(eat)=…	
  
	
  
…=(-­‐1,	
  0,	
  0,	
  0,	
  0,	
  0,	
  1,	
  0,	
  0,	
  0)	
  +	
  (0,	
  0,	
  0,	
  1,	
  0,	
  0,	
  0,	
  -­‐1,	
  0,	
  0)	
  	
  

                         3	
  right	
  shibs	
                                                7	
  leb	
  shibs	
  
                                                                                                                                               11	
  
Output	
  

               R	
                                   B	
  




Vector	
  space	
  of	
  random	
      Vector	
  space	
  of	
  terms	
  
    context	
  vectors	
  


                                                                            12	
  
Query	
  1/4	
  
•  similarity	
  between	
  terms	
  
   –  cosine	
  similarity	
  between	
  terms	
  vectors	
  in	
  B	
  
   –  terms	
  are	
  similar	
  if	
  they	
  occur	
  in	
  similar	
  syntac-c	
  
        contexts	
  
   	
  




                                                                                        13	
  
Query	
  2/4	
  
          Words	
  similar	
  to	
  “provide”	
  

offer	
                       0.855	
  
supply	
                     0.819	
  
deliver	
                    0.801	
  
give	
                       0.787	
  
contain	
                    0.784	
  
require	
                    0.782	
  
present	
                    0.778	
  
                                                    14	
  
Query	
  3/4	
  
•  similarity	
  between	
  terms	
  exploi-ng	
  
   dependencies	
  

   	
        	
  what	
  are	
  the	
  objects	
  of	
  the	
  word	
  “provide”?	
  

          1.  get	
  the	
  term	
  vector	
  for	
  “provide”	
  in	
  B	
  
          2.  compute	
  the	
  similarity	
  with	
  all	
  permutated	
  
               vectors	
  in	
  R	
  using	
  the	
  permuta-on	
  assigned	
  to	
  
               “obj”	
  rela-on	
  
          	
  
                                                                                        15	
  
Query	
  4/4	
  
What	
  are	
  the	
  objects	
  of	
  the	
  word	
  “provide”?	
  


  informa-on	
                    0.344	
  
  food	
                          0.208	
  
  support	
                       0.143	
  
  energy	
                        0.143	
  
  job	
                           0.142	
  


                                                                       16	
  
Composi-onal	
  seman-cs	
  1/2	
  
•  words	
  are	
  represented	
  in	
  isola-on	
  
•  represent	
  complex	
  structure	
  (phrase	
  or	
  
   sentence)	
  is	
  a	
  challenge	
  task	
  
   –  IR,	
  QA,	
  IE,	
  Text	
  Entailment,	
  …	
  
•  how	
  to	
  combine	
  words	
  
   –  tensor	
  product	
  of	
  words	
  
   –  Clark	
  and	
  Pulman	
  suggest	
  to	
  take	
  into	
  account	
  
      symbolic	
  features	
  (syntac-c	
  dependencies)	
  

                                                                               17	
  
Composi-onal	
  seman-cs	
  2/2	
  

         man	
  reads	
  magazine	
  

                            (Clark	
  and	
  Pulman)	
  


man ! subj ! read ! obj ! magazine



                                                           18	
  
Similarity	
  between	
  structures	
  
            man	
  reads	
  magazine	
  
        woman	
  browses	
  newspaper	
  



  man ! subj ! read ! obj ! magazine
woman ! subj ! browse ! obj ! newspaper

                                             19	
  
…a	
  bit	
  of	
  math	
  

(w1 ! w2 )" (w3 ! w4 ) = (w1 " w3 ) # (w2 " w4 )




man ! woman " read ! browse " magazine ! newspaper



                                                20	
  
System	
  setup	
  
          •  Implemented	
  in	
  JAVA	
  
          •  Two	
  corpora	
  
              –  TASA:	
  800K	
  sentences	
  
                 and	
  9M	
  dependencies	
  
              –  a	
  por-on	
  of	
  ukWaC:	
  7M	
  
                 sentences	
  and	
  127M	
  
                 dependencies	
  
              –  40,000	
  most	
  frequent	
  
                 words	
  
          •  Dependency	
  parser	
  
              –  MINIPAR	
  

                                                     21	
  
Evalua-on	
  
•  GEMS	
  2011	
  Shared	
  Task	
  for	
  composi-onal	
  
   seman-cs	
  
   –  list	
  of	
  two	
  pairs	
  of	
  words	
  combina-on	
  
       •  rated	
  by	
  humans	
  
       •  5,833	
  rates	
  
       •  encoded	
  dependencies:	
  subj,	
  obj,	
  mod,	
  nn	
  
   –  GOAL:	
  compare	
  the	
  system	
  performance	
  against	
  
      humans	
  scores	
  
       •  Spearman	
  correla-on	
  

                                                                        22	
  
Results	
  (old)	
  

Corpus	
     Combina-on	
                 ρ	
  
TASA	
       verb-­‐obj	
                 0.260	
  
             adj-­‐noun	
                 0.637	
  
             compound	
  nouns	
          0.341	
  
             overall	
                    0.275	
  
ukWaC	
      verb-­‐obj	
                 0.292	
  
             adj-­‐noun	
                 0.445	
  
             compound	
  nouns	
          0.227	
  
             overall	
                    0.261	
  

                                                      23	
  
Results	
  (new)	
  

Corpus	
     Combina-on	
              ρ	
  
TASA	
       verb-­‐obj	
              0.160	
  
             adj-­‐noun	
              0.435	
  
             compound	
  nouns	
       0.243	
  
             overall	
                 0.186	
  
ukWaC	
      verb-­‐obj	
              0.190	
  
             adj-­‐noun	
              0.303	
  
             compound	
  nouns	
       0.159	
  
             overall	
                 0.179	
  

                                                   24	
  
Conclusion	
  and	
  Future	
  Work	
  
•  Conclusion	
  
   –  encode	
  syntac-c	
  dependencies	
  using	
  vector	
  
      permuta-ons	
  and	
  Random	
  Indexing	
  
   –  early	
  arempt	
  in	
  seman-c	
  composi-on	
  
•  Future	
  Work	
  
   –  deeper	
  evalua-on	
  (in	
  vivo)	
  
   –  more	
  formal	
  study	
  about	
  seman-c	
  composi-on	
  
   –  tackle	
  scalability	
  problem	
  
   –  try	
  to	
  encode	
  other	
  kinds	
  of	
  context	
  

                                                                      25	
  
That’s	
  all	
  folks!	
  


                              26	
  

Mais conteúdo relacionado

Mais de Pierpaolo Basile

Diachronic analysis of entities by exploiting wikipedia page revisions
Diachronic analysis of entities by exploiting wikipedia page revisionsDiachronic analysis of entities by exploiting wikipedia page revisions
Diachronic analysis of entities by exploiting wikipedia page revisionsPierpaolo Basile
 
Come l'industria tecnologica ha cancellato le donne dalla storia
Come l'industria tecnologica ha cancellato le donne dalla storiaCome l'industria tecnologica ha cancellato le donne dalla storia
Come l'industria tecnologica ha cancellato le donne dalla storiaPierpaolo Basile
 
EVALITA 2018 NLP4FUN - Solving language games
EVALITA 2018 NLP4FUN - Solving language gamesEVALITA 2018 NLP4FUN - Solving language games
EVALITA 2018 NLP4FUN - Solving language gamesPierpaolo Basile
 
Buon appetito! Analyzing Happiness in Italian Tweets
Buon appetito! Analyzing Happiness in Italian TweetsBuon appetito! Analyzing Happiness in Italian Tweets
Buon appetito! Analyzing Happiness in Italian TweetsPierpaolo Basile
 
Detecting semantic shift in large corpora by exploiting temporal random indexing
Detecting semantic shift in large corpora by exploiting temporal random indexingDetecting semantic shift in large corpora by exploiting temporal random indexing
Detecting semantic shift in large corpora by exploiting temporal random indexingPierpaolo Basile
 
Bi-directional LSTM-CNNs-CRF for Italian Sequence Labeling
Bi-directional LSTM-CNNs-CRF for Italian Sequence LabelingBi-directional LSTM-CNNs-CRF for Italian Sequence Labeling
Bi-directional LSTM-CNNs-CRF for Italian Sequence LabelingPierpaolo Basile
 
INSERT COIN - Storia dei videogame: da Spacewar a Street Fighter
INSERT COIN - Storia dei videogame: da Spacewar a Street FighterINSERT COIN - Storia dei videogame: da Spacewar a Street Fighter
INSERT COIN - Storia dei videogame: da Spacewar a Street FighterPierpaolo Basile
 
QuestionCube DigithON 2017
QuestionCube DigithON 2017QuestionCube DigithON 2017
QuestionCube DigithON 2017Pierpaolo Basile
 
Diachronic Analysis of the Italian Language exploiting Google Ngram
Diachronic Analysis of the Italian Language exploiting Google NgramDiachronic Analysis of the Italian Language exploiting Google Ngram
Diachronic Analysis of the Italian Language exploiting Google NgramPierpaolo Basile
 
La macchina più geek dell’universo The Turing Machine
La macchina più geek dell’universo The Turing MachineLa macchina più geek dell’universo The Turing Machine
La macchina più geek dell’universo The Turing MachinePierpaolo Basile
 
UNIBA: Exploiting a Distributional Semantic Model for Disambiguating and Link...
UNIBA: Exploiting a Distributional Semantic Model for Disambiguating and Link...UNIBA: Exploiting a Distributional Semantic Model for Disambiguating and Link...
UNIBA: Exploiting a Distributional Semantic Model for Disambiguating and Link...Pierpaolo Basile
 
Building WordSpaces via Random Indexing from simple to complex spaces
Building WordSpaces via Random Indexing from simple to complex spacesBuilding WordSpaces via Random Indexing from simple to complex spaces
Building WordSpaces via Random Indexing from simple to complex spacesPierpaolo Basile
 
Analysing Word Meaning over Time by Exploiting Temporal Random Indexing
Analysing Word Meaning over Time by Exploiting Temporal Random IndexingAnalysing Word Meaning over Time by Exploiting Temporal Random Indexing
Analysing Word Meaning over Time by Exploiting Temporal Random IndexingPierpaolo Basile
 
COLING 2014 - An Enhanced Lesk Word Sense Disambiguation Algorithm through a ...
COLING 2014 - An Enhanced Lesk Word Sense Disambiguation Algorithm through a ...COLING 2014 - An Enhanced Lesk Word Sense Disambiguation Algorithm through a ...
COLING 2014 - An Enhanced Lesk Word Sense Disambiguation Algorithm through a ...Pierpaolo Basile
 
A Study on Compositional Semantics of Words in Distributional Spaces
A Study on Compositional Semantics of Words in Distributional SpacesA Study on Compositional Semantics of Words in Distributional Spaces
A Study on Compositional Semantics of Words in Distributional SpacesPierpaolo Basile
 
Exploiting Distributional Semantic Models in Question Answering
Exploiting Distributional Semantic Models in Question AnsweringExploiting Distributional Semantic Models in Question Answering
Exploiting Distributional Semantic Models in Question AnsweringPierpaolo Basile
 
Sst evalita2011 basile_pierpaolo
Sst evalita2011 basile_pierpaoloSst evalita2011 basile_pierpaolo
Sst evalita2011 basile_pierpaoloPierpaolo Basile
 

Mais de Pierpaolo Basile (19)

Diachronic analysis of entities by exploiting wikipedia page revisions
Diachronic analysis of entities by exploiting wikipedia page revisionsDiachronic analysis of entities by exploiting wikipedia page revisions
Diachronic analysis of entities by exploiting wikipedia page revisions
 
Come l'industria tecnologica ha cancellato le donne dalla storia
Come l'industria tecnologica ha cancellato le donne dalla storiaCome l'industria tecnologica ha cancellato le donne dalla storia
Come l'industria tecnologica ha cancellato le donne dalla storia
 
EVALITA 2018 NLP4FUN - Solving language games
EVALITA 2018 NLP4FUN - Solving language gamesEVALITA 2018 NLP4FUN - Solving language games
EVALITA 2018 NLP4FUN - Solving language games
 
Buon appetito! Analyzing Happiness in Italian Tweets
Buon appetito! Analyzing Happiness in Italian TweetsBuon appetito! Analyzing Happiness in Italian Tweets
Buon appetito! Analyzing Happiness in Italian Tweets
 
Detecting semantic shift in large corpora by exploiting temporal random indexing
Detecting semantic shift in large corpora by exploiting temporal random indexingDetecting semantic shift in large corpora by exploiting temporal random indexing
Detecting semantic shift in large corpora by exploiting temporal random indexing
 
Bi-directional LSTM-CNNs-CRF for Italian Sequence Labeling
Bi-directional LSTM-CNNs-CRF for Italian Sequence LabelingBi-directional LSTM-CNNs-CRF for Italian Sequence Labeling
Bi-directional LSTM-CNNs-CRF for Italian Sequence Labeling
 
INSERT COIN - Storia dei videogame: da Spacewar a Street Fighter
INSERT COIN - Storia dei videogame: da Spacewar a Street FighterINSERT COIN - Storia dei videogame: da Spacewar a Street Fighter
INSERT COIN - Storia dei videogame: da Spacewar a Street Fighter
 
QuestionCube DigithON 2017
QuestionCube DigithON 2017QuestionCube DigithON 2017
QuestionCube DigithON 2017
 
Diachronic Analysis of the Italian Language exploiting Google Ngram
Diachronic Analysis of the Italian Language exploiting Google NgramDiachronic Analysis of the Italian Language exploiting Google Ngram
Diachronic Analysis of the Italian Language exploiting Google Ngram
 
Diachronic Analysis
Diachronic AnalysisDiachronic Analysis
Diachronic Analysis
 
(Open) data hacking
(Open) data hacking(Open) data hacking
(Open) data hacking
 
La macchina più geek dell’universo The Turing Machine
La macchina più geek dell’universo The Turing MachineLa macchina più geek dell’universo The Turing Machine
La macchina più geek dell’universo The Turing Machine
 
UNIBA: Exploiting a Distributional Semantic Model for Disambiguating and Link...
UNIBA: Exploiting a Distributional Semantic Model for Disambiguating and Link...UNIBA: Exploiting a Distributional Semantic Model for Disambiguating and Link...
UNIBA: Exploiting a Distributional Semantic Model for Disambiguating and Link...
 
Building WordSpaces via Random Indexing from simple to complex spaces
Building WordSpaces via Random Indexing from simple to complex spacesBuilding WordSpaces via Random Indexing from simple to complex spaces
Building WordSpaces via Random Indexing from simple to complex spaces
 
Analysing Word Meaning over Time by Exploiting Temporal Random Indexing
Analysing Word Meaning over Time by Exploiting Temporal Random IndexingAnalysing Word Meaning over Time by Exploiting Temporal Random Indexing
Analysing Word Meaning over Time by Exploiting Temporal Random Indexing
 
COLING 2014 - An Enhanced Lesk Word Sense Disambiguation Algorithm through a ...
COLING 2014 - An Enhanced Lesk Word Sense Disambiguation Algorithm through a ...COLING 2014 - An Enhanced Lesk Word Sense Disambiguation Algorithm through a ...
COLING 2014 - An Enhanced Lesk Word Sense Disambiguation Algorithm through a ...
 
A Study on Compositional Semantics of Words in Distributional Spaces
A Study on Compositional Semantics of Words in Distributional SpacesA Study on Compositional Semantics of Words in Distributional Spaces
A Study on Compositional Semantics of Words in Distributional Spaces
 
Exploiting Distributional Semantic Models in Question Answering
Exploiting Distributional Semantic Models in Question AnsweringExploiting Distributional Semantic Models in Question Answering
Exploiting Distributional Semantic Models in Question Answering
 
Sst evalita2011 basile_pierpaolo
Sst evalita2011 basile_pierpaoloSst evalita2011 basile_pierpaolo
Sst evalita2011 basile_pierpaolo
 

Último

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 

Último (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 

Encoding syntactic dependencies by vector permutation

  • 1. Encoding  syntac-c  dependencies   by  vector  permuta-on   Pierpaolo  Basile,  Annalina  Caputo  and  Giovanni  Semeraro   Department  of  Computer  Science   University  of  Bari  “Aldo  Moro”  (Italy)   GEMS  2011:  GEometrical  Models  of  Natural  Language  Seman-cs   Edinburgh,  Scotland  -­‐  July  31st,  2011  
  • 2. Mo-va-on   •  meaning  is  its  use   •  the  meaning  of  a  word   is  determined  by  the  set   of  textual  contexts  in   which  it  appears   •  one  defini-on  of   context  at  a  -me   2  
  • 3. Building  Blocks   •  Random  Indexing   •  Dependency  Parser   •  Vector  Permuta-on   3  
  • 4. Random  Indexing   •  assign  a  context  vector  to  each  context   element  (e.g.  document,  passage,  term,  …)   •  term  vector  is  the  sum  of  the  context  vectors   in  which  the  term  occurs   –  some-mes  the  context  vector  could  be  boosted   by  a  score  (e.g.  term  frequency,  PMI,  …)     4  
  • 5. Context  Vector   0  0  0  0  0  0  0  -­‐1  0  0  0  0  1  0  0  -­‐1  0  1  0  0  0  0  1  0  0  0  0  -­‐1     •  sparse   •  high  dimensional   •  ternary  {-­‐1,  0,  +1}   •  small  number  of  randomly  distributed  non-­‐ zero  elements   5  
  • 6. Random  Indexing  (formal)   n,k n,m m,k B =A R k << m B  preserves  the  distance   between  points   (Johnson-­‐Lindenstrauss  lemma)   dr = c ! d 6  
  • 7. Dependency  parser   John  eats  a  red  apple.   subject   object   John   eats   apple   modifier   red   7  
  • 8. Vector  permuta-on   •  using  permuta-on  of  elements  in  random   vector  to  encode  several  contexts   –  right  shib  of  n  elements  to  encode  dependents   (permuta-on)   –  leb  shib  of  n  elements  to  encode  heads  (inverse   permuta-on)   •  choose  a  different  n  for  each  kind  of   dependency   8  
  • 9. Method   •  assign  a  context  vector  to  each  term   •  assign  a  shib  func-on  (Πn)  to  each  kind  of   dependency   •  each  term  is  represented  by  a  vector  which  is   –  the  sum  of  the  permuted  vectors  of  all  the   dependent  terms   –  the  sum  of  the  inverse  permuted  vectors  of  all  the   head  terms   9  
  • 10. Example   John  -­‐>  (0,  0,  0,  0,  0,  0,  1,  0,  -­‐1,  0)   eat  -­‐>  (1,  0,  0,  0,  -­‐1,  0,  0  ,0  ,0  ,0)   John  eats  a  red  apple   red-­‐>  (0,  0,  0,  1,  0,  0,  0,  -­‐1,  0,  0)   apple  -­‐>  (1,  0,  0,  0,  0,  0,  0,  -­‐1,  0,  0)   mod-­‐>Π3;  obj-­‐>Π7     (apple)=Π3(red)+Π-­‐7(eat)=…   10  
  • 11. Example   John  -­‐>  (0,  0,  0,  0,  0,  0,  1,  0,  -­‐1,  0)   eat  -­‐>  (1,  0,  0,  0,  -­‐1,  0,  0  ,0  ,0  ,0)   John  eats  a  red  apple   red-­‐>  (0,  0,  0,  1,  0,  0,  0,  -­‐1,  0,  0)   apple  -­‐>  (1,  0,  0,  0,  0,  0,  0,  -­‐1,  0,  0)   mod-­‐>Π3;  obj-­‐>Π7       (apple)=Π3(red)+Π-­‐7(eat)=…     …=(-­‐1,  0,  0,  0,  0,  0,  1,  0,  0,  0)  +  (0,  0,  0,  1,  0,  0,  0,  -­‐1,  0,  0)     3  right  shibs   7  leb  shibs   11  
  • 12. Output   R   B   Vector  space  of  random   Vector  space  of  terms   context  vectors   12  
  • 13. Query  1/4   •  similarity  between  terms   –  cosine  similarity  between  terms  vectors  in  B   –  terms  are  similar  if  they  occur  in  similar  syntac-c   contexts     13  
  • 14. Query  2/4   Words  similar  to  “provide”   offer   0.855   supply   0.819   deliver   0.801   give   0.787   contain   0.784   require   0.782   present   0.778   14  
  • 15. Query  3/4   •  similarity  between  terms  exploi-ng   dependencies      what  are  the  objects  of  the  word  “provide”?   1.  get  the  term  vector  for  “provide”  in  B   2.  compute  the  similarity  with  all  permutated   vectors  in  R  using  the  permuta-on  assigned  to   “obj”  rela-on     15  
  • 16. Query  4/4   What  are  the  objects  of  the  word  “provide”?   informa-on   0.344   food   0.208   support   0.143   energy   0.143   job   0.142   16  
  • 17. Composi-onal  seman-cs  1/2   •  words  are  represented  in  isola-on   •  represent  complex  structure  (phrase  or   sentence)  is  a  challenge  task   –  IR,  QA,  IE,  Text  Entailment,  …   •  how  to  combine  words   –  tensor  product  of  words   –  Clark  and  Pulman  suggest  to  take  into  account   symbolic  features  (syntac-c  dependencies)   17  
  • 18. Composi-onal  seman-cs  2/2   man  reads  magazine   (Clark  and  Pulman)   man ! subj ! read ! obj ! magazine 18  
  • 19. Similarity  between  structures   man  reads  magazine   woman  browses  newspaper   man ! subj ! read ! obj ! magazine woman ! subj ! browse ! obj ! newspaper 19  
  • 20. …a  bit  of  math   (w1 ! w2 )" (w3 ! w4 ) = (w1 " w3 ) # (w2 " w4 ) man ! woman " read ! browse " magazine ! newspaper 20  
  • 21. System  setup   •  Implemented  in  JAVA   •  Two  corpora   –  TASA:  800K  sentences   and  9M  dependencies   –  a  por-on  of  ukWaC:  7M   sentences  and  127M   dependencies   –  40,000  most  frequent   words   •  Dependency  parser   –  MINIPAR   21  
  • 22. Evalua-on   •  GEMS  2011  Shared  Task  for  composi-onal   seman-cs   –  list  of  two  pairs  of  words  combina-on   •  rated  by  humans   •  5,833  rates   •  encoded  dependencies:  subj,  obj,  mod,  nn   –  GOAL:  compare  the  system  performance  against   humans  scores   •  Spearman  correla-on   22  
  • 23. Results  (old)   Corpus   Combina-on   ρ   TASA   verb-­‐obj   0.260   adj-­‐noun   0.637   compound  nouns   0.341   overall   0.275   ukWaC   verb-­‐obj   0.292   adj-­‐noun   0.445   compound  nouns   0.227   overall   0.261   23  
  • 24. Results  (new)   Corpus   Combina-on   ρ   TASA   verb-­‐obj   0.160   adj-­‐noun   0.435   compound  nouns   0.243   overall   0.186   ukWaC   verb-­‐obj   0.190   adj-­‐noun   0.303   compound  nouns   0.159   overall   0.179   24  
  • 25. Conclusion  and  Future  Work   •  Conclusion   –  encode  syntac-c  dependencies  using  vector   permuta-ons  and  Random  Indexing   –  early  arempt  in  seman-c  composi-on   •  Future  Work   –  deeper  evalua-on  (in  vivo)   –  more  formal  study  about  seman-c  composi-on   –  tackle  scalability  problem   –  try  to  encode  other  kinds  of  context   25