{"id":30835853,"url":"https://github.com/rudikershaw/whichx","last_synced_at":"2025-09-06T17:50:02.882Z","repository":{"id":8972474,"uuid":"60023246","full_name":"rudikershaw/whichx","owner":"rudikershaw","description":"A small, no dependencies, Naive Bayes Text Classifier for JavaScript","archived":false,"fork":false,"pushed_at":"2023-07-19T14:47:54.000Z","size":409,"stargazers_count":38,"open_issues_count":2,"forks_count":6,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2025-09-01T06:38:56.516Z","etag":null,"topics":["bayes","bayes-classifier","bayesian","classifier","javascript","library","machine-learning","naive-bayes","naive-bayes-classification","naive-bayes-classifier","naive-bayes-text-classification","naive-bayes-text-classifier","natural-language-processing","natural-language-understanding","node-ml","nodejs","text-classification","text-classifier"],"latest_commit_sha":null,"homepage":"","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/rudikershaw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-30T16:14:21.000Z","updated_at":"2023-05-24T20:15:54.000Z","dependencies_parsed_at":"2023-01-11T17:31:12.150Z","dependency_job_id":null,"html_url":"https://github.com/rudikershaw/whichx","commit_stats":null,"previous_names":["rudikershaw/whichpet"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/rudikershaw/whichx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudikershaw%2Fwhichx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudikershaw%2Fwhichx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudikershaw%2Fwhichx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudikershaw%2Fwhichx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rudikershaw","download_url":"https://codeload.github.com/rudikershaw/whichx/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rudikershaw%2Fwhichx/sbom","scorecard":{"id":789161,"data":{"date":"2025-08-11","repo":{"name":"github.com/rudikershaw/whichx","commit":"af07537ddf84b09326aa6ff4fa28736affd9be46"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"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":"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":"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":"Code-Review","score":0,"reason":"Found 1/16 approved changesets -- score normalized to 0","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":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"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":"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":"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":"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":"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":"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":"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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 17 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"}},{"name":"Vulnerabilities","score":3,"reason":"7 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T06:58:11.160Z","repository_id":8972474,"created_at":"2025-08-23T06:58:11.173Z","updated_at":"2025-08-23T06:58:11.173Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273940477,"owners_count":25195096,"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-06T02:00:13.247Z","response_time":2576,"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":["bayes","bayes-classifier","bayesian","classifier","javascript","library","machine-learning","naive-bayes","naive-bayes-classification","naive-bayes-classifier","naive-bayes-text-classification","naive-bayes-text-classifier","natural-language-processing","natural-language-understanding","node-ml","nodejs","text-classification","text-classifier"],"created_at":"2025-09-06T17:49:57.281Z","updated_at":"2025-09-06T17:50:02.850Z","avatar_url":"https://github.com/rudikershaw.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![MIT Licence][licence-image]][licence-url]\n[![Build status][travis-image]][travis-url]\n[![NPM Version][npm-image]][npm-url]\n# WhichX\n\nWhichX is a [Naive Bayes' Classifier](https://en.wikipedia.org/wiki/Naive_Bayes_classifier) written in Javascript for classifying short text descriptions into categories. It is a very small library with a very simple API and no dependencies. To see a working demo you can also go to http://www.rudikershaw.com/articles/whichpet.\n\n## Installation\n\n```bash\n$ npm install whichx\n```\n\n## Usage\n\nIf you are using Node start by requiring whichx.\n\n```js\nvar WhichX = require(\"whichx\");\n```\n\nSimply define a new WhichX object. This object represents your dataset, the labels that you want your data classified into, as well as the means to add and classify descriptions.\n```js\n// Define your whichx object.\nvar whichpet = new WhichX();\n```\n\nAfter this you will want to add the labels you wish to give to the types of descriptions you wish to classify.\n```js\n// Define an array of labels for description types.\nvar labels = [\"cat\",\"dog\",\"fish\",\"horse\",\"bird\",\"reptile\"];\n// Add your labels to the whichx object.\nwhichpet.addLabels(labels);\n// Add an extra single label to the whichx object.\nwhichpet.addLabels(\"pokemon\");\n```\n\nNow you can add descriptions to each label. These descriptions, with their labels, act as your training set data.\n```js\n// Add a description and its label to the data set.\nwhichpet.addData(\"pokemon\", \"loyal and bright yellow with a lightning shaped tail\");\n// ... Add more here.\n```\n\nWith enough data (the more the better), you can provide a description on it's own and ask the classifier which label it thinks it belongs to.\n```js\n// Which pet am I talking about?\nvar pet = whichpet.classify(\"Its yellow and shoots lightning\");\nconsole.log(\"It's a \" + pet + \"!\");\n```\n\nThat's it. Enjoy.\n\nFor questions about the API or additional functionality, please see the [FAQs](documentation/faq.md).\n\n[licence-image]: http://img.shields.io/npm/l/gulp-rtlcss.svg?style=flat\n[licence-url]: https://tldrlegal.com/license/mit-license\n[travis-image]: https://app.travis-ci.com/rudikershaw/whichx.svg?branch=develop\n[travis-url]: https://app.travis-ci.com/rudikershaw/whichx\n[npm-image]: http://img.shields.io/npm/v/whichx.svg?style=flat\n[npm-url]: https://www.npmjs.org/package/whichx\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frudikershaw%2Fwhichx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frudikershaw%2Fwhichx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frudikershaw%2Fwhichx/lists"}