# Sentence generator

**URL:** <https://community.konduit.ai/t/sentence-generator/2259>\
**Category:** ND4J\
**Created:** [February 21, 2023, 12:39pm UTC](https://community.konduit.ai/t/sentence-generator/2259 "2023-02-21T12:39:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bstrdn](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/bstrdn/32/1039_2.png) [@bstrdn](https://community.konduit.ai/u/bstrdn)\
**Post date:** [February 21, 2023, 12:39pm UTC](https://community.konduit.ai/t/sentence-generator/2259/1 "2023-02-21T12:39:07Z")

</div>

How generate new sentences based on a set of existing sentences using deeplearning4j?  
Where can i see some examples?

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [February 21, 2023, 12:43pm UTC](https://community.konduit.ai/t/sentence-generator/2259/2 "2023-02-21T12:43:44Z")

</div>

@bstrdn don’t expect GPT: [deeplearning4j-examples/GenerateTxtCharCompGraphModel.java at 96e51a98dcfb831bdc89e2a44a229554164f19c0 · deeplearning4j/deeplearning4j-examples · GitHub](https://github.com/deeplearning4j/deeplearning4j-examples/blob/96e51a98dcfb831bdc89e2a44a229554164f19c0/dl4j-examples/src/main/java/org/deeplearning4j/examples/advanced/modelling/charmodelling/generatetext/GenerateTxtCharCompGraphModel.java)

We’re working on some transformers improvements + examples.

We have to setup the tokenizers and the like and do some more testing but we also have model import + examples in the works for gpt various architectures: [omnihub-zoo/samediff at main · KonduitAI/omnihub-zoo · GitHub](https://github.com/KonduitAI/omnihub-zoo/tree/main/samediff)

---

<div class="post-metadata">

**Author:** ![thomas](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@thomas](https://community.konduit.ai/u/thomas)\
**Post date:** [February 22, 2023, 6:04pm UTC](https://community.konduit.ai/t/sentence-generator/2259/3 "2023-02-22T18:04:59Z")

</div>

Hi,

@bstrdn i will try to create a text generator in the next weeks, i have first success with a transformer model. i think if i extend the architecutre with a reccurent attention layer and a new iterator it could also learn like gpt. but like @agibsonccc said don’t expect gpt quality. i have now a 12 % language understanding after 2 days of gpu on my 3 layer transformer with 256 embedding. so it needs a lot of data and training to get good results.

if you would like to work together for an text generator feel free to contact.

Best regards

Thomas

---

<div class="post-metadata">

**Author:** ![bstrdn](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/bstrdn/32/1039_2.png) [@bstrdn](https://community.konduit.ai/u/bstrdn)\
**Post date:** [February 22, 2023, 7:16pm UTC](https://community.konduit.ai/t/sentence-generator/2259/4 "2023-02-22T19:16:26Z")

</div>

Hi Thomas!

Thank you for the answer! I’m a beginner in this topic, so I can’t help yet. Actually, I was just wondering if there is any simple functionality where I can quickly generate a model by inputting text.

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [February 22, 2023, 9:52pm UTC](https://community.konduit.ai/t/sentence-generator/2259/5 "2023-02-22T21:52:05Z")

</div>

@thomas great to hear! We’ll have an improved transformer for the next release.  
I’m in the process of rewriting those with more knobs. I also want to add better kernels for gpus. NVIDIA recently open sourced some very nice transformer kernels I’ll probably integrate.

I also plan on spending some time on some transformers demos. I’d love to learn more about your results and what you found hard. Thanks!

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [February 22, 2023, 9:53pm UTC](https://community.konduit.ai/t/sentence-generator/2259/6 "2023-02-22T21:53:11Z")

</div>

@TomHillman1 we’ll be importing gpt and other kinds of transformer models. After we have those weights it’ll be much easier to build demos for that. First I want to do a pass on making the transformers (attention) code more performant.
