code: def measure(self, dataset, batch_size=20, dropout=1.0):
      predicted = {}
      correct = {}
      correct_predicted = {}
  
      for batch in NerModel.slice(dataset, batch_size):
          tags_ids = NerModel.get_tag_ids(batch)
          sentence_lengths = NerModel.get_sentence_lengths(batch)
  
          feed_dict = {
              self.sentence_lengths: sentence_lengths,
              self.word_embeddings: NerModel.get_word_embeddings(batch),
              self.word_lengths: NerModel.get_word_lengths(batch),
              self.char_ids: NerModel.get_char_ids(batch),
              self.labels: tags_ids,
              self.dropout: dropout,
          }
  
          prediction = self.session.run(
              self.prediction, feed_dict=feed_dict
          )
          batch_prediction = np.reshape(prediction, (len(batch), -1))
  
          for i in range(len(batch)):
              is_word_start = batch[i]["is_word_start"]
  
              for word in range(sentence_lengths[i]):
                  if not is_word_start[word]:
                      continue
  
                  p = batch_prediction[i][word]
                  c = tags_ids[i][word]
  
                  if c in self.dummy_tags:
                      continue
  
                  predicted[p] = predicted.get(p, 0) + 1
                  correct[c] = correct.get(c, 0) + 1
                  if p == c:
                      correct_predicted[p] = (
                          correct_predicted.get(p, 0) + 1
                      )
  
      num_correct_predicted = sum(
          [correct_predicted.get(i, 0) for i in range(1, self.ntags)]
      )
      num_predicted = sum(
          [predicted.get(i, 0) for i in range(1, self.ntags)]
      )
      num_correct = sum(
          [correct.get(i, 0) for i in range(1, self.ntags)]
      )
  
      prec = num_correct_predicted / (num_predicted or 1.0)
      rec = num_correct_predicted / (num_correct or 1.0)
  
      f1 = 2 * prec * rec / (rec + prec)
  
      return prec, rec, f1
  
imports: import math
  import random
  import sys
  import numpy
  import tensorflow
  from .sentence_grouper import SentenceGrouper
  from ..tf2contrib import *
label_desc: Use image node_id 22 for calling the NerModel obj's underlying member method code with example usage: obj.measure(dataset, batch_size, dropout) and returns: prec,  rec,  f1