code: function(example) {
      if (example.labels == null || example.words == null) {
        throw new Error('We tried learning an invalid example: "' + example + '"')
      }
      this.root.add(example)
      example.labels.forEach(label => {
        if (this.numExamples.get(label)) {
          let count = this.numExamples.get(label)
          this.numExamples.set(label, count + 1)
        } else {
          this.numExamples.set(label, 1)
        }
      })
      this.weightsNeedBuilding = true
    }
docs: Learn an example. eg. {labels, text, words: [{text, tags}]}.