Coder Social home page Coder Social logo

kaizengrowth / oulipo_package Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 1.12 MB

Testing: my first try at publishing my Python poetry NLP library as a package to Github Container Registry

Home Page: http://poetryplus.xyz/

Python 98.31% Dockerfile 1.69%
oulipo poetry spacy-nlp

oulipo_package's Introduction

Oulipo Variations

Oulipo Variations is a Python library for generating variations of text based on Oulipo text transformer logic. This library provides sophisticated text manipulations, including lemmatization, verb adjustments, and dynamic rhyming functionalities.

To use the minimal web GUI, go to: http://poetryplux.xyz

Installation

From GitHub

To install the latest version directly from GitHub:

pip install git+https://github.com/kaizengrowth/oulipo_package.git

From Source

Clone this repository to your local machine using:

git clone https://github.com/kaizengrowth/oulipo_package.git

Navigate to the cloned directory:

cd oulipo_package

Install the required dependencies:

pip install -r requirements.txt

Make sure to have installed this version of the spaCy NLP model (already installed if using Docker package):

python -m spacy download en_core_web_sm

Using Docker

To use the Docker container for Oulipo Variations, first ensure you are logged into GitHub Packages:

echo "YOUR_GITHUB_TOKEN" | docker login ghcr.io -u YOUR_GITHUB_USERNAME --password-stdin

You can access this package along with instructions here: https://github.com/kaizengrowth/oulipo_package/pkgs/container/oulipo_package%2Foulipo

Usage

Main Script

The main.py script is the entry point to the package. It supports various operations which can be executed based on the provided command-line arguments.

Command-Line Arguments

  • --load [PATH] - Load data from a specified JSON file and filter verbs.
  • --process [PATH] - Process text from a specified file.
  • --lemmatize - Apply lemmatization to the processed text (must be used in conjunction with --process).
  • --rhyme - Replace every seventh word with a rhyme in the processed text (can be used after --process). -- '--generate_music' - Generate a music sequence from the text (must be used in conjunction with --process). -- '--scramble_stanzas' - Scramble the text to create random variations (must be used in conjunction with --process).

Examples

Load and process data:

python main.py --load path/to/your/data.json

Process text with lemmatization:

python main.py --process path/to/your/text.txt --lemmatize

Replace every seventh word with a rhyme:

python main.py --process path/to/your/text.txt --rhyme

Generate music from poem:

python main.py --process path/to/your/text.txt --generate_music

Scramble stanzas:

python main.py --process path/to/your/text.txt --scramble_text

Contributing

Contributions are welcome! For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

oulipo_package's People

Contributors

kaizengrowth avatar

Watchers

 avatar Kostas Georgiou 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.