Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

langextract.resolver.ResolverParsingError: Failed to parse JSON content: Expecting value: line 1 column 1 (char 0) #258

Copy link
Copy link
@eromoe

Description

@eromoe
Issue body actions

INFO:absl:Starting resolver process for input text.
DEBUG:absl:Input Text:

{
  "extractions": [
    {
      "document_title": "20250702 rate guideline.xlsx",
      "document_title_attributes": {
        "document_type": "rate_guideline",
        "date": "20250702"
      }
    },
    {
      "sheet_name": "US Rate",
      "sheet_name_attributes": {
        "document_section": "worksheet",
        "market": "US"
      }
    },
    {
      "section_title": "Appendix Rate Sheet",
      "section_title_attributes": {
        "document_section": "appendix"
      }
    },
    {
      "general_note": "1. Except otherwise specified, the rates detailed hereunder are subject to the Notes which appears in Appendix - General Note",
      "general_note_attributes": {
        "note_type": "reference",
        "reference_document": "Appendix - General Note"
      }
    },
    {
      "container_formula_note": "2. Unless otherwise specified, the rate formula other than 40' standard container is set as per Appendix - Formula, 45' HQ should be subject to service and equipment availability.",
      "container_formula_note_attributes": {
        "note_type": "container_formula",
        "container_type": "45HQ",
        "availability_condition": "subject to service and equipment availability"
      }
    },
    {
      "arbitrary_charge_note": "3. Unless otherwise specified in (Origin) Add-On or (Destination) Add-On column, an additional arbitrary charge on top of the Kaohsiung, Hong Kong, Yantian, Pusan, Shanghai, Ningbo, Qingdao rates",
      "arbitrary_charge_note_attributes": {
        "note_type": "arbitrary_charge",
        "base_ports": [
          "Kaohsiung",
          "Hong Kong",
          "Yantian",
          "Pusan",
          "Shanghai",
          "Ningbo",
          "Qingdao"
        ]
      }
    },
    {
      "arbitrary_reference": "can be applicable as Appendix -Outport and Inland Add-On",
      "arbitrary_reference_attributes": {
        "reference_document": "Appendix -Outport and Inland Add-On"
      }
    },
    {
      "commodity_scope": "Straight or Mixed Loads of Commodities NOS including Textile, Garments, but excluding Reefer Cargoes, Dangerous or Hazardous Cargoes, Out-of-Gauge Cargoes and Taiwan Consolidated Cargo destined to Los Angeles,CA/ Oakland, CA/Chicago, IL.",
      "commodity_scope_attributes": {
        "commodity_types": [
          "NOS",
          "Textile",
          "Garments"
        ],
        "excluded_commodities": [
          "Reefer Cargoes",
          "Dangerous or Hazardous Cargoes",
          "Out-of-Gauge Cargoes",
          "Taiwan Consolidated Cargo"
        ],
        "destination_ports": [
          "Los Angeles,CA",
          "Oakland, CA",
          "Chicago, IL"
        ]
      }
    }
  ]
}

LangExtract: model=claude-3.7-sonnet-20250219, current=18,665 chars, processed=18,665 chars: [00:46]
Traceback (most recent call last):
File "C:\envs\ocr\Lib\site-packages\langextract\core\format_handler.py", line 176, in parse_output
parsed = json.loads(content)
^^^^^^^^^^^^^^^^^^^
File "C:\envs\ocr\Lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\envs\ocr\Lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\envs\ocr\Lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\envs\ocr\Lib\site-packages\langextract\resolver.py", line 259, in resolve
extraction_data = self.format_handler.parse_output(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\envs\ocr\Lib\site-packages\langextract\core\format_handler.py", line 182, in parse_output
raise exceptions.FormatParseError(msg) from e
langextract.core.exceptions.FormatParseError: Failed to parse JSON content: Expecting value: line 1 column 1 (char 0)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "D:\github_me\freight_extract\notebooks\test.py", line 44, in
result = lx.extract(
^^^^^^^^^^^
File "C:\envs\ocr\Lib\site-packages\langextract_init_.py", line 55, in extract
return extract_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\envs\ocr\Lib\site-packages\langextract\extraction.py", line 324, in extract
return annotator.annotate_text(
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\envs\ocr\Lib\site-packages\langextract\annotation.py", line 534, in annotate_text
annotations = list(
^^^^^
File "C:\envs\ocr\Lib\site-packages\langextract\annotation.py", line 249, in annotate_documents
yield from self._annotate_documents_single_pass(
File "C:\envs\ocr\Lib\site-packages\langextract\annotation.py", line 377, in _annotate_documents_single_pass
annotated_chunk_extractions = resolver.resolve(
^^^^^^^^^^^^^^^^^
File "C:\envs\ocr\Lib\site-packages\langextract\resolver.py", line 270, in resolve
raise ResolverParsingError(str(e)) from e
langextract.resolver.ResolverParsingError: Failed to parse JSON content: Expecting value: line 1 column 1 (char 0)

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.