':param depgraphs: the list of test sentence, each sentence is represented as a dependency graph where the \'head\' information is dummy
:type depgraphs: list(DependencyGraph)
:param modelfile: the model file
:type modelfile: str
:return: list (DependencyGraph) with the \'head\' and \'rel\' information'

def parse(self, depgraphs, modelFile):

    result = []
    model = pickle.load(open(modelFile, 'rb'))
    operation = Transition(self._algorithm)
    for depgraph in depgraphs:
        conf = Configuration(depgraph)
        while (len(conf.buffer) > 0):
            features = conf.extract_features()
            col = []
            row = []
            data = []
            for feature in features:
                if (feature in self._dictionary):
                    col.append(self._dictionary[feature])
                    row.append(0)
                    data.append(1.0)
            np_col = array(sorted(col))
            np_row = array(row)
            np_data = array(data)
            x_test = sparse.csr_matrix((np_data, (np_row, np_col)), shape=(1, len(self._dictionary)))
            prob_dict = {}
            pred_prob = model.predict_proba(x_test)[0]
            for i in range(len(pred_prob)):
                prob_dict[i] = pred_prob[i]
            sorted_Prob = sorted(prob_dict.items(), key=itemgetter(1), reverse=True)
            for (y_pred_idx, confidence) in sorted_Prob:
                y_pred = model.classes_[y_pred_idx]
                if (y_pred in self._match_transition):
                    strTransition = self._match_transition[y_pred]
                    baseTransition = strTransition.split(':')[0]
                    if (baseTransition == Transition.LEFT_ARC):
                        if (operation.left_arc(conf, strTransition.split(':')[1]) != (-1)):
                            break
                    elif (baseTransition == Transition.RIGHT_ARC):
                        if (operation.right_arc(conf, strTransition.split(':')[1]) != (-1)):
                            break
                    elif (baseTransition == Transition.REDUCE):
                        if (operation.reduce(conf) != (-1)):
                            break
                    elif (baseTransition == Transition.SHIFT):
                        if (operation.shift(conf) != (-1)):
                            break
                else:
                    raise ValueError('The    predicted    transition    is    not    recognized,    expected    errors')
        new_depgraph = deepcopy(depgraph)
        for key in new_depgraph.nodes:
            node = new_depgraph.nodes[key]
            node['rel'] = ''
            node['head'] = 0
        for (head, rel, child) in conf.arcs:
            c_node = new_depgraph.nodes[child]
            c_node['head'] = head
            c_node['rel'] = rel
        result.append(new_depgraph)
    return result
