Parsing Engine

danbikel.parser
Class DecoderServer

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteServer
          extended bydanbikel.switchboard.AbstractSwitchboardUser
              extended bydanbikel.switchboard.AbstractServer
                  extended bydanbikel.parser.DecoderServer
All Implemented Interfaces:
DecoderServerRemote, Remote, Serializable, Server, SwitchboardUser

public class DecoderServer
extends AbstractServer
implements DecoderServerRemote

Provides probabilities and other resources needed by decoders.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class danbikel.switchboard.AbstractSwitchboardUser
AbstractSwitchboardUser.Alive, AbstractSwitchboardUser.SBUserRetry
 
Field Summary
protected  boolean downcaseWords
          The boolean value of Settings.downcaseWords.
protected  ModelCollection modelCollection
          The model collection used by this decoder server.
protected  Word stopWord
          The value of Training.stopSym(), cached here for convenience.
protected  Symbol topSym
          The value of Training.topSym(), cached here for convenience.
protected  int unknownWordThreshold
          The integer value of Settings.unknownWordThreshold.
 
Fields inherited from class danbikel.switchboard.AbstractServer
acceptClientsOnlyByRequest, maxClients
 
Fields inherited from class danbikel.switchboard.AbstractSwitchboardUser
aliveSynch, aliveTimeout, className, defaultMaxSwitchboardTries, defaultTimeout, dieSynch, id, infiniteTries, maxSwitchboardTries, registered, switchboard, switchboardName, timeout, timeToDie
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface danbikel.switchboard.Server
acceptUnlimitedClients
 
Constructor Summary
DecoderServer(int timeout)
          Constructs a new server with the specified timeout value for its RMI sockets, to receive RMI calls on an anonymous port.
DecoderServer(int maxClients, boolean acceptClientsOnlyByRequest, int timeout, int port)
          Constructs a new server that will accept no more than the specified number of clients, will optionally accept clients only by request, that will use the specified timeout for its RMI sockets and will accept RMI calls on the specified port.
DecoderServer(int maxClients, boolean acceptClientsOnlyByRequest, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf)
          Constructs a new server that will accept no more than the specified number of clients, will optionally accept clients only by request, will accept RMI calls on the specified port and will use the specified socket factories to create its RMI sockets.
DecoderServer(int timeout, int port)
          Constructs a new server with the specified timeout value for its RMI sockets, to receive RMI calls on the specified port.
DecoderServer(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf)
          Constructs a new server that will accept RMI calls on the specified port, using the specified socket factories to create RMI sockets.
DecoderServer(String mcFilename)
          Constructs a non-exported DecoderServer object.
 
Method Summary
 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.
 String getModelCacheStats()
          A flow-through method for ModelCollection.getModelCacheStats().
protected static int getTimeout()
          Obtains the timeout from Settings.
 Map headToParentMap()
          A mapping from head labels to possible parent labels.
 Map leftSubcatMap()
          Returns a map of Event objects to Set objects, where each Event object is the last level of back-off of the probability structure for left-side subcat generation and the set contains all possible Subcat objects for that most-general context.
 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 for the lexicalized nonteminal encoded in the specified TrainerEvent, which should be an instance of 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 logProbLeftSubcat(int, TrainerEvent) or 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.
static void main(String[] args)
          Starts a decoder server and registers it with 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()
          Returns the nonterminals CountsTable of the internal ModelCollection object.
 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.
 Map rightSubcatMap()
          Returns a map of Event objects to Set objects, where each Event object is the last level of back-off of the probability structure for right-side subcat generation and the set contains all possible Subcat objects for that most-general context.
 ProbabilityStructure rightSubcatProbStructure()
          The probability structure for the submodel that generates subcats on the right-hand side of head constituents.
protected  void setModelCollection(String mcFilename)
          Sets the model collection from the specified filename, which should be the path to a Java object file.
 Map simpleModNonterminalMap()
          A map from unlexicalized parent-head-side triples to all possible partially-lexicalized modifying nonterminals.
 double testProb()
          Returns 1.0.
 
