Skip to content

Commit 1b6a54a

Browse files
committed
all done
1 parent d7b7ff3 commit 1b6a54a

File tree

147 files changed

+4490
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+4490
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
openaiapikey.txt

README.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
1-
# AutoMuseNonFiction
2-
Automatically generate nonfiction content
1+
# AutoMuseBlogger
2+
3+
Automatically generate nonfiction content about any given topic
4+
5+
1. Take a prompt of some sort (natural language instructions) like **"I want a blog about X..."**
6+
2. Brainstorm the structure of the request (list a bunch of sections)
7+
3. Iterate on that list to improve it (is this a good list?)
8+
4. Brainstorm some facts or points to include for each section (repeat this like 2 or 3 times)
9+
5. Write the actual sections
10+
6. Iterate/improve the sections
11+
7. Clean up the final product
12+

blog.txt

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
The printing press is one of the most important inventions in human history. It was invented by Johannes Gutenberg in the 15th century and it revolutionized the way information was disseminated. It allowed for books, pamphlets, and other printed materials to be mass-produced quickly and cheaply. The printing press had a profound impact on religion, politics, and war. It helped to spread religious ideas and beliefs throughout Europe and beyond. It also played a role in political revolutions and the spread of democracy. And finally, it was used to print propaganda during times of war.
2+
3+
The printing press was a game-changer because it made it possible to mass-produce printed materials. This was a huge improvement over earlier printing methods, which were slow and labor-intensive. The printing press quickly spread throughout Europe, and it had a profound impact on the spread of knowledge and the dissemination of information.
4+
5+
One of the most significant impacts of the printing press was the Protestant Reformation. The press allowed for the rapid dissemination of religious texts, which played a key role in the spread of Protestantism. The printing press has continued to evolve over the centuries, and it remains an important tool for communication and information sharing in the modern age.
6+
7+
The printing press is an amazing invention that has had a profound impact on the world. It has helped to spread religious beliefs, political revolutions, and democracy. It has also been used to print propaganda during times of war. The printing press is a essential tool for communication and information sharing in the modern age.
8+
9+
The printing press is often lauded as one of the most important inventions in history. And rightfully so! The printing press was a game changer for religion. It allowed for the mass production of religious texts, which had a profound impact on the spread of religious beliefs. It also allowed for the dissemination of religious ideas and concepts to a much wider audience.
10+
11+
The printing press had a particularly significant impact on the Protestant Reformation. Martin Luther used the printing press to widely distribute his 95 Theses, which challenged the Catholic Church's authority. The publication of Luther's theses sparked a reform movement that led to the formation of the Protestant Church.
12+
13+
The printing press also played a role in the Counter-Reformation, as Catholic leaders used it to print books and pamphlets that defended the Church and its teachings.
14+
15+
In the modern day, the printing press is still used to print religious texts, although its impact is not as great as it once was. Thanks to the printing press, Christianity and other religions were able to spread rapidly throughout the world. It's hard to imagine what the world would be like today without the printing press!
16+
17+
The printing press is a truly amazing invention that has had a profound impact on the world. It's hard to imagine a world without it!
18+
19+
The printing press is often hailed as one of the most important inventions in human history. And it's not hard to see why. The printing press had a profound impact on the political landscape, empowering the people and giving them a greater voice in the political process.
20+
21+
The invention of the printing press in the 15th century made it possible to mass produce printed materials. This had a profound impact on politics, as it meant that more people had access to information and could make informed decisions about political issues.
22+
23+
The printing press also allowed for the spread of new ideas and ideologies, which could lead to political change. In some cases, the printing press was used to spread propaganda and misinformation, which could influence the outcome of political events.
24+
25+
The printing press was a game-changer for politics. It allowed for the dissemination of information and ideas on a much wider scale than ever before. This had the effect of empowering the people and giving them a greater voice in the political process. It also allowed for the growth of political parties and the development of new political ideologies. The printing press is truly one of the most important inventions in human history.
26+
27+
The printing press is often hailed as one of the most important inventions in human history. And it's easy to see why - the ability to mass-produce printed materials changed the world in a myriad of ways. But did you know that the printing press also had a profound impact on warfare?
28+
29+
In the days before the printing press, military commanders had to rely on word of mouth to communicate with their troops. This was often ineffective, as messages would often get distorted or lost in translation. The printing press changed all that, as it allowed for the rapid dissemination of information. This made it possible for military commanders to communicate with their troops more effectively and for propaganda to be used more effectively.
30+
31+
The printing press also allowed for the mass production of maps and other military documents. This was a huge advantage for armies, as it allowed them to plan their campaigns more effectively. The printing press also allowed for the mass production of printed manuals and instructions. This was a major boon for militaries, as it allowed them to outfit entire armies with the same information.
32+
33+
In the modern age, the printing press continues to play an important role in warfare. The mass production of propaganda and other printed materials is a key part of many military campaigns. And the ability to rapidly disseminate information is still a major advantage for militaries around the world.
34+
35+
The modern printing press is a tool that has had a profound impact on society. It was invented in the mid-19th century by Johannes Gutenberg and has revolutionized the way information is disseminated. The printing press has had a particularly significant impact on politics and religion.
36+
37+
The printing press has made it possible for people to share their political views with a wider audience and has played a role in shaping public opinion. It has also allowed for the dissemination of political propaganda and the spread of political movements. The printing press has had a significant impact on religion as well. It has allowed for the spread of religious texts and the dissemination of religious beliefs. It has also played a role in the development of religious institutions and the spread of religious movements.
38+
39+
The printing press has also had a profound impact on war. It has been used to disseminate information about wars and to propaganda. It has also played a role in the development of military technology and the conduct of warfare. The printing press is an important tool in the modern age, with its ability to rapidly disseminate information across the globe.
40+
41+
The future of the printing press is shrouded in potential but fraught with uncertainty. The technology that has revolutionized communication and commerce for centuries is now being challenged by digital alternatives.
42+
43+
The printing press has been in use for over 500 years, and its impact on society has been profound. But the rise of digital technology is threatening its dominance.
44+
45+
The printing press is an essential tool for the dissemination of information. But its future is uncertain, as digital alternatives are increasingly available.
46+
47+
The printing press has been a vital tool for the spread of knowledge and the advancement of civilization. But its future is uncertain in the face of digital technology.
48+
49+
The future of the printing press is shrouded in uncertainty. The industry has been in decline for many years, and it is unclear if it will be able to rebound. Many experts believe that the printing press will eventually be replaced by digital printing technology. However, there are also those who believe that the printing press will continue to play an important role in our society.
50+
51+
It is clear that the future of the printing press is uncertain. But despite the challenges it faces, the printing press remains an essential tool for communication and knowledge dissemination. Only time will tell what role it will play in the future.
52+
53+
The printing press is one of the most significant inventions in human history. It allowed for the dissemination of knowledge and ideas on a much wider scale than ever before. It also played a role in the spread of religion, political thought, and war.
54+
55+
The printing press had a profound impact on society. It allowed for the dissemination of knowledge and ideas on a scale never before seen. It also played a role in the spread of literacy and the development of mass media. The printing press had a significant impact on religion, politics, and war. It helped to spread religious beliefs and practices and allowed for the development of new religious movements. It also facilitated the spread of political ideas and played a role in the outbreak of wars.
56+
57+
Invented in the 15th century, the printing press is often cited as one of the most important inventions in human history. It's impact on society was far-reaching and profound. The printing press allowed for the dissemination of knowledge and ideas on a scale never before seen. It also played a role in the spread of literacy and the development of mass media. The printing press had a significant impact on religion, politics, and war. It helped to spread religious beliefs and practices and allowed for the development of new religious movements. It also facilitated the spread of political ideas and played a role in the outbreak of wars.
58+
59+
The printing press was a game-changer for humanity. It allowed for the spread of knowledge and ideas on a much wider scale than ever before. It also played a role in the spread of religion, political thought, and war. The printing press is truly one of the most significant inventions in human history.

