![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
ctc-beam-search
Advanced tools
Implement Connectionist Temporal Classificiation(CTC) beam search in JavaScript
Implement the Connectionist Temporal Classification(CTC) beam search in JavaScript. The input is log probabilities of an array. The length of the array is the number of CTC slots. Each item in the array contains an array of log probabilities to each characters, including blank character. Usually the blank character is the last one. The implementation doesn't support NGram now. But it's one of the todos.
The following code is used to handle English CTC results:
const { CTCBeamSearch, EN_VOCABULARY } = require('ctc-beam-search');
const bs = new CTCBeamSearch(EN_VOCABULARY);
const data = ....; // log probabilities
const results = bs.search(data, 5); // beam width = 5
// dump the first result to console as a string
console.log(results[0].convertToStr(EN_VOCABULARY));
The EN_VOCABULARY
is like this:
const { Vocabulary } = require('ctc-beam-search');
const engV = new Vocabulary({ ' ': 0,
'a': 1,
'b': 2,
'c': 3,
'd': 4,
'e': 5,
'f': 6,
'g': 7,
'h': 8,
'i': 9,
'j': 10,
'k': 11,
'l': 12,
'm': 13,
'n': 14,
'o': 15,
'p': 16,
'q': 17,
'r': 18,
's': 19,
't': 20,
'u': 21,
'v': 22,
'w': 23,
'x': 24,
'y': 25,
'z': 26,
'\'': 27,
}, 28);
You can create you own Vocabulary.
FAQs
Implement Connectionist Temporal Classificiation(CTC) beam search in JavaScript
The npm package ctc-beam-search receives a total of 1 weekly downloads. As such, ctc-beam-search popularity was classified as not popular.
We found that ctc-beam-search demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.