Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

compound_split_bleu.sh 424 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  1. #!/bin/bash
  2. if [ $# -ne 1 ]; then
  3. echo "usage: $0 GENERATE_PY_OUTPUT"
  4. exit 1
  5. fi
  6. GEN=$1
  7. SYS=$GEN.sys
  8. REF=$GEN.ref
  9. if [ $(tail -n 1 $GEN | grep BLEU | wc -l) -ne 1 ]; then
  10. echo "not done generating"
  11. exit
  12. fi
  13. grep ^H $GEN | cut -f3- | perl -ple 's{(\S)-(\S)}{$1 ##AT##-##AT## $2}g' > $SYS
  14. grep ^T $GEN | cut -f2- | perl -ple 's{(\S)-(\S)}{$1 ##AT##-##AT## $2}g' > $REF
  15. python score.py --sys $SYS --ref $REF
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...