This post was written 2 years back in a website I used to report results back to my advisor. I spent quite some time doing quite unnecessary stuff, figuring out what was wrong why I was getting astonishingly poor results compared to those reported in literature. The corpus page had briefly a filtered version from Saumitra Yadav, which I thought was nice gesture and since seem to have taken off the same. To point to the general people why not to use a corpus as is, from my hard learnings, I publish the post backdated with my experiences here. The post is added to this site on 2020 November 28.
Some of the writing in this document is not very kind, account for that it was from an irritated research-scholar who was held to explain why he had poor results from a strong faculty-advisor, and had to go and do a set of brute-force experiments which would not go anywhere to publication. I have since built many resources out of usable parts of IITB Hindi English corpus, which I am grateful to the people who released the resources for, and in process empathize with their plights as well.
I’ve been trying to produce results with the IIT-Bombay Hindi English parallel corpus, but the dataset doesn’t seem to be giving good results at all, for NMT.
I’m in no way able to match scores reported by IIT-B teams, with some tinkering and adjustment based the training corpus, I can fine tune it for the test set - but still I have doubts of the suitability of IIT-Bombay Hindi English parallel corpus as a good training set for neural machine translation.
Architecture and Framework
- Framework: OpenNMT-py
- Primitive Tokenization (Whitespace, punctuation based)
- Model Architecture:
- Encoder: BRNN, 500 Neurons x 2 Layers
- Decoder: RNN, 500 Neurons x 2 Layers
- Attention: Luong’s General Attention
Decoding: Beam Search, beam width 5.
- Training Configurations:
- 100 Epochs.
- Model with best (Validation Accuracy, Validation Perplexity) chosen for testing.
- Replace unknowns with nearest word using attention.
Throughout my method, I’ll keep my model constant - since I’m primarily interested in how data affects training and generalization.
To figure out what exactly is happening, to see if the individual datasets that constitutes the IIT-Bombay corpus would do any better.
See how well one dataset transfers to other - use these edge-weights as a metric to combine datasets for a better training set.
The following are the results on the individual corpora that constitutes IIT-B Hindi-English parallel dataset provided.
Some notes: 1. I’m using
train, dev, test = (0.8, 0.05, 0.15) for the individual corpus, randomly sampling for all three, without replacement. 2. The whole values are reported on IIT-B parallel dataset splits of
train, dev, test.
Transfer across constituents
My experiments are similar to the ones performed in Six Challenges for Neural Machine Translation. I’m using only subsets of the corpus wherein the perplexity is reported to be low/high-BLEU is reported on the individual training, since I don’t expect the others to transfer at all.
BLEU scores are reported below, upon transfer from columns to the dataset indicated on the row.
I’m putting forth the following take-aways from the above table.
- Looks to me like books, govtweb, hiencorp and ted are what would be useful part of the datasets which would generalize to the dev/test sets given - news crawls.
- I’ll however try a few more combinations, see the variation.
- Distributions distant from the test set may end up hurting the model, trying to generalize on a more diverse corpus.
- I’m going to call tanzil, gnome, kde, dictionaries - mostly noise and distant.
- hiencorp transfers well to gnome - this is unexpected. Perhaps the same scenario in the larger dataset applies to hiencorp as well.
Refining training data based on transfer stats
I’ll try just IIT-B test set now, using models trained on combination of the above corpora.
The percentage of actual training data used to obtain the BLEU is indicated. We’re able to achieve better results with a fraction of the training set.
|combination||% of iitb-train||BLEU on iitb-test|
|govtweb + hiencorp + ted + tatoeba + indicparallel + opensubs||24.28||9.62|
|govtweb + hiencorp + ted||23.24||9.94|
|govtweb + ted + books||21.03||10.22|
|govtweb + hiencorp + ted + books + wikihead||37.18||10.50|
|govtweb + hiencorp + ted + books||35.41||10.86|
10 is reasonably good enough BLEU for translations to make sense. At this point, it may be a good idea to look at data.
The translations for refined-4 are most likely the best. And most make sense, they’re not complete garbage at the very least.
I think it’s reasonable enough to make the following conclusions at this point:
BLEU is a bad, horrible metric. At least, for NMT based approaches, we need a consensus based metric with multiple hypotheses for an input sentence.
- IITB Hindi English Corpus is a disaster. Maybe a necessary evil to some people - but I’d say more trouble than it’s worth.
- Corpus has collected data from a mountain load of sources, most of which are practically useless in generalizing to newscrawl.
- I’m not even sure if the test set is learnable at all from the train-set. When creating datasets to benchmark - at least the train set should contain data enough to learn a distribution which the test is also drawn from. I’m pretty certain test-set contains completely new vocabularies.
- There is scope for releasing a new natural dataset, than this mess of a dataset.
Better(?) Data Sampling
Related: Dynamic Data Selection for NMT
One thing I’ve seen a lot while training character language models are that frequent patterns are learnt quickly - and the perplexities of these tend to be lower.
OpenNMT-py has a bunch of metrics which quantify the above, and I believe these maybe of use to capture what would be the trainable “good” corpus within the training set.