yomitoku 0.8.0__tar.gz → 0.9.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. {yomitoku-0.8.0 → yomitoku-0.9.0}/PKG-INFO +3 -1
  2. yomitoku-0.9.0/docs/mcp.en.md +48 -0
  3. yomitoku-0.9.0/docs/mcp.ja.md +50 -0
  4. {yomitoku-0.8.0 → yomitoku-0.9.0}/mkdocs.yml +1 -0
  5. {yomitoku-0.8.0 → yomitoku-0.9.0}/pyproject.toml +6 -0
  6. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/cli/main.py +4 -3
  7. yomitoku-0.9.0/src/yomitoku/cli/mcp.py +165 -0
  8. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/configs/cfg_text_detector_dbnet.py +1 -1
  9. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/configs/cfg_text_detector_dbnet_v2.py +2 -2
  10. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/export/export_csv.py +2 -2
  11. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/export/export_html.py +10 -5
  12. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/export/export_json.py +2 -2
  13. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/export/export_markdown.py +2 -2
  14. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/utils/misc.py +12 -0
  15. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/in_demo_p1.html +10 -10
  16. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/in_demo_p1.md +10 -10
  17. yomitoku-0.9.0/static/out/in_demo_p1_ocr.jpg +0 -0
  18. yomitoku-0.9.0/static/out/in_gallery1_p1.html +66 -0
  19. yomitoku-0.9.0/static/out/in_gallery1_p1.md +58 -0
  20. yomitoku-0.9.0/static/out/in_gallery1_p1_layout.jpg +0 -0
  21. yomitoku-0.9.0/static/out/in_gallery1_p1_ocr.jpg +0 -0
  22. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/in_gallery2_p1.html +12 -12
  23. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/in_gallery2_p1.md +11 -11
  24. yomitoku-0.9.0/static/out/in_gallery2_p1_ocr.jpg +0 -0
  25. yomitoku-0.9.0/static/out/in_gallery3_p1.html +31 -0
  26. yomitoku-0.9.0/static/out/in_gallery3_p1.md +45 -0
  27. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/in_gallery3_p1_layout.jpg +0 -0
  28. yomitoku-0.9.0/static/out/in_gallery3_p1_ocr.jpg +0 -0
  29. yomitoku-0.8.0/static/out/in_gallery4_p1_ocr.jpg → yomitoku-0.9.0/static/out/in_gallery4_p1_layout.jpg +0 -0
  30. yomitoku-0.9.0/static/out/in_gallery4_p1_ocr.jpg +0 -0
  31. yomitoku-0.9.0/static/out/in_gallery5_p1.html +4 -0
  32. yomitoku-0.9.0/static/out/in_gallery5_p1.md +1 -0
  33. yomitoku-0.9.0/static/out/in_gallery5_p1_ocr.jpg +0 -0
  34. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/in_gallery6_p1.html +9 -15
  35. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/in_gallery6_p1.md +8 -17
  36. yomitoku-0.8.0/static/out/in_gallery6_p1_ocr.jpg → yomitoku-0.9.0/static/out/in_gallery6_p1_layout.jpg +0 -0
  37. yomitoku-0.8.0/static/out/in_gallery6_p1_layout.jpg → yomitoku-0.9.0/static/out/in_gallery6_p1_ocr.jpg +0 -0
  38. yomitoku-0.9.0/static/out/in_gallery7_p1_ocr.jpg +0 -0
  39. yomitoku-0.9.0/tests/data/invalid.pdf +0 -0
  40. yomitoku-0.9.0/uv.lock +1815 -0
  41. yomitoku-0.8.0/static/out/in_demo_p1_ocr.jpg +0 -0
  42. yomitoku-0.8.0/static/out/in_gallery1_p1.html +0 -126
  43. yomitoku-0.8.0/static/out/in_gallery1_p1.md +0 -148
  44. yomitoku-0.8.0/static/out/in_gallery1_p1_layout.jpg +0 -0
  45. yomitoku-0.8.0/static/out/in_gallery1_p1_ocr.jpg +0 -0
  46. yomitoku-0.8.0/static/out/in_gallery2_p1_ocr.jpg +0 -0
  47. yomitoku-0.8.0/static/out/in_gallery3_p1.html +0 -80
  48. yomitoku-0.8.0/static/out/in_gallery3_p1.md +0 -137
  49. yomitoku-0.8.0/static/out/in_gallery3_p1_ocr.jpg +0 -0
  50. yomitoku-0.8.0/static/out/in_gallery4_p1_layout.jpg +0 -0
  51. yomitoku-0.8.0/static/out/in_gallery5_p1.html +0 -40
  52. yomitoku-0.8.0/static/out/in_gallery5_p1.md +0 -64
  53. yomitoku-0.8.0/static/out/in_gallery5_p1_ocr.jpg +0 -0
  54. yomitoku-0.8.0/static/out/in_gallery7_p1.md +0 -40
  55. yomitoku-0.8.0/static/out/in_gallery7_p1_ocr.jpg +0 -0
  56. yomitoku-0.8.0/uv.lock +0 -1610
  57. {yomitoku-0.8.0 → yomitoku-0.9.0}/.github/FUNDING.yml +0 -0
  58. {yomitoku-0.8.0 → yomitoku-0.9.0}/.github/release-drafter.yml +0 -0
  59. {yomitoku-0.8.0 → yomitoku-0.9.0}/.github/workflows/build-and-publish-docs.yaml +0 -0
  60. {yomitoku-0.8.0 → yomitoku-0.9.0}/.github/workflows/build-and-publish.yml +0 -0
  61. {yomitoku-0.8.0 → yomitoku-0.9.0}/.github/workflows/create-release.yml +0 -0
  62. {yomitoku-0.8.0 → yomitoku-0.9.0}/.github/workflows/lint-and-test.yml +0 -0
  63. {yomitoku-0.8.0 → yomitoku-0.9.0}/.gitignore +0 -0
  64. {yomitoku-0.8.0 → yomitoku-0.9.0}/.pre-commit-config.yaml +0 -0
  65. {yomitoku-0.8.0 → yomitoku-0.9.0}/.python-version +0 -0
  66. {yomitoku-0.8.0 → yomitoku-0.9.0}/README.md +0 -0
  67. {yomitoku-0.8.0 → yomitoku-0.9.0}/README_EN.md +0 -0
  68. {yomitoku-0.8.0 → yomitoku-0.9.0}/configs/yomitoku-layout-parser-rtdtrv2-open-beta.yaml +0 -0
  69. {yomitoku-0.8.0 → yomitoku-0.9.0}/configs/yomitoku-table-structure-recognizer-rtdtrv2-open-beta.yaml +0 -0
  70. {yomitoku-0.8.0 → yomitoku-0.9.0}/configs/yomitoku-text-detector-dbnet-open-beta.yaml +0 -0
  71. {yomitoku-0.8.0 → yomitoku-0.9.0}/configs/yomitoku-text-recognizer-parseq-open-beta.yaml +0 -0
  72. {yomitoku-0.8.0 → yomitoku-0.9.0}/configs/yomitoku-text-recognizer-parseq-small-open-beta.yaml +0 -0
  73. {yomitoku-0.8.0 → yomitoku-0.9.0}/demo/sample.pdf +0 -0
  74. {yomitoku-0.8.0 → yomitoku-0.9.0}/demo/setting_document_anaysis.py +0 -0
  75. {yomitoku-0.8.0 → yomitoku-0.9.0}/demo/simple_document_analysis.py +0 -0
  76. {yomitoku-0.8.0 → yomitoku-0.9.0}/demo/simple_layout.py +0 -0
  77. {yomitoku-0.8.0 → yomitoku-0.9.0}/demo/simple_ocr.py +0 -0
  78. {yomitoku-0.8.0 → yomitoku-0.9.0}/demo/text_detector.yaml +0 -0
  79. {yomitoku-0.8.0 → yomitoku-0.9.0}/dockerfile +0 -0
  80. {yomitoku-0.8.0 → yomitoku-0.9.0}/docs/assets/logo.svg +0 -0
  81. {yomitoku-0.8.0 → yomitoku-0.9.0}/docs/cli.en.md +0 -0
  82. {yomitoku-0.8.0 → yomitoku-0.9.0}/docs/cli.ja.md +0 -0
  83. {yomitoku-0.8.0 → yomitoku-0.9.0}/docs/configuration.en.md +0 -0
  84. {yomitoku-0.8.0 → yomitoku-0.9.0}/docs/configuration.ja.md +0 -0
  85. {yomitoku-0.8.0 → yomitoku-0.9.0}/docs/index.en.md +0 -0
  86. {yomitoku-0.8.0 → yomitoku-0.9.0}/docs/index.ja.md +0 -0
  87. {yomitoku-0.8.0 → yomitoku-0.9.0}/docs/installation.en.md +0 -0
  88. {yomitoku-0.8.0 → yomitoku-0.9.0}/docs/installation.ja.md +0 -0
  89. {yomitoku-0.8.0 → yomitoku-0.9.0}/docs/module.en.md +0 -0
  90. {yomitoku-0.8.0 → yomitoku-0.9.0}/docs/module.ja.md +0 -0
  91. {yomitoku-0.8.0 → yomitoku-0.9.0}/gallery.md +0 -0
  92. {yomitoku-0.8.0 → yomitoku-0.9.0}/pytest.ini +0 -0
  93. {yomitoku-0.8.0 → yomitoku-0.9.0}/scripts/register_hugging_face_hub.py +0 -0
  94. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/__init__.py +0 -0
  95. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/base.py +0 -0
  96. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/cli/__init__.py +0 -0
  97. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/configs/__init__.py +0 -0
  98. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/configs/cfg_layout_parser_rtdtrv2.py +0 -0
  99. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/configs/cfg_layout_parser_rtdtrv2_v2.py +0 -0
  100. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/configs/cfg_table_structure_recognizer_rtdtrv2.py +0 -0
  101. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/configs/cfg_text_recognizer_parseq.py +0 -0
  102. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/configs/cfg_text_recognizer_parseq_small.py +0 -0
  103. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/configs/cfg_text_recognizer_parseq_v2.py +0 -0
  104. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/constants.py +0 -0
  105. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/data/__init__.py +0 -0
  106. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/data/dataset.py +0 -0
  107. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/data/functions.py +0 -0
  108. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/document_analyzer.py +0 -0
  109. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/export/__init__.py +0 -0
  110. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/layout_analyzer.py +0 -0
  111. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/layout_parser.py +0 -0
  112. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/models/__init__.py +0 -0
  113. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/models/dbnet_plus.py +0 -0
  114. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/models/layers/__init__.py +0 -0
  115. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/models/layers/activate.py +0 -0
  116. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/models/layers/dbnet_feature_attention.py +0 -0
  117. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/models/layers/parseq_transformer.py +0 -0
  118. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/models/layers/rtdetr_backbone.py +0 -0
  119. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/models/layers/rtdetr_hybrid_encoder.py +0 -0
  120. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/models/layers/rtdetrv2_decoder.py +0 -0
  121. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/models/parseq.py +0 -0
  122. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/models/rtdetr.py +0 -0
  123. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/ocr.py +0 -0
  124. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/onnx/.gitkeep +0 -0
  125. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/postprocessor/__init__.py +0 -0
  126. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/postprocessor/dbnet_postporcessor.py +0 -0
  127. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/postprocessor/parseq_tokenizer.py +0 -0
  128. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/postprocessor/rtdetr_postprocessor.py +0 -0
  129. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/reading_order.py +0 -0
  130. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/resource/MPLUS1p-Medium.ttf +0 -0
  131. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/resource/charset.txt +0 -0
  132. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/table_structure_recognizer.py +0 -0
  133. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/text_detector.py +0 -0
  134. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/text_recognizer.py +0 -0
  135. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/utils/__init__.py +0 -0
  136. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/utils/graph.py +0 -0
  137. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/utils/logger.py +0 -0
  138. {yomitoku-0.8.0 → yomitoku-0.9.0}/src/yomitoku/utils/visualizer.py +0 -0
  139. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/in/demo.jpg +0 -0
  140. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/in/gallery1.jpg +0 -0
  141. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/in/gallery2.jpg +0 -0
  142. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/in/gallery3.jpg +0 -0
  143. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/in/gallery4.jpg +0 -0
  144. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/in/gallery5.jpg +0 -0
  145. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/in/gallery6.jpg +0 -0
  146. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/in/gallery7.jpeg +0 -0
  147. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/logo/horizontal.png +0 -0
  148. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/demo_html.png +0 -0
  149. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/figures/in_demo_p1_figure_0.png +0 -0
  150. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/figures/in_gallery1_p1_figure_0.png +0 -0
  151. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/figures/in_gallery1_p1_figure_1.png +0 -0
  152. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/figures/in_gallery1_p1_figure_10.png +0 -0
  153. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/figures/in_gallery1_p1_figure_2.png +0 -0
  154. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/figures/in_gallery1_p1_figure_3.png +0 -0
  155. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/figures/in_gallery1_p1_figure_4.png +0 -0
  156. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/figures/in_gallery1_p1_figure_5.png +0 -0
  157. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/figures/in_gallery1_p1_figure_6.png +0 -0
  158. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/figures/in_gallery1_p1_figure_7.png +0 -0
  159. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/figures/in_gallery1_p1_figure_8.png +0 -0
  160. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/figures/in_gallery1_p1_figure_9.png +0 -0
  161. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/figures/in_gallery3_p1_figure_0.png +0 -0
  162. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/figures/in_gallery3_p1_figure_1.png +0 -0
  163. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/figures/in_gallery5_p1_figure_0.png +0 -0
  164. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/figures/in_gallery5_p1_figure_1.png +0 -0
  165. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/figures/in_gallery6_p1_figure_0.png +0 -0
  166. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/figures/in_gallery6_p1_figure_1.png +0 -0
  167. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/figures/in_gallery7_p1_figure_0.png +0 -0
  168. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/in_demo_p1_layout.jpg +0 -0
  169. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/in_gallery2_p1_layout.jpg +0 -0
  170. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/in_gallery4_p1.html +0 -0
  171. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/in_gallery4_p1.md +0 -0
  172. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/in_gallery5_p1_layout.jpg +0 -0
  173. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/in_gallery7_p1.html +0 -0
  174. /yomitoku-0.8.0/tests/data/invalid.jpg → /yomitoku-0.9.0/static/out/in_gallery7_p1.md +0 -0
  175. {yomitoku-0.8.0 → yomitoku-0.9.0}/static/out/in_gallery7_p1_layout.jpg +0 -0
  176. /yomitoku-0.8.0/tests/data/invalid.pdf → /yomitoku-0.9.0/tests/data/invalid.jpg +0 -0
  177. {yomitoku-0.8.0 → yomitoku-0.9.0}/tests/data/rgba.png +0 -0
  178. {yomitoku-0.8.0 → yomitoku-0.9.0}/tests/data/sampldoc.tif +0 -0
  179. {yomitoku-0.8.0 → yomitoku-0.9.0}/tests/data/small.jpg +0 -0
  180. {yomitoku-0.8.0 → yomitoku-0.9.0}/tests/data/subdir/test.jpg +0 -0
  181. {yomitoku-0.8.0 → yomitoku-0.9.0}/tests/data/test.bmp +0 -0
  182. {yomitoku-0.8.0 → yomitoku-0.9.0}/tests/data/test.jpg +0 -0
  183. {yomitoku-0.8.0 → yomitoku-0.9.0}/tests/data/test.pdf +0 -0
  184. {yomitoku-0.8.0 → yomitoku-0.9.0}/tests/data/test.png +0 -0
  185. {yomitoku-0.8.0 → yomitoku-0.9.0}/tests/data/test.tiff +0 -0
  186. {yomitoku-0.8.0 → yomitoku-0.9.0}/tests/data/test.txt +0 -0
  187. {yomitoku-0.8.0 → yomitoku-0.9.0}/tests/data/test_gray.jpg +0 -0
  188. {yomitoku-0.8.0 → yomitoku-0.9.0}/tests/test_base.py +0 -0
  189. {yomitoku-0.8.0 → yomitoku-0.9.0}/tests/test_cli.py +0 -0
  190. {yomitoku-0.8.0 → yomitoku-0.9.0}/tests/test_data.py +0 -0
  191. {yomitoku-0.8.0 → yomitoku-0.9.0}/tests/test_document_analyzer.py +0 -0
  192. {yomitoku-0.8.0 → yomitoku-0.9.0}/tests/test_export.py +0 -0
  193. {yomitoku-0.8.0 → yomitoku-0.9.0}/tests/test_layout_analyzer.py +0 -0
  194. {yomitoku-0.8.0 → yomitoku-0.9.0}/tests/test_ocr.py +0 -0
  195. {yomitoku-0.8.0 → yomitoku-0.9.0}/tests/yaml/layout_parser.yaml +0 -0
  196. {yomitoku-0.8.0 → yomitoku-0.9.0}/tests/yaml/table_structure_recognizer.yaml +0 -0
  197. {yomitoku-0.8.0 → yomitoku-0.9.0}/tests/yaml/text_detector.yaml +0 -0
  198. {yomitoku-0.8.0 → yomitoku-0.9.0}/tests/yaml/text_recognizer.yaml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yomitoku
