Filimoa / open-parse

Improved file parsing for LLM’s
https://filimoa.github.io/open-parse/
MIT License
2.55k stars 100 forks source link

Unable to run library following provided steps #12

Closed dvalletj closed 7 months ago

dvalletj commented 7 months ago

Hi everyone, currently following the Quick Start guidelines and getting this error on the initial source code, I'm on Mac OS 13.5.1, Python 3.9.12

import openparse

basic_doc_path = "./sample-docs/mobile-home-manual.pdf"
parser = openparse.DocumentParser()
parsed_basic_doc = parser.parse(basic_doc_path)

for node in parsed_basic_doc.nodes:
    print(node)`

Error:

Traceback (most recent call last): File "/Users/dv/Desktop/sample_parse_data.py", line 1, in <module> import openparse File "/Users/dv/opt/anaconda3/lib/python3.9/site-packages/openparse/__init__.py", line 2, in <module> from openparse.doc_parser import ( File "/Users/dv/opt/anaconda3/lib/python3.9/site-packages/openparse/doc_parser.py", line 7, in <module> from openparse.processing import ( File "/Users/dv/opt/anaconda3/lib/python3.9/site-packages/openparse/processing/__init__.py", line 1, in <module> from .ingest import ( File "/Users/dv/opt/anaconda3/lib/python3.9/site-packages/openparse/processing/ingest.py", line 17, in <module> from openparse.processing.semantic_transforms import ( File "/Users/dv/opt/anaconda3/lib/python3.9/site-packages/openparse/processing/semantic_transforms.py", line 14, in <module> a: np.ndarray | list[float], b: np.ndarray | list[float] TypeError: unsupported operand type(s) for |: 'type' and 'types.GenericAlias'

Would greatly appreciate any suggestions in order to get the library working, thank you!

Filimoa commented 7 months ago

Arg python 3.9 kills me! I will push a fix tonight.

Filimoa commented 7 months ago

Fixed with openparse=0.5.1