generate_blog.py

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
import re
2+
import os
3+
import openai
4+
import textwrap
5+
from time import time,sleep
6+
from pprint import pprint
7+
8+
9+
def open_file(filepath):
10+
with open(filepath, 'r', encoding='utf-8') as infile:
11+
return infile.read()
12+
13+
14+
def save_file(filepath, content):
15+
with open(filepath, 'w', encoding='utf-8') as outfile:
16+
outfile.write(content)
17+
18+
19+
openai.api_key = open_file('openaiapikey.txt')
20+
21+
22+
def gpt3_completion(prompt, engine='text-davinci-002', temp=0.7, top_p=1.0, tokens=1000, freq_pen=0.0, pres_pen=0.0, stop=['asdfasdf', 'asdasdf']):
23+
max_retry = 5
24+
retry = 0
25+
prompt = prompt.encode(encoding='ASCII',errors='ignore').decode() # force it to fix any unicode errors
26+
while True:
27+
try:
28+
response = openai.Completion.create(
29+
engine=engine,
30+
prompt=prompt,
31+
temperature=temp,
32+
max_tokens=tokens,
33+
top_p=top_p,
34+
frequency_penalty=freq_pen,
35+
presence_penalty=pres_pen,
36+
stop=stop)
37+
text = response['choices'][0]['text'].strip()
38+
#text = re.sub('\s+', ' ', text)
39+
filename = '%s_gpt3.txt' % time()
40+
save_file('gpt3_logs/%s' % filename, prompt + '\n\n==========\n\n' + text)
41+
return text
42+
except Exception as oops:
43+
retry += 1
44+
if retry >= max_retry:
45+
return "GPT3 error: %s" % oops
46+
print('Error communicating with OpenAI:', oops)
47+
sleep(1)
48+
49+
50+
def improve_outline(request, outline):
51+
prompt = open_file('prompt_improve_outline.txt').replace('<<REQUEST>>',request).replace('<<OUTLINE>>', outline)
52+
outline = '1. ' + gpt3_completion(prompt)
53+
return outline
54+
55+
56+
def neural_recall(request, section):
57+
prompt = open_file('prompt_section_research.txt').replace('<<REQUEST>>',request).replace('<<SECTION>>',section)
58+
notes = gpt3_completion(prompt)
59+
return notes
60+
61+
62+
def improve_prose(research, prose):
63+
prompt = open_file('prompt_improve_prose.txt').replace('<<RESEARCH>>',research).replace('<<PROSE>>', prose)
64+
prose = gpt3_completion(prompt)
65+
return prose
66+
67+
68+
if __name__ == '__main__':
69+
request = open_file('request.txt')
70+
# build the outline
71+
prompt = open_file('prompt_outline.txt').replace('<<REQUEST>>',request)
72+
outline = '1. ' + gpt3_completion(prompt)
73+
print('\n\nOUTLINE:', outline)
74+
for i in list(range(0,2)):
75+
outline = improve_outline(request, outline)
76+
print('\n\nIMPROVED OUTLINE:', outline)
77+
outline = outline.replace('\n\n', '\n')
78+
sections = outline.splitlines()
79+
final_blog = list()
80+
for section in sections:
81+
# research
82+
research = ''
83+
print('\n\nSECTION:', section)
84+
for i in list(range(0,2)):
85+
result = neural_recall(request, section)
86+
research = research + '\n%s' % result
87+
print('\n\nRESEARCH:', research)
88+
research = research.strip()
89+
# first draft
90+
prompt = open_file('prompt_section_prose.txt').replace('<<RESEARCH>>', research)
91+
prose = gpt3_completion(prompt)
92+
print('\n\nPROSE:', prose)
93+
for i in list(range(0,2)):
94+
prose = improve_prose(research, prose)
95+
print('\n\nPROSE:', prose)
96+
final_blog.append(prose)
97+
pprint(final_blog)
98+
output = '\n\n'.join(final_blog)
99+
save_file('blog.txt', output)

