-
Hi, first of all thank you very much for this work, very interesting and useful! I have a little trouble understanding the API. For example, for a using as in the demo: If I want to extract the text by section for each category: TEXT, TITLE, LIST, TABLE and FIGURE (exactly same as in the Contiguous text demo output). I don't understand which class to use to do this? Except for the TABLE category, thanks to the deepdoctection.datapoint.page.Page class and its import deepdoctection as dd
analyzer = dd.get_dd_analyzer(language='en')
df = analyzer.analyze(path="my.pdf")
for dp in df: #loop on all pages
..#Which class to use on dp to extract each detected category and get their text? Many thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Hi, thanks for your question. I have to admit that the consumer API is very confusing and I am experimenting with a new one that will be hopefully easier to understand. The difficulty is to establish an API that can be used even if one has a model that determines different categories than the ones currently in use. For now every, layout block other than import deepdoctection as dd
path = "/path/to/dir"
analyzer = dd.get_dd_analyzer()
df = analyzer.analyze(path=path)
df.reset_state()
for dp in df:
for item in dp.items:
print(f"reading order: {item.reading_order}")
print(f"layout: {item.layout_type.value}")
print(f"text: {item.text} \n") |
Beta Was this translation helpful? Give feedback.
-
This answer does not work anymore. Any ideas on how to get boxes with their text in their respective reading order? |
Beta Was this translation helpful? Give feedback.
Hi, thanks for your question.
I have to admit that the consumer API is very confusing and I am experimenting with a new one that will be hopefully easier to understand. The difficulty is to establish an API that can be used even if one has a model that determines different categories than the ones currently in use.
For now every, layout block other than
'TABLE'
is stored inPage.items
. Saying that you can get name, reading order position and text of the layout block as follows: