Read training data from stdin.