PP-ChatOCRv3-doc.yaml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. pipeline_name: PP-ChatOCRv3-doc
  2. input: https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/demo_paper.png
  3. SubModules:
  4. LLM_Chat:
  5. module_name: chat_bot
  6. model_name: ernie-3.5
  7. api_type: qianfan
  8. ak: "api_key" # Set this to a real API key
  9. sk: "secret_key" # Set this to a real secret key
  10. LLM_Retriever:
  11. module_name: retriever
  12. model_name: ernie-3.5
  13. api_type: qianfan
  14. ak: "api_key" # Set this to a real API key
  15. sk: "secret_key" # Set this to a real secret key
  16. PromptEngneering:
  17. KIE_CommonText:
  18. module_name: prompt_engneering
  19. task_type: text_kie_prompt
  20. # task_description: '你现在的任务是从OCR文字识别的结果中提取关键词列表中每一项对应的关键信息。
  21. # OCR的文字识别结果使用```符号包围,包含所识别出来的文字,顺序在原始图片中从左至右、从上至下。
  22. # 我指定的关键词列表使用[]符号包围。请注意OCR的文字识别结果可能存在长句子换行被切断、不合理的分词、
  23. # 文字被错误合并等问题,你需要结合上下文语义进行综合判断,以抽取准确的关键信息。'
  24. # task_description: '你现在的任务是从OCR文字识别的结果中提取关键词列表中每一项对应的关键信息。
  25. # OCR的文字识别结果使用```符号包围,包含所识别出来的文字,顺序在原始图片中从左至右、从上至下。
  26. # 我指定的关键词列表使用[]符号包围。请注意OCR的文字识别结果可能存在长句子换行被切断、不合理的分词、
  27. # 文字被错误合并等问题,你需要结合上下文语义进行综合判断,以抽取准确的关键信息。
  28. # 提取的关键信息尽可能详细和完整,并保持格式、单位、符号和标点都与OCR结果中的内容完全一致。'
  29. # rules_str:
  30. task_description: '你现在的任务是从OCR结果中提取问题列表中每一个问题的答案。
  31. OCR的文字识别结果使用```符号包围,包含所识别出来的文字,顺序在原始图片中从左至右、从上至下。
  32. 我指定的问题列表使用[]符号包围。请注意OCR的文字识别结果可能存在长句子换行被切断、不合理的分词、
  33. 文字被错误合并等问题,你需要结合上下文语义进行综合判断,以获取准确的答案。'
  34. output_format: '在返回结果时使用JSON格式,包含多个key-value对,key值为我指定的问题,value值为该问题对应的答案。
  35. 如果认为OCR识别结果中,对于问题key,没有答案,则将value赋值为"未知"。请只输出json格式的结果,
  36. 并做json格式校验后返回,不要包含其它多余文字!'
  37. rules_str: '每个问题的答案用OCR结果的内容回答,可以是单词、短语或句子,针对问题回答尽可能详细和完整,
  38. 并保持格式、单位、符号和标点都与OCR结果中的内容完全一致。'
  39. few_shot_demo_text_content:
  40. few_shot_demo_key_value_list:
  41. KIE_Table:
  42. module_name: prompt_engneering
  43. task_type: table_kie_prompt
  44. # task_description: '你现在的任务是从输入的表格内容中提取关键词列表中每一项对应的关键信息,
  45. # 表格内容用```符号包围,我指定的关键词列表使用[]符号包围。你需要结合上下文语义进行综合判断,以抽取准确的关键信息。'
  46. # task_description: '你现在的任务是从输入的表格内容中提取关键词列表中每一项对应的关键信息,
  47. # 表格内容用```符号包围,我指定的关键词列表使用[]符号包围。你需要结合上下文语义进行综合判断,以抽取准确的关键信息。
  48. # 提取的关键信息尽可能详细和完整,并保持格式、单位、符号和标点都与OCR结果中的内容完全一致。'
  49. # output_format: '在返回结果时使用JSON格式,包含多个key-value对,key值为我指定的关键词,value值为所抽取的结果。
  50. # 如果认为表格识别结果中没有关键词key对应的value,则将value赋值为"未知"。请只输出json格式的结果,
  51. # 并做json格式校验后返回,不要包含其它多余文字!'
  52. # rules_str:
  53. task_description: '你现在的任务是从输入的表格内容中提取问题列表中每一个问题的答案。
  54. 表格内容使用```符号包围,我指定的问题列表使用[]符号包围。'
  55. output_format: '在返回结果时使用JSON格式,包含多个key-value对,key值为我指定的问题,value值为该问题对应的答案。
  56. 如果认为表格内容中,对于问题key,没有答案,则将value赋值为"未知"。请只输出json格式的结果,
  57. 并做json格式校验后返回,不要包含其它多余文字!'
  58. rules_str: '每个问题的答案用表格中内容回答,可以是单词、短语或句子,针对问题回答尽可能详细和完整,
  59. 并保持格式、单位、符号和标点都与表格内容中的内容完全一致。'
  60. few_shot_demo_text_content:
  61. few_shot_demo_key_value_list:
  62. SubPipelines:
  63. LayoutParser:
  64. pipeline_name: layout_parsing
  65. use_doc_preprocessor: True
  66. use_common_ocr: True
  67. use_seal_recognition: True
  68. use_table_recognition: True
  69. SubModules:
  70. LayoutDetection:
  71. module_name: object_detection
  72. model_name: RT-DETR-H_layout_3cls
  73. model_dir: null
  74. batch_size: 1
  75. TableStructurePredictor:
  76. module_name: table_recognition
  77. model_name: SLANet_plus
  78. model_dir: null
  79. batch_size: 1
  80. SubPipelines:
  81. DocPreprocessor:
  82. pipeline_name: doc_preprocessor
  83. use_doc_orientation_classify: True
  84. use_doc_unwarping: True
  85. SubModules:
  86. DocOrientationClassify:
  87. module_name: image_classification
  88. model_name: PP-LCNet_x1_0_doc_ori
  89. model_dir: null
  90. batch_size: 1
  91. DocUnwarping:
  92. module_name: image_unwarping
  93. model_name: UVDoc
  94. model_dir: null
  95. batch_size: 1
  96. CommonOCR:
  97. pipeline_name: OCR
  98. text_type: common
  99. SubModules:
  100. TextDetection:
  101. module_name: text_detection
  102. model_name: PP-OCRv4_server_det
  103. model_dir: null
  104. batch_size: 1
  105. TextRecognition:
  106. module_name: text_recognition
  107. model_name: PP-OCRv4_server_rec
  108. model_dir: null
  109. # model_dir: /paddle/github/PaddleX/models/PP-OCRv4_server_rec_doc_infer
  110. batch_size: 1
  111. SealOCR:
  112. pipeline_name: OCR
  113. text_type: seal
  114. SubModules:
  115. TextDetection:
  116. module_name: text_detection
  117. model_name: PP-OCRv4_server_seal_det
  118. model_dir: null
  119. batch_size: 1
  120. TextRecognition:
  121. module_name: text_recognition
  122. model_name: PP-OCRv4_server_rec
  123. model_dir: null
  124. # model_dir: /paddle/github/PaddleX/models/PP-OCRv4_server_rec_doc_infer
  125. batch_size: 1