build a text generation model
Project description
Text Gen :goat:
Almost State-of-the-art Text Generation library
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 - This is the brain of rosalove ai(rosalove.xyz)
How to use it
pip install -U text-gen
from text_gen import ten_textgen as ttg
load data
data = 'rosalove.csv'
text = ttg.loaddata(data)
parameters
activation = 'softmax'
lstmlayer = 128
padding_method = 'pre'
loss='categorical_crossentropy'
optimizer='adam'
metrics='accuracy'
epochs=100
verbose = 0
patience = 10
batch = 300
pipeline = ttg.tentext(text)
seq_text = pipeline.sequence(padding_method)
configg = pipeline.configmodel(seq_text, lstmlayer, activation)
train model
model_history = pipeline.fit(loss = loss, optimizer = optimizer, batch = batch, metrics = metrics, epochs = epochs, verbose = 0, patience = patience)
generate text using the phrase
pipeline.predict('hello love')
plot loss and accuracy
pipeline.plot_loss_accuracy()
Hyper parameter optimization
pipeline.hyper_params(epochs = 100)
Give us a star :star: 🐉
Contributors
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
text_gen-0.8.0.tar.gz
(5.0 kB
view hashes)