# web-crfsuite

> A port of [crfsuite](https://github.com/chokkan/crfsuite) for Node, Browser & Deno

Latest version **0.0.5** (published 2023-03-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install web-crfsuite
pnpm add web-crfsuite
yarn add web-crfsuite
bun add web-crfsuite
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2023-03-16 |
| First published | 2023-03-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 0 |
| Unpacked size | 312.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | seanghay |

## Links

- npm: https://www.npmjs.com/package/web-crfsuite
- Repository: https://github.com/seanghay/web-crfsuite
- Homepage: https://github.com/seanghay/web-crfsuite#readme
- Issues: https://github.com/seanghay/web-crfsuite/issues
- npm.io page: https://npm.io/package/web-crfsuite

## Recent versions

- 0.0.5 (latest) — 2023-03-16
- 0.0.4 — 2023-03-16
- 0.0.3 — 2023-03-16
- 0.0.2 — 2023-03-16
- 0.0.1 — 2023-03-16

## README

# web-crfsuite

A port of [crfsuite](https://github.com/chokkan/crfsuite) for Node, Browser & Deno

## Usage

```js
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](https://emscripten.org/) sdk install on your environment.

1. Clone the project

```
git clone --recursive https://git@github.com:seanghay/web-crfsuite.git
```

2. 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](https://github.com/vunb/node-crfsuite) A nodejs binding for crfsuite
- [chokkan/crfsuite](https://github.com/chokkan/crfsuite) a fast implementation of Conditional Random Fields (CRFs)
- [chokkan/liblbfgs](https://github.com/chokkan/liblbfgs) a library of Limited-memory Broyden-Fletcher-Goldfarb-Shanno (L-BFGS)
- [manuels/hpdf.js/compile.sh](https://github.com/manuels/hpdf.js/blob/master/compile.sh)
- [Porting-Examples-and-Demos](https://github.com/emscripten-core/emscripten/wiki/Porting-Examples-and-Demos#utilities)
- [https://web.dev/emscripten-embedding-js-snippets/](https://web.dev/emscripten-embedding-js-snippets/)
- [pinqy520/yoga-layout-wasm/blob/master/Makefile](https://github.com/pinqy520/yoga-layout-wasm/blob/master/Makefile)
- [shuding/yoga-wasm-web](https://github.com/shuding/yoga-wasm-web)

---
_Source: https://npm.io/package/web-crfsuite · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
