-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated readme and added link to source
- Loading branch information
1 parent
ac115d7
commit d2274b5
Showing
2 changed files
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,13 @@ | ||
| # gpt-2-poetry | ||
|
|
||
| ## Try the [demo](https://kylemcdonald.github.io/gpt-2-poetry/). | ||
|
|
||
| I used [download-urls.py](https://gist.github.com/kylemcdonald/3cbd09752e340849e4b3cb4f12dd8c85) to quickly download the HTML from [poetryfoundation.org](poetryfoundation.org) based on the urls in `romantic-urls.txt`. | ||
|
|
||
| Then I used `Parse Poetry.ipynb` to parse the HTML and extract the title, author, and poem. There are some glitches here with newlines being rendered in some places they shouldn't, and not being rendered in places where they should. This notebook saves a bunch of text files to `output/` that include metadata as the first few lines. | ||
|
|
||
| Then I used `Generate GPT-2.ipynb` to generate poems based on random chunks from the poems and the seed words. This notebook saves files to `poems.json` and `generated.json`. To run this notebook, first get [GPT-2](https://github.com/openai/gpt-2/) running, and drop the notebook in the `gpt-2/src/` directory. | ||
|
|
||
| Both Python notebooks import from `utils` which I have separately pushed [here](http://github.com/kylemcdonald/python-utils). | ||
|
|
||
| Finally, I load `generated.json` and `poems.json` with JavaScript in `index.html` and display the results. |