Would you like to change your text or text to the style of a famous author?
i am using OpenAI Playground and OpenAI API.
The method I offer you to change one author’s tone to another is just one possible way to convert a word document of your work to another style. Other methods of converting text style and tone require a bit more complex training.
The concept behind this piece is that instead of getting a large training set of data, you simply describe the style you want to write the AI in, and expect it.
The following tutorial finally provides a piece of code that can be used to import a word document and convert the text in that document to another writing style.
Step 1: Change the document name to your word document, provide the directory path
Step 2: Change the prompts telling the AI what to do
Change your writing style to famous author styles.
First, you’ll have to do your homework and describe the way any other author writes like Dan Brown writes in a suspenseful and suspenseful style.
For example, to rewrite your work in a mysterious and mysterious style:
prompt="in a suspenseful and mysterious style
However, without describing the style of a famous writer, you can have some fun with OpeanAi and change the cues to write in a humorous or satirical writing style.
For example, to rewrite your work in a satirical style:
prompt="in a sarcastic style
complete code is below
you have to install pip
docxand get one
openai API key will work before this code.
from docx import Document
openai.api_key = "YOUR OPEN AI API KEY"
doc = Document('filename.docx')
for para in doc.paragraphs:
content = para.text
results = openai.Completion.create(
prompt="in a suspensful and mysterious style rewrite text below\n"+ content +"",
response = dict(results)
openai_response = response['choices']
Remember this is an AI interpretation, it can come up with anything.
Have fun with it 🙂 I had.
#Rewrite #work #authors #style #OpenAI #Python #Christopher #Collins #August