3
- Version: 0.8.0
3
+ Version: 0.9.0
4
4
  Summary: Yomitoku is an AI-powered document image analysis package designed specifically for the Japanese language.
5
5
  Author-email: Kotaro Kinoshita <kotaro.kinoshita@mlism.com>
6
6
  License: CC BY-NC-SA 4.0
@@ -19,6 +19,8 @@ Requires-Dist: shapely>=2.0.6
19
19
  Requires-Dist: timm>=1.0.11
20
20
  Requires-Dist: torch>=2.5.0
21
21
  Requires-Dist: torchvision>=0.20.0
22
+ Provides-Extra: mcp
23
+ Requires-Dist: mcp[cli]>=1.6.0; extra == 'mcp'
22
24
  Description-Content-Type: text/markdown
23
25
 
24
26
  日本語版 | [English](README_EN.md)
@@ -0,0 +1,48 @@
1
+ # MCP
2
+
3
+ This section explains how to use the Yomitoku MCP server in conjunction with Claude Desktop.
4
+
5
+ ## Installing Yomitoku
6
+
7
+ First, install Yomitoku by following the "Installation with uv" section in [Installation](installation.en.md).
8
+
9
+ However, to add `mcp` as a dependency during installation, include `mcp` in `--extra` as shown below.
10
+
11
+ ```bash
12
+ uv sync --extra mcp
13
+ ```
14
+
15
+ ## Setting up Claude Desktop
16
+
17
+ Next, add the following configuration to the `mcpServers` section of the Claude Desktop configuration file. (Refer to [here](https://modelcontextprotocol.io/quickstart/user) for how to open the configuration file)
18
+
19
+ ```json
20
+ {
21
+ "mcpServers": {
22
+ "yomitoku": {
23
+ "command": "uv",
24
+ "args": [
25
+ "--directory",
26
+ "(Absolute path of the directory where Yomitoku was cloned)",
27
+ "run",
28
+ "yomitoku_mcp"
29
+ ],
30
+ "env": {
31
+ "RESOURCE_DIR": "(Absolute path of the directory containing files for OCR)"
32
+ }
33
+ }
34
+ }
35
+ }
36
+ ```
37
+
38
+ For example, if you executed `git clone https://github.com/kotaro-kinoshita/yomitoku.git` in `/Users/your-username/workspace`, then `(Directory where Yomitoku was cloned)` would be `/Users/your-username/workspace/yomitoku`, and if you use `sample.pdf` in the `yomitoku/demo` directory, specify `(Directory containing files for OCR)` as `/Users/your-username/workspace/yomitoku/demo`.
39
+
40
+ ## Using Claude Desktop
41
+
42
+ * Please restart Claude Desktop to apply changes to the configuration file.
43
+
44
+ For example, if you use `yomitoku/demo/sample.pdf` as a sample, instruct as follows:
45
+
46
+ ```txt
47
+ Analyze sample.pdf using OCR and translate it into English.
48
+ ```
@@ -0,0 +1,50 @@
1
+ # MCP
2
+
3
+ ここではYomitokuのMCPサーバーをClaude Desktopに連携して利用する方法を説明します。
4
+
5
+ ## Yomitokuのインストール
6
+
7
+ まずは
8
+ [Installation](installation.ja.md)の「uvでのインストール」に従ってYomitokuをインストールしてください。
9
+
10
+ ただし、`mcp`を依存関係に追加するためにインストール時には下記のように`--extra`に`mcp`を加えます。
11
+
12
+ ```bash
13
+ uv sync --extra mcp
14
+ ```
15
+
16
+ ## Claude Desktopの設定
17
+
18
+ 次にClaude Desktopの設定ファイルの`mcpServers`に以下ように設定を追加します。(設定ファイルの開き方は[こちら](https://modelcontextprotocol.io/quickstart/user)を参照してください)
19
+
20
+ ```json
21
+ {
22
+ "mcpServers": {
23
+ "yomitoku": {
24
+ "command": "uv",
25
+ "args": [
26
+ "--directory",
27
+ "(YomitokuをCloneしたディレクトリの絶対パス)",
28
+ "run",
29
+ "yomitoku_mcp"
30
+ ],
31
+ "env": {
32
+ "RESOURCE_DIR": "(OCR対象のファイルがあるディレクトリの絶対パス)"
33
+ }
34
+ }
35
+ }
36
+ }
37
+ ```
38
+
39
+
40
+ 例えば、`/Users/your-username/workspace`で`git clone https://github.com/kotaro-kinoshita/yomitoku.git`を実行した場合は、`(YomitokuをCloneしたディレクトリ)`は`/Users/your-username/workspace/yomitoku`となり、`yomitoku/demo`ディレクトリの`sample.pdf`を用いる場合は`(OCR対象のファイルがあるディレクトリ)`を`/Users/your-username/workspace/yomitoku/demo`と指定します。
41
+
42
+ ## Claude Desktopでの利用
43
+
44
+ ※ 設定ファイルの変更を反映するにはClaude Desktopを再起動してください。
45
+
46
+ 例えば`yomitoku/demo/sample.pdf`をサンプルとして用いる場合、下記のように指示してください。
47
+
48
+ ```txt
49
+ sample.pdfをOCRで解析して要約してください。
50
+ ```
@@ -69,6 +69,7 @@ nav:
69
69
  - Installation: installation.md
70
70
  - CLI Usage: cli.md
71
71
  - Module Usage: module.md
72
+ - MCP: mcp.md
72
73
 
73
74
  repo_url: https://github.com/kotaro-kinoshita/yomitoku-dev
74
75
 
@@ -70,6 +70,12 @@ explicit = true
70
70
 
71
71
  [project.scripts]
72
72
  yomitoku = "yomitoku.cli.main:main"
73
+ yomitoku_mcp = "yomitoku.cli.mcp:run_mcp_server"
74
+
75
+ [project.optional-dependencies]
76
+ mcp = [
77
+ "mcp[cli]>=1.6.0",
78
+ ]
73
79
 
74
80
  [tool.tox]
75
81
  legacy_tox_ini = """
@@ -3,7 +3,6 @@ import os
3
3
  import time
4
4
  from pathlib import Path
5
5
 
6
- import cv2
7
6
  import torch
8
7
 
9
8
  from ..constants import SUPPORT_OUTPUT_FORMAT
@@ -14,6 +13,8 @@ from ..utils.logger import set_logger
14
13
  from ..export import save_csv, save_html, save_json, save_markdown
15
14
  from ..export import convert_json, convert_csv, convert_html, convert_markdown
16
15
 
16
+ from ..utils.misc import save_image
17
+
17
18
  logger = set_logger(__name__, "INFO")
18
19
 
19
20
 
@@ -94,7 +95,7 @@ def process_single_file(args, analyzer, path, format):
94
95
  args.outdir, f"{dirname}_{filename}_p{page+1}_ocr.jpg"
95
96
  )
96
97
 
97
- cv2.imwrite(out_path, ocr)
98
+ save_image(ocr, out_path)
98
99
  logger.info(f"Output file: {out_path}")
99
100
 
100
101
  if layout is not None:
@@ -102,7 +103,7 @@ def process_single_file(args, analyzer, path, format):
102
103
  args.outdir, f"{dirname}_{filename}_p{page+1}_layout.jpg"
103
104
  )
104
105
 
105
- cv2.imwrite(out_path, layout)
106
+ save_image(layout, out_path)
106
107
  logger.info(f"Output file: {out_path}")
107
108
 
108
109
  out_path = os.path.join(args.outdir, f"{dirname}_{filename}_p{page+1}.{format}")
@@ -0,0 +1,165 @@
1
+ import json
2
+ import io
3
+ import csv
4
+ import os
5
+ from pathlib import Path
6
+
7
+ from mcp.server.fastmcp import Context, FastMCP
8
+
9
+ from yomitoku import DocumentAnalyzer
10
+ from yomitoku.data.functions import load_image, load_pdf
11
+ from yomitoku.export import convert_json, convert_markdown, convert_csv, convert_html
12
+
13
+ try:
14
+ RESOURCE_DIR = os.environ["RESOURCE_DIR"]
15
+ except KeyError:
16
+ raise ValueError("Environment variable 'RESOURCE_DIR' is not set.")
17
+
18
+
19
+ analyzer = None
20
+
21
+
22
+ async def load_analyzer(ctx: Context) -> DocumentAnalyzer:
23
+ """
24
+ Load the DocumentAnalyzer instance if not already loaded.
25
+
26
+ Args:
27
+ ctx (Context): The context in which the analyzer is being loaded.
28
+
29
+ Returns:
30
+ DocumentAnalyzer: The loaded document analyzer instance.
31
+ """
32
+ global analyzer
33
+ if analyzer is None:
34
+ await ctx.info("Load document analyzer")
35
+ analyzer = DocumentAnalyzer(visualize=False, device="cuda")
36
+ return analyzer
37
+
38
+
39
+ mcp = FastMCP("yomitoku")
40
+
41
+
42
+ @mcp.tool()
43
+ async def process_ocr(ctx: Context, filename: str, output_format: str) -> str:
44
+ """
45
+ Perform OCR on the specified file in the resource direcory and convert
46
+ the results to the desired format.
47
+
48
+ Args:
49
+ ctx (Context): The context in which the OCR processing is executed.
50
+ filename (str): The name of the file to process in the resource directory.
51
+ output_format (str): The desired format for the output. The available options are:
52
+ - json: Outputs the text as structured data along with positional information.
53
+ - markdown: Outputs texts and tables in Markdown format.
54
+ - html: Outputs texts and tables in HTML format.
55
+ - csv: Outputs texts and tables in CSV format.
56
+
57
+ Returns:
58
+ str: The OCR results converted to the specified format.
59
+ """
60
+ analyzer = await load_analyzer(ctx)
61
+
62
+ await ctx.info("Start ocr processing")
63
+
64
+ file_path = os.path.join(RESOURCE_DIR, filename)
65
+ if Path(file_path).suffix[1:].lower() in ["pdf"]:
66
+ imgs = load_pdf(file_path)
67
+ else:
68
+ imgs = load_image(file_path)
69
+
70
+ results = []
71
+ for page, img in enumerate(imgs):
72
+ analyzer.img = img
73
+ result, _, _ = await analyzer.run(img)
74
+ results.append(result)
75
+ await ctx.report_progress(page + 1, len(imgs))
76
+
77
+ if output_format == "json":
78
+ return json.dumps(
79
+ [
80
+ convert_json(
81
+ result,
82
+ out_path=None,
83
+ ignore_line_break=True,
84
+ img=img,
85
+ export_figure=False,
86
+ figure_dir=None,
87
+ ).model_dump()
88
+ for img, result in zip(imgs, results)
89
+ ],
90
+ ensure_ascii=False,
91
+ sort_keys=True,
92
+ separators=(",", ": "),
93
+ )
94
+ elif output_format == "markdown":
95
+ return "\n".join(
96
+ [
97
+ convert_markdown(
98
+ result,
99
+ out_path=None,
100
+ ignore_line_break=True,
101
+ img=img,
102
+ export_figure=False,
103
+ )[0]
104
+ for img, result in zip(imgs, results)
105
+ ]
106
+ )
107
+ elif output_format == "html":
108
+ return "\n".join(
109
+ [
110
+ convert_html(
111
+ result,
112
+ out_path=None,
113
+ ignore_line_break=True,
114
+ img=img,
115
+ export_figure=False,
116
+ export_figure_letter="",
117
+ )[0]
118
+ for img, result in zip(imgs, results)
119
+ ]
120
+ )
121
+ elif output_format == "csv":
122
+ output = io.StringIO()
123
+ writer = csv.writer(output, quoting=csv.QUOTE_MINIMAL)
124
+ for img, result in zip(imgs, results):
125
+ elements = convert_csv(
126
+ result,
127
+ out_path=None,
128
+ ignore_line_break=True,
129
+ img=img,
130
+ export_figure=False,
131
+ )
132
+ for element in elements:
133
+ if element["type"] == "table":
134
+ writer.writerows(element["element"])
135
+ else:
136
+ writer.writerow([element["element"]])
137
+ writer.writerow([""])
138
+ return output.getvalue()
139
+ else:
140
+ raise ValueError(
141
+ f"Unsupported output format: {output_format}."
142
+ " Supported formats are json, markdown, html or csv."
143
+ )
144
+
145
+
146
+ @mcp.resource("file://list")
147
+ async def get_file_list() -> list[str]:
148
+ """
149
+ Retrieve a list of files in the resource directory.
150
+
151
+ Returns:
152
+ list[str]: A list of filenames in the resource directory.
153
+ """
154
+ return os.listdir(RESOURCE_DIR)
155
+
156
+
157
+ def run_mcp_server():
158
+ """
159
+ Run the MCP server.
160
+ """
161
+ mcp.run(transport="stdio")
162
+
163
+
164
+ if __name__ == "__main__":
165
+ run_mcp_server()
@@ -27,7 +27,7 @@ class Data:
27
27
  @dataclass
28
28
  class PostProcess:
29
29
  min_size: int = 2
30
- thresh: float = 0.2
30
+ thresh: float = 0.15
31
31
  box_thresh: float = 0.5
32
32
  max_candidates: int = 1500
33
33
  unclip_ratio: float = 7.0
@@ -27,10 +27,10 @@ class Data:
27
27
  @dataclass
28
28
  class PostProcess:
29
29
  min_size: int = 2
30
- thresh: float = 0.4
30
+ thresh: float = 0.2
31
31
  box_thresh: float = 0.5
32
32
  max_candidates: int = 1500
33
- unclip_ratio: float = 6.0
33
+ unclip_ratio: float = 5.0
34
34
 
35
35
 
36
36
  @dataclass
@@ -1,7 +1,7 @@
1
1
  import csv
2
2
  import os
3
3
 
4
- import cv2
4
+ from ..utils.misc import save_image
5
5
 
6
6
 
7
7
  def table_to_csv(table, ignore_line_break):
@@ -54,7 +54,7 @@ def save_figure(
54
54
  filename = os.path.splitext(os.path.basename(out_path))[0]
55
55
  figure_name = f"{filename}_figure_{i}.png"
56
56
  figure_path = os.path.join(save_dir, figure_name)
57
- cv2.imwrite(figure_path, figure_img)
57
+ save_image(figure_img, figure_path)
58
58
 
59
59
 
60
60
  def convert_csv(
@@ -1,10 +1,10 @@
1
1
  import os
2
2
  import re
3
3
  from html import escape
4
-
5
- import cv2
6
4
  from lxml import etree, html
7
5
 
6
+ from ..utils.misc import save_image
7
+
8
8
 
9
9
  def convert_text_to_html(text):
10
10
  """
@@ -122,7 +122,7 @@ def figure_to_html(
122
122
  filename = os.path.splitext(os.path.basename(out_path))[0]
123
123
  figure_name = f"{filename}_figure_{i}.png"
124
124
  figure_path = os.path.join(save_dir, figure_name)
125
- cv2.imwrite(figure_path, figure_img)
125
+ save_image(figure_img, figure_path)
126
126
 
127
127
  elements.append(
128
128
  {
@@ -180,8 +180,13 @@ def convert_html(
180
180
  elements = sorted(elements, key=lambda x: x["order"])
181
181
 
182
182
  html_string = "".join([element["html"] for element in elements])
183
- parsed_html = html.fromstring(html_string)
184
- formatted_html = etree.tostring(parsed_html, pretty_print=True, encoding="unicode")
183
+ if not len(html_string) == 0:
184
+ parsed_html = html.fromstring(html_string)
185
+ formatted_html = etree.tostring(
186
+ parsed_html, pretty_print=True, encoding="unicode"
187
+ )
188
+ else:
189
+ formatted_html = ""
185
190
 
186
191
  return formatted_html, elements
187
192
 
@@ -1,7 +1,7 @@
1
1
  import json
2
2
  import os
3
3
 
4
- import cv2
4
+ from ..utils.misc import save_image
5
5
 
6
6
 
7
7
  def paragraph_to_json(paragraph, ignore_line_break):
@@ -33,7 +33,7 @@ def save_figure(
33
33
  filename = os.path.splitext(os.path.basename(out_path))[0]
34
34
  figure_name = f"{filename}_figure_{i}.png"
35
35
  figure_path = os.path.join(save_dir, figure_name)
36
- cv2.imwrite(figure_path, figure_img)
36
+ save_image(figure_img, figure_path)
37
37
 
38
38
 
39
39
  def convert_json(inputs, out_path, ignore_line_break, img, export_figure, figure_dir):
@@ -1,7 +1,7 @@
1
1
  import os
2
2
  import re
3
3
 
4
- import cv2
4
+ from ..utils.misc import save_image
5
5
 
6
6
 
7
7
  def escape_markdown_special_chars(text):
@@ -89,7 +89,7 @@ def figure_to_md(
89
89
  filename = os.path.splitext(os.path.basename(out_path))[0]
90
90
  figure_name = f"{filename}_figure_{i}.png"
91
91
  figure_path = os.path.join(save_dir, figure_name)
92
- cv2.imwrite(figure_path, figure_img)
92
+ save_image(figure_img, figure_path)
93
93
 
94
94
  elements.append(
95
95
  {
@@ -1,3 +1,6 @@
1
+ import cv2
2
+
3
+
1
4
  def load_charset(charset_path):
2
5
  with open(charset_path, "r", encoding="utf-8") as f:
3
6
  charset = f.read()
@@ -9,6 +12,15 @@ def filter_by_flag(elements, flags):
9
12
  return [element for element, flag in zip(elements, flags) if flag]
10
13
 
11
14
 
15
+ def save_image(img, path):
16
+ success, buffer = cv2.imencode(".jpg", img)
17
+ if not success:
18
+ raise ValueError("Failed to encode image")
19
+
20
+ with open(path, "wb") as f:
21
+ f.write(buffer.tobytes())
22
+
23
+
12
24
  def calc_overlap_ratio(rect_a, rect_b):
13
25
  intersection = calc_intersection(rect_a, rect_b)
14
26
  if intersection is None:
@@ -1,10 +1,10 @@
1
1
  <div>
2
- <p>AI の進化に伴う課題と現状の取組</p>
2
+ <p>Al の進化に伴う課題と現状の取組</p>
3
3
  <p>第1節</p>
4
4
  <p>第4章<br/>デジタルテクノロジーの課題と現状の対応策</p>
5
5
  <table border="1" style="border-collapse: collapse">
6
6
  <tr>
7
- <td rowspan="1" colspan="3">図表 I-4-1-1<br/>生成AIの課題</td>
7
+ <td rowspan="1" colspan="3">図表I-4-1-1<br/>生成AIの課題</td>
8
8
  </tr>
9
9
  <tr>
10
10
  <td rowspan="1" colspan="2">リスク</td>
@@ -17,7 +17,7 @@
17
17
  </tr>
18
18
  <tr>
19
19
  <td rowspan="1" colspan="1">フィルターバブル及びエコーチェンバー現象</td>
20
- <td rowspan="1" colspan="1">●SNS等によるレコメンドを通じた社会の分断が生じている</td>
20
+ <td rowspan="1" colspan="1">● SNS 等によるレコメンドを通じた社会の分断が生じている</td>
21
21
  </tr>
22
22
  <tr>
23
23
  <td rowspan="1" colspan="1">多様性の喪失</td>
@@ -29,7 +29,7 @@
29
29
  </tr>
30
30
  <tr>
31
31
  <td rowspan="1" colspan="1">生命、身体、財産の侵害</td>
32
- <td rowspan="1" colspan="1">●AIが不適切な判断を下すことで、自動運転車が事故を引き起こし、生命や財産に深刻な損害<br/>を与える可能性がある<br/>●トリアージにおいては、AIが順位を決定する際に倫理的なバイアスを持つことで、公平性の<br/>喪失等が生じる可能性がある</td>
32
+ <td rowspan="1" colspan="1">●AI が不適切な判断を下すことで、自動運転車が事故を引き起こし、生命や財産に深刻な損害<br/>を与える可能性がある<br/>●トリアージにおいては、AIが順位を決定する際に倫理的なバイアスを持つことで、公平性の<br/>喪失等が生じる可能性がある</td>
33
33
  </tr>
34
34
  <tr>
35
35
  <td rowspan="1" colspan="1">データ汚染攻撃</td>
@@ -37,7 +37,7 @@
37
37
  </tr>
38
38
  <tr>
39
39
  <td rowspan="1" colspan="1">ブラックボックス化、判断に関する説明の要求</td>
40
- <td rowspan="1" colspan="1">● AIの判断のブラックボックス化に起因する問題も生じている<br/>●AIの判断に関する透明性を求める動きも上がっている</td>
40
+ <td rowspan="1" colspan="1">●AIの判断のブラックボックス化に起因する問題も生じている<br/>●AIの判断に関する透明性を求める動きも上がっている</td>
41
41
  </tr>
42
42
  <tr>
43
43
  <td rowspan="1" colspan="1">エネルギー使用量及び環境の負荷</td>
@@ -46,7 +46,7 @@
46
46
  <tr>
47
47
  <td rowspan="7" colspan="1">生成AIで<br/>特に顕在化<br/>したリスク</td>
48
48
  <td rowspan="1" colspan="1">悪用</td>
49
- <td rowspan="1" colspan="1">● AIの詐欺目的での利用も問題視されている</td>
49
+ <td rowspan="1" colspan="1">●AIの詐欺目的での利用も問題視されている</td>
50
50
  </tr>
51
51
  <tr>
52
52
  <td rowspan="1" colspan="1">機密情報の流出</td>
@@ -54,7 +54,7 @@
54
54
  </tr>
55
55
  <tr>
56
56
  <td rowspan="1" colspan="1">ハルシネーション</td>
57
- <td rowspan="1" colspan="1">●生成AIが事実と異なることをもっともらしく回答する「ハルシネーション」に関してはAI開<br/>発者·提供者への訴訟も起きている</td>
57
+ <td rowspan="1" colspan="1">●生成AIが事実と異なることをもっともらしく回答する「ハルシネーション」に関してはAI開<br/>発者・提供者への訴訟も起きている</td>
58
58
  </tr>
59
59
  <tr>
60
60
  <td rowspan="1" colspan="1">偽情報、誤情報を鵜呑みにすること</td>
@@ -74,11 +74,11 @@
74
74
  </tr>
75
75
  </table>
76
76
  <p/>
77
- <h1>1<br/>主要な LLMの概要</h1>
77
+ <h1>1 主要なLLMの概要</h1>
78
78
  <p>(出典)「AI事業者ガイドライン(第1.0版)」別添(概要)</p>
79
79
  <p>生成AIの基盤となる大規模言語モデル(LLM)の開発では、マイクロソフトやグーグルなど米<br/>国ビックテック企業などが先行している状況にある。</p>
80
80
  <p>しかし、日本以外の企業·研究機関がクローズに研究開発を進めたLLM を活用するだけでは、<br/>LLM構築の過程がブラックボックス化してしまい、LLMを活用する際の権利侵害や情報漏えいな<br/>どの懸念を払拭できない。日本語に強いLLMの利活用のためには、構築の過程や用いるデータが<br/>明らかな、透明性の高い安心して利活用できる国産のLLM構築が必要となる*3。すでに日本の企業<br/>においても、独自にLLM開発に取り組んでおり、ここではその動向を紹介する。</p>
81
- <p>ビッグテック企業が開発したLLMと比べると、日本では、中規模モデルのLLMが開発されてい<br/>る傾向が見られる(図表I-4-1-2)。</p>
82
- <p>*3 産業技術総合研究所プレスリリース「産総研の計算資源ABCIを用いて世界トップレベルの生成AIの開発を開始一産総研·東京工業大学·<br/>LLM-jp(国立情報学研究所主宰)が協力ー」(2023年10月17日), &lt; &lt; ttps://www.aist go.jp/aist_i/news/pr20231017.html&gt; (2024/<br/>参照)</p>
81
+ <p>ビッグテック企業が開発したLLMと比べると、日本では、中規模モデルのLLMが開発されてい<br/>る傾向が見られる(図表 I-4-1-2)。</p>
82
+ <p>*3 産業技術総合研究所プレスリリース「産総研の計算資源ABCIを用いて世界トップレベルの生成AIの開発を開始一産総研·東京工業大学·<br/>LLM-jp(国立情報学研究所主宰)が協力ー」(2023年10月17日), &lt; &lt; https://www.aist go.jp/aist_j/news/pr20231017.html&gt; (2022<br/>参照)</p>
83
83
  <p>令和6年版 情報通信白書 第I部 47</p>
84
84
  </div>
@@ -1,29 +1,29 @@
1
- AI の進化に伴う課題と現状の取組
1
+ Al の進化に伴う課題と現状の取組
2
2
 
3
3
  第1節
4
4
 
5
5
  第4章<br>デジタルテクノロジーの課題と現状の対応策
6
6
 
7
- |図表 I\-4\-1\-1<br>生成AIの課題|||
7
+ |図表I\-4\-1\-1<br>生成AIの課題|||
8
8
  |-|-|-|
9
9
  |リスク||事例|
10
10
  |従来型AI<br>から存在<br>するリスク|バイアスのある結果及び差別的な結果の出力|●IT企業が自社で開発したAI人材採用システムが女性を差別するという機械学習面の欠陥を持<br>ち合わせていた|
11
- ||フィルターバブル及びエコーチェンバー現象|●SNS等によるレコメンドを通じた社会の分断が生じている|
11
+ ||フィルターバブル及びエコーチェンバー現象|● SNS 等によるレコメンドを通じた社会の分断が生じている|
12
12
  ||多様性の喪失|●社会全体が同じモデルを、同じ温度感で使った場合、導かれる意見及び回答がLLMによって<br>収束してしまい、多様性が失われる可能性がある|
13
13
  ||不適切な個人情報の取扱い|●透明性を欠く個人情報の利用及び個人情報の政治利用も問題視されている|
14
- ||生命、身体、財産の侵害|●AIが不適切な判断を下すことで、自動運転車が事故を引き起こし、生命や財産に深刻な損害<br>を与える可能性がある<br>●トリアージにおいては、AIが順位を決定する際に倫理的なバイアスを持つことで、公平性の<br>喪失等が生じる可能性がある|
14
+ ||生命、身体、財産の侵害|●AI が不適切な判断を下すことで、自動運転車が事故を引き起こし、生命や財産に深刻な損害<br>を与える可能性がある<br>●トリアージにおいては、AIが順位を決定する際に倫理的なバイアスを持つことで、公平性の<br>喪失等が生じる可能性がある|
15
15
  ||データ汚染攻撃|●AIの学習実施時及びサービス運用時には学習データへの不正データ混入、サービス運用時で<br>はアプリケーション自体を狙ったサイバー攻撃等のリスクが存在する|
16
- ||ブラックボックス化、判断に関する説明の要求|● AIの判断のブラックボックス化に起因する問題も生じている<br>●AIの判断に関する透明性を求める動きも上がっている|
16
+ ||ブラックボックス化、判断に関する説明の要求|●AIの判断のブラックボックス化に起因する問題も生じている<br>●AIの判断に関する透明性を求める動きも上がっている|
17
17
  ||エネルギー使用量及び環境の負荷|●AIの利用拡大により、計算リソースの需要も拡大しており、結果として、データセンターが<br>増大しエネルギー使用量の増加が懸念されている|
18
- |生成AIで<br>特に顕在化<br>したリスク|悪用|● AIの詐欺目的での利用も問題視されている|
18
+ |生成AIで<br>特に顕在化<br>したリスク|悪用|●AIの詐欺目的での利用も問題視されている|
19
19
  ||機密情報の流出|●AIの利用においては、個人情報や機密情報がプロンプトとして入力され、そのAIからの出力<br>等を通じて流出してしまうリスクがある|
20
- ||ハルシネーション|●生成AIが事実と異なることをもっともらしく回答する「ハルシネーション」に関してはAI開<br>発者·提供者への訴訟も起きている|
20
+ ||ハルシネーション|●生成AIが事実と異なることをもっともらしく回答する「ハルシネーション」に関してはAI開<br>発者・提供者への訴訟も起きている|
21
21
  ||偽情報、誤情報を鵜呑みにすること|●生成AIが生み出す誤情報を鵜呑みにすることがリスクとなりうる<br>●ディープフェイクは、各国で悪用例が相次いでいる|
22
22
  ||著作権との関係|●知的財産権の取扱いへの議論が提起されている|
23
23
  ||資格等との関係|●生成AIの活用を通じた業法免許や資格等の侵害リスクも考えうる|
24
24
  ||バイアスの再生成|●生成AIは既存の情報に基づいて回答を作るため既存の情報に含まれる偏見を増幅し、不公平<br>や差別的な出力が継続/拡大する可能性がある|
25
25
 
26
- # 1<br>主要な LLMの概要
26
+ # 1 主要なLLMの概要
27
27
 
28
28
  \(出典\)「AI事業者ガイドライン\(第1.0版\)」別添\(概要\)
29
29
 
@@ -31,8 +31,8 @@ AI の進化に伴う課題と現状の取組
31
31
 
32
32
  しかし、日本以外の企業·研究機関がクローズに研究開発を進めたLLM を活用するだけでは、<br>LLM構築の過程がブラックボックス化してしまい、LLMを活用する際の権利侵害や情報漏えいな<br>どの懸念を払拭できない。日本語に強いLLMの利活用のためには、構築の過程や用いるデータが<br>明らかな、透明性の高い安心して利活用できる国産のLLM構築が必要となる\*3。すでに日本の企業<br>においても、独自にLLM開発に取り組んでおり、ここではその動向を紹介する。
33
33
 
34
- ビッグテック企業が開発したLLMと比べると、日本では、中規模モデルのLLMが開発されてい<br>る傾向が見られる\(図表I\-4\-1\-2\)。
34
+ ビッグテック企業が開発したLLMと比べると、日本では、中規模モデルのLLMが開発されてい<br>る傾向が見られる\(図表 I\-4\-1\-2\)。
35
35
 
36
- \*3 産業技術総合研究所プレスリリース「産総研の計算資源ABCIを用いて世界トップレベルの生成AIの開発を開始一産総研·東京工業大学·<br>LLM\-jp\(国立情報学研究所主宰\)が協力ー」\(2023年10月17日\), < < ttps://www.aist go.jp/aist_i/news/pr20231017.html> \(2024/<br>参照\)
36
+ \*3 産業技術総合研究所プレスリリース「産総研の計算資源ABCIを用いて世界トップレベルの生成AIの開発を開始一産総研·東京工業大学·<br>LLM\-jp\(国立情報学研究所主宰\)が協力ー」\(2023年10月17日\), < < https://www.aist go.jp/aist_j/news/pr20231017.html> \(2022<br>参照\)
37
37
 
38
38
  令和6年版 情報通信白書 第I部 47