Azure / Azure/azure-sdk-for-python

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

Ouverte
#39,062 2 commentaires 0 réactions 1 personne assignée Assignée à @bojunehsu Voir sur GitHub
Client Cognitive - Form Recognizer customer-reported needs-team-attention question Service Attention
Langage dominant
Python
Étoiles
5.6k
Forks
3.4k
Merge moyen
2 j
PR mergées (30 j)
217

Description

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

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.