final routine of document similarity serialize results to protobuf