Almost state of art text generation library with python
Text Gen
Text gen is a python library that allow you build a custom text generation model with ease smile Something sweet built with Tensorflow and Pytorch(coming soon)
How to use it
Install text-gen
pip install -U text-gen
import the library
from text_gen import ten_textgen as ttg
Load your data. your data must be in a text format.
Download the example data from the example folder
load data
data = 'rl.csv'
text = ttg.loaddata(data)
build our Model Architeture
pipeline = ttg.tentext(text)
seq_text = pipeline.sequence(padding_method = 'pre')
configg = pipeline.configmodel(seq_text, lstmlayer = 128, activation = 'softmax', dropout = 0.25)
train model
model_history = pipeline.fit(loss = 'categorical_crossentropy', optimizer = 'adam', batch = 300, metrics