PP-ChatOCRv3-doc.yaml 4.6 KB

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