Python Forum
Calculating BLEU scores in Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calculating BLEU scores in Python
#1
Dear all,
Wondering if anyone has ever had any experience with calculating BLEU scores for evaluating machine translation quality?
I want to compare machine-translated text to a human translation reference and have found the code to calculate this here: https://github.com/vikasnar/Bleu
I have visual studio code, but I have absolutely no idea what I am doing and have absolutely no experience with programming. There is a test set on the code, but I cannot seem to figure out how to even input this or run this.
Is anyone able to help/offer a programming for dummies explanation of how to calculate this test set?
I would be very grateful!

Thanks in advance!
Reply
#2
If I understand well how the program works, you don't need any programming experience to use it as a black box:
  1. Create a file machine-translated.txt containing the machine translation of some text.
  2. Create a directory containing one or more human translations of the same text, say human-translated-1.txt, human-translated-2.txt etc.
  3. Run the command python calculatebleu.py machine-translated.txt path-to-directory
  4. Then read the contents of the new file bleu_output.txt
kg17 likes this post
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python Coding Help: Calculating Sums bperez 9 3,552 Jan-18-2021, 07:25 AM
Last Post: perfringo
  Calculating of difficult integrals in python enitorc 0 5,552 Apr-15-2018, 01:24 PM
Last Post: enitorc

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020