Skip to content

RNN based arch that uses your name to guess language your speak

Notifications You must be signed in to change notification settings

LunaticMaestro/-NLP-_you_may_speak

Repository files navigation

title emoji colorFrom colorTo sdk sdk_version app_file pinned short_description
You Might Speak
🌍
pink
gray
gradio
5.9.1
app.py
false
I guess you might speak <Language>

Language Guesser based on Name

preview

Data Source

https://pytorch.org/tutorials/intermediate/char_rnn_classification_tutorial.html Last Accessed: 30th Dec 2024

Code Information

The code is partially inspired by https://pytorch.org/tutorials/intermediate/char_rnn_classification_tutorial.html

Changes I Introduced

  • NamesDataset is separated from transformation, useful for transformation during inference
  • target is made integer instead of one-hot encoding;
  • changed the loss from combination of LogSoftmax + NLLoss to CrossEntropy (EXACTLY THE SAME STUFF); which further required removing the softmax layer from the architecture.
  • DataLoader is added
  • Input made batch first > Corresponding RNN is also made batch first.

Evaluation

Although the code is mostly replicated. However, I changed the dataloader to use apply lowercase transformation to data, and it confused the model.

Notice that the diagonal brightness for the without lowercase, which can be said that the actual class being arabic (for example) is guess as arabic. This is not the case with with lowercase.

  • Confusion matrix with with lowercase transformation Click here to view the image Click here to view the image

  • Confusion matrix without lowercase transformation Click here to view the image Click here to view the image

About

RNN based arch that uses your name to guess language your speak

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages