SShortSingh.
Back to feed

Benchmark of 7 Python JSON parsers on 300 malformed LLM outputs reveals key tradeoffs

0
·1 views

A developer who maintains a Python tool called jsonshim built a 300-case test suite, MALFORMED-300, to evaluate how well seven JSON parsers handle malformed outputs from large language models. The benchmark, run on Python 3.12.3, split results across 275 recoverable cases and 25 unrecoverable ones to fairly account for differing design goals among the libraries. jsonshim led the overall 300-case ranking with 94% accuracy, largely due to its refusal policy on unrecoverable inputs, while json-repair edged ahead on the 275 recoverable cases at 96% versus 94.3%. Libraries like dirtyjson, json5, pyjson5, and demjson3 scored poorly overall because they are dialect parsers focused on looser JSON grammar, not on extracting JSON embedded in prose or code fences. The author advises developers to first determine what refusal behavior their pipeline requires — whether silent failures are acceptable — before choosing a parser based on recovery rate.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

How to Migrate Java App Deployment from RPM to TAR Using Gradle and Ansible

Switching from RPM-based distribution to .tar.gz archives removes dependency on host-level package managers like yum or dnf, simplifying build pipelines. On the Gradle side, RPM plugins and tasks are replaced with the native distribution plugin or a custom Tar task, and Artifactory publishing is updated to push the archive and a manifest file. For Ansible deployment, yum and dnf installation tasks are swapped out for the built-in unarchive module, which downloads and unpacks the tarball directly onto the target host. Unlike RPM, tar-based deployments do not automatically manage file permissions, so ownership and access modes must be explicitly set in Ansible tasks. Versioned extraction directories are also recommended to handle rollbacks cleanly, since tar does not update a package database.

0
ProgrammingDEV Community ·

Free browser tool transcribes audio and video in 90+ languages without signup

Developer Nadia has launched MP3toText, a free browser-based transcription tool that converts audio and video files — including MP3, WAV, MP4, and MKV formats — into text without requiring an account. The tool supports speaker labeling, line-by-line timestamps, and subtitle export in SRT or VTT formats. It auto-detects the spoken language across more than 90 languages and accepts files up to 2GB or four hours in length. Users receive four hours of free transcription daily, with a cumulative cap of ten hours total, and uploaded files are automatically deleted after 24 hours. Accuracy is reported at around 99% for clear speech, though performance may drop with accents, background noise, or overlapping speakers.

0
ProgrammingDEV Community ·

DEV Community Post Walks Through Python Programs on Primes and Divisibility

A tutorial published on DEV Community presents five Python practice programs focused on number theory concepts. The tasks include identifying prime and composite numbers from 2 to 31, expressing 42 as the sum of two consecutive primes, and finding twin prime pairs up to 100. Additional exercises check whether a given number is divisible by 2 or 3, with the divisibility-by-3 task also demonstrating a digit-sum verification method. The post provides full code snippets alongside expected outputs, making it a hands-on reference for beginner Python learners.

Benchmark of 7 Python JSON parsers on 300 malformed LLM outputs reveals key tradeoffs · ShortSingh