Azure / Azure/azure-sdk-for-python

Words in `DocumentLine` store polygons as lists of floats instead of lists of `Point`s

Offen
#39,062 2 Kommentare 0 Reaktionen 1 zugewiesene Person Zugewiesen an @bojunehsu Auf GitHub ansehen
Client Cognitive - Form Recognizer customer-reported needs-team-attention question Service Attention
Vorherrschende Sprache
Python
Sterne
5.6k
Forks
3.4k
Ø Merge
2 T. 2 Std.
Gemergte PRs (30 T.)
202

Beschreibung

- **Package Name**: `azure.ai.formrecognizer`
- **Package Version**: 3.3.3
- **Operating System**: MacOS
- **Python Version**: 3.12

**Describe the bug**

The words in a `DocumentLine` seem to store their polygons as a list of floats rather than as a list of `Point` objects.

```python
from typing import reveal_type

line: DocumentLine
for w in line.get_words():
for p in w.polygon:
reveal_type(p) # this reveals as `Point` but it turns out to be a `float` at runtime
```

This is in contrast to iterating over words from the `words` field in a `DocumentPage`, where the polygons are indeed sequences of `Point` objects.

**To Reproduce**
Steps to reproduce the behavior:
1. Use a `prebuilt-read` model on pdf bytes to run OCR
2. Examine the words in a document line in the result

Tangentially related to #39031

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.