Post-Workshop Work

Generic Decoding Project

Notes from Friday, May 16

ccb: I'm taking notes while Chris D is coding up the interface. He's not writing comments so I'm taking them down here.

Classes

FinishingAgenda

The FinishingAgenda stores Vertices that are not fully formed; they may not make the cut and be added to the Hypergraph. It contains a set of grouped vertices (for instance, in a phrase-based decoder the groups of vertices could represent the beam stacks).

  • Constructor: The finishing agenda is constructed with a VertexSignatureCreator and a VertexRanker. The VertexRanker scores the vertices (be they complete or incomplete); everything will be a finished or finishing edge. The VertexSignatureCreator which given a Vertex state returns an object that represented the equivalence class that you want it to be placed in for the kind of search you're doing.
  • add: This method puts a vertex into its equivalence class, based on its signature.

ExplorationAgenda

Is an object which does not need to be subclassed for a particular search strategy. It provides methods for getting the next active vertex to be processed, and adding pairs of active and passive vertices which you will explore (called a traversal in the parsing lit / Klein paper).

It's up to the user to put things on the ExplorationAgenda properly. For instance, if something results in both an active and passive state the user must put both on. As with S -> NP VP *, S -> NP VP * PP.

VertexGroup

This represents the equivalence classes used by the FinishingAgenda. It maintains a heap of the vertices within it, keeping them sorted by whatever comparator functions they define. Because the VertexGroups themselves should be comparable, it has to define this method. For instance, it could keep track of the score of the vertex at the top of its heap. Alternately it could first sort by some feature of the Signature like the number of source words covered in translation.

It should contain the information necessary to determine the compatible passive edges.

The VertexGroup may by a singleton set if there aren't equivalence classes associated with a search method.

VertexSignatureCreator

Maps from Strings to Objects. The String is a query about some particular aspect of the Vertex, such as "language model state" or "coverage vector".

SearchStrategy

Three methods:

  • retrieveCombinableVertices: gets the compatible vertices given the signature of a vertex. For instance, it may consult the coverage vector and get the translations of source phrases which are still not covered. (This method is passed the sentence and the hypergraph, among other things).
  • applyFundamentalRule: It expands the hypothesis, for instance by moving the dot, or adding a translation option and marking off the coverage vector. It returns a VertexState instead of a Vertex. This is important because it allows us to look up and see if such a Vertex already exists.
  • generateTraversals: Is passed two sets - one of of vertices (grouped together, in sorted order) and set of extensions. Combines them and adds the combinations to the ExplorationAgenda. The pruning strategy is implemented in this method.

This class will also keep all of the basic expansions like the translation options.

Decoder

Initializes a finishing agenda. While the finishing agenda or the exploration agenda still have elements, it gets the next pair of Vertexes (a traversal) from the ExplorationAgenda. It retrieves the combinable vertices from the SearchStrategy

(Lane just asked "So, CKY is an inherently parallelizable algorithm will this support parallelization". Answer: "Yes, and you don't have to change the search strategy; just the general code").

Seemingly noteworthy sleep deprived quotes:

  • Listening to Bob Moore speak is better than sunshine.
  • In Java you can think of extends as isa and implements as acts like a.

Notes from Wednesday, May 14

Today we are revising the design of our Hypergraph prototype code. We have decided to have a Hyperarc replace the AndNode.

Here's the outline of a Hypergraph for the case of parsing.

  • Unconnected HA in 1 of 2 agendas
    • Active HA
    • Passive HA
  • Agendas
    • Exploration
    • Finishing
      • Filled with Passive HA (phrase pairs) at initialization
      • 1 start active HA

Hypergraph pseudo code:

 Parse
   for(f_vertex  in finishing) {
     consume(e_edge in explore) {
         if(!finishing.vertexExists(e_edge) {
            finishing.addNewVertex(e_edge);
         } else {
            // in the viterbi case we will collapse
            // and keep the best one... 
            combine(e_edge)
         {
     }
     HG.addNode(f_vertex)
     // expand
     if(f_vertex.isActive) {
       for(passive) {
         if(combine(active, passive))
            // in the phrase-based case an active
            // edge is a coverage vector...
            explore.add(new AHA(active, passive))
       }
     }
   }

With inspiration from the Klein and Manning 2004 paper.

Evening note on terminology problem. In chart parsing we talk about active and passing edges. In hypergraphs these are vertices.

Notes from Tuesday, May 13

Algorithms that we want our abstract Hypergraph to be able to compute:

  • Viterbi
  • k-best
  • Inside
  • Sample
    • (Design question: do we want an abstract way of defining uniqueness to allow other search strategies to be implemented)
    • (The hypergraph data structure will provide easy ways of traversing the graph, so it might be simpler just to implement these, and figure that other search strategies can be implemented by analogy; probably will not pursue useful generics now)

Some useful papers

Toy example:

  • Phrase-based model
    • guten --> good
    • Tag --> day
    • guten Tag --> hello
    • guten Tag --> good day
    • Tag --> hi
  • CKY
    • guten X --> good X
    • X Tag --> X day
    • Tag --> day
    • Tag --> hi
    • guten --> X
    • guten Tag --> hello
    • guten Tag --> good day

Notes from Monday, May 12

HyperGraph types

OrNode

  • points to a list of an arbitrary number of AndNodes
  • implements two interfaces State and Score/Weight
    • (Possibly two subtypes: CompoasedOr, or AtomicOr)
    • (Alternately: AndNode stores list of OrNodes and an Axiom; specialized AndNode can be "Lite" in that they don't store the Axiom)
    • (In a phrase-based system the start state is a ComposedOr points to all the translations that covers a specific source span.)
    • (Score is included in the SemiRing operation Collect; others are Extend ...)

AndNodes

  • and a list of Axioms that could have been used to cover that Span (particular non-terminals) "HyperEdge bundle" / one Axiom
    • (CJD: if there's something Nasty it's going to be in how the AndNode stores Axioms)
  • points to a fixed number OrNodes (for instance two OrNodes one spanning i-j, and one spanning j-k)
  • implements Score/Weight, Orderable
  • State is the State of the parent OrNode; don't need to store this
  • Method on the AndNode which allows us to recover the Viterbi path
    • (proposal: something that is separate from the AndNode and operates on the graph calculates the Viterbi path)
    • (agreed: but an AndNode ought to be able to give its children; its best / Nth-best derivation; its terminal string)
    • (this is done in the model-specific derivation)

State

  • must contain span

Terminal case: an OrNode with no children Axiom?: basic information (rule in Heiro, phrase translation in Moses)

For any particular application, you'll have to write your own specific AndNode implementation, and your own Decoder which operates on them, although the phrase-based and CKY will both operate identically.

Objective for tonight: two groups, both prototyping the HyperGraph interface, tomorrow will try doing phrase-based v. cky

Page last modified on June 12, 2008, at 03:56 PM