Giter Site home page Giter Site logo

frozenburrito / easytext Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 298 KB

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

Python 100.00%
education english-learners openai-api paraphrase plain-language adapted-text

easytext's Introduction

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

Jon Morris, 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

easytext's People

Contributors

frozenburrito avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.