You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Language packs are pre-built translation models with an included instance of the Joshua runtime environment. There are no dependencies, so installing a black-box machine translation system on your computer is as easy as downloading the link, opening up the tarball, and running the included shell script.

The following language packs are available for Joshua. Follow the links to individual language pair pages, where you can download the models.

Using Language Packs

Once you download the model, unpack it. The simplest use-case is then to run Joshua as a standard UNIX tool, accepting a single line of input and writing a single line of output. Assuming your language pack is downloaded to "apache-joshua-language-pack.tgz":

tar xzvf apache-joshua-language-pack.tgz
cat input.txt | ./apache-joshua-language-pack/joshua

Here, "input.txt" is a file containing sentences in your input language, one per line. Joshua expects to be given one sentence at a time; it will not do this for documents by itself.

There is some startup cost associated with the models, however. You may find it more beneficial, therefore, to run it as a server. Joshua can run in two server modes: raw TCP, and HTTP.

# start in server mode, taking direct TCP/IP connections
./apache-joshua-language-pack/joshua -server-port 5674 -server-type tcp
cat input.txt | nc localhost 5674
 
# start in server mode, answering web queries.
# Then open ./apache-joshua-language-pack/html/index.html in your browser
./apache-joshua-language-pack/joshua -server-port 5674 -server-type http

Decoder Options

Joshua supports many command-line options controlling its output. By default, it outputs only a single hypothesis per input line. Here are some options that may be useful to you:

  • "-m XXg" — increase the amount of memory provided to Joshua. The default is 8g, but for the larger language packs, you will want 16 or 24. In general, 50% more memory than the raw model size should be more than sufficient.
  • "-top-n N" — output up to N translation candidates, instead of just one.
  • "-output-format STRING" — change the output format. By default, Joshua outputs just the single, tokenized translation with the highest model probability. 
    Here are some other options:
    • %s: the raw translated string
    • %S: the detokenized translated string
    • %e: the source string
    • %i: the sequence number (0-indexed)
    • %c: the model score
    • %f: the feature string
    These can all be combined in a single string, e.g., -output-format "%i ||| %s ||| %f ||| %c"

Citations

Please cite the following paper if you use Joshua in your research.

  @article{post2015joshua,
Author = {Post, Matt and Cao, Yuan and Kumar, Gaurav},
Journal = {The Prague Bulletin of Mathematical Linguistics},
Title = {Joshua 6: A phrase-based and hierarchical statistical machine translation system},
Year = {2015}
}
  • No labels