nicolafan / image-captioning-cnn-rnn

Tensorflow/Keras implementation of an image captioning neural network, using CNN and RNN
MIT License
6 stars 1 forks source link

Improve (?) implementation of the BLEU metric #1

Open nicolafan opened 1 year ago

nicolafan commented 1 year ago

The BLEU metric is a numerical metric used in image captioning.

They need to be implemented inside the src/models/metrics.py file (not sure if it is the correct place by the way). I think this should not be implemented as a tensor metric that can be used by Tensorflow, but as a metric that has to be applied directly to strings.

Basically, we will provide the ground truth caption string and a string predicted by the model. How the prediction string is produced depends on the implementation to try: sampling, beam search, or max likelihood, but is not of interest for the BLEU Implementation.

nicolafan commented 1 year ago

I've just found out that nltk already provides this measure.

nicolafan commented 1 year ago

I've added the BLEU metric to metrics.py, I'd like a double check to see if everything is ok.