{"id":22081594,"url":"https://github.com/vunb/node-crfsuite","last_synced_at":"2025-07-17T00:32:18.391Z","repository":{"id":69291509,"uuid":"108101823","full_name":"vunb/node-crfsuite","owner":"vunb","description":"A nodejs binding for crfsuite","archived":false,"fork":false,"pushed_at":"2024-02-26T07:54:11.000Z","size":525,"stargazers_count":14,"open_issues_count":3,"forks_count":11,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-06T13:04:28.320Z","etag":null,"topics":["crf","crfsuite","data-science","node-crfsuite","vntk"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vunb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-24T08:56:51.000Z","updated_at":"2024-02-26T07:54:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"58824dab-5b49-42fe-b3bf-e8833cccee14","html_url":"https://github.com/vunb/node-crfsuite","commit_stats":{"total_commits":71,"total_committers":2,"mean_commits":35.5,"dds":"0.014084507042253502","last_synced_commit":"291a3eda29092edebea98fea4506baf6ae5a6bbb"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/vunb/node-crfsuite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vunb%2Fnode-crfsuite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vunb%2Fnode-crfsuite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vunb%2Fnode-crfsuite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vunb%2Fnode-crfsuite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vunb","download_url":"https://codeload.github.com/vunb/node-crfsuite/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vunb%2Fnode-crfsuite/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265554787,"owners_count":23787279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crf","crfsuite","data-science","node-crfsuite","vntk"],"created_at":"2024-11-30T23:24:39.779Z","updated_at":"2025-07-17T00:32:18.370Z","avatar_url":"https://github.com/vunb.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-crfsuite\n\nA nodejs binding for crfsuite\n\n[![MIT License](https://img.shields.io/badge/license-MIT_License-green.svg?style=flat-square)](./LICENSE)\n[![npm version](https://img.shields.io/npm/v/crfsuite.svg?style=flat)](https://www.npmjs.com/package/crfsuite)\n[![downloads](https://img.shields.io/npm/dm/crfsuite.svg)](https://www.npmjs.com/package/crfsuite)\n[![Travis](https://travis-ci.org/vunb/node-crfsuite.svg?branch=master)](https://travis-ci.org/vunb/node-crfsuite)\n[![Appveyor](https://ci.appveyor.com/api/projects/status/9gd460vxd6jbel14/branch/master?svg=true)](https://ci.appveyor.com/project/vunb/node-crfsuite/branch/master)\n\n\u003e 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.\n\n# Installation\n\nFor most \"standard\" use cases (on Mac, Linux, or Windows on a x86 or x64 processor), `node-crfsuite` will install easy with:\n\n\u003e npm install crfsuite\n\n# API Usage\n\n## CRFSuite Tagger\n\n```js\nconst crfsuite = require('crfsuite')\nconst tagger = new crfsuite.Tagger()\n\nlet is_opened = tagger.open('./path/to/crf.model')\nconsole.log('File model is opened:', is_opened)\n\nlet tags = tagger.tag(input)\nconsole.log('Tags: ', tags)\n```\n\n## CRFSuite Trainer\n\n```js\nconst path = require('path')\nconst crfsuite = require('crfsuite')\nconst trainer = new crfsuite.Trainer({\n  debug: true\n})\n\nlet model_filename = path.resolve('./model.crfsuite')\n\nlet xseq = [['walk'], ['walk', 'shop'], ['clean', 'shop']]\nlet yseq = ['sunny', 'sunny', 'rainy']\n\n// submit training data to the trainer\ntrainer.append(xseq, yseq)\ntrainer.train(model_filename)\n\n// output: ./model.crfsuite\n```\n\n# Installation Special Cases\n\nWe use [node-pre-gyp](https://github.com/mapbox/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](https://github.com/nodejs/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.\n\n* See [node-gyp installation prerequisites](https://github.com/nodejs/node-gyp#installation).\n\n## Build from source\n\n```bash\n# clone the project\ngit clone --recursive https://github.com/vunb/node-crfsuite.git\n\n# go to working folder\ncd node-crfsuite\n\n# install dependencies and build the binary\nnpm install\n```\n\nFor development:\n\n```bash\n# rebuild\nnpm run build\n\n# run unit-test\nnpm test\n```\n\n# Change Log\n\n### 2020-03-07: Release version 1.0.1\n\n* Add an options parameter to pass to a Trainer with a debug property to avoid writing logs to stdout. ([17](https://github.com/vunb/node-crfsuite/pull/17)) ([mathquis](https://github.com/mathquis))\n* Update typescript declaration file\n\n### 2019-07-18: Release version 1.0.0\n\n* Convert all sources to use N-API, remove `nan`\n* Add typescript declaration file\n* Cleanup package dependencies\n* CI Tool run \u0026 test only in node version 10 LTS\n* Add project convention: `.gitattributes`, `.editorconfig`\n* Enforced to use `new` keyword to create new **Tagger** and **Trainer**\n\n### 2019-06-09: uses N-API\n\nFrom `crfsuite@0.9.6` the library uses `N-API` to use the binary in multiple version of Node.\n\n* [Acording to Node.js Foundation](https://medium.com/the-node-js-collection/4f35b781f00e): 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](https://github.com/nodejs/node-chakracore/).\n\n# Contributing\n\nPull requests and stars are highly welcome.\n\nFor bugs and feature requests, please [create an issue](https://github.com/vunb/node-crfsuite/issues/new).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvunb%2Fnode-crfsuite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvunb%2Fnode-crfsuite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvunb%2Fnode-crfsuite/lists"}