You could always check out AIDungeon for some ideas about how AI story generation goes. It works alright for story generation as long as you don't mind editing or retrtying , but as an actual game, not so much. They added some game like features in there, but they don't work very well.
As far as actually writing a text adventure game goes these days, there's lots of options for languages and libraries that are specific to making text adventures.
There's Inform and TADS for making parser based games.
https://en.m.wikipedia.org/wiki/Inform
https://en.m.wikipedia.org/wiki/TADS
There's renpy, Quest and a bunch of others for making more visual novel/choose your own adventure style stories.
https://en.m.wikipedia.org/wiki/Ren%27Py
http://textadventures.co.uk/quest/
There's actually still a fairly large text based game community out there these days.