MCPcopy Index your code
hub / github.com/tensorflow/tfjs-examples / generateText

Method generateText

lstm-text-generation/index.js:123–128  ·  view source on GitHub ↗

* Generate text using the LSTM model. * * @param {number[]} sentenceIndices Seed sentence, represented as the * indices of the constituent characters. * @param {number} length Length of the text to generate, in number of * characters. * @param {number} temperature Temperature p

(sentenceIndices, length, temperature)

Source from the content-addressed store, hash-verified

121 * @returns {string} The generated text.
122 */
123 async generateText(sentenceIndices, length, temperature) {
124 onTextGenerationBegin();
125 return await model.generateText(
126 this.model, this.textData_, sentenceIndices, length, temperature,
127 onTextGenerationChar);
128 }
129};
130
131/**

Callers 1

generateTextFunction · 0.80

Calls 1

onTextGenerationBeginFunction · 0.90

Tested by

no test coverage detected