sijunhe commited on
Commit
d0dc5bb
1 Parent(s): 1cd0594

update app.py

Browse files
Files changed (2) hide show
  1. app.py +14 -13
  2. footer.html +1 -1
app.py CHANGED
@@ -169,8 +169,9 @@ def get_schema(schema_str):
169
  return schema_list, schema_lang
170
 
171
 
172
- def run_taskflow(document, schema):
173
  task_instance.set_schema(schema)
 
174
  return task_instance({'doc': document})
175
 
176
 
@@ -308,10 +309,10 @@ gradio-app h2, .gradio-app h2 {
308
  with gr.Blocks(css=CSS) as demo:
309
  gr.HTML(read_content("header.html"))
310
  gr.Markdown(
311
- "**UIE-X 🧾 🎓** is a universal information extraction engine which supports both document and text inputs. It is powered by BAIDU and released on PaddleNLP. "
312
- "Our extraction target(schema) can be set in natural language without limitation, and it also supports most extraction tasks. "
313
- "The model performs well on zero-shot and few-shot settings. Moreover, on PaddleNLP, we provide a comprehensive and easy-to-use fine-tuning customization workflow."
314
- "For more details, please visit the [GitHub](https://github.com/PaddlePaddle/PaddleNLP/tree/develop/applications/information_extraction)"
315
  )
316
 
317
  document = gr.Variable()
@@ -321,7 +322,7 @@ with gr.Blocks(css=CSS) as demo:
321
  with gr.Row(equal_height=True):
322
  with gr.Column():
323
  with gr.Row():
324
- gr.Markdown("## 1. 选择文件 / Select a file 📄", elem_id="select-a-file")
325
  img_clear_button = gr.Button(
326
  "Clear", variant="secondary", elem_id="file-clear", visible=False
327
  )
@@ -352,16 +353,16 @@ with gr.Blocks(css=CSS) as demo:
352
  )
353
 
354
  with gr.Column():
355
- gr.Markdown("## 2. 信息抽取 / Information extraction ℹ️ ")
356
- gr.Markdown("### 👉 设置schema")
 
 
 
357
  gr.Markdown("实体抽取:实体类别之间以';'分割,例如 **人物;组织机构**")
358
  gr.Markdown("关系抽取:需配置主体和关系类别,中间以'|'分割,例如 **人物|出生时间;人物|邮箱**")
359
- gr.Markdown("### 👉 Set a schema")
360
- gr.Markdown("Entity extraction: entity label should be separated by ';', e.g. **Person;Organization**")
361
- gr.Markdown("Relation extraction: set the subject and relation type, separated by '|', e.g. **Person|Date;Person|Email**")
362
- gr.Markdown("### 💪 模型定制 / Model customization")
363
- gr.Markdown("我们建议通过[数据标注+微调](https://github.com/PaddlePaddle/PaddleNLP/tree/develop/applications/information_extraction/document)的流程进一步增强模型在特定场景的效果")
364
  gr.Markdown("We recommend to further improve the extraction performance in specific domain through the process of [data annotation & fine-tuning](https://github.com/PaddlePaddle/PaddleNLP/tree/develop/applications/information_extraction/document)")
 
365
 
366
  schema = gr.Textbox(
367
  label="Schema",
 
169
  return schema_list, schema_lang
170
 
171
 
172
+ def run_taskflow(document, schema, argument):
173
  task_instance.set_schema(schema)
174
+ task_instance.set_argument(argument)
175
  return task_instance({'doc': document})
176
 
177
 
 
309
  with gr.Blocks(css=CSS) as demo:
310
  gr.HTML(read_content("header.html"))
311
  gr.Markdown(
312
+ "Open-sourced by PaddleNLP, **UIE-X 🧾 🎓** is a universal information extraction engine for both scanned document and text inputs. It supports Entity Extraction, Relation Extraction and Event Extraction tasks."
313
+ "UIE-X performs well on a zero-shot settings, which is enabled by a flexible schema that allows you to specify extraction targets with simple natural language."
314
+ "Moreover, on PaddleNLP, we provide a comprehensive and easy-to-use fine-tuning and few-shot customization workflow."
315
+ "For more details, please visit our [GitHub](https://github.com/PaddlePaddle/PaddleNLP/tree/develop/applications/information_extraction)"
316
  )
317
 
318
  document = gr.Variable()
 
322
  with gr.Row(equal_height=True):
323
  with gr.Column():
324
  with gr.Row():
325
+ gr.Markdown("## 1. Select a file 选择文件", elem_id="select-a-file")
326
  img_clear_button = gr.Button(
327
  "Clear", variant="secondary", elem_id="file-clear", visible=False
328
  )
 
353
  )
354
 
355
  with gr.Column():
356
+ gr.Markdown("## 2. Information Extraction 信息抽取 ")
357
+ gr.Markdown("### Set a schema")
358
+ gr.Markdown("Entity extraction: entity type should be separated by ';', e.g. **Person;Organization**")
359
+ gr.Markdown("Relation extraction: set the subject and relation type, separated by '|', e.g. **Person|Date;Person|Email**")
360
+ gr.Markdown("### 设置schema")
361
  gr.Markdown("实体抽取:实体类别之间以';'分割,例如 **人物;组织机构**")
362
  gr.Markdown("关系抽取:需配置主体和关系类别,中间以'|'分割,例如 **人物|出生时间;人物|邮箱**")
363
+ gr.Markdown("### Model customization 模型定制")
 
 
 
 
364
  gr.Markdown("We recommend to further improve the extraction performance in specific domain through the process of [data annotation & fine-tuning](https://github.com/PaddlePaddle/PaddleNLP/tree/develop/applications/information_extraction/document)")
365
+ gr.Markdown("我们建议通过[数据标注+微调](https://github.com/PaddlePaddle/PaddleNLP/tree/develop/applications/information_extraction/document)的流程进一步增强模型在特定场景的效果")
366
 
367
  schema = gr.Textbox(
368
  label="Schema",
footer.html CHANGED
@@ -1,4 +1,4 @@
1
  <div class="footer">
2
- <p>Model by <a href="https://github.com/PaddlePaddle/PaddleNLP" style="text-decoration: underline;" target="_blank">PaddleNLP</a> - Gradio Demo by 🤗 Hugging Face
3
  </p>
4
  </div>
 
1
  <div class="footer">
2
+ <p>Powered by <a href="https://github.com/PaddlePaddle/PaddleNLP" style="text-decoration: underline;" target="_blank">PaddleNLP</a> and Gradio
3
  </p>
4
  </div>