Methods inherited from class danbikel.switchboard.AbstractServer
acceptClientsOnlyByRequest, disableHttp, maxClients, register, reRegister, setPolicyFile, setPolicyFile
 
Methods inherited from class danbikel.switchboard.AbstractSwitchboardUser
alive, cleanup, die, disableHttp, getAliveTimeout, getSwitchboard, getSwitchboard, getSwitchboard, getSwitchboard, getSwitchboard, getSwitchboard, host, id, nonZeroTimeout, setPolicyFile, setPolicyFile, startAliveThread, unexportWhenDead
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface danbikel.switchboard.Server
acceptClientsOnlyByRequest, id, maxClients
 
Methods inherited from interface danbikel.switchboard.SwitchboardUser
alive, die, host
 

Field Detail

modelCollection

protected ModelCollection modelCollection
The model collection used by this decoder server.


topSym

protected Symbol topSym
The value of Training.topSym(), cached here for convenience.


stopWord

protected Word stopWord
The value of Training.stopSym(), cached here for convenience.


unknownWordThreshold

protected int unknownWordThreshold
The integer value of Settings.unknownWordThreshold.


downcaseWords

protected boolean downcaseWords
The boolean value of Settings.downcaseWords.

Constructor Detail

DecoderServer

public DecoderServer(String mcFilename)
              throws ClassNotFoundException,
                     IOException,
                     OptionalDataException
Constructs a non-exported DecoderServer object.


DecoderServer

public DecoderServer(int timeout)
              throws RemoteException
Constructs a new server with the specified timeout value for its RMI sockets, to receive RMI calls on an anonymous port.

Parameters:
timeout - the timeout value, in milliseconds, to be used for the client- and server-side RMI sockets of this object

DecoderServer

public DecoderServer(int timeout,
                     int port)
              throws RemoteException
Constructs a new server with the specified timeout value for its RMI sockets, to receive RMI calls on the specified port.

Parameters:
timeout - the timeout value, in milliseconds, to be used for the client- and server-side RMI sockets of this object
port - the port on which to receive RMI calls

DecoderServer

public DecoderServer(int maxClients,
                     boolean acceptClientsOnlyByRequest,
                     int timeout,
                     int port)
              throws RemoteException
Constructs a new server that will accept no more than the specified number of clients, will optionally accept clients only by request, that will use the specified timeout for its RMI sockets and will accept RMI calls on the specified port.

Parameters:
maxClients - the maximum number of clients this server is willing to accept
acceptClientsOnlyByRequest - if true, then this server will only accept clients that request it specifically
timeout - the timeout value, in milliseconds, to be used for the client- and server-side RMI sockets of this object
port - the port on which to receive RMI calls

DecoderServer

public DecoderServer(int port,
                     RMIClientSocketFactory csf,
                     RMIServerSocketFactory ssf)
              throws RemoteException
Constructs a new server that will accept RMI calls on the specified port, using the specified socket factories to create RMI sockets.

Parameters:
port - the port on which to receive RMI calls
csf - the factory from which to create client-side RMI sockets
ssf - the factory from which to create server-side RMI sockets

DecoderServer

public DecoderServer(int maxClients,
                     boolean acceptClientsOnlyByRequest,
                     int port,
                     RMIClientSocketFactory csf,
                     RMIServerSocketFactory ssf)
              throws RemoteException
Constructs a new server that will accept no more than the specified number of clients, will optionally accept clients only by request, will accept RMI calls on the specified port and will use the specified socket factories to create its RMI sockets.

Parameters:
maxClients - the maximum number of clients this server is willing to accept
acceptClientsOnlyByRequest - if true, then this server will only accept clients that request it specifically
port - the port on which to receive RMI calls
csf - the factory from which to create client-side RMI sockets
ssf - the factory from which to create server-side RMI sockets
Method Detail

setModelCollection

protected void setModelCollection(String mcFilename)
                           throws ClassNotFoundException,
                                  IOException,
                                  OptionalDataException
