darpanaswal commited on
Commit
f8a16e0
·
verified ·
1 Parent(s): 3a53014

Update cross_encoder_reranking_train.py

Browse files
Files changed (1) hide show
  1. cross_encoder_reranking_train.py +8 -1
cross_encoder_reranking_train.py CHANGED
@@ -137,6 +137,13 @@ def extract_text(content_dict, text_type="full"):
137
  if key == "features":
138
  content += list(content_dict[key].values())
139
 
 
 
 
 
 
 
 
140
  elif text_type == "tac1":
141
  # Extract title, abstract, and first claim
142
  title = content_dict.get("title", "")
@@ -304,7 +311,7 @@ def main():
304
  parser.add_argument('--queries_list', type=str, default='test_queries.json',
305
  help='Path to training queries JSON file')
306
  parser.add_argument('--text_type', type=str, default='TA',
307
- choices=['TA', 'claims', 'description', 'full', 'tac1', 'smart', 'smart2', 'claimfeat'],
308
  help='Type of text to use for scoring')
309
  parser.add_argument('--model_name', type=str, default='intfloat/e5-large-v2',
310
  help='Name of the cross-encoder model')
 
137
  if key == "features":
138
  content += list(content_dict[key].values())
139
 
140
+ elif text_type == "feat":
141
+ # Extract all claims (keys starting with 'c')
142
+ content = []
143
+ for key, value in content_dict.items():
144
+ if key == "features":
145
+ content += list(content_dict[key].values())
146
+
147
  elif text_type == "tac1":
148
  # Extract title, abstract, and first claim
149
  title = content_dict.get("title", "")
 
311
  parser.add_argument('--queries_list', type=str, default='test_queries.json',
312
  help='Path to training queries JSON file')
313
  parser.add_argument('--text_type', type=str, default='TA',
314
+ choices=['TA', 'claims', 'description', 'full', 'tac1', 'smart', 'smart2', 'claimfeat', 'feat'],
315
  help='Type of text to use for scoring')
316
  parser.add_argument('--model_name', type=str, default='intfloat/e5-large-v2',
317
  help='Name of the cross-encoder model')