invokeNLP = async (doEntity, doSentiment, metadata, dispatch) => {
  // const texts = []
  // const entityLabels = []
  // const traitLabels = []
  dispatch({
    type: ModelActions.RUNNING,
  });
  const textData = metadata.data;
  const nlpData = [];
  let correctResults = 0;
  const numQueries = 10;
  for (let i = 0; i < numQueries; i++) {
    const nlpDatapoint = {};
    const text = textData[i][metadata.columns[0]]
      .trim()
      .replace("?|.|!|/|;|:|#|*", "");
    const resp = await getWitResult(ottoNLP, text);

    if (doEntity) {
      const entities = resp["entities"];
      const entityLabel = labelForSample(entities, false);
      //entityLabels.push(entityLabel);
      let entityTypeMap = [];
      if (entityLabel !== "") {
        const entityStrings = entityLabel.split(",");
        entityTypeMap = entityStrings.map((entString) => entString.split(":"));
      }
      nlpDatapoint.entities = entityTypeMap;
    }

    if (doSentiment) {
      const traits = resp["traits"];
      const traitLabel = labelForSample(traits, true);
      //traitLabels.push(traitLabel);
      if (traitLabel.toLowerCase().indexOf("negative") !== -1) {
        if (
          textData[i].hasOwnProperty("sentiment") &&
          textData[i].sentiment.toLowerCase() === "negative"
        ) {
          correctResults += 1;
        }
        nlpDatapoint.sentiments = "Negative";
      } else if (traitLabel.toLowerCase().indexOf("positive") !== -1) {
        if (
          textData[i].hasOwnProperty("sentiment") &&
          textData[i].sentiment.toLowerCase() === "positive"
        ) {
          correctResults += 1;
        }
        nlpDatapoint.sentiments = "Positive";
      } else {
        nlpDatapoint.sentiments = "Neutral";
      }
    }
    nlpDatapoint.data = text;
    nlpData.push(nlpDatapoint);
    //texts.push(text);
  }
  dispatch({
    type: ModelActions.NLP_DONE,
    datas: nlpData,
    results: [correctResults, numQueries],
  });
}
Generates array of data objects: {data: "string", entities: "string", sentiments: "string"}