|
Top-Down Search/Parsing |
Bottom-Up Search/Parsing |
|---|---|
|
| |
|
since we’re trying to find trees rooted with an |
we also want trees that cover the input word. So start with trees that link up words in the right way, then work our way up to form larger trees |
|
only searches for trees that can be answers |
only forms trees consistent with the input words |
|
suggests trees that are not consistent with any of the words |
suggest trees that make no sense globally |
|
rules are applied from left to right |
rules are applied from right to left |
|
|
Constituency Parsing - Control
- in both cases we left out how to keep track of the search space and how to make choices:
- which node to try to expand next (DFS vs BFS)
- which grammar rule to use to expand the node
- one approach is called back tracking: make a choice, if it doesn’t work then back up and make a different choice
Constituency Parsing - With Backtracking
- Depth-First Search - the states form a stack LIFO policy
- Breadth-First Search - the states form a queue FIFO policy
example backtracking
|
Given |
Top-Down DFS Search |
|---|---|
|
sentence:
lexicon:
grammar:
|
|
|
Traversal Tree | |
|
| |
Problems
even with best filtering, backtracking methods are doomed because of two inter-related problems:
- ambiguity -
- shared sub-problems - no matter what kind of search (top-down or bottom-up or mixed):
- we don’t want to redo work we have already done
- unfortunately, naive backtracking will lead to duplicated work
Ambiguity
![]()