{"id":21590997,"url":"https://github.com/tuananh/fasttext-native","last_synced_at":"2025-04-10T22:24:47.252Z","repository":{"id":57233446,"uuid":"112940398","full_name":"tuananh/fasttext-native","owner":"tuananh","description":"fastText native bindings for ⬡.js","archived":false,"fork":false,"pushed_at":"2017-12-04T15:59:38.000Z","size":202,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-03-24T19:22:07.684Z","etag":null,"topics":["fasttext","nodejs"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tuananh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-03T15:40:23.000Z","updated_at":"2023-06-17T15:00:55.000Z","dependencies_parsed_at":"2022-08-31T14:11:37.002Z","dependency_job_id":null,"html_url":"https://github.com/tuananh/fasttext-native","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuananh%2Ffasttext-native","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuananh%2Ffasttext-native/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuananh%2Ffasttext-native/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuananh%2Ffasttext-native/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tuananh","download_url":"https://codeload.github.com/tuananh/fasttext-native/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247968259,"owners_count":21025820,"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":["fasttext","nodejs"],"created_at":"2024-11-24T16:21:41.616Z","updated_at":"2025-04-10T22:24:47.231Z","avatar_url":"https://github.com/tuananh.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fasttext-native\n\n\u003e fastText native bindings for ⬡.js\n\n[![npm](https://img.shields.io/npm/v/fasttext-native.svg?style=flat-square)](https://npm.im/fasttext-native)\n[![Travis](https://img.shields.io/travis/tuananh/fasttext-native/develop.svg?label=Linux%20%26%20macOS%20build\u0026style=flat-square)](https://travis-ci.org/tuananh/fasttext-native)\n[![David](https://img.shields.io/david/tuananh/fasttext-native.svg?style=flat-square)](https://david-dm.org/tuananh/fasttext-native)\n\nForked from [pragonauts's fast-text](https://github.com/pragonauts/fast-text)\n\n## Features\n\n- Executing prediction models\n- Searching nearest neighbour\n- Prebuilt binaries for Linux and macOS (Windows is not supported by fastText)\n- Tracking latest fastText upstream version (currently version 0.1.0)\n\n## Usage\n\n### Prediction\n\nThere is a simple class for executing prediction models:\n\n```javascript\nconst path = require('path')\nconst { Classifier } = require('fasttext-native')\n\nconst model = path.resolve(__dirname, './classification.bin')\n\nconst classifier = new Classifier(model)\n\nclassifier.predict('how it works', 1, (err, res) =\u003e {\n  if (err) {\n    console.error(err)\n  } else if (res.length \u003e 0) {\n    const tag = res[0].label // __label__someTag\n    const score = res[0].valuel // 1.3455345\n  } else {\n    console.log('No matches')\n  }\n})\n```\n\n\n### Nearest neighbour\n\nThere is a simple class for searching nearest neighbours:\n\n```javascript\nconst path = require('path')\nconst { Query } = require('fasttext-native')\n\nconst model = path.resolve(__dirname, './skipgram.bin')\n\nconst query = new Query(model)\n\nquery.nn('word', 10, (err, res) =\u003e {\n  if (err) {\n    console.error(err)\n  } else if (res.length \u003e 0) {\n    const tag = res[0].label // letter\n    const score = res[0].valuel // 0.99992\n  } else {\n    console.log('No matches')\n  }\n})\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuananh%2Ffasttext-native","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftuananh%2Ffasttext-native","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuananh%2Ffasttext-native/lists"}