Learning Segment Similarity and Alignment in Large-Scale Content Based Video Retrieval