title: Using Tensorflows Universal Sentence Encoder in Node.js?
body: <p>I'm using tensorflow js in node and trying to encode my inputs.</p>
  
  <pre><code>const tf = require('@tensorflow/tfjs-node');
  const argparse = require('argparse');
  const use = require('@tensorflow-models/universal-sentence-encoder');
  </code></pre>
  
  <p>These are imports, the suggested import statement (ES6) isn't permitted for me in my node environment? Though they seem to work fine here.</p>
  
  <pre><code>const encodeData = (tasks) =&gt; {
    const sentences = tasks.map(t =&gt; t.input);
    let model = use.load();
    let embeddings = model.embed(sentences);
    console.log(embeddings.shape);
    return embeddings;  // `embeddings` is a 2D tensor consisting of the 512-dimensional embeddings for each sentence.
  };
  </code></pre>
  
  <p>This code produces an error that model.embed is not a function. Why? How do I properly implement an encoder in node.js?</p>