ispras / dedoc

Dedoc is a library (service) for automate documents parsing and bringing to a uniform format. It automatically extracts content, logical structure, tables, and meta information from textual electronic documents. (Parse document; Document content extraction; Logical structure extraction; PDF parser; Scanned document parser; DOCX parser; HTML parser
Apache License 2.0
111 stars 15 forks source link

Неправильное определение размера шрифта #378

Closed ValiullinAlbert closed 6 months ago

ValiullinAlbert commented 7 months ago

Приложение 2.docx

При считывании этого документа неправильно определяются размер шрифта:

import numpy as np
from dedoc.readers import DocxReader

filepath = "Приложение 2.docx"
reader = DocxReader(config={})
document = reader.read(filepath, parameters={"with_attachments": "false"})
for index, line in enumerate(document.lines):
    annotation = line.annotations
    wheres = (np.where(np.asarray([x.name for x in annotation]) == "size"))[0]
    print(line.line)
    for where in wheres:
        print(annotation[where])

Вывод следующий:

Приложение 2
к распоряжению 

Size(0:29, 12.0)

Соотношение долей командных и индивидуальных ключевых показателей эффективности для целей проведения оценки результативности работников 

Size(0:137, 12.0)
Size(44:45, 11.0)

В последней строке присутствуют 2 разных шрифта, при этом пересекающихся между собой

NastyBoget commented 7 months ago

Ошибка воспроизвелась, постараемся исправить в ближайшее время, спасибо!

NastyBoget commented 6 months ago

Поправили в новой версии dedoc==2.0