Skip to content

SimulTrans-demo/STACL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

code for STACL(Simultaneous Translation with Intergrated Aniticipation and Controllable Latency) paper

metric of Average Lagging (AL)

details in Sec.4 of STACL paper

run sample

python metricAL.py
# output:
# corpus mean: 5.96639835314598
# weighted average: 5.486924076400874

functions

  1. RW2AL(s, add_eos=False)
  • get AL value from a single RW sequence
  • s is RW sequence, a string, in format of 0 0 0 1 1 0 1 0 1, or R R R W W R W R W, flexible on blank/comma
  • add_eos is used to add eos token for both src and tgt if you did not do it during RW generating (to add tail 0 and 1 into the RW sequence)
  • output is a single value as AL
  1. RW2AL_file(file_rw, is_weight_ave=False)
  • get AL value from a file with RW sequences
  • file_rw is the path to a RW sequence file
  • is_weight_ave is used to return weighted average result against READ length or mean result on corpus
  • output is a single value as AL

About

code for STACL(STACL: Simultaneous Translation with Integrated Anticipation and Controllable Latency)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages