<!-- Source: https://docs.squirro.com/en/latest/api/squirro.lib.nlp.steps.filters.PyMuPDFEntityBBoxFilter.html -->
# PyMuPDFEntityBBoxFilter

**`class PyMuPDFEntityBBoxFilter(config)`**

Bases: [`Filter`](squirro.lib.nlp.steps.filters.Filter.md#squirro.lib.nlp.steps.filters.Filter)

After SquirroEntityFilter has created entities with offsets/lengths,
this step uses PyMuPDF to compute precise bounding boxes and
fills in page_to_rects for each extract.

Parameters

- `type` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)) – bbox_filter
- `entities_field` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)) – Name of the input field where entities are stored.
- `output_field` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)) – Name of the output field where the updated entities will be stored.
- `pdf_input_field` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``None`) – Field of pdf page content

Methods SummaryMethods Documentation

**`get_ent_ranking(content, query)`**

Get the ordinal of the entity based on its text and page.
This assumes entities are grouped by text and page.

Return type

[`dict`](https://docs.python.org/3.11/library/stdtypes.html#dict)

**`get_pdf_files(fields)`**

Return type

[`Iterator`](https://docs.python.org/3.11/library/collections.abc.html#collections.abc.Iterator)[[`tuple`](https://docs.python.org/3.11/library/stdtypes.html#tuple)[[`dict`](https://docs.python.org/3.11/library/stdtypes.html#dict), [`str`](https://docs.python.org/3.11/library/stdtypes.html#str)]]

**`process_doc(doc)`**

Process a document

Parameters

`doc` ([`Document`](../technical/libnlp/base.md#squirro.lib.nlp.document.Document)) – Document

Returns

Processed document

Return type

[Document](../technical/libnlp/base.md#squirro.lib.nlp.document.Document)
