@2008-horse/horse-korean
v1.1.0
Published
Horse Korean: converts written Korean (Hangul) into how it is pronounced. Offline ONNX model with a JavaScript SDK.
Maintainers
Readme
Horse Korean
Horse Korean: converts written Korean (Hangul) into how it is pronounced. Offline ONNX model with a JavaScript SDK.
Version 1.1.0 (Horse Korean 1.1). Free for non-commercial use. Commercial use requires a license.
Install
npm install @2008-horse/horse-korean onnxruntime-webonnxruntime-web is a peer dependency (>=1.19.2 <2). The package works in browsers, in module Web Workers and in Node.js 18 or later. If your bundler serves the onnxruntime-web .wasm files from another location, set ort.env.wasm.wasmPaths to that URL.
Usage
import * as ort from 'onnxruntime-web';
import { create, files } from '@2008-horse/horse-korean';
// In a browser, serve the files from the package's models/ folder.
const model = await (await fetch(files.model)).arrayBuffer();
const knowledge = await (await fetch(files.knowledge)).json();
const korean = await create({ ort, model, knowledge });
console.log(await korean.pronounce('달랠 사람이 없다')); // 달랠 싸라미 업따
await korean.dispose();In Node.js, read the same files from disk:
import { readFile } from 'node:fs/promises';
const model = await readFile(files.model);
const knowledge = JSON.parse(await readFile(files.knowledge, 'utf8'));pronounce expects NFC text and returns a string of the same length, with each Hangul syllable replaced by how it is pronounced. Other characters are returned unchanged.
Files
| File | Bytes | SHA-256 |
|---|---|---|
| model.int8.onnx | 2239105 | e3ebb0c7ee7770f769af8a4a3829b71263b5f38b29c8eeae5b952d085c279b53 |
| knowledge.json | 888401 | 5f13612caee0d217301c13d8d56431a14dfd1f66004ba6fa4211e3d1ee0bbc6c |
Verify
SHA256SUMS lists the package files and is signed with minisign (SHA256SUMS.minisig). The public key is at https://2008-horse.com/security/model-signing-key.txt
minisign -Vm SHA256SUMS -p model-signing-key.txt
shasum -a 256 -c SHA256SUMSLicense
Horse Models Community License v2.0. See LICENSE. Commercial licensing: https://2008-horse.com/licensing/
Official website: https://2008-horse.com
