andreslu commited on
Commit
4e06688
·
1 Parent(s): 5a65d09

Upload utils.py

Browse files
Files changed (1) hide show
  1. src/utils.py +5 -6
src/utils.py CHANGED
@@ -9,12 +9,11 @@ def post_process_template(tB):
9
 
10
 
11
  def construct_template(words, templateA, if_then=False):
12
- if len(words) == 2:
13
- # template = ['{} <mask> {}.'.format(words[0], words[1])]
14
- templates = [
15
- # '{} is <mask> {}.'.format(words[0], words[1]),
16
- '{} <mask> {}.'.format(words[0], words[1]),
17
- ]
18
  elif len(words) == 1:
19
  templates = [
20
  # '{} is <mask>.'.format(words[0]),
 
9
 
10
 
11
  def construct_template(words, templateA, if_then=False):
12
+ if len(words) >= 2:
13
+ templates = ['{} <mask> '.format(words[0])]
14
+ for i in range(1, len(words)-1):
15
+ templates[0] += '{} <mask> '.format(words[i])
16
+ templates[0] += '{}.'.format(words[-1])
 
17
  elif len(words) == 1:
18
  templates = [
19
  # '{} is <mask>.'.format(words[0]),