research14 commited on
Commit
99d8a50
·
1 Parent(s): 29b7662

edit syntax

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -117,7 +117,7 @@ def process_text(model_name, task, text):
117
  for gid in tqdm(gid_list, desc='Query'):
118
  text = ptb[gid]['text']
119
 
120
- if model_name is 'gpt3.5':
121
  if task == 'POS':
122
  strategy1 = template_all.format(text)
123
  strategy2 = prompt2_pos.format(text)
@@ -126,6 +126,7 @@ def process_text(model_name, task, text):
126
  response1 = gpt_pipeline(strategy1)
127
  response2 = gpt_pipeline(strategy2)
128
  response3 = gpt_pipeline(strategy3)
 
129
  elif task == 'Chunking':
130
  strategy1 = template_all.format(text)
131
  strategy2 = prompt2_chunk.format(text)
@@ -134,6 +135,7 @@ def process_text(model_name, task, text):
134
  response1 = gpt_pipeline(strategy1)
135
  response2 = gpt_pipeline(strategy2)
136
  response3 = gpt_pipeline(strategy3)
 
137
  elif task == 'Parsing':
138
  strategy1 = template_all.format(text)
139
  strategy2 = prompt2_parse.format(text)
@@ -142,8 +144,7 @@ def process_text(model_name, task, text):
142
  response1 = gpt_pipeline(strategy1)
143
  response2 = gpt_pipeline(strategy2)
144
  response3 = gpt_pipeline(strategy3)
145
-
146
- return (response1, response2, response3)
147
 
148
  # Define prompts for each strategy based on the task
149
  #strategy_prompts = {
 
117
  for gid in tqdm(gid_list, desc='Query'):
118
  text = ptb[gid]['text']
119
 
120
+ if model_name == 'gpt3.5':
121
  if task == 'POS':
122
  strategy1 = template_all.format(text)
123
  strategy2 = prompt2_pos.format(text)
 
126
  response1 = gpt_pipeline(strategy1)
127
  response2 = gpt_pipeline(strategy2)
128
  response3 = gpt_pipeline(strategy3)
129
+ return (response1, response2, response3)
130
  elif task == 'Chunking':
131
  strategy1 = template_all.format(text)
132
  strategy2 = prompt2_chunk.format(text)
 
135
  response1 = gpt_pipeline(strategy1)
136
  response2 = gpt_pipeline(strategy2)
137
  response3 = gpt_pipeline(strategy3)
138
+ return (response1, response2, response3)
139
  elif task == 'Parsing':
140
  strategy1 = template_all.format(text)
141
  strategy2 = prompt2_parse.format(text)
 
144
  response1 = gpt_pipeline(strategy1)
145
  response2 = gpt_pipeline(strategy2)
146
  response3 = gpt_pipeline(strategy3)
147
+ return (response1, response2, response3)
 
148
 
149
  # Define prompts for each strategy based on the task
150
  #strategy_prompts = {