{"id":29215386,"url":"https://github.com/mbejda/node-opennlp","last_synced_at":"2025-09-11T07:40:57.156Z","repository":{"id":27077023,"uuid":"30543580","full_name":"mbejda/Node-OpenNLP","owner":"mbejda","description":"Apache OpenNLP wrapper for Nodejs","archived":false,"fork":false,"pushed_at":"2019-04-12T13:40:01.000Z","size":20683,"stargazers_count":56,"open_issues_count":6,"forks_count":17,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-09-09T02:47:45.632Z","etag":null,"topics":["javascript","nlp","nlp-library","node-opennlp","opennlp","punctuation","sentence"],"latest_commit_sha":null,"homepage":"https://opennlp.apache.org/","language":"JavaScript","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/mbejda.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}},"created_at":"2015-02-09T15:50:20.000Z","updated_at":"2024-04-18T02:03:02.000Z","dependencies_parsed_at":"2022-09-18T20:51:34.125Z","dependency_job_id":null,"html_url":"https://github.com/mbejda/Node-OpenNLP","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mbejda/Node-OpenNLP","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbejda%2FNode-OpenNLP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbejda%2FNode-OpenNLP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbejda%2FNode-OpenNLP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbejda%2FNode-OpenNLP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbejda","download_url":"https://codeload.github.com/mbejda/Node-OpenNLP/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbejda%2FNode-OpenNLP/sbom","scorecard":{"id":630863,"data":{"date":"2025-08-11","repo":{"name":"github.com/mbejda/Node-OpenNLP","commit":"fe47c154b67c8e6b6ad2c4054862215d4a57a9f2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":1,"reason":"Found 3/20 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":8,"reason":"binaries present in source code","details":["Warn: binary detected: lib/opennlp-tools-1.6.0.jar:1","Warn: binary detected: lib/opennlp-uima-1.6.0.jar:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T07:52:39.697Z","repository_id":27077023,"created_at":"2025-08-21T07:52:39.697Z","updated_at":"2025-08-21T07:52:39.697Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274596053,"owners_count":25314021,"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","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["javascript","nlp","nlp-library","node-opennlp","opennlp","punctuation","sentence"],"created_at":"2025-07-03T00:09:37.481Z","updated_at":"2025-09-11T07:40:57.072Z","avatar_url":"https://github.com/mbejda.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nNodeJs OpenNLP\n===============\n[![NPM](https://travis-ci.org/mbejda/Node-OpenNLP.svg?branch=master)](https://nodei.co/npm/opennlp/)\n\n# Node OpenNLP - (OpenNLP 1.6.0)\n## OpenNLP Wrapper For Node.js\nNode-OpenNLP is depended on `Node-Java`. Please take make sure your environment is properly configured to run `Node-Java`.  Click [here](https://github.com/joeferner/node-java) to learn more about `Node-Java`.\n\n### Installation\n```\n npm install opennlp --save\n```\nNode-OpenNLP comes with **Apache OpenNLP 1.6.0** along with the following trained 1.5 series models:\n\n * en-chunker.bin\n * en-ner-person.bin\n * en-pos-maxent.bin\n * en-sent.bin\n * en-token.bin\n\nMore trained models can be found here:\nhttp://opennlp.sourceforge.net/models-1.5\n\n### Sentence Detector\nThe OpenNLP Sentence Detector can detect that a punctuation character marks the end of a sentence or not. In this sense a sentence is defined as the longest white space trimmed character sequence between two punctuation marks.\n\n```Javascript\nvar openNLP = require(\"opennlp\");\nvar sentence = 'Pierre Vinken , 61 years old , will join the board as a nonexecutive director Nov. 29 .';\nvar sentenceDetector = new openNLP().sentenceDetector;\nsentenceDetector.sentDetect(sentence, function(err, results) {\n  /// To get probabilities\n    sentenceDetector.probs(function(error,probability){\n      console.log(error,probability)\n    })\n\tconsole.log(results)\n});\n```\n\n### Configurations \nThe following default configurations can be overrided during initialization. \n```Javascript\nvar openNLP = require(\"opennlp\");\nvar opennlp = new openNLP({\n    models : {\n        doccat:__dirname + '/models/en-doccat.bin',\n        posTagger: __dirname + '/models/en-pos-maxent.bin',\n        tokenizer: __dirname + '/models/en-token.bin',\n        nameFinder: __dirname + '/models/en-ner-person.bin',\n        sentenceDetector: __dirname + '/models/en-sent.bin',\n        chunker: __dirname + '/models/en-chunker.bin'\n    },\n    openNLP = {\n        jar: __dirname + \"/lib/opennlp-tools-1.6.0.jar\"\n    }\n});\n\n```\n\n### Tokenizer\nThe OpenNLP Tokenizers segment an input character sequence into tokens. Tokens are usually words, punctuation, numbers, etc.\n\n```Javascript\nvar openNLP = require(\"opennlp\");\nvar sentence = 'Pierre Vinken , 61 years old , will join the board as a nonexecutive director Nov. 29 .';\nvar tokenizer = new openNLP().tokenizer;\ntokenizer.tokenize(sentence, function(err, results) {\n    console.log(err,results);\n    tokenizer.getTokenProbabilities(function(error, response) {\n            console.log(error,response);\n    });\n});\n```\n\n### Name Finder\nThe Name Finder can detect named entities and numbers in text. To be able to detect entities the Name Finder needs a model. The model is dependent on the language and entity type it was trained for.\n\n```Javascript\nvar openNLP = require(\"opennlp\");\nvar sentence = 'Pierre Vinken , 61 years old , will join the board as a nonexecutive director Nov. 29 .';\nvar nameFinder = new openNLP().nameFinder;\nnameFinder.find(sentence, function(err, tokens_arr) {\n    console.log(err, tokens_arr)\n    nameFinder.probs(function(error, response) {\n        console.log(error, response)\n    });\n});\n```\n\n\n### Document Categorizer\nThe OpenNLP Document Categorizer can classify text into pre-defined categories. It is based on maximum entropy framework.\n\n\n** To use the document categorizer you need to train a model first. The default trained model that is included is for testing purposes only. **\n```Javascript\nvar openNLP = require(\"opennlp\");\nvar doccat = new openNLP().doccat;\ndoccat.categorize(\"I enjoyed watching Rocky\", function(err, list) {\n    doccat.getAllResults(list, function(err, category) {\n    });\n    doccat.getBestCategory(list, function(err, category) {\n    });\n});\ndoccat.scoreMap(\"I enjoyed watching Rocky\", function(err, category) {\n});\ndoccat.sortedScoreMap(\"I enjoyed watching Rocky\", function(err, category) {\n});\ndoccat.getCategory(1, function(err, category) {\n});\ndoccat.getIndex('Happy', function(err, index) {\n});\n```\n\n### Part-of-Speech Tagger\nThe Part of Speech Tagger marks tokens with their corresponding word type based on the token itself and the context of the token. A token might have multiple pos tags depending on the token and the context. The OpenNLP POS Tagger uses a probability model to predict the correct pos tag out of the tag set.\n\n``` Javascript\nvar openNLP = require(\"opennlp\");\nvar posTagger = new openNLP().posTagger;\nvar sentence = 'Pierre Vinken , 61 years old , will join the board as a nonexecutive director Nov. 29 .';\nposTagger.tag(sentence, function(err, tokens_arr) {\n    console.log(err, tokens_arr)\n});\nposTagger.topKSequences(sentence, function(error, tagger) {\n    console.log(tagger.getScore())\n    console.log(tagger.getProbs())\n    console.log(tagger.getOutcomes())\n});\n```\n### Chunker\nText chunking consists of dividing a text in syntactically correlated parts of words, like noun groups, verb groups, but does not specify their internal structure, nor their role in the main sentence.\n\n```Javascript\nvar openNLP = require(\"opennlp\");\nvar posTagger = new openNLP().posTagger;\nvar sentence = 'Pierre Vinken , 61 years old , will join the board as a nonexecutive director Nov. 29 .';\nvar chunker = new openNLP().chunker;\nposTagger.tag(sentence, function(err, tokens_arr) {\n    chunker.topKSequences(sentence, tokens_arr, function(err, tokens_arr) {\n      console.log(err, tokens_arr)\n    });\n    chunker.chunk(sentence, tokens_arr, function(err, tokens_arr) {\n        chunker.probs(function(error, prob) {\n\n        });\n    });\n});\n```\n\u003chr\u003e\nPlease report any bugs. Feel free to send me a tweet if you need any help.\n\u003chr\u003e\nFollow me on Twitter\n[@notmilobejda](https://twitter.com/notmilobejda)\u003cbr\u003e\nMy Blog\n[mbejda.com](https://mbejda.com)\u003cbr\u003e\n\n[![Support via Gratipay](https://cdn.rawgit.com/gratipay/gratipay-badge/2.3.0/dist/gratipay.svg)](https://gratipay.com/mbejda/)\n[![NPM](https://nodei.co/npm/opennlp.png)](https://nodei.co/npm/opennlp/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbejda%2Fnode-opennlp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbejda%2Fnode-opennlp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbejda%2Fnode-opennlp/lists"}