1. A method for annotating a document comprising: for a plurality of different types of data element, modeling data elements of an input document and dependencies between the data elements as a dependency network, at least some of the data elements being associated with a label; defining static features of at least some of the data elements, the static features each expressing a relationship between a characteristic of the data element and its label; defining a set of dynamic features, each of the dynamic features defining a link between a label of a first data element in a pair of the data elements and a label of a second data element in the pair of data elements; learning parameters of a collective probabilistic model for the document, the parameters expressing, for each of a plurality of the data elements, a conditional probability that the data element should be labeled with a neighbor label comprising information derived from a label of another data element linked to the data element by a dynamic feature, the learning including training a set of local learning models to generate estimations of the neighbor labels for at least one of the data elements based on static features and stacking the local learning models with higher level models to refine the estimations; and collectively classifying data elements in the collective probabilistic model based on the learned parameters, whereby at least some of the data elements are each annotated with a label comprising information derived from the label of another element.