Azure / Azure/azure-sdk-for-python

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

Aperta
#39,062 2 commenti 0 reazioni 1 assegnatario Assegnata a @bojunehsu Vedi su GitHub
Client Cognitive - Form Recognizer customer-reported needs-team-attention question Service Attention
Lingua principale
Python
Stelle
5.6k
Fork
3.4k
Merge medio
2g 2h
PR unite (30g)
202

Descrizione

- **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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.