NaNoGenMo / 2016

National Novel Generation Month, 2016 edition.
https://nanogenmo.github.io
162 stars 7 forks source link

Dream-inspired diary #57

Open keheitz opened 8 years ago

keheitz commented 8 years ago

Not sure what direction I'm going to go yet. Two thoughts I had:

  1. Since a lot of actual novels were inspired by dreams, use posts from reddit r/dreams to try to generate some kind of narrative? Not sure how I'd approach this yet - if I would try to make a continuous narrative, or have the dreams interrupt a story generated in some other way.
  2. Use this approach and project with a different existing novel https://medium.com/deep-writing/how-to-write-with-artificial-intelligence-45747ed073c#.e4v21oilq but try to modify it to a. allow initial mad-lib like inputs that get used in place of some of the original characters/nouns/places b. train separately for the different parts of the plot, then use them in order

Or something else entirely!

joeld42 commented 8 years ago

I think the Deep-Dream style generators mixed with tracery/madlibs style template blocks is a really interesting direction. Good luck, I'll keep an eye on this one!

keheitz commented 8 years ago

I've written some initial code I'd like to improve upon to generate a novel using r/dreams posts. The first novel is available here: https://github.com/keheitz/NaNoGenMo16/blob/master/horror-diary

This was inspired by attending a Mary Shelley exhibit last month, which discussed that the inspiration for Frankenstein was a dream she had. Turns out that makes sense, because people's dreams are mostly terrifying (especially the ones they post on the internet!)

Approach

The code uses the reddit api to write 5000 dream posts to file, then I'm using markovify for building markov models from the posts to generate new sentences. Since a lot of the posts have sentences referencing it is a dream, i.e. "in my dream", I'm stripping those out. The paragraphs sort of seemed like disjointed, creepy diary entries, so I added methods to datestamp each paragraph.

Examples:

June 06, 1987 I asked my mom for the International Association for the kids. One by one I dragged the bodies, called out their names, I guess we didn't have the strength to move, it was a square around it with all my might to move this to the middle of her leaving me its unreal. Edit: There were monsters we were picking characters to play and crossed traffic. Suddenly I'm stricken with rage, I have fallen deeply in love with them. At one point and laid down, thinking I'll only rest for a while she sits on top of my life, involving a high dose of mushrooms.

July 06, 1987 Sometimes I even feel good as if it meant anything more. As long as he's chasing them they start running towards the town. Afterwards I jump down the remaining steps on top of a road trip. So for the past few days? In the room toward where I seen small children and mothers/caretakers was there actually a pretty short lived. Then I talked to her and then he was perfectly fine. The last few months back, I had already graduated from college, and I crossed the street looking at this hour. I even feel good as if all the way down as he lives in a wagon, and that i own, but I wanted to do so, but I'm pretty close to the left that leads to a good place to start. The tellers are replaced by iPads to find all the things were. Then my parents and all my life. Sometimes when im about to travel in time again. I was freaked out watching darning needles, knives and syringes to the beach. She went to check my watch and saw the girl began to rip apart the very bottom, and a light breeze.

Next Steps

Before the end of the month, I'd like to add a method for using names you provide to replace other names, maybe to give it a bit more continuity. Also planning on checking out some of the other approaches folks have been posting to try to improve! This was my first attempt at natural language generation.

enkiv2 commented 8 years ago

Awesome! I love working with dreams.

On Sun, Nov 13, 2016 at 4:43 PM Kelly notifications@github.com wrote:

I've written some initial code I'd like to improve upon to generate a novel using r/dreams posts. The first novel is available here: https://github.com/keheitz/NaNoGenMo16/blob/master/horror-diary

This was inspired by attending a Mary Shelley exhibit last month, which discussed that the inspiration for Frankenstein was a dream she had. Turns out that makes sense, because people's dreams are mostly terrifying (especially the ones they post on the internet!) Approach

The code uses the reddit api to write 5000 dream posts to file, then I'm using markovify for building markov models from the posts to generate new sentences. Since a lot of the posts have sentences referencing it is a dream, i.e. "in my dream", I'm stripping those out. The paragraphs sort of seemed like disjointed, creepy diary entries, so I added methods to datestamp each paragraph. Examples:

June 06, 1987 I asked my mom for the International Association for the kids. One by one I dragged the bodies, called out their names, I guess we didn't have the strength to move, it was a square around it with all my might to move this to the middle of her leaving me its unreal. Edit: There were monsters we were picking characters to play and crossed traffic. Suddenly I'm stricken with rage, I have fallen deeply in love with them. At one point and laid down, thinking I'll only rest for a while she sits on top of my life, involving a high dose of mushrooms.

July 06, 1987 Sometimes I even feel good as if it meant anything more. As long as he's chasing them they start running towards the town. Afterwards I jump down the remaining steps on top of a road trip. So for the past few days? In the room toward where I seen small children and mothers/caretakers was there actually a pretty short lived. Then I talked to her and then he was perfectly fine. The last few months back, I had already graduated from college, and I crossed the street looking at this hour. I even feel good as if all the way down as he lives in a wagon, and that i own, but I wanted to do so, but I'm pretty close to the left that leads to a good place to start. The tellers are replaced by iPads to find all the things were. Then my parents and all my life. Sometimes when im about to travel in time again. I was freaked out watching darning needles, knives and syringes to the beach. She went to check my watch and saw the girl began to rip apart the very bottom, and a light breeze. Next Steps

Before the end of the month, I'd like to add a method for using names you provide to replace other names, maybe to give it a bit more continuity. Also planning on checking out some of the other approaches folks have been posting to try to improve! This was my first attempt at natural language generation.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/NaNoGenMo/2016/issues/57#issuecomment-260215099, or mute the thread https://github.com/notifications/unsubscribe-auth/AAd6GaeSHyjnEmJvxb5UOt0dBh9H8U3cks5q94SDgaJpZM4Kmapa .