Socket
Socket
Sign inDemoInstall

deepspeech-gpu

Package Overview
Dependencies
78
Maintainers
1
Versions
93
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.6.0-alpha.7 to 0.6.0-alpha.8

lib/binding/v0.6.0-alpha.8/linux-x64/electron-v1.6/deepspeech.node

185

index.js

@@ -23,2 +23,14 @@ 'use strict';

/**
* @class
* An object providing an interface to a trained DeepSpeech model.
*
* @param {string} aModelPath The path to the frozen model graph.
* @param {number} aNCep The number of cepstrum the model was trained with.
* @param {number} aNContext The context window the model was trained with.
* @param {string} aAlphabetConfigPath The path to the configuration file specifying the alphabet used by the network. See alphabet.h.
* @param {number} aBeamWidth The beam width used by the decoder. A larger beam width generates better results at the cost of decoding time.
*
* @throws on error
*/
function Model() {

@@ -37,2 +49,13 @@ this._impl = null;

/**
* Enable decoding using beam scoring with a KenLM language model.
*
* @param {string} aAlphabetConfigPath The path to the configuration file specifying the alphabet used by the network. See alphabet.h.
* @param {string} aLMPath The path to the language model binary file.
* @param {string} aTriePath The path to the trie file build from the same vocabulary as the language model binary.
* @param {float} aLMAlpha The alpha hyperparameter of the CTC decoder. Language Model weight.
* @param {float} aLMBeta The beta hyperparameter of the CTC decoder. Word insertion weight.
*
* @return {number} Zero on success, non-zero on failure (invalid arguments).
*/
Model.prototype.enableDecoderWithLM = function() {

@@ -43,2 +66,11 @@ const args = [this._impl].concat(Array.prototype.slice.call(arguments));

/**
* Use the DeepSpeech model to perform Speech-To-Text.
*
* @param {object} aBuffer A 16-bit, mono raw audio signal at the appropriate sample rate.
* @param {number} aBufferSize The number of samples in the audio signal.
* @param {number} aSampleRate The sample-rate of the audio signal.
*
* @return {string} The STT result. Returns undefined on error.
*/
Model.prototype.stt = function() {

@@ -49,2 +81,12 @@ const args = [this._impl].concat(Array.prototype.slice.call(arguments));

/**
* Use the DeepSpeech model to perform Speech-To-Text and output metadata
* about the results.
*
* @param {object} aBuffer A 16-bit, mono raw audio signal at the appropriate sample rate.
* @param {number} aBufferSize The number of samples in the audio signal.
* @param {number} aSampleRate The sample-rate of the audio signal.
*
* @return {object} Outputs a :js:func:`Metadata` struct of individual letters along with their timing information. The user is responsible for freeing Metadata by calling :js:func:`FreeMetadata`. Returns undefined on error.
*/
Model.prototype.sttWithMetadata = function() {

@@ -55,2 +97,10 @@ const args = [this._impl].concat(Array.prototype.slice.call(arguments));

/**
* Create a new streaming inference state. The streaming state returned by this function can then be passed to :js:func:`Model.feedAudioContent` and :js:func:`Model.finishStream`.
*
* @param {number} aSampleRate The sample-rate of the audio signal.
* @return {object} an opaque object that represents the streaming state.
*
* @throws on error
*/
Model.prototype.createStream = function() {

@@ -67,2 +117,10 @@ const args = [this._impl].concat(Array.prototype.slice.call(arguments));

/**
* Feed audio samples to an ongoing streaming inference.
*
* @param {object} aSctx A streaming state returned by :js:func:`Model.setupStream`.
* @param {buffer} aBuffer An array of 16-bit, mono raw audio samples at the
* appropriate sample rate.
* @param {number} aBufferSize The number of samples in @param aBuffer.
*/
Model.prototype.feedAudioContent = function() {

@@ -72,2 +130,9 @@ binding.FeedAudioContent.apply(null, arguments);

/**
* Compute the intermediate decoding of an ongoing streaming inference. This is an expensive process as the decoder implementation isn't currently capable of streaming, so it always starts from the beginning of the audio.
*
* @param {object} aSctx A streaming state returned by :js:func:`Model.setupStream`.
*
* @return {string} The STT intermediate result.
*/
Model.prototype.intermediateDecode = function() {

@@ -77,2 +142,11 @@ return binding.IntermediateDecode.apply(null, arguments);

/**
* Signal the end of an audio signal to an ongoing streaming inference, returns the STT result over the whole audio signal.
*
* @param {object} aSctx A streaming state returned by :js:func:`Model.setupStream`.
*
* @return {string} The STT result.
*
* This method will free the state (@param aSctx).
*/
Model.prototype.finishStream = function() {

@@ -82,2 +156,11 @@ return binding.FinishStream.apply(null, arguments);

/**
* Signal the end of an audio signal to an ongoing streaming inference, returns per-letter metadata.
*
* @param {object} aSctx A streaming state pointer returned by :js:func:`Model.setupStream`.
*
* @return {object} Outputs a :js:func:`Metadata` struct of individual letters along with their timing information. The user is responsible for freeing Metadata by calling :js:func:`FreeMetadata`.
*
* This method will free the state pointer (@param aSctx).
*/
Model.prototype.finishStreamWithMetadata = function() {

@@ -87,2 +170,8 @@ return binding.FinishStreamWithMetadata.apply(null, arguments);

/**
* Frees associated resources and destroys model object.
*
* @param {object} model A model pointer returned by :js:func:`Model`
*
*/
function FreeModel(model) {

@@ -92,8 +181,98 @@ return binding.FreeModel(model._impl);

/**
* Free memory allocated for metadata information.
*
* @param {object} metadata Object containing metadata as returned by :js:func:`Model.sttWithMetadata` or :js:func:`Model.finishStreamWithMetadata`
*/
function FreeMetadata(metadata) {
return binding.FreeMetadata(metadata);
}
/**
* Destroy a streaming state without decoding the computed logits. This
* can be used if you no longer need the result of an ongoing streaming
* inference and don't want to perform a costly decode operation.
*
* @param {Object} stream A streaming state pointer returned by :js:func:`Model.createStream`.
*/
function FreeStream(stream) {
return binding.FreeStream(stream);
}
/**
* Print version of this library and of the linked TensorFlow library on standard output.
*/
function printVersions() {
return binding.PrintVersions();
}
//// Metadata and MetadataItem are here only for documentation purposes
/**
* @class
*
* Stores each individual character, along with its timing information
*/
function MetadataItem() {}
/**
* The character generated for transcription
*
* @return {string} The character generated
*/
MetadataItem.prototype.character = function() {}
/**
* Position of the character in units of 20ms
*
* @return {int} The position of the character
*/
MetadataItem.prototype.timestep = function() {};
/**
* Position of the character in seconds
*
* @return {float} The position of the character
*/
MetadataItem.prototype.start_time = function() {};
/**
* @class
*
* Stores the entire CTC output as an array of character metadata objects
*/
function Metadata () {}
/**
* List of items
*
* @return {array} List of :js:func:`MetadataItem`
*/
Metadata.prototype.items = function() {}
/**
* Size of the list of items
*
* @return {int} Number of items
*/
Metadata.prototype.num_items = function() {}
/**
* Approximated confidence value for this transcription. This is roughly the
* sum of the acoustic model logit values for each timestep/character that
* contributed to the creation of this transcription.
*
* @return {float} Confidence value
*/
Metadata.prototype.confidence = function() {}
module.exports = {
Model: Model,
printVersions: binding.PrintVersions,
Metadata: Metadata,
MetadataItem: MetadataItem,
printVersions: printVersions,
FreeModel: FreeModel,
FreeStream: binding.FreeStream,
FreeMetadata: binding.FreeMetadata
FreeStream: FreeStream,
FreeMetadata: FreeMetadata
};

4

package.json
{
"name" : "deepspeech-gpu",
"version" : "0.6.0-alpha.7",
"version" : "0.6.0-alpha.8",
"description" : "DeepSpeech NodeJS bindings",

@@ -11,3 +11,3 @@ "main" : "./index",

"license": "MPL-2.0",
"homepage": "https://github.com/mozilla/DeepSpeech/tree/v0.6.0-alpha.7#project-deepspeech",
"homepage": "https://github.com/mozilla/DeepSpeech/tree/v0.6.0-alpha.8#project-deepspeech",
"files": [

@@ -14,0 +14,0 @@ "README.md",

# Project DeepSpeech
[![Documentation](https://readthedocs.org/projects/deepspeech/badge/?version=latest)](http://deepspeech.readthedocs.io/?badge=latest)
[![Task Status](https://github.taskcluster.net/v1/repository/mozilla/DeepSpeech/master/badge.svg)](https://github.taskcluster.net/v1/repository/mozilla/DeepSpeech/master/latest)

@@ -4,0 +5,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc