Skip to content

Specifoc JSON error #47

Closed as not planned
Closed as not planned

Description

@nataraj2712

Trying to run DocStrange in local GPU for Specific JSON format. Used the below code. Unfortunately got the unexpected keyword json_schema. Not sure if I am missing anything.

from docstrange import DocumentExtractor

extractor = DocumentExtractor()
result = extractor.extract("contract.pdf")


schema = {
    "contract_number": "string",
    "parties": ["string"],
    "total_value": "number",
    "start_date": "string",
    "terms": ["string"]
}

structured_data = result.extract_data(json_schema=schema)
print(structured_data)

Activity

  1. linear commented on Nov 19, 2025

    @linear
  2. thisnotebooksuser commented on Dec 1, 2025

    @thisnotebooksuser

    Has anyone had any success fixing this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions