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

List of all members.

Public Member Functions

 JoshuaDecoder (String configFile)
void changeBaselineFeatureWeights (double[] weights)
void changeDiscrminativeModelOnly (String discrminativeModelFile)
void changeFeatureWeightVector (double[] weights, String discrminativeModelFile)
void decodeTestSet (String testFile, String nbestFile, String oracleFile) throws IOException
void decodeTestSet (String testFile, String nbestFile)
void decodeSentence (String testSentence, String[] nbests)
void cleanUp ()
void visualizeHyperGraphForSentence (String sentence)
JoshuaDecoder initialize (String configFile)

Static Public Member Functions

static JoshuaDecoder getUninitalizedDecoder ()
static void writeConfigFile (double[] newWeights, String template, String outputFile, String newDiscriminativeModel)
static void main (String[] args) throws IOException

Private Member Functions

 JoshuaDecoder ()
void initializeLanguageModel () throws IOException
void initializeGlueGrammar () throws IOException
void initializeMainTranslationGrammar () throws IOException
void initializeStateComputers (int nGramOrder, int ngramStateID)
void initializeFeatureFunctions ()

Private Attributes

DecoderFactory decoderFactory
List< GrammarFactorygrammarFactories
ArrayList< FeatureFunctionfeatureFunctions
ArrayList< NGramLanguageModellanguageModels
List< StateComputer > stateComputers
Map< String, Integer > ruleStringToIDTable

Static Private Attributes

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

Detailed Description


Constructor & Destructor Documentation

Constructs a new decoder using the specified configuration file.

Parameters:
configFileName of configuration file.

Here is the call graph for this function:

Constructs an uninitialized decoder for use in testing.

This method is private because it should only ever be called by the getUninitalizedDecoder() method to provide an uninitialized decoder for use in testing.

Here is the caller graph for this function:


Member Function Documentation

Here is the call graph for this function:

Here is the caller graph for this function:

void joshua.decoder.JoshuaDecoder.changeDiscrminativeModelOnly ( String  discrminativeModelFile)

Here is the call graph for this function:

void joshua.decoder.JoshuaDecoder.changeFeatureWeightVector ( double[]  weights,
String  discrminativeModelFile 
)

Sets the feature weight values used by the decoder.

This method assumes that the order of the provided weights is the same as their order in the decoder's configuration file.

Parameters:
weightsFeature weight values

Here is the caller graph for this function:

Here is the caller graph for this function:

void joshua.decoder.JoshuaDecoder.decodeSentence ( String  testSentence,
String[]  nbests 
)

Decode a sentence. This must be non-parallel.

void joshua.decoder.JoshuaDecoder.decodeTestSet ( String  testFile,
String  nbestFile,
String  oracleFile 
) throws IOException

Decode a whole test set. This may be parallel.

Parameters:
testFile
nbestFile
oracleFile

Here is the call graph for this function:

Here is the caller graph for this function:

void joshua.decoder.JoshuaDecoder.decodeTestSet ( String  testFile,
String  nbestFile 
)

Here is the call graph for this function:

Gets an uninitialized decoder for use in testing.

This method is called by unit tests or any outside packages (e.g., MERT) relying on the decoder.

Here is the call graph for this function:

Initialize all parts of the JoshuaDecoder.

Parameters:
configFileFile containing configuration options
Returns:
An initialized decoder

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the call graph for this function:

Here is the caller graph for this function:

void joshua.decoder.JoshuaDecoder.initializeGlueGrammar ( ) throws IOException [private]

Here is the caller graph for this function:

void joshua.decoder.JoshuaDecoder.initializeLanguageModel ( ) throws IOException [private]

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the caller graph for this function:

void joshua.decoder.JoshuaDecoder.initializeStateComputers ( int  nGramOrder,
int  ngramStateID 
) [private]

Here is the caller graph for this function:

static void joshua.decoder.JoshuaDecoder.main ( String[]  args) throws IOException [static]

Here is the call graph for this function:

Here is the call graph for this function:

Here is the caller graph for this function:

static void joshua.decoder.JoshuaDecoder.writeConfigFile ( double[]  newWeights,
String  template,
String  outputFile,
String  newDiscriminativeModel 
) [static]

Here is the call graph for this function:


Member Data Documentation

The DecoderFactory is the main thread of decoding

final Logger joshua.decoder.JoshuaDecoder.logger = Logger.getLogger(JoshuaDecoder.class.getName()) [static, private]

Logger for this class.

Map<String, Integer> joshua.decoder.JoshuaDecoder.ruleStringToIDTable [private]
List<StateComputer> joshua.decoder.JoshuaDecoder.stateComputers [private]