Learning Movement Primitive Libraries through Probabilistic Segmentation