Skip to content

Commit

Permalink
feat: data.train: src_term is optional
Browse files Browse the repository at this point in the history
(will throw an error if template requires it thanks to previous fix)
  • Loading branch information
PaulLerner committed May 13, 2024
1 parent 98f5f33 commit 020cd60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions neot/data/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def fill_template(item, template, icl=False, src="en", tgt="fr", src_lang="angla
tgt_term = " " + item[tgt]["text"]
else:
tgt_term = ""
return template.format(tgt_term=tgt_term, src_lang=src_lang, tgt_lang=tgt_lang, src_term=item[src]["text"],
src_def=item[def_lang]["def"]["text"])
return template.format(tgt_term=tgt_term, src_lang=src_lang, tgt_lang=tgt_lang,
src_term=item.get(src, {}).get("text"), src_def=item[def_lang]["def"]["text"])


class Identity:
Expand Down

0 comments on commit 020cd60

Please sign in to comment.