DocumentAnalyzerSchema¶
Bases: BaseSchema
ソースコード位置: src/yomitoku/schemas/document_analyzer.py
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 | |
to_csv(out_path, **kwargs)
¶
Export the document analysis results to a CSV file.
This method uses the export_csv function to convert the document analysis results
into a CSV format and save it to the specified file path.
引数:
| 名前 | タイプ | デスクリプション | デフォルト |
|---|---|---|---|
out_path
|
str
|
The file path where the CSV output will be saved. |
必須 |
**kwargs
|
Any
|
Additional keyword arguments for ignore_line_break (bool, optional): Whether to ignore line breaks in the text content. Defaults to False. img (np.ndarray, optional):
The input image associated with the document. Required if export_figure (bool, optional): Whether to export figures detected in the document. Defaults to True. export_figure_letter (bool, optional): Whether to export individual letters from figures. Defaults to False. figure_dir (str, optional):
The directory where figures will be saved if encoding (str, optional): The encoding to use for the CSV file. Defaults to "utf-8". |
{}
|
戻り値:
| 名前 | タイプ | デスクリプション |
|---|---|---|
list |
list[dict[str, Any]]
|
A list of elements representing the exported data, |
list[dict[str, Any]]
|
sorted by their order in the document. |
ソースコード位置: src/yomitoku/schemas/document_analyzer.py
to_html(out_path, **kwargs)
¶
Export the document analysis results to an HTML file.
This method uses the export_html function to convert the document analysis results
into an HTML format and save it to the specified file path.
引数:
| 名前 | タイプ | デスクリプション | デフォルト |
|---|---|---|---|
out_path
|
str
|
The file path where the HTML output will be saved. |
必須 |
**kwargs
|
Any
|
Additional keyword arguments for ignore_line_break (bool, optional): Whether to ignore line breaks in the text content. Defaults to False. export_figure (bool, optional): Whether to export figures detected in the document. Defaults to True. export_figure_letter (bool, optional): Whether to export individual letters from figures. Defaults to False. img (np.ndarray, optional):
The input image associated with the document. Required if figure_width (int, optional): The width (in pixels) of the exported figures in the HTML. Defaults to 200. figure_dir (str, optional):
The directory where figures will be saved if encoding (str, optional): The encoding to use for the HTML file. Defaults to "utf-8". |
{}
|
戻り値:
| 名前 | タイプ | デスクリプション |
|---|---|---|
str |
str
|
The formatted HTML content as a string. |
ソースコード位置: src/yomitoku/schemas/document_analyzer.py
to_json(out_path, **kwargs)
¶
Export the document analysis results to a JSON file.
This method uses the export_json function to convert the document analysis results
into a JSON format and save it to the specified file path.
引数:
| 名前 | タイプ | デスクリプション | デフォルト |
|---|---|---|---|
out_path
|
str
|
The file path where the JSON output will be saved. |
必須 |
**kwargs
|
Any
|
Additional keyword arguments for ignore_line_break (bool, optional): Whether to ignore line breaks in the text content. Defaults to False. img (np.ndarray, optional):
The input image associated with the document. Required if export_figure (bool, optional): Whether to include figures detected in the document in the JSON output. Defaults to False. figure_dir (str, optional):
The directory where figures will be saved if encoding (str, optional): The encoding to use for the JSON file. Defaults to "utf-8". |
{}
|
戻り値:
| 名前 | タイプ | デスクリプション |
|---|---|---|
DocumentAnalyzerSchema |
DocumentAnalyzerSchema
|
The converted document analysis results. |
ソースコード位置: src/yomitoku/schemas/document_analyzer.py
to_markdown(out_path, **kwargs)
¶
Export the document analysis results to a Markdown file.
This method uses the export_markdown function to convert the document analysis results
into a Markdown format and save it to the specified file path.
引数:
| 名前 | タイプ | デスクリプション | デフォルト |
|---|---|---|---|
out_path
|
str
|
The file path where the Markdown output will be saved. |
必須 |
**kwargs
|
Any
|
Additional keyword arguments for ignore_line_break (bool, optional): Whether to ignore line breaks in the text content. Defaults to False. export_figure (bool, optional): Whether to export figures detected in the document. Defaults to True. export_figure_letter (bool, optional): Whether to export individual letters from figures. Defaults to False. img (np.ndarray, optional):
The input image associated with the document. Required if figure_width (int, optional): The width (in pixels) of the exported figures in the Markdown. Defaults to 200. figure_dir (str, optional):
The directory where figures will be saved if encoding (str, optional): The encoding to use for the Markdown file. Defaults to "utf-8". |
{}
|
戻り値:
| 名前 | タイプ | デスクリプション |
|---|---|---|
str |
str
|
The formatted Markdown content as a string. |