{"id":17444586,"url":"https://github.com/joedoyle23/fasttextjs","last_synced_at":"2025-04-30T10:14:33.427Z","repository":{"id":146538939,"uuid":"110936994","full_name":"JoeDoyle23/fasttextjs","owner":"JoeDoyle23","description":"JavaScript implementation of the FastText prediction algorithm","archived":false,"fork":false,"pushed_at":"2017-11-29T17:08:03.000Z","size":32,"stargazers_count":31,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T10:14:28.116Z","etag":null,"topics":["fasttext"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JoeDoyle23.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-11-16T07:15:48.000Z","updated_at":"2022-08-09T16:25:25.000Z","dependencies_parsed_at":"2024-06-13T05:05:17.438Z","dependency_job_id":null,"html_url":"https://github.com/JoeDoyle23/fasttextjs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoeDoyle23%2Ffasttextjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoeDoyle23%2Ffasttextjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoeDoyle23%2Ffasttextjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoeDoyle23%2Ffasttextjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JoeDoyle23","download_url":"https://codeload.github.com/JoeDoyle23/fasttextjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251683357,"owners_count":21626953,"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"],"created_at":"2024-10-17T17:39:16.808Z","updated_at":"2025-04-30T10:14:33.408Z","avatar_url":"https://github.com/JoeDoyle23.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fasttextJS\r\n\r\nA JavaScript implementation of the FastText prediction algorithm\r\n\r\nThe goal is to provide a compatible `predict` and `predict-prob` with the C++\r\nversion of FastText for use in Node.js.\r\n\r\n## FastText\r\n\r\n[FastText](https://fasttext.cc/) is a project out of Facebook Research. The primary\r\nimplementation can be found at [https://github.com/facebookresearch/fastText](https://github.com/facebookresearch/fastText). That is the source code used to create\r\nthis version.\r\n\r\n## Purpose of this code\r\n\r\nThis code is an experiment to see how fast a pure JavaScript implimentation could be.\r\nI envision that a modified version of the original C++ compliled to WebAssembly will\r\nbe the most performant while having the best interoperability with Node.js.\r\n\r\nThe original FastText C++ version allows for both the creation of the model via training,\r\nas well as the ability to use that model for predictions. This implimentaion is currently\r\nonly focused on the prediction side of FastText. With that in mind, it is compatible with\r\nmodels generated by the C++ version.\r\n\r\nAs much as I love Node and JavaScript, I don't see much value in implimenting the training\r\ncode as the original is multithreaded and the performance will never be matched.\r\n\r\n## Status\r\n\r\nInitial testing with our pretrained models is showing results that are very close to the\r\nC++ version. I'm still working through the code to see if I missed something in the\r\nport.\r\n\r\nI also haven't started preformance tuning the code yet. There are many places for\r\noptimizations and doing things the JavaScript way instead of the C++ way.\r\n\r\nThis is still in progress, but I'd be curious to hear of other's experiences with it.\r\n\r\n## Limitations\r\n\r\nSeveral of the values stored in the model file are 64-bit integers, so JavaScript limits\r\napply (max values of 2^53 - 1). Models that are larger than that will probably fail to\r\nwork correctly.\r\n\r\nCurrently this code only loads the \"compressed\" model format (.ftz).\r\n\r\n## Sample Model\r\n\r\nYou can find sample models on the FastText website. The one in the `test.js` file is the\r\ncompressed Amazon Review Full which can be found at https://fasttext.cc/docs/en/supervised-models.html#content\r\n\r\n## License\r\n\r\nfasttextJS is BSD-licensed just like the original source. I can only assume that the\r\npatent clause also applies to this port.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoedoyle23%2Ffasttextjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoedoyle23%2Ffasttextjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoedoyle23%2Ffasttextjs/lists"}