evidently
evidently copied to clipboard
Add new `JSONMatch()` descriptor to Evidently
Add a new JSONMatch()
descriptor
About Hacktoberfest contributions: https://github.com/evidentlyai/evidently/wiki/Hacktoberfest-2024
Description:
The JSONMatch()
descriptor compares a JSON object in a given column against a reference JSON object in the specified reference column and returns True
or False
based on whether the JSONs are identical.
JSON Matching Criteria:
- Both JSON objects must have the exact same set of keys.
- The values associated with each key must be identical.
- The order of keys does not matter.
- Whitespace outside of the actual values (e.g., spaces, tabs, or newlines) is ignored.
- If either of the inputs is an invalid JSON, they will not match, and the descriptor will return
False
.
Reference:
For a two-column descriptor implementation, use the CustomPairColumnEval
template and check the SemanticSimilarity
descriptor as an example (implement the with_column
parameter the same way).