Show this code if user has previously left a comment

This will be the main code

 global $current_user, $post;
 $user_comment_count = get_comments(array('user_id' => $current_user->ID, 'post_id'=>$post->ID) );

if($user_comment_count) { 
   the_ratings(); 
} else {
    comment_form(array('class_submit'=>'button'));
} 

Also you may want to first check is the user is logged in with the is_user_logged_in()