Artifical intelligence is already being used to write entire eBooks and articles, so the natural next step was to write entire Wikipedias.
I know, Wikipedia is struggling as it is, the last thing it needs is something making it even more redundant.
Too bad. I made a GPT-4 wrapper that converts a single text prompt containing a topic into a full sized, interconnected encylopedia with 100+ pages.
There’s two ways of looking at this:
- A procedural Wikipedia generator
- A text to Wikipedia generator
How it works
- A nested dictionary representing the page hierarchy is either pre-defined or generated.
- This hierarchy is traversed recursively
- For each ‘leaf topic’, a full markdown page is constructed according to predefined set of rules.
def recursiveFile(parent):
"""Recursively traverses nested dictionairy
Create list -> Parse list -> Generate full Markdown w/ openAI API"""
for topic in parent:
if isInstance(parent[topic], list):
file_name = sanitizeTopicName(topic)
createMDfile(file_name)
else:
recursiveFile(parent[topic])
Was this Medium article AI generated? I guess we’ll never know :)