mirror of
https://github.com/run-llama/llama_cloud_services.git
synced 2026-08-27 19:30:01 -04:00
LLamaparse could not extract figures from one pdf file despite good pdf quality (edge-case) #366
Open
opened 2026-02-16 00:17:38 -05:00 by yindo
·
16 comments
No Branch/Tag Specified
main
claude/slack-session-O3953
dependabot/github_actions/slackapi/slack-github-action-3.0.3
dependabot/github_actions/pnpm/action-setup-6
cursor/llamaparse-heartbeat-timeout-retry-d4fc
cursor/s3-transaction-race-6a10
cursor/llamacloud-chart-version-0-7-1-2dc9
nprad/extract-tests
changeset-release/main
nprad/update
nprad/xlsx
logan/deprecate_llama_parse
nprad/e2e-test-freq
nprad/fix-e2e-1
nprad/fix-e2e
nprad/e2e-test-invalidate-cache
nprad/slack-msg
nprad/retries
neerajprad-patch-3
nprad/reparse-yml2
nprad/reparse-yml
nprad/hourly-extract-tests
nprad/bump-patch
nprad/bump-version
claude/refactor-invalid-extraction-error-j6fJs
pierre/supportNoExtensionFiles
pierre/allowNotExtFiles
adrian/forgot-ts-changeset
adrian/bbox-support
logan/deprecate_notice
logan/fix_publish
clelia/corrent-links-in-readme
logan/improve_polling
parse-example
logan/client_tier
javier/li-4421-notebook-demo-using-split-api
fix-sheets-api
add_sheets_options
nprad/bump-v
logan/line_level_bbox
logan/dummy_release
logan/no_presigned_url
timeout
roman/batch-parse-example
adrian/testing-utils
clelia/agent-data-mock
pierre/moreParseParameters
cursor/implement-test-plan-and-create-mocked-tests-gpt-5.1-codex-high-3eb6
dependabot/github_actions/actions/checkout-6
cursor/implement-llama-cloud-testing-utilities-and-tests-gpt-5.1-codex-high-ae1a
nprad/nb-extract
logan/propagate_retrieval_mode
logan/beta_spreadsheet
adrian/fix-npm-build
adrian/ts-params
adrian/no-org-classify
nprad/bump-0.6.78
pjames27/job-id-on-parse-failure
nprad/sourcetxt
clelia/add-classify-ts
dependabot/github_actions/actions/setup-node-6
jerry/fix_classify_nb
bogdan/add-aggressive-table-extraction
logan/safest_types_possible
logna/fix_default_bbox_values
pjames27/only-escape-single-dollar
adrian/re-enable-js
logan/loosen_packaing
terry/fix_citataion_type
adrian/fixup-tagging
logan/fix_changeset_harder
logan/fix-version
adrian/fix-tag
pjames27/escaping-notebook-md-dollarsigns
adrian/tmp-disable-ts-release
adrian/changesets-fixes
adrian/fix-token
adrian/nvmrc
adrian/changesets
adrian/update-llama-cloud-dep
mnl/parse-classify-extract
cursor/LI-3624-handle-validation-errors-for-agent-data-retrieval-7504
adrian/extraction-metadata-bug
cursor/LI-3623-add-failing-test-for-citation-field-bug-9352
adrian/no-org-id
cursor/LI-3577-refactor-agent-fields-in-llama-cloud-services-1796
mnl/getting_started_multimodal
parse-error-handling
jerry/add_classify_extract_nb
mnl/add-streaming-citations
pierre/ChartAndBbox
nprad/v0.6.64
nprad/remove-report
clelia/fix-ts-release-notes
adrian/fix-v-prefix
adrian/client-unification
adrian/lint-version
jerry/new_getting_started_notebook
surface-errors
jerry/fix_preset_nb
logan/update_notebooks
jerry/add_parse_preset_notebooks
adrian/override-base-url
logan/deprecate_some_methods
jerry/fix_composite_retriever
bump-llama-cloud-services-0-1-38
adrian/extract-file
adrian/handle-error-field
fix/export-extracted-field-metadata-types
adrian/xdist
adrian/fix-lost-dimension
logan/sec_fixes
logan/fix_audio_results
nprad/update-extract-doc
clelia/refactor-parse-ts
clelia/add-extract-to-ts
clelia/changesets
nprad/update-extract
clelia/fix-python-tests
llama-cloud-index-demo
ms/add-e2e-tests
nprad/claude
ms/remove-llamaindex
adrian/re-enable
adrian/citation-confidence-fixes
adrian/extracted-citations
clelia/restructure-docs
clelia/delete-symlink-examples
clelia/examples-symlink
clelia/add-changesets
clelia/ts-examples
logan-markewich-patch-1
clelia/no-git-checks-on-publish
clelia/add-ts-examples
clelia/ts-refactoring
clelia/add-llamacloud-index
clelia/fix-npm-release
adrian/citations
javier/bump-llamacloud-version
clelia/monorepo
multimodal-reportgen-agent
adrian/derp
adrian/public-agent-data
update_get_result
adrian/update-0.6.49
adrian/full-md
nprad/update-v0.6.48
clelia/v0.6.47
clelia/add-table-extraction
rebelde/deprecate-llama-parse
adrian/agent-file-fields
pierre/merge_tables_across_pages_in_markdown
adrian/agent-data
logan/relax_pydantic_job_object
nprad/v0.6.42
pierre/headersFooters
nprad/bump-v0.6.39
logan/except_more
add-rpe
nprad/bump-v0.6.37
nprad/fix-flaky
nprad/v0.6.36
nprad/retry-job-fetch
nprad/v-0.6.35
logan/fix_partition
pierre/high_res_ocr
pierre/addWarningOnUnusedParameter
logan/bump_llama_cloud
jerry/add_fund_analysis_nb
nprad/bump-v0.6.30
suo/allow_none_project
logan/more_optional_types
logan/v0.6.25
pierre/outlined_table_extraction
logan/v0.6.24
nprad/insider-trans
nprad/bump-v-0.6.23
fix-verify
logan/v0.6.22
extract-with-citations
logan/more_optional
logan/v0.6.20
sacha/v0.6.19
pierre/auto_mode_configuration_json
pierre/preset
logan/original_width_height_optional
bump-v0.6.16
nprad/upgrade-le
logan/nits
pierre/page_error
logan/llama-report-tests
sacha/feat/add-markdown_table_multiline_header_separator
nprad/file-col
logan/parse_readme_nits
logan/v0.6.12
logan/new_result_object
nprad/le-docs
bump-v0.6.11
logan/v0.6.10
nprad/text-input-support
pierre/add_compact_markdown_table
nprad/pooling
nprad/support-bytes
marplex/parse_layout_agent_demo
neerajprad-patch-2
jerry/add_dd_notebook
nprad/rename-test-endpoint
jerry/add_solar_panel
mnl/eu-saas-readme
jerry/fix
jerry/extract_demo
bump-v0.6.9
pierre/update_parse_mode
nprad/nb-update
bump-v0.6.7
nprad/httpx-params-only
nprad/custom-httpx-client
nprad/xfail-report
bump-v0.6.6
nprad/update-lc
george/parse-retry
ljv/sec-edits
nprad/sec-10k
bump-v0.6.5
sacha/feat/adaptive_long_table
bump-0.6.3
neerajprad-patch-1
logan/vbump
nprad/add-le
pierre/upParameters
logan/fix_workflow
logan/org_id
jerry/add_gemini2_flash_nb
logan/v0.6.0
logan/refactor_services
sacha/fix/release-pipeline
pierre/newParameters
logan/v0.5.19
pierre/newFeatures
jerry/update_auto_mode
ljv/auto-mode-extended
jerry/auto_mode_notebook
pierre/htmlHideNavigationElements
ljv/json-mode-tour
pierre/morearguments
logan/add_test
jerry/dynamic_section_retrieval
pierre/input_url
pierre/xlsx2
pierre/newParams
jerry/mm_report_gen_image
sacha/feat/continuous-mode
sacha/chore/gh-template-update
jerry/fix_rfp_example
jerry/add_annotate_links
sacha/feat/formatting-instruction
sacha/feat/add-missing-parameters
jerry/add_rfp_workflow
jerry/add_mm_contextual_retrieval
logan/check_error
jerry/fix_excel_nb
jerry/move_o1_excel
pierre/premium_mode
jerry/fix_mm_slide_deck
sacha/fix/result-type-no-json
pierre/fix_path
sour/bump
jerry/update_readme
suo/take_screenshot
jerry/add_report_gen_agent
jerry/add_report_example
jerry/small_edits
jerry/add_gpt4omini_example
pierre/fix_page_separator
jerry/nit_fix_multimodal
jerry/add_sonnet
jerry/nit_fix
jerry/add_mm_notebook
pierre/new_param
logan/v0.4.5
pierre/new_params
jerry/dcf_rag_v2
jerry/add_split_by_page
jerry/rewrite_advanced_example
pierre/new_options
jerry/add_dcf_excel
jerry/add_kg_agent
pierre/spreadsheet
fastMode
logan/add_features
fix_img_path
jerry/add_caltrain_weekend_doc
jerry/add_gpt4o_mm_rag
jerry/fix_badge
jerry/caltrain_schedule
jerry/gpt4o_nb
logan/new_params
logan/fix_image_extension
html
html_support
update-notebooks
logan/fix_tests
logan/v0.4.1
logan/qol_fixes
logan/0.4.0
pierre/extend_formats
pierre/wip
jerry/fix_mongodb_nb
jerry/fix_advanced_title
jerry/revert_revert
hz/json
logan/openai_agent
jerry/fix_grammar
new_demo
ljv/parsing-instructions-demo
jerry/add_financial_powerpoint
jerry/add_ppt_demo
jerry/support_more_file_types
logan/fix_json_bug
jerry/add_json_cookbook
pierre/json-images
logan/fix_language
jerry/add_table_comparisons
jerry/bump_version_0.3.5
jerry/add_language_cookbook
pierre/add_language_support
jerry/new_example_astra
jerry/fix_astra_example
logan/async_batch
hz/demo_v5
hz/demo_v4
logan/update_docs
jerry/fix_v10
hz/demo_V3
hz/demo_v1
hz/llama_p_demo
suo/bump_version
suo/handle_exception
hz/demo_v2
hz/hz_pdf
sour/print_job_id
jerry/nits
hz/demo
llama_parse@0.6.94
llama-cloud-services-py@0.6.94
llama_parse@0.6.93
llama-cloud-services-py@0.6.93
llama_parse@0.6.92
llama-cloud-services@0.5.4
llama-cloud-services-py@0.6.92
llama_parse@0.6.91
llama-cloud-services-py@0.6.91
llama_parse@0.6.90
llama-cloud-services-py@0.6.90
llama-cloud-services@0.5.3
llama-cloud-services@0.5.2
llama_parse@0.6.89
llama-cloud-services-py@0.6.89
llama-cloud-services@0.5.1
llama_parse@0.6.88
llama-cloud-services@0.4.3
llama-cloud-services-py@0.6.88
llama_parse@0.6.87
llama-cloud-services-py@0.6.87
llama_parse@0.6.86
llama-cloud-services-py@0.6.86
llama_parse@0.6.85
llama-cloud-services-py@0.6.85
llama_parse@0.6.84
llama-cloud-services-py@0.6.84
llama_parse@0.6.83
llama-cloud-services-py@0.6.83
llama_parse@0.6.82
llama-cloud-services@0.4.2
llama-cloud-services-py@0.6.82
llama_parse@0.6.81
llama-cloud-services@0.4.1
llama-cloud-services-py@0.6.81
llama_parse@0.6.80
llama-cloud-services-py@0.6.80
llama_parse@0.6.79
llama-cloud-services@0.4.0
llama-cloud-services-py@0.6.79
llama_parse@0.6.78
llama-cloud-services-py@0.6.78
llama_parse@0.6.77
llama-cloud-services-py@0.6.77
llama-cloud-services@0.3.10
llama-cloud-services@0.3.9
llama_parse@0.6.76
llama-cloud-services-py@0.6.76
llama_parse@0.6.75
llama-cloud-services-py@0.6.75
llama_parse@0.6.74
llama-cloud-services-py@0.6.74
llama_parse@0.6.73
llama-cloud-services@0.3.8
llama-cloud-services-py@0.6.73
llama_parse@0.6.72
llama-cloud-services-py@0.6.72
llama-cloud-services@0.3.7
v0.6.69
v0.6.68
llama-cloud-services@0.3.6
v0.6.67
v0.6.66
llama-cloud-services@0.3.5
v0.6.65
v0.6.64
llama-cloud-services@0.3.4
v0.6.63
v0.6.62
v0.6.60
v0.6.59
llama-cloud-services@0.3.3
llama-cloud-services@0.3.2
v0.6.58
v0.6.57
llama-cloud-services@0.3.1
v0.6.56
llama-cloud-services@0.3.0
v0.6.55
llama-cloud-services@v0.2.0
v0.6.54
llama-cloud-services@0.1.0
v0.6.53
v0.6.52
v0.6.51
v0.6.50
v0.6.49
v0.6.48
v0.6.47
v0.6.46
v0.6.45
v0.6.44
v0.6.43
v0.6.42
v0.6.41
v0.6.40
v0.6.39
v0.6.38
v0.6.37
v0.6.36
v0.6.35
v0.6.33
v.0.6.33
v0.6.32
v0.6.31
v0.6.30
v0.6.29
v0.6.28
v.0.6.27
v0.6.26
v0.6.25
v0.6.24
v0.6.23
v0.6.22
v0.6.21
v0.6.20
v0.6.19
v0.6.18
v0.6.17
v0.6.16
v0.6.15
v0.6.14
v0.6.12
v0.6.11
v0.6.10
v0.6.9
v0.6.8
list
v0.6.7
v0.6.6
v0.6.5
v0.6.4
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.20
v0.5.19
v0.5.18
v0.5.17
v0.5.16
v0.5.15
v0.5.14
v0.5.13
v0.5.12
v0.5.11
v0.5.10
v0.5.9
v0.5.8
v0.5.7
v0.5.6
v0.5.5
v0.5.4
v0.5.3
v0.5.2
v0.5.1
v0.5.0
v0.4.9
v0.4.8
v0.4.7
v0.4.6
v0.4.5
v0.4.4
v0.4.3
v0.4.2
v0.4.1
No Label
enhancement
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: run-llama/llama_cloud_services#366
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @haniehm on GitHub (Dec 5, 2024).
Describe the bug
I am trying to extract graphical figures and text in some pdf files. The code below, which is inspired by a helpful response of @tkcoding to another issue does work for many pdfs with figures but there is an edge case, that I can not parse despite some "prompt" engineering effort:
This is the code I used, that is mostly adopted from (https://github.com/run-llama/llama_parse/issues/317)
Files
TRISL_Guideline_02_2021e_Aug2021Intercropping.pdf
Job ID
9d32683a-a45e-400b-8099-4f50ab29881f
Client:
Additional context
I am trying to extract Figures.
@BinaryBrain commented on GitHub (Dec 6, 2024):
It looks like you don't inject the parsing instruction (
parsing_instruction). Try this:@BinaryBrain commented on GitHub (Dec 6, 2024):
Note that we also have an option to skip_diagonal_text.
@haniehm commented on GitHub (Dec 6, 2024):
@BinaryBrain Thank you for your response. Tested with both options active and still does not work (job_id 555145c4-f0c9-4c68-a820-39220f04e069)
def __init__(self,parsing_ins): self.parser = LlamaParse( verbose=True, ignore_errors=False, invalidate_cache=True, do_not_cache=True, parsing_instruction=parsing_ins, skip_diagonal_text=True )@BinaryBrain commented on GitHub (Dec 6, 2024):
Oh, sorry I missed something else:
You need to fetch the markdown and not the text by providing
result_type="markdown".The parsing instruction don't apply to text because they are in a raw format.
If you don't want to rerun the job, you can use this API endpoint: https://api.cloud.llamaindex.ai/api/parsing/job/9d32683a-a45e-400b-8099-4f50ab29881f/result/markdown
@haniehm commented on GitHub (Dec 6, 2024):
@BinaryBrain Thank you I just tried
def __init__(self,parsing_ins): self.parser = LlamaParse( verbose=True, ignore_errors=False, invalidate_cache=True, do_not_cache=True, parsing_instruction=parsing_ins, skip_diagonal_text=True, result_type="markdown" )and still no luck (job_id ea6c8459-5b9e-4336-970a-cd12040e5142).@BinaryBrain commented on GitHub (Dec 6, 2024):
Can you post the markdown you get?
Have you tried another mode? Premium works very well on charts and figures.
@haniehm commented on GitHub (Dec 6, 2024):
response.txt you can search for "Figure 1. " and "Figure 2." and see the outcome in the markdown.
Have not tried Premium since this is a pro-bono project with 0 budget sadly.
Thanks
@tkcoding commented on GitHub (Dec 13, 2024):
@haniehm
Sorry for the last reply , if you haven find the solution.
Basically llama is still working on improving the image extraction ,specifically for images that looks like a bunch of text in an images often confuse the outcome of the extraction (extracted as bunch of text with delimiter).
Solution:
Hybrid with other framework like paddleOCR (best solution) or pymupdf (OK solution). To extract the images. Create a multi-vector retriever with images processed into text and taking markdown from llamaparse.
This will yield the best quality so far.
Note: Above paddleOCR and pymupdf are free as well so it fits your project purpose.
@BinaryBrain commented on GitHub (Dec 17, 2024):
@tkcoding There's no images in the document. It's texts representing some charts and diagrams. The OCR won't help.
@haniehm On the figure where there's a lot of
T T T T T T T T T T T T T T T T T T T T T T T, the markdown from the response shows:I don't really know what you expect the output to be but it seems to fit your prompt.
Furthermore, you can use the Premium Mode for free. It just cost more credits. Here your example in Markdown:
TRISL_Guideline_02_2021e_Aug2021Intercropping-1.pdf.md
@haniehm commented on GitHub (Dec 18, 2024):
@Thank you, @BinaryBrain and @tkcoding, for your assistance.
@BinaryBrain, I appreciate the clarification regarding the performance in Figure 1 and for sharing the markdown file—it’s very helpful. My primary concern lies with Figure 2, as it wasn’t extracted correctly. That said, I believe these are edge cases, as LlamaParse has performed well on other documents.
@BinaryBrain commented on GitHub (Dec 20, 2024):
I'd like LlamaParse to be able to handle each and every edge cases.
Could you manually generate the kind of answer you want for Figure 2, so I can have a better understanding on what should be the output?
@haniehm commented on GitHub (Dec 20, 2024):
@BinaryBrain Sure this is the response I was hoping for Figure 2:

@BinaryBrain commented on GitHub (Dec 20, 2024):
But how would you translate this in Markdown?
@haniehm commented on GitHub (Dec 20, 2024):
@BinaryBrain this is Figure 1 in the same document and I was hoping to get image below:


Interesting that llamaparse did detect the below Figure, which is in another document and has some similarities to figure 1 in the sense of using letters, very well with the prompt shared before .
@BinaryBrain commented on GitHub (Dec 20, 2024):
I see. Out of the box, we don't detect it as an image (because it's not really an image) but we just released a layout detection option: https://docs.cloud.llamaindex.ai/llamaparse/features/layout_extraction
It's 1 extra credit per page but it may solve your problem.
@haniehm commented on GitHub (Dec 20, 2024):
I am just wondering how the figure below was detected well and I got a .png file out of it using the prompt above but not for the other ones. This is a mystery to me.