Rafal commited on
Commit
a6d6e4e
1 Parent(s): c4a4c9e

Fixed display of multi-token group terms

Browse files
Files changed (1) hide show
  1. mgr_bias_scoring.py +6 -0
mgr_bias_scoring.py CHANGED
@@ -263,6 +263,12 @@ def maskSentenceDifferences(sentence, rewrite, target_words, att_term):
263
  if no_space_att in rewrite:
264
  rewrite = rewrite.replace(no_space_att, att_term)
265
 
 
 
 
 
 
 
266
  # add variation without '-'
267
  target_words.extend([t.replace('-','') for t in target_words])
268
  target_words = [t.lower() for t in target_words]
 
263
  if no_space_att in rewrite:
264
  rewrite = rewrite.replace(no_space_att, att_term)
265
 
266
+ # identify group term in both sentences
267
+ sentence = sentence_to_template(sentence, target_words[0], "[T]")
268
+ rewrite = sentence_to_template(rewrite, target_words[1], "[T]")
269
+ #print(f'S1: {sentence}')
270
+ #print(f'R1: {rewrite}')
271
+
272
  # add variation without '-'
273
  target_words.extend([t.replace('-','') for t in target_words])
274
  target_words = [t.lower() for t in target_words]