add function to take random sample from the corpus