gpt3_logs/1664019439.9263752_gpt3.txt

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Write a killer blog outline for the following request from a customer.
2+
3+
REQUEST: "I want a cool blog post about the history of Shinto and torii gates in Japan. Like, how did they come up with that idea? What does it mean? What are the coolest ones to see? I'm going to Japan next summer."
4+
5+
Brainstorm a list of sections for this blog post. The outline should meet the customer's request and each section should be highly descriptive.
6+
7+
SECTIONS:
8+
1.
9+
10+
==========
11+
12+
What is Shinto?
13+
2. A Brief History of Shinto
14+
3. What are Torii Gates?
15+
4. The Meaning of Torii Gates
16+
5. The Coolest Torii Gates in Japan

gpt3_logs/1664019598.345472_gpt3.txt

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Write a killer blog outline for the following request from a customer.
2+
3+
REQUEST: "I want a cool blog post about the history of Shinto and torii gates in Japan. Like, how did they come up with that idea? What does it mean? What are the coolest ones to see? I'm going to Japan next summer."
4+
5+
Brainstorm a list of sections for this blog post. The outline should meet the customer's request and each section should be highly descriptive.
6+
7+
SECTIONS:
8+
1.
9+
10+
==========
11+
12+
What is Shinto?
13+
2. A Brief History of Shinto
14+
3. What are Torii Gates?
15+
4. The Significance of Torii Gates
16+
5. The Coolest Torii Gates in Japan

gpt3_logs/1664019600.5607758_gpt3.txt

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
I brainstormed the following list of sections of a blog based on the customer's request. I need to brainstorm to see if there are any improvement I can make to this outline.
2+
3+
REQUEST: "I want a cool blog post about the history of Shinto and torii gates in Japan. Like, how did they come up with that idea? What does it mean? What are the coolest ones to see? I'm going to Japan next summer."
4+
5+
OUTLINE:
6+
1. What is Shinto?
7+
2. A Brief History of Shinto
8+
3. What are Torii Gates?
9+
4. The Significance of Torii Gates
10+
5. The Coolest Torii Gates in Japan
11+
12+
Brainstorm some possible improvements:
13+
14+
1.
15+
16+
==========
17+
18+
What is Shinto?
19+
2. A Brief History of Shinto
20+
3. What are Torii Gates?
21+
4. The Significance of Torii Gates
22+
5. The Coolest Torii Gates in Japan
23+
6. Tips for Visiting Torii Gates in Japan

