Giter Site home page Giter Site logo

rxn-onmt-utils's Introduction

RXN package for OpenNMT-related utilities

Actions tests

This repository contains OpenNMT-related utilities used in the RXN universe. For general utilities not related to OpenNMT, see our other repository rxn-utilities.

Links:

System Requirements

This package is supported on all operating systems. It has been tested on the following systems:

  • macOS: Big Sur (11.1)
  • Linux: Ubuntu 18.04.4

A Python version of 3.6, 3.7, or 3.8 is recommended. Python versions 3.9 and above are not expected to work due to compatibility with the selected version of OpenNMT.

Installation guide

The package can be installed from Pypi:

pip install rxn-onmt-utils

For local development, the package can be installed with:

pip install -e ".[dev]"

Package highlights

Translate with OpenNMT from Python code

By importing the following,

from rxn.onmt_utils import Translator, translate

you can do OpenNMT translations directly in Python. The translate function acts on input/output files, while the Translator class gives you flexibility for getting translation results on strings directly.

Stripping models

The script rxn-strip-opennmt-model installed the package allows you to strip ~2/3 of the size of model checkpoints by removing the state of the optimizer. You can do this safely if you don't need to continue training on these checkpoints.

Extending the model vocabulary

If you finetune a model on a dataset with additional tokens compared to the base model, you will need to extend the model weights. The script rxn-extend-model-with-vocab does that for you.

rxn-onmt-utils's People

Contributors

avaucher avatar helderlopes97 avatar mirunacrt avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.