sort_keys=True makes json.dumps emit dictionary keys in sorted order, so two JSON responses with the same data but different key order serialize to identical strings. Sorting happens on the original Python keys before they are converted to JSON strings, so numeric keys sort by value.
python / json / json.dumps / sort_keys / testing / deterministic-serialization / regression-tests
Azure AI Search hybrid queries combine full-text and vector search using Reciprocal Rank Fusion (RRF). The @search.score field reflects this fusion, often appearing small due to RRF’s reciprocal rank weighting. This score cannot be directly compared across queries because it depends on the relative ranking within each query’s result set. Practical guidance includes using ranking order instead of absolute scores and understanding when semantic ranking alters the relevance signal.
Azure AI Search / Hybrid Search / Reciprocal Rank Fusion / RRF / Vector Search / Full-Text Search / Semantic Ranking / Relevance Scoring
This article explains how to address control characters emitted by language models in JSON output, detailing the default strict mode in Python's json.loads and strategies for graceful degradation when encountering these characters.
JSON / Python / JSONDecodeError / Control Characters / Strict Mode
Python 3.15+ json.loads array_hook intercepts JSON arrays for validation before full object construction, ensuring data integrity.
json / python / deserialization / validation / array_hook / json.loads / data integrity / type safety
Limit input size and number types when decoding untrusted model JSON to prevent resource exhaustion and malformed numbers. Use Python json with bounded input and custom parse_int, parse_float, and parse_constant hooks.
json / python / security / dos-protection / parsing
Use Python's json module object_hook to convert JSON dicts to typed instances during deserialization, avoiding full tree reprocessing.
Python / JSON / Deserialization / object_hook
patternProperties constrains value types by key-name regex, if/then adds conditional requirements driven by a discriminator, and unevaluatedProperties closes the schema when composition is involved.
json-schema / patternProperties / if-then / unevaluatedProperties / dynamic-keys / validation / jsonschema / python
A reliable JSON parsing strategy that caps input size and uses parse_int, parse_float, and parse_constant to control number decoding and reject non-standard constants before they become resource drains.
json / python / security / parsing / parse_int / parse_float / parse_constant / DoS protection
Python's json module explicitly warns that JSON lacks framing, so calling dump() twice on the same file object writes two adjacent documents that json.load() cannot parse. The fix is to collect objects into a list and dump once, or use newline-delimited JSON with raw_decode for streaming scenarios.
python / json / serialization / llm / json-lines / framing / json-schema / streaming
JSON only allows string keys for objects. Consequently, json.dumps converts numeric Python dictionary keys to strings, meaning loads(dumps(x)) != x for dictionaries with non-string keys. This causes KeyErrors when looking up integer token IDs in dictionaries loaded from JSON.
python / json / serialization / dict-keys / token-id / round-trip
additionalProperties only sees properties in the same subschema, so allOf extension fails to reject unknown keys. Use unevaluatedProperties in draft 2019-09 or later to recognize nested subschema properties without redeclaring them.
JSON Schema / allOf / additionalProperties / unevaluatedProperties / draft 2019-09 / schema extension / validation / object schema
Python's json module silently emits NaN and Infinity tokens that violate RFC 7159, breaking strict external parsers. Setting allow_nan=False and parse_constant enforces compliance on both serializer and deserializer sides.
json / python / rfc-7159 / nan / infinity / allow_nan / parse_constant / interoperability
Python's json.loads silently keeps only the last value when a JSON object contains duplicate keys, discarding earlier ones without warning. The object_pairs_hook parameter intercepts the full ordered list of key-value pairs before dict construction, enabling explicit duplicate detection at parse time.
json / object_pairs_hook / duplicate-keys / LLM-output / python / parsing / validation
A Pipeline chains preprocessing and estimation so that fit statistics come only from training folds. This prevents leakage during cross-validation and keeps training and inference transformations consistent.
scikit-learn / pipeline / data-leakage / cross-validation / preprocessing
Timestamps in ASR provide temporal data for spoken words or segments. Configuring pipelines for word-level timestamps enhances transcription utility for tasks like meeting notes.
ASR / timestamps / speech recognition / Hugging Face / transformers / NLP / audio processing
This guide explains how the application validates and authorizes tool requests before execution. Protocol item names such as function_call and function_call_output are specific to the OpenAI Responses API; other providers use their own wire formats.
tool-calling / function-calling / security / validation / permissions / side-effects / execution-boundary / tool-output
Batching can raise throughput while increasing queueing delay and memory use. Compare offline static batches with continuous batching for generation, then measure the trade-off on your model, input lengths, hardware, and latency target.
transformers / batching / throughput / latency / memory / gpu / pipeline / continuous-batching
Fix the evaluation set, metrics, aggregation rules, and comparison rules before running experiments so results stay comparable and per-subset failures are not hidden by one aggregate number.
evaluation / model comparison / reproducibility / metrics / aggregation / scikit-learn / huggingface-evaluate / experiment design
A chat template fixes the exact token sequence a chat model expects, including role control tokens and special boundary tokens. Treating it as contract data prevents silent quality loss from mismatched formatting and duplicated special tokens.
chat-templates / transformers / tokenization / special-tokens / model-contract / prompt-formatting / llm-ops
Filtered vector search in Azure AI Search combines vector similarity with metadata filtering. Pre-filtering reduces the candidate set before scoring, potentially lowering latency but risking recall loss. Post-filtering preserves recall but may return fewer results. Testing both modes is essential to find the right trade-off for your data.
Azure AI Search / vector search / filtered vector search / hybrid search / pre-filter / post-filter / semantic ranker / metadata filtering
Learn to use EvaluationSuites to identify specific performance gaps across diverse tasks instead of relying on a single aggregate score.
model-evaluation / risk-management / huggingface-evaluate / multi-task-learning / ai-safety
Learn how to effectively evaluate the precision and recall of AI models, especially when working with small question datasets. This guide covers the concepts, calculation methods, and practical considerations using scikit-learn.
ai / precision / recall / evaluation / small dataset / machine learning / scikit-learn / classification
A guide to setting up multimodal search in Azure AI Search using vectorization of text and images. Describes steps for creating an index, selecting models (e.g., CLIP), methods for generating embeddings, and executing hybrid queries to improve relevance.
azure-ai-search / vector-search / multimodal-search / clip / openai / hybrid-search
Explore the principles of semantic search, its reliance on embeddings, and the reasons why text that appears similar might not provide the desired answer. Learn about vector search, hybrid search, and their applications in information retrieval.
semantic search / vector search / embeddings / AI / information retrieval / natural language processing / hybrid search / Azure AI Search