| 6 | let warning, score, thoughts; |
| 7 | |
| 8 | function setup() { |
| 9 | // initialize sentiment |
| 10 | sentiment = ml5.sentiment("movieReviews", modelReady); |
| 11 | |
| 12 | statusEl = document.querySelector(".spinner"); |
| 13 | resultbox = document.querySelector(".resultbox"); |
| 14 | |
| 15 | inputBox = document.querySelector("#inputText"); |
| 16 | submitBtn = document.querySelector("#submitBtn"); |
| 17 | sentimentResult = document.querySelector("#score"); |
| 18 | |
| 19 | warning = document.querySelector(".warning"); |
| 20 | thoughts = document.querySelector(".thoughts"); |
| 21 | score = document.querySelector(".score"); |
| 22 | |
| 23 | // predicting the sentiment on mousePressed() |
| 24 | submitBtn.addEventListener("click", getSentiment); |
| 25 | } |
| 26 | |
| 27 | setup(); |
| 28 | |