NaNoGenMo / 2019

National Novel Generation Month, 2019 edition.
97 stars 5 forks source link

Generative Cities #5

Open sbassoon opened 4 years ago

sbassoon commented 4 years ago

I'm working on a program that will generate new chapters of writing like Italo Calvino's "Invisible Cities," which feels like a novel about generativity, especially in the way Marco Polo describes his adventures.

One problem I anticipate is that the source text is pretty small. It's only about 26,000 words. I've been experimenting with Markov chains, but I've also thought a lot about doing a tracery grammar and modelling specific chapters. I'm also interested in pairing this stuff with sentiment analysis and trying to swap out some words for others to create new texts, but that are thematically related. Another approach is to model Calvino's writing by loading in his other texts and creating a NN that emulates his style.

Another thing I've been thinking about is the superstructure of Invisible Cities as a text. Calvino's form is very particular -- sort of like a cascading atlas, or a canon, adding "genres" of cities, that have specific numbers of cities per genre.

Additionally, there's the narrative aspect of the text. This exists primarily as a framing device, and I wasn't thinking of working with it, but it could be interesting to toy around with it.

I'm excited to see what develops from this!

ghost commented 4 years ago

Very cool idea! If you're interested, there's also a short story called "Invisible Planets" (featured in an anthology of the same name) based on "Invisible Cities".

sbassoon commented 4 years ago

Very cool idea! If you're interested, there's also a short story called "Invisible Planets" (featured in an anthology of the same name) based on "Invisible Cities".

Ah, I had read Three Body Problem earlier this year and actually picked up this anthology after finishing it! I'll be sure to give it a read before November to see how it influences things. Thanks!

cpressey commented 4 years ago

If you haven't already read it, you also might find Calvino's essay Cybernetics and Ghosts interesting. It sticks in my mind because it's one of the few instances I've seen of a writer talking about the idea of a computer-generated novel with any seriousness. (And certainly one of the earliest - this was in 1967!)

sbassoon commented 4 years ago

If you haven't already read it, you also might find Calvino's essay Cybernetics and Ghosts interesting. It sticks in my mind because it's one of the few instances I've seen of a writer talking about the idea of a computer-generated novel with any seriousness. (And certainly one of the earliest - this was in 1967!)

I haven't -- thanks for recommending it!

LuRsT commented 4 years ago

I need to read Calvino's first, but this does sound like a good idea!

mgrider commented 4 years ago

Just wanted to chime in and say I loved Invisible Cities. I used to make Marathon maps, and named several of them after cities in the book.

sbassoon commented 4 years ago

Adding my repo here, with some introductory work with markovs and textgenrnn. Nothing worth posting yet -- hoping to do a more formalist analysis of Invisible Cities and generate a superstructure to fill in.

Repo available here: https://github.com/sbassoon/nanogenmo-2019

sbassoon commented 4 years ago

I've used word vector analysis to generate new chapter themes! I needed 22 themes, since the original text is about 25,000 words, and I am aiming for 50,000. Here are the themes that were selected:

Cities and Blood Cities and Lips Cities and Letters Long Cities Separate Cities Cities and Smiles Cities and Demands Cities and the Beyond Cities and the Faint Alive Cities Shining Cities

Cities and Trust Cities and Rules Cities and Reason Internal Cities Blue Cities Cities and Flesh Cities and Exchange Cities and the Face Cities and the Heart Common Cities Personal Cities

greg-kennedy commented 4 years ago

How far did you get on this? Did you hit 50,000 words?

sbassoon commented 4 years ago

Hey! Thanks for reaching out! I actually finished the coding of the generative processes, but I decided to not generate 50,000 words by the end of November, instead allowing myself more time to tweak some of the code's settings. Looks like those final updates didn't wind up getting pushed to my repo! Rather than getting stressed about the deadline, I decided it was better to let the project sit and come back to it sometime in the spring to take a second look and do some more generation then to get more results, and publically, officially, cross the 50k line then.