Which machine learning algorithm could I use to break up a poem by lines?
You should try to use an RNN. You feed in letter by letter and have a binary output of linebreak - no linebreak. If you have enough data it might actually work.