xl2533 commited on
Commit
28873f9
1 Parent(s): e998926
Files changed (2) hide show
  1. ape/instance.py +2 -2
  2. app.py +1 -1
ape/instance.py CHANGED
@@ -106,8 +106,8 @@ def load_entity(file='./ape/data/entity_train.json'):
106
  input = i['text']
107
  output = []
108
  for j in i['labels']:
109
- ##筛选局部实体类型,也可以拆分成单个实体类型
110
- if j[1] in ['DRUG_DOSAGE', 'DRUG_TASTE', 'DRUG_EFFICACY']:
111
  output.append({'类型': j[1], '实体': j[-1]})
112
  output = json.dumps(output, ensure_ascii=False)
113
  data.append((input, output))
 
106
  input = i['text']
107
  output = []
108
  for j in i['labels']:
109
+ ##拆分成单实体任务类型
110
+ if j[1] in =='DRUG_EFFICACY':
111
  output.append({'类型': j[1], '实体': j[-1]})
112
  output = json.dumps(output, ensure_ascii=False)
113
  data.append((input, output))
app.py CHANGED
@@ -21,7 +21,7 @@ with gr.Blocks(title="Automatic Prompt Engineer", theme=gr.themes.Glass()) as de
21
  n_eval = gr.Slider(label="评估样本数", minimum=1, maximum=30, step=5, value=20)
22
 
23
  with gr.Column(scale=3):
24
- gr.Markdown("## 第二步:加载数据")
25
  with gr.Tab("选择数据"):
26
  with gr.Row():
27
  file = gr.File(label='上传txt文件,input[空格]output[换行]')
 
21
  n_eval = gr.Slider(label="评估样本数", minimum=1, maximum=30, step=5, value=20)
22
 
23
  with gr.Column(scale=3):
24
+ gr.Markdown("## 第二步:加载数据(选任务或上传数据)")
25
  with gr.Tab("选择数据"):
26
  with gr.Row():
27
  file = gr.File(label='上传txt文件,input[空格]output[换行]')