Sets the model collection from the specified filename, which should be the path to a Java object file.

Throws:
ClassNotFoundException
IOException
OptionalDataException

getModelCacheStats

public String getModelCacheStats()
A flow-through method for ModelCollection.getModelCacheStats().

Returns:
the value of ModelCollection.getModelCacheStats()

convertUnknownWord

public Sexp convertUnknownWord(Symbol originalWord,
                               int index)
                        throws RemoteException
Description copied from interface: DecoderServerRemote
Returns either the specified word untouched, or a 3-element list as would be created by DecoderServerRemote.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 DecoderServerRemote.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

nonterminals

public CountsTable nonterminals()
                         throws RemoteException
Returns the nonterminals CountsTable of the internal ModelCollection object. The set of nonterminals is needed when decoding.

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

posMap

public Map posMap()
           throws RemoteException
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
Returns a map of Event objects to Set objects, where each Event object is the last level of back-off of the probability structure for left-side subcat generation and the set contains all possible Subcat objects for that most-general context.

Specified by:
leftSubcatMap in interface DecoderServerRemote
Throws:
RemoteException

rightSubcatMap

public Map rightSubcatMap()
                   throws RemoteException
Returns a map of Event objects to Set objects, where each Event object is the last level of back-off of the probability structure for right-side subcat generation and the set contains all possible Subcat objects for that most-general context.

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

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)

leftSubcatProbStructure

public ProbabilityStructure leftSubcatProbStructure()
                                             throws RemoteException
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 leftSubcatMap().

Specified by:
leftSubcatProbStructure in interface DecoderServerRemote
Throws:
RemoteException

rightSubcatProbStructure

public ProbabilityStructure rightSubcatProbStructure()
                                              throws RemoteException
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 rightSubcatMap().

Specified by:
rightSubcatProbStructure in interface DecoderServerRemote
Throws:
RemoteException

modNonterminalProbStructure

public ProbabilityStructure modNonterminalProbStructure()
                                                 throws RemoteException
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 modNonterminalMap().

Specified by:
modNonterminalProbStructure in interface DecoderServerRemote
Throws:
RemoteException

testProb

public double testProb()
                throws RemoteException
Returns 1.0.

Specified by:
testProb in interface DecoderServerRemote
Throws:
RemoteException

logPrior

public double logPrior(int id,
                       TrainerEvent event)
Returns the prior probability for the lexicalized nonteminal encoded in the specified TrainerEvent, which should be an instance of HeadEvent. The prior probability is decomposed into two parts:
p(w,t) * p(N | w,t)
where N is a nonterminal label, w is a word and t is a part-of-speech tag.

Specified by:
logPrior in interface DecoderServerRemote

logProbHeadWithSubcats

public double logProbHeadWithSubcats(int id,
                                     TrainerEvent event)
Description copied from interface: DecoderServerRemote
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

logProbHead

public double logProbHead(int id,
                          TrainerEvent event)
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

logProbLeftSubcat

public double logProbLeftSubcat(int id,
                                TrainerEvent event)
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

logProbRightSubcat

public double logProbRightSubcat(int id,
                                 TrainerEvent event)
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

logProbSubcat

public double logProbSubcat(int id,
                            TrainerEvent event,
                            boolean side)
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)

logProbTop

public double logProbTop(int id,
                         TrainerEvent event)
Description copied from interface: DecoderServerRemote
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

logProbMod

public double logProbMod(int id,
                         TrainerEvent event)
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

logProbModNT

public double logProbModNT(int id,
                           TrainerEvent event)
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

logProbGap

public double logProbGap(int id,
                         TrainerEvent event)
Description copied from interface: DecoderServerRemote
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

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

getTimeout

protected static int getTimeout()
Obtains the timeout from Settings.

See Also:
Settings.sbUserTimeout

main

public static void main(String[] args)
Starts a decoder server and registers it with the switchboard. usage: [switchboard binding name]


Parsing Engine

Author: Dan Bikel.