So, over the past few days, I tried various encoder-decoder models which take in incorrect sentences as input and outputs correct sentences. (Just your/you’re confusion pair)
Character Level seq2seq model
First I tried a character level model. Trained it for 2 days, 120 epochs, dataset of size 26046. But the results were not promising as the number of parameters to train in a character level model is very huge.
And then there is the problem of long term dependencies when the sentences are long.
Word Level seq2seq model
I used GloVe embeddings, trained it for 2 days ,100 epochs, It gave some correct results but still not good enough.
Here are some results.
Input : Thanks for your’re explanation.
Output : Thanks for your explanation
Input : Open your’re mouth!
Output : Open your face!
Input : Which is your’re luggage?
Output : Which is your luggage
Input : I need your advice.
Output : I need your advice
Input : Put your’re hands down!
Output : Put your hands up!
Input : Enjoy your’re meal!
Output : Enjoy your bed!
Input : Here is your change.
Output : Here is your change
Input : On your feet, children!
Output : On your story, please!
But longer sentences becomes a problem. It learned to correctly distinguish between when to use ‘your’ and when to use ‘you’re’ but the generating decoder part is erroneous. It can be made better (maybe) if I gave it more training data and trained it for more epochs.
Shall I try another approach which I think might work? Since the model knows when to use ‘your’ and when to use ‘you’re’ depending upon the context, I can train it to figure out where exactly in the sentence (which words) are incorrect. And change just those words. This would greatly reduce the complexity as it would avoid generating the whole sentence.