@i18n-inflect/neural
v0.1.7
Published
Neural inflection fallback runtime for i18n-inflect — tiny char-level seq2seq models over a swappable inference engine (onnxruntime-web, onnxruntime-node, or the cordova-plugin-boogie-onnx native bridge).
Readme
@i18n-inflect/neural
Optional neural inflection fallback for i18n-inflect: runs a tiny (~2 MB int8) character-level seq2seq model to inflect out-of-vocabulary words the rule engine was unsure about.
- Swappable inference engine — three adapters ship:
@i18n-inflect/neural/ort-web(browser, onnxruntime-web WASM)@i18n-inflect/neural/ort-node(Node, onnxruntime-node)@i18n-inflect/neural/boogie-onnx(Cordova, native ONNX Runtime viacordova-plugin-boogie-onnx— zero JS deps)
- Autodetected, or bring your own by implementing the 3-method
InferenceEngineinterface. onnxruntime-*packages are optional peers — install only what your platform uses.
import { registerFallback, preload } from "i18n-inflect";
import { createNeuralFallback } from "@i18n-inflect/neural";
import { loadModelHu } from "@i18n-inflect/model-hu";
registerFallback(createNeuralFallback({ model: await loadModelHu() }));
await preload("hu");Full environment-by-environment guide: docs/neural.md.
MIT licensed.
