finic-ai / doctran

MIT License
479 stars 42 forks source link

AttributeError: 'coroutine' object has no attribute 'extracted_properties' ​ #7

Open AutomaticHourglass opened 1 year ago

AutomaticHourglass commented 1 year ago

I'm trying to replicate the tutorial but got this error on Extract Properties section:


AttributeError                            Traceback (most recent call last)
Cell In[37], line 34
      4 properties = [ExtractProperty(
      5             name="contact_info", 
      6             description="A list of each person mentioned and their contact information",
   (...)
     30             required=True
     31         )]
     33 transformed_document = document.extract(properties=properties).execute()
---> 34 print(json.dumps(transformed_document.extracted_properties, indent=2))

AttributeError: 'coroutine' object has no attribute 'extracted_properties'```
AutomaticHourglass commented 1 year ago

Found the solution:

You need to write: transformed_documents = await document.extract(properties=properties).execute()