web-crfsuite
v0.0.5
Published
A port of [crfsuite](https://github.com/chokkan/crfsuite) for Node, Browser & Deno
Downloads
2
Readme
web-crfsuite
A port of crfsuite for Node, Browser & Deno
Usage
import CRFSuite from "web-crfsuite";
// training example
const trainer = new CRFSuite.Trainer();
const xseq = [['walk'], ['walk', 'shop'], ['clean', 'shop']];
const yseq = ['sunny', 'sunny', 'rainy'];
trainer.append(xseq, yseq);
// virtual file system
trainer.train("/model.crfsuite");
const buffer = FS.readFile("/model.crfsuite");
// tagging example
const tagger = new CRFSuite.Tagger();
// writing to the virtual file system
FS.writeFile("/model.crfsuite", buffer);
const result = tagger.tag(xseq);
// => [ 'sunny', 'sunny', 'rainy' ]
Building
Make sure you've Emscripten sdk install on your environment.
- Clone the project
git clone --recursive https://[email protected]:seanghay/web-crfsuite.git
- Compile & Build
npm install
npm run build
It will create a folder called build
in the current directory with the output files.
References
Without these awesome projects from the community, this wouldn't be possible.
- vunb/node-crfsuite A nodejs binding for crfsuite
- chokkan/crfsuite a fast implementation of Conditional Random Fields (CRFs)
- chokkan/liblbfgs a library of Limited-memory Broyden-Fletcher-Goldfarb-Shanno (L-BFGS)
- manuels/hpdf.js/compile.sh
- Porting-Examples-and-Demos
- https://web.dev/emscripten-embedding-js-snippets/
- pinqy520/yoga-layout-wasm/blob/master/Makefile
- shuding/yoga-wasm-web