Skip to content

quickly create adapted versions of texts (plain language, paraphrased, reduced reading level) using OpenAI's API

Notifications You must be signed in to change notification settings

FrozenBurrito/easytext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

easytext.py

A simple python script to quickly create adapted versions of texts (plain language, paraphrased, reduced reading level) using OpenAI's API.

Description

  • easytext.py is a python script which uses OpenAI's API endpoint to shift the creation of adapted texts (plain language, paraphrased, reduced reading level) from a high impact, high teacher effort strategy to a high impact, low teacher effort strategy.
  • Providing adapted texts is an educational practice grounded in the SIOP Model, Krashen's Theories, and UDL. See Educational Rationale section below for more information.
  • Input: text file (.txt) with paragraphs separated by blank lines (\n\n)
  • Output: markdown file (.md) showing main text displayed side-by-side with paraphrased version and paragraph numbers.
    • Note that paragraph numbers are an important text feature for supporting speaking and listening activities.
    • Output can be quickly converted to a Google Doc by pasting rendered markdown input a Google Doc.
  • Connects to OpenAI's API endpoints (OpenAI API Key required to use)

Educational Rationale

Providing adapted texts is an educational practice grounded in the SIOP Model, Krashen's Theories, and UDL.

Screenshot

app screenshot        

Setup and Usage

Cloning and Environment Setup

  • Windows
git clone https://github.com/FrozenBurrito/easytext.git
cd easytext
python -m venv .
scripts\activate.bat 
pip install -r requirements.txt

Changing the .env file (connecting to OpenAI's API endpoint)

  • Rename template.env to .env
  • Create an OpenAI Account and activate API access.
  • Add your Organization ID and OpenAI API Key to the .env file
    • OPENAI_API_KEY = "YOUR API KEY"
    • OPENAI_ORG_ID = "YOUR API KEY"
  • Create a prompt for paraphrasing in the .env file
    • PROMPT = "Create a simplified version of the following paragraphs (5th grade level): "
    • This is only an example prompt. Try several different prompts for best results.

Usage

Input text file should contain paragraphs separated by '\n\n' (blank line between two paragraphs)

python easytext.py [input text file path]

Rendered version of output markdown (.md) can be pasted directly into Google Docs or converted into PDF, ODT, or .DOCX using pandoc.

Authors

J Mo, frozenburrito

Ideas for Future Features (To Do List)

  • To do list items are noted in the code comments.

Helpful Python Libraries

Helpful Links and Resources

About

quickly create adapted versions of texts (plain language, paraphrased, reduced reading level) using OpenAI's API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages