text_rewritter
1.0.0
Using LangChain and GPT3 to rewrite a large text chunk by chunk (remembering previous modifications to take them into account).
The text is sliced into chunks which are processed in order with the following prompt (shortened for the first two calls):
You are rewriting a novel, rewrite the full extract according to the instructions:
INSTRUCTIONS:
{instructions}
EXAMPLES OF REWRITINGS FROM OTHER PARTS OF THE TEXT:
{previous_rewrites}
EXTRACT TO REWRITE:
{previous_chunk}
{chunk}
REWRITTEN EXTRACT:
{previous_rewrite}
instructions is the user-provided prompt
previous_rewrites are examples of rewrites whose chunk is similar to the provided chunk
previous_chunk/previous_rewrite is the previous chunk of text (insuring continuity)
chunk is the current chunk of text
mentalism_index conda env to get the dependenciesdata folder (it contains examples of prompts and results)rewrite.py.I recommend testing your prompts on smaller texts as it can take many trials before finding a good prompt.