Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mechanical top-down novel generation #94

Open
ghost opened this issue Nov 30, 2018 · 2 comments
Open

mechanical top-down novel generation #94

ghost opened this issue Nov 30, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Nov 30, 2018

I made a couple Python scripts that parse text for word to word weights, and then uses those edges to build a novel in a very top-down, mechanical way by:

  1. Generating a set of main and secondary characters and a narrator, each with a tag to load sets of word to word edge weights (from ParseText.py) for generating sentences
  2. Generating a set of scenes by choosing a pair of characters to interact, with each main character having a scene with most other main characters (up to twice), and each secondary character having a scene with a third of all main characters
  3. Each scene alternates a paragraph from the narrator, then one character then another until a minimum number of words has been reached (50,000 words / number of scenes).
  4. Each paragraph is a set of sentences starting either with a random capitalized word, or a topic chosen from the nouns in the previous paragraph

You can see the code here, including a sample novel: request, anything, and kindness.txt:

Chapter 0: Jackson Morris and Malachi discuss side and side


Third. Im very dark common contrasts strongly of the backs seemed likely to a child, it as that they said Holmes pushed the dollars won the change will do what I pieced on the next to Joe alone with tears filled my spirit, as yet discovered that each side of purely speculative thought he could see, sighing heavily, whom he's side, O me. Belemnite that best nurses, colouring with her. 


"There is the other side you, why he came into our young friend Jonathan still advanced to Tate Hill, having paid for I know of the multitude of forest." said Jackson Morris. "Turning to my head, and give to triumph! Answer me out. That has not contradict her head is arranged that you say that side in doubt as I wonder if wrapped it seemed to me right across so far behind, that lay his position."


"I got one of gaslight or other side, theoretical and glimmer from her an equal candour, she read it again and she added." said Malachi. "Revueltas and have always breaks from Nebo and then, that Mulligan cad he find one who took Stephens ear, and explained to Simonlionel first countess of energy can have put query, and hands for the ottoman."


The gaslight sprang up in the service in degree of himself in his fingers in a shudder ran on the constancy through them. Dormouse, and unsatisfied, practising. Confidentially You know how much delighted with Paris is also true that might make him to be that all sorts of Four Hundred feet, I dressed it was standing near it would not give me to-morrow? Ophelia was the political morality of Pumblechook being. Us two or convenience until the danger, well know by the peoples. 
@hugovk
Copy link
Member

hugovk commented Nov 30, 2018

Well done!

Here's a link to the same sample novel with line breaks:

https://raw.githubusercontent.com/mattdmarch/nanogenmo2018/master/request%2C%20anything%2C%20and%20kindness.txt

@ghost
Copy link
Author

ghost commented Nov 30, 2018

Thanks! This was fun. Big thank you to everyone organizing (and participating)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant