Azure / Azure/azure-sdk-for-python

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

Abierto
#39,062 2 comentarios 0 reacciones 1 asignado Asignado a @bojunehsu Ver en GitHub
Client Cognitive - Form Recognizer customer-reported needs-team-attention question Service Attention
Lenguaje dominante
Python
Estrellas
5.6k
Forks
3.4k
Merge medio
2 d 2 h
PR fusionados (30 d)
202

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.