I have 5000 html files (structured text), how can I generate a new one that "resembles" those?
You could try to train a recurrent neural net on char level. Basically, you took GRU or LSTM and use a sequence of characters, not tags or words. In the blogpost &quot;The Unreasonable Effectiveness of Recurrent Neural Networks&quot; there are examples for Shakespeare, Linux source code on C and for papers in latex code, and the results are quite valid, produced from similar to your size training sets. The good thing in case of html pages is that modern browsers are very good at handling a slightly broken HTML, so this approach could work for both of your tasks.