You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# [How to Build a Text Generator using Keras in Python](https://www.thepythoncode.com/article/text-generation-keras-python)
2
2
To run this:
3
3
-`pip3 install -r requirements.txt`
4
-
- To use pre-trained text generator model that was trained on Alice's wonderland text book:
4
+
- To use pre-trained text generator model that was trained on Alice's wonderland text book or Python Code:
5
5
```
6
6
python generate.py --help
7
7
```
8
-
**Output:**
8
+
This will prompt you with the choice, seed and number of characters you want!
9
+
Here is an example on Alice's wonderland with 200 characters:
9
10
```
10
-
usage: generate.py [-h] [-n N_CHARS] seed
11
-
12
-
Text generator that was trained on Alice's Adventures in the Wonderland book.
13
-
14
-
positional arguments:
15
-
seed Seed text to start with, can be any english text, but
16
-
it's preferable you take from the book itself.
17
-
18
-
optional arguments:
19
-
-h, --help show this help message and exit
20
-
-n N_CHARS, --n-chars N_CHARS
21
-
Number of characters to generate, default is 200.
22
-
```
23
-
Generating 200 characters with that seed:
24
-
```
25
-
python generate.py "down down down there was nothing else to do so alice soon began talking again " -n 200
11
+
Generated text:
12
+
the duchess asked to the dormouse she wanted about for the world all her life i dont know what to think that it was so much sort of mine for the world a little like a stalking and was going to the mou
the duchess asked to the dormouse she wanted about for the world all her life i dont know what to think that it was so much sort of mine for the world a little like a stalking and was going to the mou
0 commit comments