|
Joshua
open source statistical hierarchical phrase-based machine translation system
|
Public Member Functions | |
| DecoderThread (List< Grammar > grammars, FeatureVector weights, List< FeatureFunction > featureFunctions, JoshuaConfiguration joshuaConfiguration) throws IOException | |
| void | run () |
| Translation | translate (Sentence sentence) |
Private Member Functions | |
| Grammar | getGrammarFromHyperGraph (String goal, HyperGraph hg) |
Private Attributes | |
| final JoshuaConfiguration | joshuaConfiguration |
| final List< Grammar > | allGrammars |
| final List< FeatureFunction > | featureFunctions |
Static Private Attributes | |
| static final Logger | logger = Logger.getLogger(DecoderThread.class.getName()) |
This class handles decoding of individual Sentence objects (which can represent plain sentences or lattices). A single sentence can be decoded by a call to translate() and, if an InputHandler is used, many sentences can be decoded in a thread-safe manner via a single call to translateAll(), which continually queries the InputHandler for sentences until they have all been consumed and translated.
The DecoderFactory class is responsible for launching the threads.
| joshua.decoder.DecoderThread.DecoderThread | ( | List< Grammar > | grammars, |
| FeatureVector | weights, | ||
| List< FeatureFunction > | featureFunctions, | ||
| JoshuaConfiguration | joshuaConfiguration | ||
| ) | throws IOException |
| Grammar joshua.decoder.DecoderThread.getGrammarFromHyperGraph | ( | String | goal, |
| HyperGraph | hg | ||
| ) | [private] |
| void joshua.decoder.DecoderThread.run | ( | ) |
Translate a sentence.
| sentence | The sentence to be translated. |
Joshua supports (as of September 2014) both phrase-based and hierarchical decoding. Here we build the appropriate chart. The output of both systems is a hypergraph, which is then used for further processing (e.g., k-best extraction).
final List<Grammar> joshua.decoder.DecoderThread.allGrammars [private] |
final List<FeatureFunction> joshua.decoder.DecoderThread.featureFunctions [private] |
final JoshuaConfiguration joshua.decoder.DecoderThread.joshuaConfiguration [private] |
final Logger joshua.decoder.DecoderThread.logger = Logger.getLogger(DecoderThread.class.getName()) [static, private] |