Improving Text Generation


(Bilal) #1

I am trying to generate text based on a fine-tuned language model but the result are not that great. I realize that learn.predict may not be setup to give optimal results for this use case. How can I tweak it for text generation? I think one way would be to implement beam search but not sure if there is a straightforward way to do this.


Text Generation and Beam search
(Thomas Chambon) #2

Beam search seems to be a good way to get much better result. You can find a good video by Andrew ng explaining beam search: https://www.youtube.com/watch?v=RLWuzLLSIgw
I am not aware of better ways but would be very interested if you find some.


(Bilal) #3

Thanks! Have you seen any code to implement this in fastai and/or pytorch?


#4

fastai v1.0.43 will have it (it’s currently in master).


(Kofi Asiedu Brempong) #5

how can we use it, I also want to create a text generator. Thanks