Automatically compute document lineages