A nodejs binding for crfsuite
This is a link to the CRFSuite library written by Naoaki Okazaki. CRF or Conditional Random Fields are a class of statistical modeling method often applied in pattern recognition and machine learning and used for structured prediction.
For most "standard" use cases (on Mac, Linux, or Windows on a x86 or x64 processor),
node-crfsuite will install easy with:
npm install crfsuite
const crfsuite =const tagger =let is_opened = taggerconsolelet tags = taggerconsole
const path =const crfsuite =const trainer =debug: truelet model_filename = pathlet xseq = 'walk' 'walk' 'shop' 'clean' 'shop'let yseq = 'sunny' 'sunny' 'rainy'// submit training data to the trainertrainertrainer// output: ./model.crfsuite
Installation Special Cases
We use node-pre-gyp to compile and publish binaries of the library for most common use cases (Linux, Mac, Windows on standard processor platforms). If you have a special case,
node-crfsuite will work, but it will compile the binary during the install. Compiling with nodejs is done via node-gyp which requires Python 2.x, so please ensure you have it installed and in your path for all operating systems. Python 3.x will not work.
Build from source
# clone the projectgit clone --recursive https://github.com/vunb/node-crfsuite.git# go to working foldercd node-crfsuite# install dependencies and build the binarynpm install
# rebuildnpm run build# run unit-testnpm test
2019-07-18: Release version 1.0.0
- Convert all sources to use N-API, remove
- Add typescript declaration file
- Cleanup package dependencies
- CI Tool run & test only in node version 10 LTS
- Add project convention:
- Enforced to use
newkeyword to create new Tagger and Trainer
2019-06-09: uses N-API
email@example.com the library uses
N-API to use the binary in multiple version of Node.
- Acording to Node.js Foundation: With N-API, native module developers can compile their module once per platform and architecture, and make it available for any version of Node.js that implements N-API. This holds true even for versions of Node.js that are built with a different VM, e.g. Node-ChakraCore.
Pull requests and stars are highly welcome.
For bugs and feature requests, please create an issue.