A web app that sends text to OpenAI for copy editing.
This web app helps you utilize OpenAI's GPT3.5 engine to copy edit your documents. Submit a .txt file with writing of any kind, and the site will return a document that has been edited for spelling, grammar, punctuation, syntax, and other specifications of the Chicago Manual of Style.While ChatGPT and the OpenAI API have length limitations for submissions, this web app will handle almost any length behind the scenes, breaking down large documents into chunks of about one thousand words, submitting them in successive API calls, then returning the results in one file. Be mindful that this app breaks documents down by paragraph, so if your document has huge paragraphs (specifically, two successive paragraphs totaling more than about 1500 words), then it may resort in an error.
Included in this repository is the single app folder "copyeditor" which can be installed into a standard Django project environment.Remember to alter the Django project's settings.py file:
INSTALLED_APPS = ['copyeditor']
AUTH_USER_MODEL = "copyeditor.User"
And alter the the project's urls.py file to include the app URLs:
from django.urls import path, include
urlpatterns = [path("", include("copyeditor.urls"))]
The requirements.txt includes three required libraries: Diff-match-patch, Python-docx, and Marvin. Diff-match-patch, and Python-docx are used to manage text comparison and creating a downloadable Word file, while the Marvin library will manage other dependencies to make API calls to large language models.
If you don't have an API key, head to OpenAI's API page and create an account. You will also need to set up a payment method, as the API does cost a negligible amount for usage. Once you obtain an API key, save it in your account settings.How much does it cost? The short answer is, very little.
This app is using the gpt-3.5-turbo-instruct model, which costs $0.0015 per one thousand tokens of usage. Analysis of one thousand words will use about 2,500 tokens. So, editing a full-length article will run you about ten cents. A novel of one hundred thousand words will run you about half the cost of a cup of coffee.