Filling in the code for calculating RAFT scores