I'm using fine-tuned T5 model for performing spell checks in my dataset of consisting of reviews. However, I'm facing an issue where the model when performing spell checks does not give entire string as an output or sometimes repeats the phrases of the given review. It is not in large amounts but there do exists some reviews. During the fine-tuning of the model, the training and validation losses were 0.0003 and 0.0002 respectively. I have attached my code and 2 reviews as well for your reference. class ReviewDataset(Dataset): def __init__(self, texts): self.inputs = ["fix: " + text for text in texts] def __len__(self): return len(self.inputs) def __getitem__(self, idx): return self.inputs[idx] def collate_fn(batch): encodings = tokenizer( batch, padding=True, truncation=True, max_length=128, return_tensors="pt" ) return encodings The for loop which performs the task is: all_predictions = [] with torch.no_grad(): for batch in dataloader: input_ids = batch["input_ids"].to(device) attention_mask = batch["attention_mask"].to(device) outputs = model.generate(input_ids=input_ids, attention_mask=attention_mask, max_length=64) decoded = tokenizer.batch_decode(outputs, skip_special_tokens=True) all_predictions.extend(decoded)``` The reviews are below: 1)As per the global review I purchased this product. Also I used this product for 5 times from my 1st purchase of bottle.. Suddenly the product color changes into golden and shimmery.. While I was spray the product on my face it was exhausted in a shimmering liquid form. It was a real shock to me.. It's a big problem..... As per the global review I purchased this product. Also I used this product for 5 times from my first purchase of bottle..Suddenly the product color changes into golden and shimmery.. While I was spraying the product on my face it was exhausted in a shimmering liquid form. It was a 2)I am literally not so happy with this product I am disappointed with this product I am literally not so happy with this product I am disappointed with this product I am disappointed with this product. Continue reading...