Robustness: Library fails on LLM outputs containing CJK Radicals and malformed JSON
- Dominant language
- Python
- Stars
- 38.6k
- Forks
- 2.7k
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 3
Description
The langextract library currently lacks robustness in handling common "messy" outputs from Large Language Models (LLMs). Specifically, it fails in two ways:
Unicode Normalization Failure: When the LLM returns strings containing CJK compatibility characters or radicals (e.g., ⻬ U+2EEC instead of 齐 U+9F50, or ⺠ U+2⺠5 instead of 民 U+6C11), the library does not normalize them. This leads to silent data corruption where the stored entities do not match standard characters, causing issues in downstream applications like graph databases.
JSON Parsing Failure: When the LLM produces a slightly malformed JSON string (e.g., with unescaped quotes), the library crashes with a json.decoder.JSONDecodeError.
These issues make the library brittle in real-world use cases where LLM outputs are not always perfectly clean.
Contributor guide
Assessment
This issue has not been assessed yet.