A Web API implementation using a narrative outline to generate context-free text.
C# ASP
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.vs/narrative-engine/v14
narrativeEngine
README.md
narrative-engine.sln

README.md

Introduction


Narrative-Engine is a Web API implementation for generating texts according to a predefined narrative outline. The text itself is randomized from building blocks containing either expressions (building block sequences) or values (strings).

This allows us to create random text generators that actually make some kind of sense (or not, if that's what you prefer).

Example Config:


The narrative of this example config tells us that someone did something against someone or something. Each block/part in the narrative is resolved separately, and if the part is one or more expressions it will recurse into those parts as well.

{
	"Narrative": [
	    "someone deed target"
	],
	"Parts":[{
	    "Name": "someone",
		"Values": [
			"Erdogan",
			"Jane",
			"Joe",
			"Khadafi",
			"Dr. Strangelove",
			"Bruce Wayne",
			"Batman"
		]},
		{
	    "Name": "deed",
	    "Values": [
	        "bought",
		    "ate",
		    "poked",
		    "completely destroyed",
		    "surfed on",
		    "built"
        ]},
		{
		"Name": "target",
		"Expressions": [
			"size animal",
		]},
		{
		"Name": "size",
		"Values": [
			"a small",
			"a large",
			"a tiny",
			"a gigantic"
		]},
		{
		"Name": "animal",
		"Values": [
			"cat.",
			"dog.",
			"dinosaur.",
			"snake.",
			"bunny.",
			"cow."
		]},
    ]
}

Example outputs:


Based on the example configuration above, the output received would look something like this:

  • Dr. Strangelove poked a gigantic bunny
  • Khadafi poked a large cow.
  • Erdogan completely destroyed a small dinosaur.
  • Khadafi bought a small dog.

Why would anyone want to use this?


Well, there's probably a lot of reasons, like creating fake articles, novel pages or what not. A popular example, which uses Dada Engine and not narrative-engine, is @LisaWray's project for generating bogus text snippets that look like they are from the novel Fifty shades of Grey.