carrie commited on
Commit
bb6e8d2
1 Parent(s): 55ea91c

change output format

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -13,6 +13,7 @@ en_nlp = stanza.Pipeline('en', processors='tokenize')
13
  article='''
14
  ## About
15
  This is a demo for our paper: [How Do We Answer Complex Questions: Discourse Structure of Long-form Answers](https://aclanthology.org/2022.acl-long.249/).
 
16
  Fangyuan Xu, Junyi Jessy Li, Eunsol Choi. 2022.
17
  ## Model
18
  The model served here is a T5(large)-based role classification model trained on functional roles of ELI5 answers.
@@ -69,8 +70,8 @@ def process_t5_output(input_txt, output_txt):
69
  for _, (idx, sentence) in enumerate(idx_to_sentence):
70
  pred_role = ' ' if idx not in idx_to_role else idx_to_role[idx]
71
  mapped_pred_role = role_mappings[pred_role]
72
- pred_roles.append('{}: {}'.format(sentence, mapped_pred_role))
73
- pred_roles.append(output_txt)
74
  return '\n'.join(pred_roles)
75
 
76
 
 
13
  article='''
14
  ## About
15
  This is a demo for our paper: [How Do We Answer Complex Questions: Discourse Structure of Long-form Answers](https://aclanthology.org/2022.acl-long.249/).
16
+
17
  Fangyuan Xu, Junyi Jessy Li, Eunsol Choi. 2022.
18
  ## Model
19
  The model served here is a T5(large)-based role classification model trained on functional roles of ELI5 answers.
 
70
  for _, (idx, sentence) in enumerate(idx_to_sentence):
71
  pred_role = ' ' if idx not in idx_to_role else idx_to_role[idx]
72
  mapped_pred_role = role_mappings[pred_role]
73
+ pred_roles.append('{} ({})'.format(sentence, mapped_pred_role))
74
+ print(input_txt, output_txt)
75
  return '\n'.join(pred_roles)
76
 
77