Add build_collocations function