The code for generating pokemon names was forked from this repository. The generated model is used to expose its functionality as part of a REST API.
The model generates new unique Pokemon names with Keras using a recurrent neural network (LSTM). Written as a generic text generator that can be used to generate lines of poetry, other names, or just text in general. It all depends on what it gets input.
Train the model with the jupyter notebook in ./training/name_generator.ipynb. It will produce a file which stores the model used to generate new names in ./training/model.h5.
To start the jupyter notebook:
jupyter notebookNotebook with code and explainations
| Purndew | Chingoos | Nodow | Fregaycha |
| Magmagly | Cteenidel | Browodon | Noinga |
| Ferfeon | Midgeos | Deowwar | Harouthal |
| Spera | Kleffas | Picorno | Suorthe |
| Ponytau | Jellpid | Mewable | Meetty |
| Phound | Passir | Golduzon | Frislask |
Copy the files that are used for training into the api application:
cp training/input/names.txt api/static
cp training/model.h5 api/static/Create a virtualenv and activate it:
python3 -m venv venv
. venv/bin/activateOr windows:
py -3 -m venv venv
venv\Scripts\activate.batInstall all the dependencies.
pip3 install -r requirements.txtStart the API
python3 api/main.pyBuild the Docker container.
docker build -t name-generator .Run the docker container and map the internal port to external port-
docker run -p 5000:5000/tcp name-generatorcoverage run -m pytest/names?amount=<amount>
GET
| Parameter | Type | Required | Default Value | Description |
|---|---|---|---|---|
amount |
int |
no |
1 |
amount of Pokemon names |
http://localhost:5000/?amount=5["Goigon", "Tangros", "Kalmiphan", "Camermosh", "Wincino"]Endpoints are documented using Swagger. To access the interactive documentation got to:
/swagger