fasttext.wasm.js

WebAssembly version of fastText with compressed lid.176.ftz
model (~900KB) and a typescript wrapper This project focuses on cross-platform, zero-dependency and out-of-the-box.
Usage
import {
LanguageIdentifyModel,
initializeFastTextModule,
} from 'fasttext.wasm.js'
await initializeFastTextModule()
const model = new LanguageIdentifyModel()
await model.load()
const result = model.identify('Hello, world!')
console.log(result)
import {
LanguageIdentifyModel,
initializeFastTextModule,
} from 'fasttext.wasm.js/browser'
await initializeFastTextModule()
const model = new LanguageIdentifyModel({
modelHref: '/models/lid.176.ftz',
})
await model.load()
const result = model.identify('Hello, world!')
console.log(result)
Credits
References
Build & Publish
npm run build
npx changeset
npx changeset version
git commit
npx changeset publish
git push --follow-tags
changeset
prerelease doc
License
MIT License © 2023 Yuns