https://github.com/dbeley/text_generator
Generate text with the help of textgenrnn and gpt-2-simple.
https://github.com/dbeley/text_generator
Last synced: about 20 hours ago
JSON representation
Generate text with the help of textgenrnn and gpt-2-simple.
- Host: GitHub
- URL: https://github.com/dbeley/text_generator
- Owner: dbeley
- License: mit
- Created: 2019-04-26T23:57:49.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-09-30T19:49:46.000Z (over 3 years ago)
- Last Synced: 2025-11-22T14:20:21.907Z (7 months ago)
- Language: Python
- Homepage:
- Size: 105 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# text_generator
## Requirements
- gpt-2-simple
- numpy
- pandas
- requests
- scikit-learn
- textgenrnn
- tqdm
- markovify
- xlrd
- tensorflow
## Installation of the virtualenv (recommended)
```
pipenv install
```
## gpt2_generate
### Help
```
python gpt2_generate.py -h
```
```
usage: gpt2_generate.py [-h] [--debug] [-f FILE] [-i ITERATION]
[-t TEMPERATURE]
Generate text with gpt2_simple
optional arguments:
-h, --help show this help message and exit
--debug Display debugging information
-f FILE, --file FILE Text file to train the model from
-i ITERATION, --iteration ITERATION
Number of iteration for the training. Default = 1
-t TEMPERATURE, --temperature TEMPERATURE
Temperature. Default = 0.5
```
## markovify_generate
### Help
```
python markovify_generate.py -h
```
```
usage: markovify_generate.py [-h] [--debug] [-f FILE]
Generate text with markovify
optional arguments:
-h, --help show this help message and exit
--debug Display debugging information
-f FILE, --file FILE Text file to train the model from
```
## textgenrnn_generate
### Help
```
python textgenrnn_generate.py -h
```
```
usage: textgenrnn_generate.py [-h] [--debug] [-f FILE] [-i ITERATION]
[-n NUMBER] [-t TEMPERATURE]
Generate text with textgenrnn
optional arguments:
-h, --help show this help message and exit
--debug Display debugging information
-f FILE, --file FILE Text file to train the model from
-i ITERATION, --iteration ITERATION
Number of iteration for the training. Default = 1
-n NUMBER, --number NUMBER
Number of string to generate (~3/seconds). Default =
10
-t TEMPERATURE, --temperature TEMPERATURE
Temperature. Default = 0.5
```