This repo takes ~200 stories from WikiNovelPlots, alters them using GPT-3, and then presents them as a quiz in a Hugo site using quizdown.
input | step | output |
---|---|---|
WikiNovelPlots | N/A, the novel summaries were already copied to this repo | summaries_clean.pkl |
summaries_clean.pkl |
get_gpt_summaries.py |
summaries_clean_700_to_710_with_gpt.pkl |
summaries_clean_700_to_710_with_gpt.pkl |
clean_gpt_summaries.py |
summaries_clean_700_to_710_with_gpt_clean.pkl |
summaries_clean_700_to_710_with_gpt_clean.pkl |
generate_quiz.py |
quizdown.md |
The code (see /scripts/get_gpt_summaries.py
) below was used to alter each summary. I made 233 requests and it cost me $4.29.
PROMPT = 'Summarize and expand the following story to make it original, surreal, and magical:\n\n'
def get_gpt_summary(summary_clean):
response = openai.Completion.create(
engine="text-davinci-001",
prompt=f"{PROMPT}{summary_clean}",
temperature=1,
max_tokens=300,
top_p=0.5,
frequency_penalty=1,
presence_penalty=1
)
return response.get('choices')[0]['text']
- some before & after plots are identical
- plots are too long
- some altered plots are obvious, e.g. missing parentheses, much shorter
- choose shorter plots, around ~300 characters
- skip plots with parentheses
- make before & after the same number of sentences
- prompt with just first two(?) sentences and generate the rest instead of feeding the entire plot
- add text-to-image pictures