MCPcopy Create free account
hub / github.com/ml5js/ml5-library / encode

Method encode

src/UniversalSentenceEncoder/index.js:57–59  ·  view source on GitHub ↗

* Encodes a string based on the loaded tokenizer if the withTokenizer:true * @param {*} textString * @param {*} callback

(textString, callback)

Source from the content-addressed store, hash-verified

55 * @param {*} callback
56 */
57 encode(textString, callback){
58 return callCallback(this.encodeInternal(textString), callback);
59 }
60
61 async encodeInternal(textString){
62 if(this.config.withTokenizer === true){

Callers 2

encodeInternalMethod · 0.80
predictFunction · 0.80

Calls 2

encodeInternalMethod · 0.95
callCallbackFunction · 0.85

Tested by

no test coverage detected