Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Training with Arabic Online Handwriting Data #2

Open
pj-mathematician opened this issue Oct 9, 2022 · 4 comments
Open

Training with Arabic Online Handwriting Data #2

pj-mathematician opened this issue Oct 9, 2022 · 4 comments

Comments

@pj-mathematician
Copy link

Can you please suggest the modifications that I should apply, so that I can train the given model for Arabic Handwriting sequences. Arabic text is written from right to left, which might be the reason for which this model isnt yielding correct results.
Thanks.
Example arabic online handwriting model is ADAB

@X-rayLaser
Copy link
Owner

Yes, it is quite possibly the reason. I vaguely recall that in the code the attention window slides from left to right. If that's the case then, neural net might look at the least relevant part of a character string when predicting next point.

Have you tried to reverse the order of the text transcript (apple -> elppa) on a level of a dataset? Perhaps you can decorate the dataset class you have like this:

class ReversedTextDataset:
    def __init__(self, ds):
      self.ds = ds
    def __getitem__(self, indx):
      handwriting, text = self.ds[indx]      
      return handwriting, text[::-1]
    def __len__(self):
      return len(self.ds)

@pj-mathematician
Copy link
Author

Thank you, this seems promising. I will try it out on my data.

@X-rayLaser
Copy link
Owner

X-rayLaser commented Oct 12, 2022

By the way, could you show a couple of typical samples generated by the neural net? It's just that there may be other issues with code besides the neural side (e.g. some rendering bugs).

@X-rayLaser
Copy link
Owner

Yep, try that. It might be the quickest fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants