MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / setup

Function setup

assets/js/SentimentAnalysis.js:8–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6let warning, score, thoughts;
7
8function 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
27setup();
28

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected