SlideShare a Scribd company logo
1 of 43
Download to read offline
Dependency Parsing
        Jinho D. Choi
    University of Colorado
      Preliminary Exam
        March 4, 2009
Contents
• Dependency Structure
  - What is dependency structure?
  - Phrase structure vs. Dependency structure
  - Dependency Graph
• Dependency Parsers
  - MaltParser: Nivre’s algorithm
  - MSTParser: Edmonds’s algorithm
  - MaltParser vs. MSTParser
  - Choi’s algorithm
• Applications
Dependency Structure
• What is dependency?
  - Syntactic or semantic relation between lexicons
  - Syntactic: NMOD, AMOD, Semantic: LOC, MNR
• Phrase Structure(PS) vs. Dependency Structure(DS)
  - Constituents vs. Dependencies
  - There are no phrasal nodes in DS.
     ! Each node in DS represents a word-token.
  - In DS, every node except the root is dependent in exactly one
    other node.
Phrase vs. Dependency
                    She bought a car
         Phrase Structure    Dependency Structure
            S

                                                       bought
   NP                VP
                                                 SBJ                OBJ


   Pro          V               NP         she                            car


                                                                          DET
   she      bought        Det        N

                                                                a

                          a          car




• Not flexible with word-orders
• Language dependent
• No semantic information
Dependency Graph
• For a sentence x = w ..w , a dependency graph G = (V , E )
                          1   n                                        x           x    x


  - V = {w = root, w , ... , w },
      x       0       1               n


  - E = {(w , r, w ) : w " w , w ! V , w ! V - w , r ! R }
      x       i   j   i           j       i   x   j       x     0              x


     ! R = a set of all possible dependency relations in x
          x



• Well-formed Dependency Graph                                        Root


  - Unique root                                                       bought


  - Single head                                                 SBJ          OBJ



  - Connected                                             She                          car



  - Acyclic
                                                                                   NMOD

                                                  Jinho                        a
Projectivity vs Non-projectivity
• Projectivity means no cross-edges.
                 root        She   bought         a            car




    root   She      bought     a   car      yesterday       that     was   blue




• Why projectivity?
  - Regenerate the original sentence with the same word-orders
  - Parsing is less expressive (O(n) vs. O(n ))         2


  - There are not many non-projective relations
Dependency Parsers
• Two state-of-art dependency parsers
  - MaltParser: performed the best in CoNLL 2007 shared task
  - MSTParser: performed the best in CoNLL 2006 shared task
• MaltParser
  - Developed by Johan Hall, Jens Nilsson, and Joakim Nivre
  - Nivre’s algorithm(p, O(n)), Covington’s algorithm(n, O(n ))
                                                            2


• MSTParser
  - Developed by Ryan McDonald
  - Eisner’s algorithm(p,O(k log k)), Edmonds’s algorithm(n, O(kn )
                                                                 2
Nivre’s Algorithm
• Based on Shift-Reduce algorithm
• S = a stack
• I = a list of remaining input tokens

                                         she   bought   a   car
Nivre’s Algorithm
       she   bought       a   car




S                     I             A
Nivre’s Algorithm
                    she   bought       a   car




             S                     I             A
•   Initialize
Nivre’s Algorithm
                    she   bought         a   car




                                   she
                              bought
                                    a
                                   car

             S                     I               A
•   Initialize
Nivre’s Algorithm
                       she   bought         a   car




                                      she
                                 bought
                                       a
                                      car

             S                        I               A
•   Initialize
•   Shift : ‘she’
Nivre’s Algorithm
                       she   bought         a   car




                                 bought
                                      a
             she                      car

             S                        I               A
•   Initialize
•   Shift : ‘she’
Nivre’s Algorithm
                            she   bought         a   car




                                      bought
                                           a
             she                           car

             S                             I               A
•   Initialize
•   Shift : ‘she’
•   Left-Arc : ‘she ! bought’
Nivre’s Algorithm
                            she   bought         a   car




                                      bought
                                           a
             she                           car             she ! bought

             S                             I                   A
•   Initialize
•   Shift : ‘she’
•   Left-Arc : ‘she ! bought’
Nivre’s Algorithm
                            she   bought         a   car




                                      bought
                                           a
                                           car             she ! bought

             S                             I                   A
•   Initialize
•   Shift : ‘she’
•   Left-Arc : ‘she ! bought’
Nivre’s Algorithm
                            she   bought         a   car




                                      bought
                                           a
                                           car             she ! bought

             S                             I                   A
•   Initialize
•   Shift : ‘she’
•   Left-Arc : ‘she ! bought’
•   Shift : ‘bought’
Nivre’s Algorithm
                            she   bought         a   car




                                           a
          bought                           car             she ! bought

             S                             I                   A
•   Initialize
•   Shift : ‘she’
•   Left-Arc : ‘she ! bought’
•   Shift : ‘bought’
Nivre’s Algorithm
                            she   bought            a   car




                                           a
          bought                           car                she ! bought

             S                             I                      A
•   Initialize                    •   Shift : ‘a’
•   Shift : ‘she’
•   Left-Arc : ‘she ! bought’
•   Shift : ‘bought’
Nivre’s Algorithm
                            she   bought            a   car




                 a
          bought                           car                she ! bought

             S                             I                      A
•   Initialize                    •   Shift : ‘a’
•   Shift : ‘she’
•   Left-Arc : ‘she ! bought’
•   Shift : ‘bought’
Nivre’s Algorithm
                            she   bought            a   car




                 a
          bought                           car                she ! bought

             S                             I                      A
•   Initialize                    •   Shift : ‘a’
•   Shift : ‘she’                 •   Left-Arc : ‘a ! car’
•   Left-Arc : ‘she ! bought’
•   Shift : ‘bought’
Nivre’s Algorithm
                            she   bought            a   car




                 a                                              a ! car
          bought                           car                she ! bought

             S                             I                      A
•   Initialize                    •   Shift : ‘a’
•   Shift : ‘she’                 •   Left-Arc : ‘a ! car’
•   Left-Arc : ‘she ! bought’
•   Shift : ‘bought’
Nivre’s Algorithm
                            she   bought            a   car




                                                                a ! car
          bought                           car                she ! bought

             S                             I                      A
•   Initialize                    •   Shift : ‘a’
•   Shift : ‘she’                 •   Left-Arc : ‘a ! car’
•   Left-Arc : ‘she ! bought’
•   Shift : ‘bought’
Nivre’s Algorithm
                            she   bought            a   car




                                                                   a ! car
          bought                           car                she ! bought

             S                             I                         A
•   Initialize                    •   Shift : ‘a’
•   Shift : ‘she’                 •   Left-Arc : ‘a ! car’
•   Left-Arc : ‘she ! bought’     •   Right-Arc : ‘bought " car’
•   Shift : ‘bought’
Nivre’s Algorithm
                            she   bought            a   car




                                                               bought " car
                                                                   a ! car
          bought                           car                she ! bought

             S                             I                         A
•   Initialize                    •   Shift : ‘a’
•   Shift : ‘she’                 •   Left-Arc : ‘a ! car’
•   Left-Arc : ‘she ! bought’     •   Right-Arc : ‘bought " car’
•   Shift : ‘bought’
Nivre’s Algorithm
                            she   bought            a   car




                                                               bought " car
             car                                                   a ! car
          bought                                              she ! bought

             S                             I                         A
•   Initialize                    •   Shift : ‘a’
•   Shift : ‘she’                 •   Left-Arc : ‘a ! car’
•   Left-Arc : ‘she ! bought’     •   Right-Arc : ‘bought " car’
•   Shift : ‘bought’
Nivre’s Algorithm
                            she   bought            a   car




                                                               bought " car
             car                                                   a ! car
          bought                                              she ! bought

             S                             I                         A
•   Initialize                    •   Shift : ‘a’
•   Shift : ‘she’                 •   Left-Arc : ‘a ! car’
•   Left-Arc : ‘she ! bought’     •   Right-Arc : ‘bought " car’
•   Shift : ‘bought’              •   Terminate (no need to reduce ‘car’ or ‘bought’)
Edmonds’s Algorithm
• Based on Maximum Spanning Tree algorithm
• Algorithm
  1. Build a complete graph
  2. Keep only incoming edges with the maximum scores
  3. If there is no cycle, goto #5
  4. If there is a cycle, pretend the cycle as one vertex and update
     scores for all incoming edges to the cycle; goto #2
  5. Break all cycles by removing appropriate edges in the cycle
     (edges that cause multiple heads)
Edmonds’s Algorithm
    root                      9
                10

9               saw
     20                       0
           30            30

    John         11           Mary
                     3
Edmonds’s Algorithm
    root                      9      root
                10

9               saw                              saw
     20                       0       20
           30            30                 30         30

    John         11           Mary   John                   Mary
                     3
Edmonds’s Algorithm
    root                      9      root
                10

9               saw                              saw
     20                       0       20
           30            30                 30         30

    John         11           Mary   John                   Mary
                     3
Edmonds’s Algorithm
                 root                         9      root
                                10

            9                   saw                              saw
                     20                       0       20
                           30            30                 30         30

                John                11        Mary   John                   Mary
                                     3



     root                       9
                40

29              saw
                               30
                          30

     John        31            Mary
                     3
Edmonds’s Algorithm
                 root                         9                          root
                                10

            9                   saw                                                  saw
                     20                       0                           20
                           30            30                                     30         30

                John                11        Mary                      John                    Mary
                                     3



     root                       9                    root
                40                                          40

29              saw                                         saw
                               30
                          30                                      30

     John        31            Mary                  John              Mary
                     3
Edmonds’s Algorithm
                 root                         9                          root
                                10

            9                   saw                                                  saw
                     20                       0                           20
                           30            30                                     30         30

                John                11        Mary                      John                      Mary
                                     3



     root                       9                    root                                  root
                40                                          40                                          10

29              saw                                         saw                                          saw
                               30
                          30                                      30                               30          30

     John        31            Mary                  John              Mary                John                     Mary
                     3
MaltParser vs. MSTParser
• Advantages
  - MaltParser: low complexity, more accurate for short-distance
  - MSTParser: high accuracy, more accurate for long-distance
• Merge MaltParser and MSTParser in learning stages
Choi’s Algorithm
• Projective dependency parsing algorithm
  - Motivation: do more exhaustive searches than MaltParser but
    keep the complexity lower than the one for MSTParser

  - Intuition: in projective dependency graph, every word can find
    its head from a word in adjacent phrases



   She    bought     a     car    yesterday    that   was    blue



  - Searching: starts with the edge-node, jump to its head
  - Complexity: O(k"n), k is the number of words in each phrase
Choi’s Algorithm
    0.9       0.6

A         B         C   D   E

    X
Choi’s Algorithm
    0.9       0.6                   0.9

A         B         C   D   E   A         B   C   D   E

    X                                     X
Choi’s Algorithm
    0.9         0.6                       0.9

A         B           C       D   E   A         B   C   D   E

    X                                           X


    0.9                   X

A           B         C       D   E

                0.5
      0.7
Choi’s Algorithm
    0.9         0.6                       0.9

A         B           C       D   E   A         B         C   D   E

    X                                           X


    0.9                   X                     0.7
                                          0.9
A           B         C       D   E
                                      A         B         C   D   E
                0.5
      0.7
                                                      X
Choi’s Algorithm
    0.9         0.6                             0.9

A         B           C       D         E   A         B         C   D   E

    X                                                 X


    0.9                   X                           0.7
                                                0.9
A           B         C       D         E
                                            A         B         C   D   E
                0.5
      0.7
                                                            X


          0.7
    0.9                           0.8

A           B         C       D         E

                          X
                  X
Choi’s Algorithm
    0.9         0.6                             0.9

A         B           C       D         E   A         B         C   D           E

    X                                                 X


    0.9                   X                           0.7
                                                0.9
A           B         C       D         E
                                            A          B        C   D           E
                0.5
      0.7
                                                            X


          0.7                                         0.7
    0.9                           0.8           0.9                       0.8

A           B         C       D         E   A          B        C   D           E

                          X                                         0.5
                  X                                   0.8
Applications
• Semantic Role Labeling
  - CoNLL 2008~9 shared task
• Sentence Compression
  - Relation extraction
• Sentence Alignment
  - Paraphrase detection, machine translation
• Sentiment Analysis

More Related Content

What's hot

A Panorama of Natural Language Processing
A Panorama of Natural Language ProcessingA Panorama of Natural Language Processing
A Panorama of Natural Language ProcessingTed Xiao
 
Natural language processing
Natural language processingNatural language processing
Natural language processingYogendra Tamang
 
Introduction to natural language processing
Introduction to natural language processingIntroduction to natural language processing
Introduction to natural language processingMinh Pham
 
Natural language processing
Natural language processing Natural language processing
Natural language processing Md.Sumon Sarder
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language ProcessingMariana Soffer
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processingrewa_monami
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language ProcessingToine Bogers
 
Text classification & sentiment analysis
Text classification & sentiment analysisText classification & sentiment analysis
Text classification & sentiment analysisM. Atif Qureshi
 
IE: Named Entity Recognition (NER)
IE: Named Entity Recognition (NER)IE: Named Entity Recognition (NER)
IE: Named Entity Recognition (NER)Marina Santini
 
Natural Language Processing
Natural Language Processing Natural Language Processing
Natural Language Processing Adarsh Saxena
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language ProcessingRishikese MR
 

What's hot (20)

A Panorama of Natural Language Processing
A Panorama of Natural Language ProcessingA Panorama of Natural Language Processing
A Panorama of Natural Language Processing
 
Natural language processing
Natural language processingNatural language processing
Natural language processing
 
Natural language processing
Natural language processingNatural language processing
Natural language processing
 
Nlp ambiguity presentation
Nlp ambiguity presentationNlp ambiguity presentation
Nlp ambiguity presentation
 
NLP
NLPNLP
NLP
 
Introduction to natural language processing
Introduction to natural language processingIntroduction to natural language processing
Introduction to natural language processing
 
Natural language processing
Natural language processing Natural language processing
Natural language processing
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
 
NLP_KASHK:POS Tagging
NLP_KASHK:POS TaggingNLP_KASHK:POS Tagging
NLP_KASHK:POS Tagging
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
 
NLP_KASHK:Minimum Edit Distance
NLP_KASHK:Minimum Edit DistanceNLP_KASHK:Minimum Edit Distance
NLP_KASHK:Minimum Edit Distance
 
Machine Translation
Machine TranslationMachine Translation
Machine Translation
 
Text classification & sentiment analysis
Text classification & sentiment analysisText classification & sentiment analysis
Text classification & sentiment analysis
 
IE: Named Entity Recognition (NER)
IE: Named Entity Recognition (NER)IE: Named Entity Recognition (NER)
IE: Named Entity Recognition (NER)
 
Text Summarization
Text SummarizationText Summarization
Text Summarization
 
Natural Language Processing
Natural Language Processing Natural Language Processing
Natural Language Processing
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
 
NLP
NLPNLP
NLP
 

More from Jinho Choi

Adaptation of Multilingual Transformer Encoder for Robust Enhanced Universal ...
Adaptation of Multilingual Transformer Encoder for Robust Enhanced Universal ...Adaptation of Multilingual Transformer Encoder for Robust Enhanced Universal ...
Adaptation of Multilingual Transformer Encoder for Robust Enhanced Universal ...Jinho Choi
 
Analysis of Hierarchical Multi-Content Text Classification Model on B-SHARP D...
Analysis of Hierarchical Multi-Content Text Classification Model on B-SHARP D...Analysis of Hierarchical Multi-Content Text Classification Model on B-SHARP D...
Analysis of Hierarchical Multi-Content Text Classification Model on B-SHARP D...Jinho Choi
 
Competence-Level Prediction and Resume & Job Description Matching Using Conte...
Competence-Level Prediction and Resume & Job Description Matching Using Conte...Competence-Level Prediction and Resume & Job Description Matching Using Conte...
Competence-Level Prediction and Resume & Job Description Matching Using Conte...Jinho Choi
 
Transformers to Learn Hierarchical Contexts in Multiparty Dialogue for Span-b...
Transformers to Learn Hierarchical Contexts in Multiparty Dialogue for Span-b...Transformers to Learn Hierarchical Contexts in Multiparty Dialogue for Span-b...
Transformers to Learn Hierarchical Contexts in Multiparty Dialogue for Span-b...Jinho Choi
 
The Myth of Higher-Order Inference in Coreference Resolution
The Myth of Higher-Order Inference in Coreference ResolutionThe Myth of Higher-Order Inference in Coreference Resolution
The Myth of Higher-Order Inference in Coreference ResolutionJinho Choi
 
Noise Pollution in Hospital Readmission Prediction: Long Document Classificat...
Noise Pollution in Hospital Readmission Prediction: Long Document Classificat...Noise Pollution in Hospital Readmission Prediction: Long Document Classificat...
Noise Pollution in Hospital Readmission Prediction: Long Document Classificat...Jinho Choi
 
Abstract Meaning Representation
Abstract Meaning RepresentationAbstract Meaning Representation
Abstract Meaning RepresentationJinho Choi
 
Semantic Role Labeling
Semantic Role LabelingSemantic Role Labeling
Semantic Role LabelingJinho Choi
 
CS329 - WordNet Similarities
CS329 - WordNet SimilaritiesCS329 - WordNet Similarities
CS329 - WordNet SimilaritiesJinho Choi
 
CS329 - Lexical Relations
CS329 - Lexical RelationsCS329 - Lexical Relations
CS329 - Lexical RelationsJinho Choi
 
Automatic Knowledge Base Expansion for Dialogue Management
Automatic Knowledge Base Expansion for Dialogue ManagementAutomatic Knowledge Base Expansion for Dialogue Management
Automatic Knowledge Base Expansion for Dialogue ManagementJinho Choi
 
Attention is All You Need for AMR Parsing
Attention is All You Need for AMR ParsingAttention is All You Need for AMR Parsing
Attention is All You Need for AMR ParsingJinho Choi
 
Graph-to-Text Generation and its Applications to Dialogue
Graph-to-Text Generation and its Applications to DialogueGraph-to-Text Generation and its Applications to Dialogue
Graph-to-Text Generation and its Applications to DialogueJinho Choi
 
Real-time Coreference Resolution for Dialogue Understanding
Real-time Coreference Resolution for Dialogue UnderstandingReal-time Coreference Resolution for Dialogue Understanding
Real-time Coreference Resolution for Dialogue UnderstandingJinho Choi
 
Topological Sort
Topological SortTopological Sort
Topological SortJinho Choi
 
Multi-modal Embedding Learning for Early Detection of Alzheimer's Disease
Multi-modal Embedding Learning for Early Detection of Alzheimer's DiseaseMulti-modal Embedding Learning for Early Detection of Alzheimer's Disease
Multi-modal Embedding Learning for Early Detection of Alzheimer's DiseaseJinho Choi
 
Building Widely-Interpretable Semantic Networks for Dialogue Contexts
Building Widely-Interpretable Semantic Networks for Dialogue ContextsBuilding Widely-Interpretable Semantic Networks for Dialogue Contexts
Building Widely-Interpretable Semantic Networks for Dialogue ContextsJinho Choi
 
How to make Emora talk about Sports Intelligently
How to make Emora talk about Sports IntelligentlyHow to make Emora talk about Sports Intelligently
How to make Emora talk about Sports IntelligentlyJinho Choi
 

More from Jinho Choi (20)

Adaptation of Multilingual Transformer Encoder for Robust Enhanced Universal ...
Adaptation of Multilingual Transformer Encoder for Robust Enhanced Universal ...Adaptation of Multilingual Transformer Encoder for Robust Enhanced Universal ...
Adaptation of Multilingual Transformer Encoder for Robust Enhanced Universal ...
 
Analysis of Hierarchical Multi-Content Text Classification Model on B-SHARP D...
Analysis of Hierarchical Multi-Content Text Classification Model on B-SHARP D...Analysis of Hierarchical Multi-Content Text Classification Model on B-SHARP D...
Analysis of Hierarchical Multi-Content Text Classification Model on B-SHARP D...
 
Competence-Level Prediction and Resume & Job Description Matching Using Conte...
Competence-Level Prediction and Resume & Job Description Matching Using Conte...Competence-Level Prediction and Resume & Job Description Matching Using Conte...
Competence-Level Prediction and Resume & Job Description Matching Using Conte...
 
Transformers to Learn Hierarchical Contexts in Multiparty Dialogue for Span-b...
Transformers to Learn Hierarchical Contexts in Multiparty Dialogue for Span-b...Transformers to Learn Hierarchical Contexts in Multiparty Dialogue for Span-b...
Transformers to Learn Hierarchical Contexts in Multiparty Dialogue for Span-b...
 
The Myth of Higher-Order Inference in Coreference Resolution
The Myth of Higher-Order Inference in Coreference ResolutionThe Myth of Higher-Order Inference in Coreference Resolution
The Myth of Higher-Order Inference in Coreference Resolution
 
Noise Pollution in Hospital Readmission Prediction: Long Document Classificat...
Noise Pollution in Hospital Readmission Prediction: Long Document Classificat...Noise Pollution in Hospital Readmission Prediction: Long Document Classificat...
Noise Pollution in Hospital Readmission Prediction: Long Document Classificat...
 
Abstract Meaning Representation
Abstract Meaning RepresentationAbstract Meaning Representation
Abstract Meaning Representation
 
Semantic Role Labeling
Semantic Role LabelingSemantic Role Labeling
Semantic Role Labeling
 
CKY Parsing
CKY ParsingCKY Parsing
CKY Parsing
 
CS329 - WordNet Similarities
CS329 - WordNet SimilaritiesCS329 - WordNet Similarities
CS329 - WordNet Similarities
 
CS329 - Lexical Relations
CS329 - Lexical RelationsCS329 - Lexical Relations
CS329 - Lexical Relations
 
Automatic Knowledge Base Expansion for Dialogue Management
Automatic Knowledge Base Expansion for Dialogue ManagementAutomatic Knowledge Base Expansion for Dialogue Management
Automatic Knowledge Base Expansion for Dialogue Management
 
Attention is All You Need for AMR Parsing
Attention is All You Need for AMR ParsingAttention is All You Need for AMR Parsing
Attention is All You Need for AMR Parsing
 
Graph-to-Text Generation and its Applications to Dialogue
Graph-to-Text Generation and its Applications to DialogueGraph-to-Text Generation and its Applications to Dialogue
Graph-to-Text Generation and its Applications to Dialogue
 
Real-time Coreference Resolution for Dialogue Understanding
Real-time Coreference Resolution for Dialogue UnderstandingReal-time Coreference Resolution for Dialogue Understanding
Real-time Coreference Resolution for Dialogue Understanding
 
Topological Sort
Topological SortTopological Sort
Topological Sort
 
Tries - Put
Tries - PutTries - Put
Tries - Put
 
Multi-modal Embedding Learning for Early Detection of Alzheimer's Disease
Multi-modal Embedding Learning for Early Detection of Alzheimer's DiseaseMulti-modal Embedding Learning for Early Detection of Alzheimer's Disease
Multi-modal Embedding Learning for Early Detection of Alzheimer's Disease
 
Building Widely-Interpretable Semantic Networks for Dialogue Contexts
Building Widely-Interpretable Semantic Networks for Dialogue ContextsBuilding Widely-Interpretable Semantic Networks for Dialogue Contexts
Building Widely-Interpretable Semantic Networks for Dialogue Contexts
 
How to make Emora talk about Sports Intelligently
How to make Emora talk about Sports IntelligentlyHow to make Emora talk about Sports Intelligently
How to make Emora talk about Sports Intelligently
 

Recently uploaded

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 

Recently uploaded (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Dependency Parsing

  • 1. Dependency Parsing Jinho D. Choi University of Colorado Preliminary Exam March 4, 2009
  • 2. Contents • Dependency Structure - What is dependency structure? - Phrase structure vs. Dependency structure - Dependency Graph • Dependency Parsers - MaltParser: Nivre’s algorithm - MSTParser: Edmonds’s algorithm - MaltParser vs. MSTParser - Choi’s algorithm • Applications
  • 3. Dependency Structure • What is dependency? - Syntactic or semantic relation between lexicons - Syntactic: NMOD, AMOD, Semantic: LOC, MNR • Phrase Structure(PS) vs. Dependency Structure(DS) - Constituents vs. Dependencies - There are no phrasal nodes in DS. ! Each node in DS represents a word-token. - In DS, every node except the root is dependent in exactly one other node.
  • 4. Phrase vs. Dependency She bought a car Phrase Structure Dependency Structure S bought NP VP SBJ OBJ Pro V NP she car DET she bought Det N a a car • Not flexible with word-orders • Language dependent • No semantic information
  • 5. Dependency Graph • For a sentence x = w ..w , a dependency graph G = (V , E ) 1 n x x x - V = {w = root, w , ... , w }, x 0 1 n - E = {(w , r, w ) : w " w , w ! V , w ! V - w , r ! R } x i j i j i x j x 0 x ! R = a set of all possible dependency relations in x x • Well-formed Dependency Graph Root - Unique root bought - Single head SBJ OBJ - Connected She car - Acyclic NMOD Jinho a
  • 6. Projectivity vs Non-projectivity • Projectivity means no cross-edges. root She bought a car root She bought a car yesterday that was blue • Why projectivity? - Regenerate the original sentence with the same word-orders - Parsing is less expressive (O(n) vs. O(n )) 2 - There are not many non-projective relations
  • 7. Dependency Parsers • Two state-of-art dependency parsers - MaltParser: performed the best in CoNLL 2007 shared task - MSTParser: performed the best in CoNLL 2006 shared task • MaltParser - Developed by Johan Hall, Jens Nilsson, and Joakim Nivre - Nivre’s algorithm(p, O(n)), Covington’s algorithm(n, O(n )) 2 • MSTParser - Developed by Ryan McDonald - Eisner’s algorithm(p,O(k log k)), Edmonds’s algorithm(n, O(kn ) 2
  • 8. Nivre’s Algorithm • Based on Shift-Reduce algorithm • S = a stack • I = a list of remaining input tokens she bought a car
  • 9. Nivre’s Algorithm she bought a car S I A
  • 10. Nivre’s Algorithm she bought a car S I A • Initialize
  • 11. Nivre’s Algorithm she bought a car she bought a car S I A • Initialize
  • 12. Nivre’s Algorithm she bought a car she bought a car S I A • Initialize • Shift : ‘she’
  • 13. Nivre’s Algorithm she bought a car bought a she car S I A • Initialize • Shift : ‘she’
  • 14. Nivre’s Algorithm she bought a car bought a she car S I A • Initialize • Shift : ‘she’ • Left-Arc : ‘she ! bought’
  • 15. Nivre’s Algorithm she bought a car bought a she car she ! bought S I A • Initialize • Shift : ‘she’ • Left-Arc : ‘she ! bought’
  • 16. Nivre’s Algorithm she bought a car bought a car she ! bought S I A • Initialize • Shift : ‘she’ • Left-Arc : ‘she ! bought’
  • 17. Nivre’s Algorithm she bought a car bought a car she ! bought S I A • Initialize • Shift : ‘she’ • Left-Arc : ‘she ! bought’ • Shift : ‘bought’
  • 18. Nivre’s Algorithm she bought a car a bought car she ! bought S I A • Initialize • Shift : ‘she’ • Left-Arc : ‘she ! bought’ • Shift : ‘bought’
  • 19. Nivre’s Algorithm she bought a car a bought car she ! bought S I A • Initialize • Shift : ‘a’ • Shift : ‘she’ • Left-Arc : ‘she ! bought’ • Shift : ‘bought’
  • 20. Nivre’s Algorithm she bought a car a bought car she ! bought S I A • Initialize • Shift : ‘a’ • Shift : ‘she’ • Left-Arc : ‘she ! bought’ • Shift : ‘bought’
  • 21. Nivre’s Algorithm she bought a car a bought car she ! bought S I A • Initialize • Shift : ‘a’ • Shift : ‘she’ • Left-Arc : ‘a ! car’ • Left-Arc : ‘she ! bought’ • Shift : ‘bought’
  • 22. Nivre’s Algorithm she bought a car a a ! car bought car she ! bought S I A • Initialize • Shift : ‘a’ • Shift : ‘she’ • Left-Arc : ‘a ! car’ • Left-Arc : ‘she ! bought’ • Shift : ‘bought’
  • 23. Nivre’s Algorithm she bought a car a ! car bought car she ! bought S I A • Initialize • Shift : ‘a’ • Shift : ‘she’ • Left-Arc : ‘a ! car’ • Left-Arc : ‘she ! bought’ • Shift : ‘bought’
  • 24. Nivre’s Algorithm she bought a car a ! car bought car she ! bought S I A • Initialize • Shift : ‘a’ • Shift : ‘she’ • Left-Arc : ‘a ! car’ • Left-Arc : ‘she ! bought’ • Right-Arc : ‘bought " car’ • Shift : ‘bought’
  • 25. Nivre’s Algorithm she bought a car bought " car a ! car bought car she ! bought S I A • Initialize • Shift : ‘a’ • Shift : ‘she’ • Left-Arc : ‘a ! car’ • Left-Arc : ‘she ! bought’ • Right-Arc : ‘bought " car’ • Shift : ‘bought’
  • 26. Nivre’s Algorithm she bought a car bought " car car a ! car bought she ! bought S I A • Initialize • Shift : ‘a’ • Shift : ‘she’ • Left-Arc : ‘a ! car’ • Left-Arc : ‘she ! bought’ • Right-Arc : ‘bought " car’ • Shift : ‘bought’
  • 27. Nivre’s Algorithm she bought a car bought " car car a ! car bought she ! bought S I A • Initialize • Shift : ‘a’ • Shift : ‘she’ • Left-Arc : ‘a ! car’ • Left-Arc : ‘she ! bought’ • Right-Arc : ‘bought " car’ • Shift : ‘bought’ • Terminate (no need to reduce ‘car’ or ‘bought’)
  • 28. Edmonds’s Algorithm • Based on Maximum Spanning Tree algorithm • Algorithm 1. Build a complete graph 2. Keep only incoming edges with the maximum scores 3. If there is no cycle, goto #5 4. If there is a cycle, pretend the cycle as one vertex and update scores for all incoming edges to the cycle; goto #2 5. Break all cycles by removing appropriate edges in the cycle (edges that cause multiple heads)
  • 29. Edmonds’s Algorithm root 9 10 9 saw 20 0 30 30 John 11 Mary 3
  • 30. Edmonds’s Algorithm root 9 root 10 9 saw saw 20 0 20 30 30 30 30 John 11 Mary John Mary 3
  • 31. Edmonds’s Algorithm root 9 root 10 9 saw saw 20 0 20 30 30 30 30 John 11 Mary John Mary 3
  • 32. Edmonds’s Algorithm root 9 root 10 9 saw saw 20 0 20 30 30 30 30 John 11 Mary John Mary 3 root 9 40 29 saw 30 30 John 31 Mary 3
  • 33. Edmonds’s Algorithm root 9 root 10 9 saw saw 20 0 20 30 30 30 30 John 11 Mary John Mary 3 root 9 root 40 40 29 saw saw 30 30 30 John 31 Mary John Mary 3
  • 34. Edmonds’s Algorithm root 9 root 10 9 saw saw 20 0 20 30 30 30 30 John 11 Mary John Mary 3 root 9 root root 40 40 10 29 saw saw saw 30 30 30 30 30 John 31 Mary John Mary John Mary 3
  • 35. MaltParser vs. MSTParser • Advantages - MaltParser: low complexity, more accurate for short-distance - MSTParser: high accuracy, more accurate for long-distance • Merge MaltParser and MSTParser in learning stages
  • 36. Choi’s Algorithm • Projective dependency parsing algorithm - Motivation: do more exhaustive searches than MaltParser but keep the complexity lower than the one for MSTParser - Intuition: in projective dependency graph, every word can find its head from a word in adjacent phrases She bought a car yesterday that was blue - Searching: starts with the edge-node, jump to its head - Complexity: O(k"n), k is the number of words in each phrase
  • 37. Choi’s Algorithm 0.9 0.6 A B C D E X
  • 38. Choi’s Algorithm 0.9 0.6 0.9 A B C D E A B C D E X X
  • 39. Choi’s Algorithm 0.9 0.6 0.9 A B C D E A B C D E X X 0.9 X A B C D E 0.5 0.7
  • 40. Choi’s Algorithm 0.9 0.6 0.9 A B C D E A B C D E X X 0.9 X 0.7 0.9 A B C D E A B C D E 0.5 0.7 X
  • 41. Choi’s Algorithm 0.9 0.6 0.9 A B C D E A B C D E X X 0.9 X 0.7 0.9 A B C D E A B C D E 0.5 0.7 X 0.7 0.9 0.8 A B C D E X X
  • 42. Choi’s Algorithm 0.9 0.6 0.9 A B C D E A B C D E X X 0.9 X 0.7 0.9 A B C D E A B C D E 0.5 0.7 X 0.7 0.7 0.9 0.8 0.9 0.8 A B C D E A B C D E X 0.5 X 0.8
  • 43. Applications • Semantic Role Labeling - CoNLL 2008~9 shared task • Sentence Compression - Relation extraction • Sentence Alignment - Paraphrase detection, machine translation • Sentiment Analysis