Task segmentation based on transition state clustering for surgical robot assistance