class_docstr: A dependency scorer built around a MaxEnt classifier.  In this
  particular class that classifier is a ``NaiveBayesClassifier``.
  It uses head-word, head-tag, child-word, and child-tag features
  for classification.
  
  >>> from nltk.parse.dependencygraph import DependencyGraph, conll_data2
  
  >>> graphs = [DependencyGraph(entry) for entry in conll_data2.split('\n\n') if entry]
  >>> npp = ProbabilisticNonprojectiveParser()
  >>> npp.train(graphs, NaiveBayesDependencyScorer())
  >>> parses = npp.parse(['Cathy', 'zag', 'hen', 'zwaaien', '.'], ['N', 'V', 'Pron', 'Adj', 'N', 'Punc'])
  >>> len(list(parses))
  1
class_docstr_tok: ["A","dependency","scorer","built","around","a","MaxEnt","classifier",".","In","this","particular","class","that","classifier","is","a","``","NaiveBayesClassifier","``",".","It","uses","head-word",",","head-tag",",","child-word",",","and","child-tag","features","for","classification",".",">",">",">","from","nltk.parse.dependencygraph","import","DependencyGraph",",","conll_data2",">",">",">","graphs","=","[","DependencyGraph","(","entry",")","for","entry","in","conll_data2.split","(","'\\n\\n","'",")","if","entry","]",">",">",">","npp","=","ProbabilisticNonprojectiveParser","(",")",">",">",">","npp.train","(","graphs",",","NaiveBayesDependencyScorer","(",")",")",">",">",">","parses","=","npp.parse","(","[","'Cathy","'",",","'zag","'",",","'hen","'",",","'zwaaien","'",",","'",".","'","]",",","[","'N","'",",","'","V","'",",","'Pron","'",",","'Adj","'",",","'N","'",",","'Punc","'","]",")",">",">",">","len","(","list","(","parses",")",")","1"]
docstr: Converts the graph into a feature-based representation of
  each edge, and then assigns a score to each based on the
  confidence of the classifier in assigning it to the
  positive label.  Scores are returned in a multidimensional list.
  
  :type graph: DependencyGraph
  :param graph: A dependency graph to score.
  :rtype: 3 dimensional list
  :return: Edge scores for the graph parameter.
docstr_tok: ["Converts","the","graph","into","a","feature-based","representation","of","each","edge",",","and","then","assigns","a","score","to","each","based","on","the","confidence","of","the","classifier","in","assigning","it","to","the","positive","label",".","Scores","are","returned","in","a","multidimensional","list",".",":","type","graph",":","DependencyGraph",":","param","graph",":","A","dependency","graph","to","score",".",":","rtype",":","3","dimensional","list",":","return",":","Edge","scores","for","the","graph","parameter","."]
code: def score(self, graph):
      """
      Converts the graph into a feature-based representation of
      each edge, and then assigns a score to each based on the
      confidence of the classifier in assigning it to the
      positive label.  Scores are returned in a multidimensional list.
  
      :type graph: DependencyGraph
      :param graph: A dependency graph to score.
      :rtype: 3 dimensional list
      :return: Edge scores for the graph parameter.
      """
      # Convert graph to feature representation
      edges = []
      for head_node in graph.nodes.values():
          for child_node in graph.nodes.values():
              edges.append(
                  dict(
                      a=head_node["word"],
                      b=head_node["tag"],
                      c=child_node["word"],
                      d=child_node["tag"],
                  )
              )
  
      # Score edges
      edge_scores = []
      row = []
      count = 0
      for pdist in self.classifier.prob_classify_many(edges):
          logger.debug("%.4f %.4f", pdist.prob("T"), pdist.prob("F"))
          # smoothing in case the probability = 0
          row.append([math.log(pdist.prob("T") + 0.00000000001)])
          count += 1
          if count == len(graph.nodes):
              edge_scores.append(row)
              row = []
              count = 0
      return edge_scores
  
imports: import logging
  import math
  from nltk.parse.dependencygraph import DependencyGraph
label_desc: Use image node_id 3 for calling the NaiveBayesDependencyScorer obj's underlying member method code with example usage: obj.score(graph) and returns: edge_scores