'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.'

def train(self, graphs):

    from nltk.classify import NaiveBayesClassifier
    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)
