Joshua
open source statistical hierarchical phrase-based machine translation system
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
joshua.decoder.DecoderFactory Class Reference
Collaboration diagram for joshua.decoder.DecoderFactory:
[legend]

List of all members.

Public Member Functions

 DecoderFactory (List< GrammarFactory > grammarFactories, boolean useMaxLMCostForOOV, List< FeatureFunction > featureFunctions, List< StateComputer > stateComputers)
void decodeTestSet (String testFile, String nbestFile, String oracleFile)
HyperGraph getHyperGraphForSentence (String sentence)

Private Attributes

List< GrammarFactorygrammarFactories = null
List< FeatureFunctionfeatureFunctions = null
List< StateComputer > stateComputers
boolean useMaxLMCostForOOV = false
Thread[] decoderThreads

Static Private Attributes

static final Logger logger = Logger.getLogger(DecoderFactory.class.getName())

Detailed Description

this class implements: (1) parallel decoding: split the test file, initiate DecoderThread, wait and merge the decoding results (2) non-parallel decoding is a special case of parallel decoding

Author:
Zhifei Li, zhife.nosp@m.i.wo.nosp@m.rk@gm.nosp@m.ail..nosp@m.com
Version:
$LastChangedDate$

Constructor & Destructor Documentation

joshua.decoder.DecoderFactory.DecoderFactory ( List< GrammarFactory grammarFactories,
boolean  useMaxLMCostForOOV,
List< FeatureFunction featureFunctions,
List< StateComputer >  stateComputers 
)

Member Function Documentation

void joshua.decoder.DecoderFactory.decodeTestSet ( String  testFile,
String  nbestFile,
String  oracleFile 
)

This is the public-facing method to decode a set of sentences. This automatically detects whether we should run the decoder in parallel or not.

(Matt Post, August 2011) This needs to be rewritten. The proper way to do it is to put all the sentences in a queue or wrap access to them in a thread-safe class. Then start the decoder threads. Each thread obtains the sentece to decode and deposits it somewhere. Deposits are then accumulated and output sequentially.

Here is the caller graph for this function:

Decode a single sentence and return its hypergraph.

Here is the call graph for this function:


Member Data Documentation

final Logger joshua.decoder.DecoderFactory.logger = Logger.getLogger(DecoderFactory.class.getName()) [static, private]
List<StateComputer> joshua.decoder.DecoderFactory.stateComputers [private]