katlings, updated 🕥 2022-01-21 20:11:23

pyambic-pentameter

A webapp that Markov-generates poems from plaintext.


Setup:

Drop plain text sources in /generate/data/ as SOURCE_NAME.txt.

pip install -r requirements.txt (Virtualenv recommended.)

You will need to download the pronunciation dictionary once with python -c "import nltk; nltk.download('cmudict')" or you will get the runtime error Resource cmudict not found.

Run with flask run.

(May require some futzing with relative/absolute imports depending on setup.)

Browse to http://localhost:5000 to read poems!

Issues

Bump ipython from 7.5.0 to 7.16.3

opened on 2022-01-21 20:11:23 by dependabot[bot]

Bumps ipython from 7.5.0 to 7.16.3.

Commits


Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/katlings/pyambic-pentameter/network/alerts).

Improvement: flexible syllable stress

opened on 2020-01-30 03:56:14 by katlings

The poem template will be a little more general if it's able to interpret "stressed syllable", "unstressed syllable", and "a syllable where stress doesn't matter".

Specifically this would be a good step towards refactoring haiku generation (currently special-cased to hell)

Improvement: Higher-order Markov generation

opened on 2020-01-15 21:34:50 by katlings

The current setup only uses first-order Markov generation but some of the corpuses are more than large enough to support second-order (or more). Theoretically it's not a hard adjustment to make, it just gets a little tricky to reason about with going backwards and all.

Extension: Rewrite a poem

opened on 2020-01-15 21:33:09 by katlings

Input a poem(/song/text), use the pronunciation dictionary to extract the syllable and/or rhyme pattern of the input, and then generate new words that fit the same scheme.

Inspired by https://twitter.com/Adason15th/status/1217554175841619968

Handling words the pronunciation dictionary doesn't know (e.g. "Brightside") could get tricky. A good first approach would be to use the "syllable guess" function to estimate the number of syllables. It could be a fun rabbit hole to try to interpret the syllable pattern of a word based on the rest of the line and the lines around it. It could be another fun rabbit hole to specifically handle compound words.

TODO: Refactor package structure

opened on 2020-01-15 21:24:24 by katlings

Once upon a time I made some rudimentary attempts at getting this repo to properly behave like a package, but it could use some improvements (e.g. relative/absolute imports are pretty iffy right now). It would be great, for example, to easily be able to generate poems from a REPL/the command line without needing to launch the web interface.

The generate code could also use a simplifying refactor in general to make it more understandable/usable.