Parsing Engine

danbikel.parser
Class CachingDecoderServer

java.lang.Object
  extended by danbikel.parser.CachingDecoderServer
All Implemented Interfaces:
DecoderServerRemote, Server, SwitchboardUser, Remote

public class CachingDecoderServer
extends Object
implements DecoderServerRemote

A wrapper object for a DecoderServerRemote instance that provides probability caching. Allmethods that return either probabilities or log probabilities first check and internal probability cache before requesting a probability using the DecoderServerRemote instance. Cache size is determined by the value of the setting Settings.decoderLocalCacheSize.

See Also:
Settings.decoderLocalCacheSize, Settings.decoderUseLocalProbabilityCache, ProbabilityCache

Field Summary
protected  ProbabilityCache cache
          The cache used for storing probabilities.
protected  int numAccesses
          The number of cache accesses over the lifetime of this object.
protected  int numHits
          The number of cache hits over the lifetime of this object.
protected  DecoderServerRemote stub
          The stub through which all method invocations on this object will flow.
 
Fields inherited from interface danbikel.switchboard.Server
acceptUnlimitedClients
 
Constructor Summary
CachingDecoderServer(DecoderServerRemote stub)
          Constructs a new instance around the specified stub.
 
Method Summary
 boolean acceptClientsOnlyByRequest()
          Returns whether this server is only willing to accept clients that request it.
 boolean alive()
          A simple "ping" method for the switchboard to continually make sure its users are alive.
 Sexp convertUnknownWord(Symbol originalWord, int index)
          Returns either the specified word untouched, or a 3-element list as would be created by convertUnknownWords(SexpList).
 SexpList convertUnknownWords(SexpList sentence)
          Replaces all unknown words in the specified sentence with three-element lists, where the first element is the word itself, the second element is a word-feature vector, as determined by the implementation of WordFeatures.features(Symbol,boolean), and the third element is Constants.trueSym if this word was never observed during training or Constants.falseSym if it was observed at least once during training.
 void die(boolean now)
          Tells the switchboard user to commit suicide.
 Map headToParentMap()
          A mapping from head labels to possible parent labels.
 String host()
          Returns the hostname on which this switchboard user is running.
 int id()
          The unique identifier of this DecoderServerRemote instance.
 Map leftSubcatMap()
          A mapping from left subcat-prediction conditioning contexts (typically parent and head nonterminal labels) to all possible left subcat frames.
 ProbabilityStructure leftSubcatProbStructure()
          The probability structure for the submodel that generates subcats on the left-hand side of head constituents.
 double logPrior(int id, TrainerEvent event)
          Returns the prior probability of generating the nonterminal contained in the specified HeadEvent.
 double logProbGap(int id, TrainerEvent event)
          Returns the log of the probability of generating a gap.
 double logProbHead(int id, TrainerEvent event)
          Returns the log of the probability of generating a head child in the context of a particular parent (both the head to be generated and the parent are contained in the specified TrainerEvent object).
 double logProbHeadWithSubcats(int id, TrainerEvent event)
          Returns the log of the probability of generating a new head and its left and right subcat frames.
 double logProbLeftSubcat(int id, TrainerEvent event)
          Returns the log of the probability of generating a left subcat in the context of a particular parent and head (the subcat to be generated, the head and parent are all contained in the specified TrainerEvent object).
 double logProbMod(int id, TrainerEvent event)
          Returns the log of the probability of generating a fully-lexicalized modifying nonterminal given a particular parent, head and other components of the syntactic context.
 double logProbModNT(int id, TrainerEvent event)
          Returns the log of the probability of generating a partially-lexicalized modifying nonterminal given a particular parent, head and other components of the syntactic context.
 double logProbRightSubcat(int id, TrainerEvent event)
          Returns the log of the probability of generating a right subcat in the context of a particular parent and head (the subcat to be generated, the head and parent are all contained in the specified TrainerEvent object).
 double logProbSubcat(int id, TrainerEvent event, boolean side)
          Invokes DecoderServerRemote.logProbLeftSubcat(int, TrainerEvent) or DecoderServerRemote.logProbRightSubcat(int, TrainerEvent) depending on the value of side.
 double logProbTop(int id, TrainerEvent event)
          Returns the log of the probability of generating the head nonterminal of an entire sentence.
 int maxClients()
          The maximum number of clients this server is willing to accept, or Server.acceptUnlimitedClients if this server is willing to accept a virtually unlimited number of clients (a large maximum value may be used by the switchboard).
 Map modNonterminalMap()
          A map of events from the last back-off level of the modifier nonterminal–generation submodel to the set of possible futures (typically, a future is a modifier label and its head word's part-of-speech tag).
 ProbabilityStructure modNonterminalProbStructure()
          The probability structure for the submodel that generates modifiers of head constituents.
 CountsTable nonterminals()
          A counts table of unlexicalized nonterminals, i.e., a map of unlexicalized nonterminals to their respective frequencies in the training data.
 Map posMap()
          Returns the map of vocabulary items to possible parts of speech, contained in the internal ModelCollection object.
 double probHead(int id, TrainerEvent event)
          Returns the probability of generating a head child in the context of a particular parent (both the head to be generated and the parent are contained in the specified TrainerEvent object).
 double probLeftSubcat(int id, TrainerEvent event)
          Returns the probability of generating a left subcat in the context of a particular parent and head (the subcat to be generated, the head and parent are all contained in the specified TrainerEvent object).
 double probMod(int id, TrainerEvent event)
          Returns the probability of generating a fully-lexicalized modifying nonterminal given a particular parent, head and other components of the syntactic context.
 double probRightSubcat(int id, TrainerEvent event)
          Returns the probability of generating a right subcat in the context of a particular parent and head (the subcat to be generated, the head and parent are all contained in the specified TrainerEvent object).
 double probTop(int id, TrainerEvent event)
          Returns the probability of generating the head nonterminal of an entire sentence.
 Set prunedPreterms()
          A set of Sexp objects representing preterminals that were pruned during training.
 Set prunedPunctuation()
          Returns the set of preterminals (Sexp objects) that were punctuation elements that were “raised away” because they were either at the beginning or end of a sentence.
protected  void putInCache(TrainerEvent key, double value)
          Inserts the specified TrainerEvent and its associated probability into this object's probability cache.
 Map rightSubcatMap()
          A mapping from right subcat-prediction conditioning contexts (typically parent and head nonterminal labels) to all possible right subcat frames.
 ProbabilityStructure rightSubcatProbStructure()
          The probability structure for the submodel that generates subcats on the right-hand side of head constituents.
 Map simpleModNonterminalMap()
          A map from unlexicalized parent-head-side triples to all possible partially-lexicalized modifying nonterminals.
 double testProb()
          Returns a test probability (for debugging purposes).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stub

protected DecoderServerRemote stub
The stub through which all method invocations on this object will flow. Methods that return probabilities use a cache, whereas all other methods flow through to this stub directly.


cache

protected ProbabilityCache cache
The cache used for storing probabilities.

See Also:
Settings.decoderLocalCacheSize, Settings.decoderUseLocalProbabilityCache

numAccesses

protected int numAccesses
The number of cache accesses over the lifetime of this object.


numHits

protected int numHits
The number of cache hits over the lifetime of this object.

Constructor Detail

CachingDecoderServer

public CachingDecoderServer(DecoderServerRemote stub)
Constructs a new instance around the specified stub.

Parameters:
stub - the stub to use for flow-through calls
Method Detail

putInCache

protected void putInCache(TrainerEvent key,
                          double value)
Inserts the specified TrainerEvent and its associated probability into this object's probability cache.

Parameters:
key - the event whose probability is to be cached
value - the probability to be cached

id

public int id()
       throws RemoteException
The unique identifier of this DecoderServerRemote instance.

Specified by:
id in interface Server
Specified by:
id in interface SwitchboardUser
Returns:
the id of this DecoderServerRemote instance.
Throws:
RemoteException

acceptClientsOnlyByRequest

public boolean acceptClientsOnlyByRequest()
                                   throws RemoteException
Description copied from interface: Server
Returns whether this server is only willing to accept clients that request it. This is the method by which a client can "arrange" to be hooked up to a specific server, such as when it is desirable to have a single server per client.

Note that a server may change the return value of this method over time; this method is guaranteed to be called and its value cached every time a client is assigned to this server.

Specified by:
acceptClientsOnlyByRequest in interface Server
Throws:
RemoteException
See Also:
SwitchboardRemote.register(Server), SwitchboardRemote.getServer(int,int)

maxClients

public int maxClients()
               throws RemoteException
Description copied from interface: Server
The maximum number of clients this server is willing to accept, or Server.acceptUnlimitedClients if this server is willing to accept a virtually unlimited number of clients (a large maximum value may be used by the switchboard). It is an error for this method to return any number other than a non-zero positive integer or the special value.

Note that a server may change the return value of this method over time; this method is guaranteed to be called and its value cached every time a client is assigned to this server.

Specified by:
maxClients in interface Server
Throws:
RemoteException
See Also:
SwitchboardRemote.register(Server)

alive

public boolean alive()
              throws RemoteException
Description copied from interface: SwitchboardUser
A simple "ping" method for the switchboard to continually make sure its users are alive. Implementations are required to allow one last call returning false after invocation of die(false) to indicate to switchboard that user is dying safely. However, implementations should also not wait indefinitely for this last call, instead using an appropriate maximum timeout value (such as the timeout of the transport layer, if available) before unexporting themselves.

Specified by:
alive in interface SwitchboardUser
Throws:
RemoteException
See Also:
AbstractSwitchboardUser

die

public void die(boolean now)
         throws RemoteException
Description copied from interface: SwitchboardUser
Tells the switchboard user to commit suicide. This method will typically be invoked by the switchboard when sentence processing is complete, but may also be invoked by a switchboard user itself to commit suicide. Typically, if a switchboard user wishes to commit suicide gracefully, it should invoke this method on itself with a now value of false, to allow the switchboard a final successful call to alive, which will return false. The switchboard will typically invoke this method on its users with a now value of true.

Important synchronization note: This method should be non-blocking. That is, it shouldn't wait for some switchboard resource or information to become available before returning. If this condition is not met, then deadlock could occur.

Specified by:
die in interface SwitchboardUser
Parameters:
now - if false, indicates that this switchboard user should wait gracefully for a final invocation by the switchboard of its SwitchboardUser.alive() method, so that it can return false; otherwise, this method should cause the switchboard user to die as soon as possible
Throws:
RemoteException

host

public String host()
            throws RemoteException
Description copied from interface: SwitchboardUser
Returns the hostname on which this switchboard user is running.

Specified by:
host in interface SwitchboardUser
Throws:
RemoteException

posMap

public Map posMap()
           throws RemoteException
Description copied from interface: DecoderServerRemote
Returns the map of vocabulary items to possible parts of speech, contained in the internal ModelCollection object. This map is needed when decoding.

Specified by:
posMap in interface DecoderServerRemote
Throws:
RemoteException

headToParentMap

public Map headToParentMap()
                    throws RemoteException
Description copied from interface: DecoderServerRemote
A mapping from head labels to possible parent labels. The keys of this map are Symbol obects, and the values are Set objects containing Symbol objects.

Specified by:
headToParentMap in interface DecoderServerRemote
Returns:
a mapping from head labels to possible parent labels
Throws:
RemoteException

leftSubcatMap

public Map leftSubcatMap()
                  throws RemoteException
Description copied from interface: DecoderServerRemote
A mapping from left subcat-prediction conditioning contexts (typically parent and head nonterminal labels) to all possible left subcat frames. The keys should represent the conditioning contexts that are the last back-off level of the subcat-prediction models. The keys of this map are Event objects, and the values are Set objects containing Subcat objects.

Specified by:
leftSubcatMap in interface DecoderServerRemote
Throws:
RemoteException

rightSubcatMap

public Map rightSubcatMap()
                   throws RemoteException
Description copied from interface: DecoderServerRemote
A mapping from right subcat-prediction conditioning contexts (typically parent and head nonterminal labels) to all possible right subcat frames. The keys should represent the conditioning contexts that are the last back-off level of the subcat-prediction models. The keys of this map are Event objects, and the values are Set objects containing Subcat objects.

Specified by:
rightSubcatMap in interface DecoderServerRemote
Throws:
RemoteException

modNonterminalMap

public Map modNonterminalMap()
                      throws RemoteException
Description copied from interface: DecoderServerRemote
A map of events from the last back-off level of the modifier nonterminal–generation submodel to the set of possible futures (typically, a future is a modifier label and its head word's part-of-speech tag). The keys are instances of Event, and the values are Set instances containing Event objects.

Specified by:
modNonterminalMap in interface DecoderServerRemote
Throws:
RemoteException

simpleModNonterminalMap

public Map simpleModNonterminalMap()
                            throws RemoteException
Description copied from interface: DecoderServerRemote
A map from unlexicalized parent-head-side triples to all possible partially-lexicalized modifying nonterminals. This map provides a simpler mechanism for determining whether a given modifier is possible in the current parent-head context than is provided by DecoderServerRemote.modNonterminalMap().

The keys are SexpList objects containing exactly three Symbol elements representing the following in a production:

  1. an unlexicalized parent nonterminal
  2. an unlexicalized head nonterminal
  3. the direction of modification, either Constants.LEFT or Constants.RIGHT.

The values consist of Set objects containing SexpList objects that contain exactly two Symbol elements representing a partially-lexicalized modifying nonterminal:

  1. the unlexicalized modifying nonterminal
  2. the part-of-speech tag of the modifying nonterminal's head word.

An example of a partially-lexicalized nonterminal in the Penn Treebank is NP(NNP), which is a noun phrase headed by a singular proper noun.

Specified by:
simpleModNonterminalMap in interface DecoderServerRemote
Throws:
RemoteException
See Also:
Settings.useSimpleModNonterminalMap

nonterminals

public CountsTable nonterminals()
                         throws RemoteException
Description copied from interface: DecoderServerRemote
A counts table of unlexicalized nonterminals, i.e., a map of unlexicalized nonterminals to their respective frequencies in the training data.

Specified by:
nonterminals in interface DecoderServerRemote
Returns:
a counts table of unlexicalized nonterminals
Throws:
RemoteException

prunedPreterms

public Set prunedPreterms()
                   throws RemoteException
Description copied from interface: DecoderServerRemote
A set of Sexp objects representing preterminals that were pruned during training.

Specified by:
prunedPreterms in interface DecoderServerRemote
Returns:
a set of Sexp objects representing preterminals that were pruned during training.
Throws:
RemoteException
See Also:
Training.prune(Sexp), Treebank.isPreterminal(Sexp)

prunedPunctuation

public Set prunedPunctuation()
                      throws RemoteException
Description copied from interface: DecoderServerRemote
Returns the set of preterminals (Sexp objects) that were punctuation elements that were “raised away” because they were either at the beginning or end of a sentence.

Specified by:
prunedPunctuation in interface DecoderServerRemote
Throws:
RemoteException
See Also:
Training.raisePunctuation(Sexp), Treebank.isPuncToRaise(Sexp)

convertUnknownWord

public Sexp convertUnknownWord(Symbol originalWord,
                               int index)
                        throws RemoteException
Returns either the specified word untouched, or a 3-element list as would be created by convertUnknownWords(SexpList).

Specified by:
convertUnknownWord in interface DecoderServerRemote
Parameters:
originalWord - the original word to be (potentially) converted
index - the index of the specified word
Returns:
if the specified word is unknown, a 3-element list is returned, as described in convertUnknownWords(SexpList), or, if the specified word is not unknown, then it is returned untouched
Throws:
RemoteException

convertUnknownWords

public SexpList convertUnknownWords(SexpList sentence)
                             throws RemoteException
Replaces all unknown words in the specified sentence with three-element lists, where the first element is the word itself, the second element is a word-feature vector, as determined by the implementation of WordFeatures.features(Symbol,boolean), and the third element is Constants.trueSym if this word was never observed during training or Constants.falseSym if it was observed at least once during training.

Specified by:
convertUnknownWords in interface DecoderServerRemote
Parameters:
sentence - a list of symbols representing a sentence to be parsed
Throws:
RemoteException

leftSubcatProbStructure

public ProbabilityStructure leftSubcatProbStructure()
                                             throws RemoteException
Description copied from interface: DecoderServerRemote
The probability structure for the submodel that generates subcats on the left-hand side of head constituents. This structure is needed to derive most-general contexts (using the last level of back-off) in order to determine all possible left-side subcat frames for a given context, using the DecoderServerRemote.leftSubcatMap().

Specified by:
leftSubcatProbStructure in interface DecoderServerRemote
Throws:
RemoteException

rightSubcatProbStructure

public ProbabilityStructure rightSubcatProbStructure()
                                              throws RemoteException
Description copied from interface: DecoderServerRemote
The probability structure for the submodel that generates subcats on the right-hand side of head constituents. This structure is needed to derive most-general contexts (using the last level of back-off) in order to determine all possible left-side subcat frames for a given context, using the DecoderServerRemote.rightSubcatMap().

Specified by:
rightSubcatProbStructure in interface DecoderServerRemote
Throws:
RemoteException

modNonterminalProbStructure

public ProbabilityStructure modNonterminalProbStructure()
                                                 throws RemoteException
Description copied from interface: DecoderServerRemote
The probability structure for the submodel that generates modifiers of head constituents. This structure is needed to derive most-general contexts (using the last level of back-off) in order to determine all possible modifiers for a given context, using the DecoderServerRemote.modNonterminalMap().

Specified by:
modNonterminalProbStructure in interface DecoderServerRemote
Throws:
RemoteException

testProb

public double testProb()
                throws RemoteException
Returns a test probability (for debugging purposes).

Specified by:
testProb in interface DecoderServerRemote
Throws:
RemoteException

logPrior

public double logPrior(int id,
                       TrainerEvent event)
                throws RemoteException
Returns the prior probability of generating the nonterminal contained in the specified HeadEvent.

Specified by:
logPrior in interface DecoderServerRemote
Throws:
RemoteException

logProbHeadWithSubcats

public double logProbHeadWithSubcats(int id,
                                     TrainerEvent event)
                              throws RemoteException
Returns the log of the probability of generating a new head and its left and right subcat frames.

Specified by:
logProbHeadWithSubcats in interface DecoderServerRemote
Parameters:
id - the unique id of the client invoking the method
event - the top-level TrainerEvent, containing the complete context needed to compute the requested probability
Returns:
the log of the probability of generating a new head and its left and right subcat frames
Throws:
RemoteException

logProbHead

public double logProbHead(int id,
                          TrainerEvent event)
                   throws RemoteException
Description copied from interface: DecoderServerRemote
Returns the log of the probability of generating a head child in the context of a particular parent (both the head to be generated and the parent are contained in the specified TrainerEvent object).

Specified by:
logProbHead in interface DecoderServerRemote
Parameters:
id - the unique id of the client invoking the method
event - the top-level TrainerEvent, containing the complete context needed to compute the requested probability
Returns:
the log of the probability of generating the new head
Throws:
RemoteException

logProbLeftSubcat

public double logProbLeftSubcat(int id,
                                TrainerEvent event)
                         throws RemoteException
Description copied from interface: DecoderServerRemote
Returns the log of the probability of generating a left subcat in the context of a particular parent and head (the subcat to be generated, the head and parent are all contained in the specified TrainerEvent object).

Specified by:
logProbLeftSubcat in interface DecoderServerRemote
Parameters:
id - the unique id of the client invoking the method
event - the top-level TrainerEvent, containing the complete context needed to compute the requested probability
Returns:
the log of the probability of generating the left subcat
Throws:
RemoteException

logProbRightSubcat

public double logProbRightSubcat(int id,
                                 TrainerEvent event)
                          throws RemoteException
Description copied from interface: DecoderServerRemote
Returns the log of the probability of generating a right subcat in the context of a particular parent and head (the subcat to be generated, the head and parent are all contained in the specified TrainerEvent object).

Specified by:
logProbRightSubcat in interface DecoderServerRemote
Parameters:
id - the unique id of the client invoking the method
event - the top-level TrainerEvent, containing the complete context needed to compute the requested probability
Returns:
the log of the probability of generating the right subcat
Throws:
RemoteException

logProbSubcat

public double logProbSubcat(int id,
                            TrainerEvent event,
                            boolean side)
                     throws RemoteException
Description copied from interface: DecoderServerRemote
Invokes DecoderServerRemote.logProbLeftSubcat(int, TrainerEvent) or DecoderServerRemote.logProbRightSubcat(int, TrainerEvent) depending on the value of side.

Specified by:
logProbSubcat in interface DecoderServerRemote
Parameters:
id - the unique id of the client invoking the method
event - the top-level TrainerEvent, containing the complete context needed to compute the requested probability
side - either Constants.LEFT or Constants.RIGHT
Returns:
the value of DecoderServerRemote.logProbLeftSubcat(int, TrainerEvent) or DecoderServerRemote.logProbRightSubcat(int, TrainerEvent)
Throws:
RemoteException

logProbTop

public double logProbTop(int id,
                         TrainerEvent event)
                  throws RemoteException
Returns the log of the probability of generating the head nonterminal of an entire sentence.

Specified by:
logProbTop in interface DecoderServerRemote
Parameters:
id - the unique id of the client invoking the method
event - the top-level TrainerEvent, containing the complete context needed to compute the requested probability
Returns:
the log of the probability of generating the head nonterminal of an entire sentence
Throws:
RemoteException

logProbMod

public double logProbMod(int id,
                         TrainerEvent event)
                  throws RemoteException
Description copied from interface: DecoderServerRemote
Returns the log of the probability of generating a fully-lexicalized modifying nonterminal given a particular parent, head and other components of the syntactic context.

Specified by:
logProbMod in interface DecoderServerRemote
Parameters:
id - the unique id of the client invoking the method
event - the top-level TrainerEvent, containing the complete context needed to compute the requested probability
Returns:
the log of the probability of generating the lexicalized modifying nonterminal
Throws:
RemoteException

logProbModNT

public double logProbModNT(int id,
                           TrainerEvent event)
                    throws RemoteException
Description copied from interface: DecoderServerRemote
Returns the log of the probability of generating a partially-lexicalized modifying nonterminal given a particular parent, head and other components of the syntactic context.

Specified by:
logProbModNT in interface DecoderServerRemote
Parameters:
id - the unique id of the client invoking the method
event - the top-level TrainerEvent, containing the complete context needed to compute the requested probability
Returns:
the log of the probability of generating a partially-lexicalized modifying nonterminal
Throws:
RemoteException

logProbGap

public double logProbGap(int id,
                         TrainerEvent event)
                  throws RemoteException
Returns the log of the probability of generating a gap.

Specified by:
logProbGap in interface DecoderServerRemote
Parameters:
id - the unique id of the client invoking the method
event - the top-level TrainerEvent, containing the complete context needed to compute the requested probability
Returns:
the log of the probability of generating a gap
Throws:
RemoteException

probHead

public double probHead(int id,
                       TrainerEvent event)
                throws RemoteException
Description copied from interface: DecoderServerRemote
Returns the probability of generating a head child in the context of a particular parent (both the head to be generated and the parent are contained in the specified TrainerEvent object).

N.B.: This method is unsupported when Settings.precomputeProbs is true.

Specified by:
probHead in interface DecoderServerRemote
Parameters:
id - the unique id of the client invoking the method
event - the top-level TrainerEvent, containing the complete context needed to compute the requested probability
Returns:
the probability of generating the new head
Throws:
RemoteException

probMod

public double probMod(int id,
                      TrainerEvent event)
               throws RemoteException
Description copied from interface: DecoderServerRemote
Returns the probability of generating a fully-lexicalized modifying nonterminal given a particular parent, head and other components of the syntactic context.

N.B.: This method is unsupported when Settings.precomputeProbs is true.

Specified by:
probMod in interface DecoderServerRemote
Parameters:
id - the unique id of the client invoking the method
event - the top-level TrainerEvent, containing the complete context needed to compute the requested probability
Returns:
the probability of generating the lexicalized modifying nonterminal
Throws:
RemoteException

probLeftSubcat

public double probLeftSubcat(int id,
                             TrainerEvent event)
                      throws RemoteException
Description copied from interface: DecoderServerRemote
Returns the probability of generating a left subcat in the context of a particular parent and head (the subcat to be generated, the head and parent are all contained in the specified TrainerEvent object).

N.B.: This method is unsupported when Settings.precomputeProbs is true.

Specified by:
probLeftSubcat in interface DecoderServerRemote
Parameters:
id - the unique id of the client invoking the method
event - the top-level TrainerEvent, containing the complete context needed to compute the requested probability
Returns:
the probability of generating the left subcat
Throws:
RemoteException

probRightSubcat

public double probRightSubcat(int id,
                              TrainerEvent event)
                       throws RemoteException
Description copied from interface: DecoderServerRemote
Returns the probability of generating a right subcat in the context of a particular parent and head (the subcat to be generated, the head and parent are all contained in the specified TrainerEvent object).

N.B.: This method is unsupported when Settings.precomputeProbs is true.

Specified by:
probRightSubcat in interface DecoderServerRemote
Parameters:
id - the unique id of the client invoking the method
event - the top-level TrainerEvent, containing the complete context needed to compute the requested probability
Returns:
the probability of generating the right subcat
Throws:
RemoteException

probTop

public double probTop(int id,
                      TrainerEvent event)
               throws RemoteException
Description copied from interface: DecoderServerRemote
Returns the probability of generating the head nonterminal of an entire sentence.

N.B.: This method is unsupported when Settings.precomputeProbs is true.

Specified by:
probTop in interface DecoderServerRemote
Parameters:
id - the unique id of the client invoking the method
event - the top-level TrainerEvent, containing the complete context needed to compute the requested probability
Returns:
the probability of generating the head nonterminal of an entire sentence
Throws:
RemoteException

Parsing Engine

Author: Dan Bikel.