Google News
ml5.js Interview Questions
word2vec has been disabled : We've intentionally disabled the word2vec function after recognizing it has the potential to produce harmful outputs while using the pre-trained model files included in our examples. We'll consider reenabling the word2vec function along with changes to address these issues in a future release of ml5.js
Description : Word2vec is a group of related models that are used to produce word embeddings. This method allows you to perform vector operations on a given set of input vectors.
Quickstart :
// Create a new word2vec method
const wordVectors = ml5.word2vec('data/wordvecs.json', modelLoaded);

// When the model is loaded
function modelLoaded() {
  console.log('Model Loaded!');

// Find the closest word to 'rainbow'
wordVectors.nearest('rainbow', (err, results) => {
Usage :
const word2vec = ml5.Word2Vec(model, ?callback);

* model : A string to the path of the JSON model.

* callback : Optional. A callback function that is called once the model has loaded. If no callback is provided, it will return a promise that will be resolved once the model has loaded.
The ml5 utilities are handy functions that make your life easier when working with data, images, etc.
Usage : 

Methods :
.flipImage() : Flips an image or video input horizontally and returns the flipped image. Handy for mirroring an image or video.
const flippedImage = ml5.flipImage(input);
Inputs :
* input : Optional. A HTMLVideoElement | p5 video element | HTMLImageElement.

Outputs :
* Object : Returns a flipped image.

Example :
Assuming you're using ml5 with p5.js :
  <meta charset="UTF-8" />
  <script src=""></script>
  <script src=""></script>
  <script src="http://localhost:8080/ml5.js" type="text/javascript"></script>
      let video;
      function setup() {
        createCanvas(640, 480);
        video = createCapture(VIDEO);
        video.size(640, 480);

      function draw() {
        const flippedVideo = ml5.flipImage(video);
        image(flippedVideo, 0, 0, width, height);

Sources : Ml5.js, W3C, more..