Public Repository

Last pushed: 3 years ago
Short Description
Realtime Adaptive Translation Systems with cdec (Spanish -> English)
Full Description

This is a hierarchical phrase-based translation system built with cdec trained for Spanish to English translations.

  • cdec: (cdec is a decoder, aligner, and learning framework for statistical machine translation and similar structured prediction models)

It is very easy to integrate it in existing systems (Python)

Translate a sentence:

>>> import rt
>>> translator = rt.RealtimeTranslator('/demo-es-en/demo-es-en.d', tmpdir='/tmp', cache_size=5, norm=False)
>>> translation = translator.translate('<Spanish Sentence>', ctx_name=None)

Add data to models:

>>> translator.learn('Source sentence', 'Target sentence', ctx_name=None)

Save state to a file or standard out (None).

If passed a StringIO object, state lines will be written to the object, resulting in an in-memory representation of state that is useful for operations such as storing state in a database:

>>> translator.save_state(file_or_stringio=None, ctx_name=None)

Drop state, freeing system resources:

>>> translator.drop_ctx(ctx_name=None)

Load state from a file or standard in (None).

If passed a StringIO object, state lines will be read from its getvalue() method. For example, state could be read from a database, written to a StringIO object, and passed to load_state():

>>> translator.load_state(file_or_stringio=None, ctx_name=None)
Docker Pull Command

Comments (0)