Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aajanki/kalevala-rnn
Recurrent neural network imitates Kalevala
https://github.com/aajanki/kalevala-rnn
char-rnn keras neural-network tensorflowjs text-generation
Last synced: about 2 months ago
JSON representation
Recurrent neural network imitates Kalevala
- Host: GitHub
- URL: https://github.com/aajanki/kalevala-rnn
- Owner: aajanki
- License: mit
- Created: 2018-10-15T17:34:58.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-05T05:34:12.000Z (almost 2 years ago)
- Last Synced: 2024-04-24T03:01:44.855Z (9 months ago)
- Topics: char-rnn, keras, neural-network, tensorflowjs, text-generation
- Language: Python
- Homepage: https://säesampo.fi
- Size: 8.1 MB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Recurrent neural network text generation
This project trains a recurrent neural network (RNN) that generates
text imitating the style of
[Kalevala](https://en.wikipedia.org/wiki/Kalevala) and
[Kanteletar](https://en.wikipedia.org/wiki/Kanteletar).A character level RNN is implemented using Keras. The trained model is
a stateful RNN with two LSTM layers.## Usage
Prepare the environment:
```
npm install
pipenv install
pipenv shell
```Training:
```
python -m src.preprocess
python -m src.train
python -m src.convert2tfjs "weights/2020-07-07T21:19:37/" # <- replace the path!
```Generating text from a trained model:
```
python -m src.sample -n 1000 --temperature 0.4 --preseed "Sanoi vanha Väinämöinen" weights/
```## Run the app
```
npm run start
```## Deploying
```
npm run zip
```Upload saesampo.zip to AWS Amplify.
## License
MIT license
The texts of Kalevala and Kanteletar included in the data subdirectory
are in public domain.