gpt3_logs/1664019602.7860944_gpt3.txt

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
I brainstormed the following list of sections of a blog based on the customer's request. I need to brainstorm to see if there are any improvement I can make to this outline.
2+
3+
REQUEST: "I want a cool blog post about the history of Shinto and torii gates in Japan. Like, how did they come up with that idea? What does it mean? What are the coolest ones to see? I'm going to Japan next summer."
4+
5+
OUTLINE:
6+
1. What is Shinto?
7+
2. A Brief History of Shinto
8+
3. What are Torii Gates?
9+
4. The Significance of Torii Gates
10+
5. The Coolest Torii Gates in Japan
11+
6. Tips for Visiting Torii Gates in Japan
12+
13+
Brainstorm some possible improvements:
14+
15+
1.
16+
17+
==========
18+
19+
What is Shinto?
20+
2. A Brief History of Shinto
21+
3. What are Torii Gates?
22+
4. The Significance of Torii Gates
23+
5. The Coolest Torii Gates in Japan
24+
6. Tips for Visiting Torii Gates in Japan
25+
7. FAQs about Shinto and Torii Gates

gpt3_logs/1664019606.3078802_gpt3.txt

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
I brainstormed the following list of sections of a blog based on the customer's request. I need to brainstorm to see if there are any improvement I can make to this outline.
2+
3+
REQUEST: "I want a cool blog post about the history of Shinto and torii gates in Japan. Like, how did they come up with that idea? What does it mean? What are the coolest ones to see? I'm going to Japan next summer."
4+
5+
OUTLINE:
6+
1. What is Shinto?
7+
2. A Brief History of Shinto
8+
3. What are Torii Gates?
9+
4. The Significance of Torii Gates
10+
5. The Coolest Torii Gates in Japan
11+
6. Tips for Visiting Torii Gates in Japan
12+
7. FAQs about Shinto and Torii Gates
13+
14+
Brainstorm some possible improvements:
15+
16+
1.
17+
18+
==========
19+
20+
What are the different types of Shinto?
21+
2. A more in-depth history of Shinto
22+
3. What are the different types of Torii Gates?
23+
4. The Significance of Torii Gates in Shinto
24+
5. The Coolest Torii Gates in Japan
25+
6. Tips for Visiting Torii Gates in Japan
26+
7. FAQs about Shinto and Torii Gates

gpt3_logs/1664019608.8319678_gpt3.txt

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
I brainstormed the following list of sections of a blog based on the customer's request. I need to brainstorm to see if there are any improvement I can make to this outline.
2+
3+
REQUEST: "I want a cool blog post about the history of Shinto and torii gates in Japan. Like, how did they come up with that idea? What does it mean? What are the coolest ones to see? I'm going to Japan next summer."
4+
5+
OUTLINE:
6+
1. What are the different types of Shinto?
7+
2. A more in-depth history of Shinto
8+
3. What are the different types of Torii Gates?
9+
4. The Significance of Torii Gates in Shinto
10+
5. The Coolest Torii Gates in Japan
11+
6. Tips for Visiting Torii Gates in Japan
12+
7. FAQs about Shinto and Torii Gates
13+
14+
Brainstorm some possible improvements:
15+
16+
1.
17+
18+
==========
19+
20+
Add more photos and videos to break up the text
21+
2. Write in a more engaging, conversational tone
22+
3. Share personal anecdotes or stories related to Shinto or torii gates
23+
4. Offer practical advice for visitors to Japan
24+
5. Highlight interesting facts or trivia about Shinto or torii gates

gpt3_logs/1664019631.950293_gpt3.txt

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Write a killer blog outline for the following request from a customer.
2+
3+
REQUEST: "I want a cool blog post about the history of Shinto and torii gates in Japan. Like, how did they come up with that idea? What does it mean? What are the coolest ones to see? I'm going to Japan next summer."
4+
5+
Brainstorm a list of sections for this blog post. The outline should meet the customer's request and each section should be highly descriptive.
6+
7+
SECTIONS:
8+
1.
9+
10+
==========
11+
12+
What is Shinto?
13+
2. A Brief History of Shinto
14+
3. The Meaning of Torii Gates
15+
4. The Coolest Torii Gates in Japan

0 commit comments

Comments
 (0)