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: Trains a ``NaiveBayesClassifier`` using the edges present in
  graphs list as positive examples, the edges not present as
  negative examples.  Uses a feature vector of head-word,
  head-tag, child-word, and child-tag.
  
  :type graphs: list(DependencyGraph)
  :param graphs: A list of dependency graphs to train the scorer.
docstr_tok: ["Trains","a","``","NaiveBayesClassifier","``","using","the","edges","present","in","graphs","list","as","positive","examples",",","the","edges","not","present","as","negative","examples",".","Uses","a","feature","vector","of","head-word",",","head-tag",",","child-word",",","and","child-tag",".",":","type","graphs",":","list","(","DependencyGraph",")",":","param","graphs",":","A","list","of","dependency","graphs","to","train","the","scorer","."]
code: def train(self, graphs):
      """
      Trains a ``NaiveBayesClassifier`` using the edges present in
      graphs list as positive examples, the edges not present as
      negative examples.  Uses a feature vector of head-word,
      head-tag, child-word, and child-tag.
  
      :type graphs: list(DependencyGraph)
      :param graphs: A list of dependency graphs to train the scorer.
      """
  
      from nltk.classify import NaiveBayesClassifier
  
      # Create training labeled training examples
      labeled_examples = []
      for graph in graphs:
          for head_node in graph.nodes.values():
              for child_index, child_node in graph.nodes.items():
                  if child_index in head_node["deps"]:
                      label = "T"
                  else:
                      label = "F"
                  labeled_examples.append(
                      (
                          dict(
                              a=head_node["word"],
                              b=head_node["tag"],
                              c=child_node["word"],
                              d=child_node["tag"],
                          ),
                          label,
                      )
                  )
  
      self.classifier = NaiveBayesClassifier.train(labeled_examples)
  
imports: import logging
  import math
  from nltk.parse.dependencygraph import DependencyGraph
label_desc: Use image node_id 2 for calling the NaiveBayesDependencyScorer obj's underlying member method code with example usage: obj.train(graphs) without return types