function getPositivityScore(text) {
const trimmed = text
.trim()
.toLowerCase()
.replace(/(\.|\,|\!)/g, '')
.split(' ');
const inputBuffer = tf.buffer([1, metadata.max_len], "float32");
trimmed.forEach((word, i) =>
inputBuffer.set(metadata.word_index[word] + metadata.index_from, 0, i)
);
const input = inputBuffer.toTensor();
const predictOut = model.predict(input);
const positivity = predictOut.dataSync()[0];
console.log("positivity score = ", positivity);
predictOut.dispose();
return positivity;
}