Questions tagged [text-generation]

There are many text generators for website text, e.g. Lorem Ipsum.

There can be text generators for name and other data required for programming, there can be OMR Sheet Generators which generate the sheet with variable data such as roll number, exam id and mcq questions with pre-filled data.

You can learn more by reading this.

83 questions
7
votes
1 answer

Minimal working example or tutorial showing how to use Pytorch's nn.TransformerDecoder for batch text generation in training and inference modes?

I want to solve a sequence-to-sequence text generation task (e.g. question answering, language translation, etc.). For the purposes of this question, you may assume that I already have the input part already handled. (I already have a tensor of…
4
votes
1 answer

NLP - Paraphrase extraction in Python

I am trying to develop a NLP model, which takes something like you have high levels of cholesterol(this will be a tag) as input and has to output something like you have high levels of cholesterol, you need to have a low-salt diet that emphasizes…
4
votes
1 answer

Can someone please explain what this sample function is upto?

So there is a function in Dino_Name_Generator at Deeplearning.ai notebook def sample(parameters, char_to_ix, seed): # Retrieve parameters and relevant shapes from "parameters" dictionary Waa, Wax, Wya, by, b = parameters['Waa'],…
thanatoz
  • 2,495
  • 4
  • 20
  • 41
4
votes
1 answer

From regression neural network to generative one

I made a neural network with word embedding, RNN and some dense layers to predict the score of computer game reviews based on the title of the game. I used Keras in Python. I was wondering if it would be somehow possible to transform my model into a…
Viktor
  • 860
  • 1
  • 6
  • 17
4
votes
1 answer

LLMs for text generation

We know that AI is rapidly growing. do we have any large language models (LLMs) to process images, pdf documents directly (fine-tune approach) for text generation tasks?
3
votes
1 answer

Pytorch: understanding the purpose of each argument in the forward function of nn.TransformerDecoder

According to https://pytorch.org/docs/stable/generated/torch.nn.TransformerDecoder.html, the forward function of nn.TransformerDecoder contemplates the following arguments: tgt – the sequence to the decoder (required). memory – the sequence from…
3
votes
2 answers

How to generate a sentence with exactly N words?

Thanks to GPT2 pretrained model now it is possible to generate meaningful sequence of words with or without prefix. However a sentence should end with a proper endings (.,!,?). I am just wondering how to generate a sentence (with proper ending) of…
user185597
  • 31
  • 2
3
votes
1 answer

Choosing the size of Character Embedding for Language Generation models

I am working on a character-based Language Generator, loosely based on this tutorial on the TensorFlow 2.0 website. Following the example, I am using an Embedding() layer to generate character embeddings: I want my model to generate text character…
Leevo
  • 6,445
  • 3
  • 18
  • 52
3
votes
0 answers

Back-Translation model for German and English

Do you know of any pre-trained models for back translation between German and English? I am aware that there are ways to include a monolingual corpus into the training of a machine translation model (often referred to as back translation). I am…
3
votes
2 answers

What NN architecture to predict fantasy character names based on description?

I would like to build a neural network to predict a fantasy character name given a description. Like 'Scar-faced long haired elf warrior' -> 'Glorfindel' I have a dataset of about 12,000 fantasy names and description from various fantasy works. I …
freediver
  • 141
  • 2
3
votes
1 answer

Choosing a right algorithm for template-based text generation

I am doing a text generation project -- the task is to basically represent the statistical data in a readable way. The way I decided to go about this is template-based: each data type has a template for how sentence should be formed and what…
3
votes
0 answers

Help with the following error: Variable already exists, disallowed. Did you mean to set reuse=True in VarScope?

I am not sure how to handle this error. This is from an RNN tutorial found here. I vaguely understand that the variables need to be able to be reused, but I don't know how to implement this fix. Train.py ran for several hours and finished…
3
votes
0 answers

How to train next token prediction text generation model using Pytorch Transformer classes?

For learning purposes, I have tried to train a text generation model at a tiny scale in this notebook using RNN/LSTM model. But I am not able to take it further to use transformer model. Can anyone help me understand if I can use this data setup for…
3
votes
1 answer

Fine-tuning a pre-trained LLM for question-answering

Objective My goal is to fine-tune a pre-trained LLM on a dataset about Manchester United's (MU's) 2021/22 season (they had a poor season). I want to be able to prompt the fine-tuned model with questions such as "How can MU improve?", or "What are…
3
votes
1 answer

How do we evaluate the outputs of text generation models?

Evaluation of a wide variety of natural language generation (NLG) tasks is difficult. For instance, for a question answering model, it is hard for a human to quantify how well the model has answered a particular question. Doing this at scale is even…
1
2 3 4 5 6