Skip to content

lua wrapper for sentencepiece library

License

Notifications You must be signed in to change notification settings

OpenNMT/lua-sentencepiece

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository defines a Lua wrapper for sentencepiece.

Installation

1. Install Lua development libraries (optional if Torch is installed):

On Ubuntu, they can be installed with apt-get:

sudo apt-get install lua5.1 liblua5.1-dev

2. Install sentencepiece

3. Install the wrapper:

luarocks make lua-sentencepiece-scm-1.rockspec

Test and use

$(which luajit lua | head -n 1) test.lua

The module creates a sentencepiece namespace with 2 functions:

  • sentencepiece.encode(model, string): encodes the string (convert into pieces table)
  • sentencepiece.decode(model, table): builds a string from the table of piece

About

lua wrapper for sentencepiece library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published