Repository Analysis

google/langextract

A Python library for extracting structured information from unstructured text using LLMs with precise source grounding and interactive visualization.

26.4 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of google/langextract, a Python project with 37,146 GitHub stars. SynthScan v2.0 examined 42,130 lines of code across 131 source files, recording 891 pattern matches distributed across 18 syntactic categories. The overall adjusted score of 26.4 places this repository in the Moderate AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

26.4
Adjusted Score
26.4
Raw Score
100%
Time Factor
2026-07-02
Last Push
37.1K
Stars
Python
Language
42.1K
Lines of Code
131
Files
891
Pattern Hits
2026-07-14
Scan Date
0.41
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 1HIGH 53MEDIUM 21LOW 816

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 891 distinct pattern matches across 18 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Hyper-Verbose Identifiers532 hits · 506 pts
SeverityFileLineSnippetContext
LOWtests/chunking_test.py69 def test_multi_sentence_chunk(self):CODE
LOWtests/chunking_test.py96 def test_sentence_with_multiple_newlines_and_right_interval(self):CODE
LOWtests/chunking_test.py164 def test_long_token_gets_own_chunk(self):CODE
LOWtests/chunking_test.py207 def test_newline_at_chunk_boundary_does_not_create_empty_interval(self):CODE
LOWtests/chunking_test.py261 def test_newlines_is_secondary_sentence_break(self):CODE
LOWtests/chunking_test.py312 def test_tokenizer_propagation(self):CODE
LOWtests/chunking_test.py425 def test_make_batches_of_textchunk(CODE
LOWtests/chunking_test.py473 def test_text_chunk_additional_context(self):CODE
LOWtests/chunking_test.py486 def test_chunk_iterator_without_additional_context(self):CODE
LOWtests/chunking_test.py497 def test_multiple_chunks_with_additional_context(self):CODE
LOWtests/chunking_test.py549 def test_text_chunk_properties(CODE
LOWtests/progress_test.py27 def test_download_progress_bar(self):CODE
LOWtests/progress_test.py37 def test_extraction_progress_bar(self):CODE
LOWtests/progress_test.py47 def test_save_load_progress_bars(self):CODE
LOWtests/progress_test.py57 def test_model_info_extraction(self):CODE
LOWtests/progress_test.py68 def test_formatting_functions(self):CODE
LOWtests/format_handler_test.py147 def test_end_to_end_integration_with_prompt_and_resolver(self):CODE
LOWtests/format_handler_test.py232 def test_format_parse_roundtrip(STRING
LOWtests/format_handler_test.py260 def test_think_tags_stripped_before_parsing(self):CODE
LOWtests/format_handler_test.py276 def test_top_level_list_accepted_as_fallback(self):CODE
LOWtests/annotation_test.py47 def assert_char_interval_match_source(CODE
LOWtests/annotation_test.py80 def test_annotate_text_single_chunk(self):CODE
LOWtests/annotation_test.py206 def test_annotate_text_without_index_suffix(self):CODE
LOWtests/annotation_test.py325 def test_annotate_text_with_attributes_suffix(self):CODE
LOWtests/annotation_test.py469 def test_annotate_text_multiple_chunks(self):CODE
LOWtests/annotation_test.py569 def test_annotate_text_no_extractions(self):CODE
LOWtests/annotation_test.py766 def test_annotate_documents_exceptions(CODE
LOWtests/annotation_test.py817 def test_multipass_extraction_non_overlapping(self):CODE
LOWtests/annotation_test.py867 def test_multipass_extraction_overlapping(self):CODE
LOWtests/annotation_test.py918 def test_multipass_extraction_single_pass(self):CODE
LOWtests/annotation_test.py948 def test_multipass_extraction_empty_passes(self):CODE
LOWtests/annotation_test.py1052 def test_merge_non_overlapping_extractions(CODE
LOWtests/annotation_test.py1160 def test_yields_documents_not_generators(self):CODE
LOWtests/annotation_test.py1220 def test_context_window_includes_previous_chunk_text(self):CODE
LOWtests/annotation_test.py1271 def test_no_context_included_when_disabled(self):CODE
LOWtests/annotation_test.py1309 def test_context_window_per_document_isolation(self):CODE
LOWtests/schema_test.py48def _openai_attribute_properties(openai_schema, extraction_class):CODE
LOWtests/schema_test.py57 def test_abstract_methods_required(self):CODE
LOWtests/schema_test.py62 def test_subclass_must_implement_all_methods(self):CODE
LOWtests/schema_test.py971 def test_base_schema_rejects_user_schemas_by_default(self):CODE
LOWtests/schema_test.py975 def test_gemini_from_schema_dict_targets_json_schema_field(self):CODE
LOWtests/schema_test.py985 def test_gemini_from_schema_dict_validates_envelope(self):CODE
LOWtests/schema_test.py995 def test_openai_from_schema_dict_builds_response_format(self):CODE
LOWtests/schema_test.py78 def test_get_schema_class_returns_none_by_default(self):CODE
LOWtests/schema_test.py88 def test_apply_schema_stores_instance(self):CODE
LOWtests/schema_test.py257 def test_from_examples_constructs_expected_schema(CODE
LOWtests/schema_test.py264 def test_to_provider_config_returns_response_schema(self):CODE
LOWtests/schema_test.py286 def test_requires_raw_output_returns_true(self):CODE
LOWtests/schema_test.py307 def test_response_format_returns_json_schema_response_format(self):CODE
LOWtests/schema_test.py340 def test_to_provider_config_uses_provider_schema_hook(self):CODE
LOWtests/schema_test.py348 def test_from_examples_constructs_strict_openai_schema(self):CODE
LOWtests/schema_test.py446 def test_from_examples_preserves_list_attribute_schema(self):CODE
LOWtests/schema_test.py473 def test_from_examples_empty_examples_allow_empty_extraction_objects(self):CODE
LOWtests/schema_test.py487 def test_validate_format_rejects_yaml(self):CODE
LOWtests/schema_test.py498 def test_requires_raw_output_returns_true(self):CODE
LOWtests/schema_test.py504 def test_validate_format_warns_when_fences_enabled(self):CODE
LOWtests/schema_test.py517 def test_validate_format_warns_with_wrong_wrapper_key(self):CODE
LOWtests/schema_test.py532 def test_from_examples_preserves_scalar_attribute_types(self):CODE
LOWtests/schema_test.py569 def test_from_examples_preserves_mixed_numeric_attribute_types(self):CODE
LOWtests/schema_test.py620 def test_from_examples_allows_none_attribute_values(self):CODE
472 more matches not shown…
Docstring Block Structure36 hits · 180 pts
SeverityFileLineSnippetContext
HIGHlangextract/plugins.py125Load a provider class from module:Class specification. Args: spec: Import specification in format "module.path:ClSTRING
HIGHlangextract/plugins.py186Get a provider class by name. Args: name: Provider name (e.g., "gemini", "openai", "ollama"). allow_override:STRING
HIGHlangextract/annotation.py124Iterates over documents to yield text chunks along with the document ID. Args: documents: A sequence of Document STRING
HIGHlangextract/annotation.py222Annotates a sequence of documents with NLP extractions. Breaks documents into chunks, processes them into promptsSTRING
HIGHlangextract/chunking.py146Creates a token interval. Args: start_index: first token's index (inclusive). end_index: last token's index +STRING
HIGHlangextract/chunking.py173Get the text within an interval of tokens. Args: tokenized_text: Tokenized documents. token_interval: An inteSTRING
HIGHlangextract/chunking.py220Returns the char interval corresponding to the token interval. Args: tokenized_text: Document. token_intervalSTRING
HIGHlangextract/chunking.py247Converts all whitespace characters in input text to a single space. Args: text: Input to sanitize. Returns: STRING
HIGHlangextract/io.py51Loads the dataset from a CSV file. Args: delimiter: The delimiter to use when reading the CSV file. YielSTRING
HIGHlangextract/io.py148Loads annotated documents from a JSON Lines file. Args: jsonl_path: The file path to the JSON Lines file. shoSTRING
HIGHlangextract/io.py198Reads a CSV file and yields rows as dicts. Args: filepath: The path to the file. column_names: The names of tSTRING
HIGHlangextract/io.py271Download text content from a URL with optional progress bar. Args: url: The URL to download from. timeout: ReSTRING
HIGHlangextract/prompt_validation.py136Align extractions to their own example text and collect issues. Args: examples: The few-shot examples to validateSTRING
HIGHlangextract/prompting.py56Reads a structured prompt template from a file. Args: prompt_path: Path to a file containing PromptTemplateStructSTRING
HIGHlangextract/factory.py114Create a language model instance from configuration. Args: config: Model configuration with optional model_id andSTRING
HIGHlangextract/factory.py236Internal helper to create a model with optional schema constraints. This function creates a language model and optionSTRING
HIGHlangextract/extraction.py76Extracts structured information from text. Retrieves structured information from the provided text or documents usingSTRING
HIGHlangextract/resolver.py282Runs resolve function on text with YAML/JSON extraction data. Args: input_text: The input text to be procesSTRING
HIGHlangextract/resolver.py406Parses a YAML or JSON-formatted string into extraction data. This method is kept for backward compatibility with teSTRING
HIGHlangextract/resolver.py441Extracts and orders extraction data based on their associated indexes. This function processes a list of dictionariSTRING
HIGHlangextract/core/output_schema.py111Validates the LangExtract output envelope and returns an isolated copy. LangExtract's resolver parses a top-level JSOSTRING
HIGHlangextract/core/output_schema.py255Builds a schema for one LangExtract extraction object. Pair this with `extractions_schema()` to produce the full outpSTRING
HIGHlangextract/core/base_model.py206Parses model output as JSON or YAML. Note: This expects raw JSON/YAML without code fences. Code fence extractioSTRING
HIGHlangextract/core/tokenizer.py474Reconstructs the substring of the original text spanning a given token interval. Args: tokenized_text: A TokenizeSTRING
HIGHlangextract/core/tokenizer.py586Finds a 'sentence' interval from a given start index. Sentence boundaries are defined by: - punctuation tokens inSTRING
HIGHlangextract/core/format_handler.py154Parse model output to extract data. Args: text: Raw model output. strict: If True, enforce strict schemSTRING
HIGHlangextract/core/format_handler.py279Extract content from text, handling fences if configured. Args: text: Input text that may contain fenced blocSTRING
HIGHlangextract/providers/openai_batch.py357Execute batch inference on multiple prompts using OpenAI Batch API. Args: client: OpenAI client instance (or compSTRING
HIGHlangextract/providers/router.py140Resolve a model ID to a provider class. Args: model_id: The model identifier to resolve. Returns: The provSTRING
HIGHlangextract/providers/router.py171Resolve a provider name to a provider class. This allows explicit provider selection by name or class name. Args: STRING
HIGHlangextract/providers/gemini_batch.py327Submit a file-based batch job to Vertex AI using GCS storage. Batch processing is only supported with Vertex AI becauSTRING
HIGHlangextract/providers/gemini_batch.py562Poll batch job until completion or timeout. Args: client: google.genai.Client instance for polling job status. STRING
HIGHlangextract/providers/gemini_batch.py639Extract text outputs from file-based batch results, preserving order. Reads results from GCS output directory. ArgSTRING
HIGHlangextract/providers/gemini_batch.py719Execute batch inference on multiple prompts using the Vertex AI Batch API. This function provides file-based batch prSTRING
HIGHlangextract/providers/ollama.py561Sends a prompt to an Ollama model and returns the generated response. Note: This is a low-level method. ConstructorSTRING
HIGHscripts/create_provider_plugin.py240\ """Schema implementation for {provider_name} provider.""" import langextract as lx from langeSTRING
Over-Commented Block108 hits · 101 pts
SeverityFileLineSnippetContext
LOWautoformat.sh1#!/bin/bashCOMMENT
LOW.pre-commit-config.yaml1# Copyright 2025 Google LLC.COMMENT
LOWpyproject.toml1# Copyright 2025 Google LLC.COMMENT
LOWtox.ini1# Copyright 2025 Google LLC.COMMENT
LOWtests/chunking_test.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/progress_test.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/format_handler_test.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/annotation_test.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/schema_test.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/prompting_test.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/inference_test.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/provider_schema_test.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/extract_precedence_test.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/resolver_test.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/resolver_test.py661 extraction_text="prednisone",COMMENT
LOWtests/fuzzy_alignment_cases_test.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/test_kwargs_passthrough.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/gemini_retry_test.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/data_lib_test.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/init_test.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/openai_batch_test.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/registry_test.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/tokenizer_test.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/extract_schema_integration_test.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/prompt_validation_test.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/factory_test.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/visualization_test.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/io_test.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/provider_plugin_test.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/factory_schema_test.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/test_live_api.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/test_ollama_integration.py1# Copyright 2025 Google LLC.COMMENT
LOWtests/test_gemini_batch_api.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/plugins.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/annotation.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/chunking.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/registry.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/data_lib.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/io.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/prompt_validation.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/prompting.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/__init__.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/visualization.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/factory.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/tokenizer.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/extraction.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/resolver.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/inference.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/exceptions.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/progress.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/data.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/schema.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/core/output_schema.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/core/__init__.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/core/types.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/core/base_model.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/core/tokenizer.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/core/format_handler.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/core/exceptions.py1# Copyright 2025 Google LLC.COMMENT
LOWlangextract/core/data.py1# Copyright 2025 Google LLC.COMMENT
48 more matches not shown…
Unused Imports49 hits · 48 pts
SeverityFileLineSnippetContext
LOWtests/openai_batch_test.py19CODE
LOWlangextract/plugins.py20CODE
LOWlangextract/registry.py21CODE
LOWlangextract/data_lib.py16CODE
LOWlangextract/io.py16CODE
LOWlangextract/prompt_validation.py17CODE
LOWlangextract/prompting.py16CODE
LOWlangextract/__init__.py21CODE
LOWlangextract/visualization.py24CODE
LOWlangextract/factory.py22CODE
LOWlangextract/tokenizer.py21CODE
LOWlangextract/tokenizer.py25CODE
LOWlangextract/extraction.py17CODE
LOWlangextract/resolver.py21CODE
LOWlangextract/inference.py21CODE
LOWlangextract/exceptions.py22CODE
LOWlangextract/progress.py16CODE
LOWlangextract/data.py21CODE
LOWlangextract/data.py25CODE
LOWlangextract/schema.py22CODE
LOWlangextract/core/output_schema.py16CODE
LOWlangextract/core/__init__.py22CODE
LOWlangextract/core/types.py16CODE
LOWlangextract/core/base_model.py16CODE
LOWlangextract/core/format_handler.py17CODE
LOWlangextract/core/exceptions.py21CODE
LOWlangextract/core/data.py16CODE
LOWlangextract/core/schema.py16CODE
LOWlangextract/core/debug_utils.py16CODE
LOWlangextract/providers/openai_batch.py22CODE
LOWlangextract/providers/gemini.py19CODE
LOWlangextract/providers/openai.py18CODE
LOWlangextract/providers/router.py22CODE
LOWlangextract/providers/gemini_batch.py25CODE
LOWlangextract/providers/ollama.py84CODE
LOWlangextract/providers/schemas/__init__.py16CODE
LOWlangextract/providers/schemas/gemini.py18CODE
LOWlangextract/providers/schemas/openai.py18CODE
LOWlangextract/_compat/registry.py18CODE
LOWlangextract/_compat/__init__.py21CODE
LOWlangextract/_compat/inference.py17CODE
LOWlangextract/_compat/exceptions.py18CODE
LOWlangextract/_compat/schema.py18CODE
LOW…amples/custom_provider_plugin/test_example_provider.py24CODE
LOW…ovider_plugin/langextract_provider_example/provider.py17CODE
LOW…ovider_plugin/langextract_provider_example/__init__.py17CODE
LOW…provider_plugin/langextract_provider_example/schema.py17CODE
LOWbenchmarks/fuzzy_benchmark.py29CODE
LOWscripts/validate_community_providers.py18CODE
Excessive Try-Catch Wrapping44 hits · 45 pts
SeverityFileLineSnippetContext
LOWtests/prompt_validation_test.py457 except Exception: # pylint: disable=broad-exceptCODE
LOWtests/prompt_validation_test.py505 except Exception: # pylint: disable=broad-exceptCODE
LOWtests/prompt_validation_test.py526 except Exception: # pylint: disable=broad-exceptCODE
LOWlangextract/prompting.py78 except Exception as e:CODE
LOWlangextract/visualization.py59 except Exception:CODE
LOWlangextract/resolver.py433 except Exception as e:CODE
LOWlangextract/core/base_model.py228 except Exception as e:CODE
LOWlangextract/core/debug_utils.py89 except Exception:CODE
LOWlangextract/core/debug_utils.py129 except Exception:CODE
LOWlangextract/core/debug_utils.py184 except Exception:CODE
LOWlangextract/providers/openai_batch.py253 except Exception as e:CODE
LOWlangextract/providers/openai_batch.py277 except Exception as e:CODE
LOWlangextract/providers/openai_batch.py313 except Exception as e:CODE
LOWlangextract/providers/openai_batch.py444 except Exception as e:CODE
LOWlangextract/providers/openai_batch.py470 except Exception as e:CODE
LOWlangextract/providers/openai_batch.py496 except Exception as e:CODE
LOWlangextract/providers/openai_batch.py508 except Exception as e:CODE
LOWlangextract/providers/__init__.py131 except Exception as e:CODE
LOWlangextract/providers/__init__.py136 except Exception as e:CODE
LOWlangextract/providers/gemini.py373 except Exception as e:CODE
LOWlangextract/providers/gemini.py457 except Exception as e:CODE
LOWlangextract/providers/gemini.py494 except Exception as e:CODE
LOWlangextract/providers/openai.py258 except Exception as e:CODE
LOWlangextract/providers/openai.py337 except Exception as e:CODE
LOWlangextract/providers/openai.py375 except Exception as e:CODE
LOWlangextract/providers/gemini_batch.py172 except Exception:CODE
LOWlangextract/providers/gemini_batch.py253 except Exception as e:CODE
LOWlangextract/providers/gemini_batch.py426 except Exception as e:CODE
LOWlangextract/providers/gemini_batch.py467 except Exception as e:CODE
LOWlangextract/providers/gemini_batch.py478 except Exception as e:CODE
LOWlangextract/providers/gemini_batch.py596 except Exception as e:CODE
LOWlangextract/providers/gemini_batch.py848 except Exception as e:CODE
LOWlangextract/providers/ollama.py313 except Exception as e:CODE
LOW…ovider_plugin/langextract_provider_example/provider.py181 except Exception as e:CODE
LOWexamples/ollama/demo_ollama.py452 except Exception as e:CODE
LOWexamples/ollama/demo_ollama.py533 except Exception as e:CODE
MEDIUMbenchmarks/plotting.py339 print(f"Error loading {json_file}: {e}")CODE
LOWscripts/create_provider_plugin.py375 except Exception as e:CODE
LOWscripts/create_provider_plugin.py393 except Exception:CODE
LOWscripts/create_provider_plugin.py395 except Exception as e:CODE
LOWscripts/create_provider_plugin.py429 except Exception as e:STRING
LOWscripts/create_provider_plugin.py444 except Exception as e:STRING
LOW.github/scripts/zenodo_publish.py211 except Exception as e:CODE
MEDIUM.github/scripts/zenodo_publish.py180def main() -> int:CODE
Magic Placeholder Names9 hits · 42 pts
SeverityFileLineSnippetContext
HIGHREADME.md213docker run --rm -e LANGEXTRACT_API_KEY="your-api-key" langextract python your_script.pyCODE
HIGHREADME.md236export LANGEXTRACT_API_KEY="your-api-key-here"CODE
HIGHREADME.md246LANGEXTRACT_API_KEY=your-api-key-hereCODE
HIGHREADME.md275 api_key="your-api-key-here" # Only use this for testing/developmentCODE
HIGHdocs/examples/medication_examples.md51 api_key="your-api-key-here" # Optional if LANGEXTRACT_API_KEY environment variable is setCODE
HIGHdocs/examples/medication_examples.md171 api_key="your-api-key-here" # Optional if LANGEXTRACT_API_KEY environment variable is setSTRING
HIGHdocs/examples/japanese_extraction.md43 api_key="your-api-key-here" # Optional if env var is setCODE
HIGHexamples/custom_provider_plugin/README.md125 provider_kwargs={"api_key": "your-api-key"},CODE
HIGHexamples/custom_provider_plugin/README.md142 provider_kwargs={"api_key": "your-api-key"},CODE
Deep Nesting38 hits · 37 pts
SeverityFileLineSnippetContext
LOWtests/extract_schema_integration_test.py116CODE
LOWtests/extract_schema_integration_test.py150CODE
LOWlangextract/annotation.py46CODE
LOWlangextract/annotation.py285CODE
LOWlangextract/data_lib.py27CODE
LOWlangextract/io.py85CODE
LOWlangextract/io.py265CODE
LOWlangextract/prompt_validation.py130CODE
LOWlangextract/prompting.py52CODE
LOWlangextract/factory.py56CODE
LOWlangextract/extraction.py45CODE
LOWlangextract/resolver.py1287CODE
LOWlangextract/resolver.py437CODE
LOWlangextract/resolver.py591CODE
LOWlangextract/core/tokenizer.py580CODE
LOWlangextract/core/tokenizer.py336CODE
LOWlangextract/core/format_handler.py151CODE
LOWlangextract/providers/openai_batch.py411CODE
LOWlangextract/providers/__init__.py71CODE
LOWlangextract/providers/__init__.py149CODE
LOWlangextract/providers/gemini.py351CODE
LOWlangextract/providers/gemini.py393CODE
LOWlangextract/providers/openai.py284CODE
LOWlangextract/providers/router.py170CODE
LOWlangextract/providers/gemini_batch.py259CODE
LOWlangextract/providers/gemini_batch.py633CODE
LOWlangextract/providers/gemini_batch.py452CODE
LOWlangextract/providers/schemas/gemini.py121CODE
LOWlangextract/providers/schemas/openai.py85CODE
LOWexamples/ollama/demo_ollama.py418CODE
LOWbenchmarks/benchmark.py140CODE
LOWbenchmarks/benchmark.py276CODE
LOWbenchmarks/benchmark.py311CODE
LOWbenchmarks/fuzzy_benchmark.py342CODE
LOWbenchmarks/plotting.py170CODE
LOWbenchmarks/plotting.py220CODE
LOWbenchmarks/plotting.py376CODE
LOWbenchmarks/plotting.py492CODE
Cross-File Repetition6 hits · 30 pts
SeverityFileLineSnippetContext
HIGHtests/test_live_api.py0the patient was prescribed lisinopril and metformin last month. he takes the lisinopril 10mg daily for hypertension, butSTRING
HIGHdocs/examples/medication_examples.md0the patient was prescribed lisinopril and metformin last month. he takes the lisinopril 10mg daily for hypertension, butSTRING
HIGHexamples/ollama/demo_ollama.py0the patient was prescribed lisinopril and metformin last month. he takes the lisinopril 10mg daily for hypertension, butSTRING
HIGHtests/test_live_api.py0extract medications with their details, using attributes to group related information: 1. extract entities in the order STRING
HIGHdocs/examples/medication_examples.md0extract medications with their details, using attributes to group related information: 1. extract entities in the order STRING
HIGHexamples/ollama/demo_ollama.py0extract medications with their details, using attributes to group related information: 1. extract entities in the order STRING
Self-Referential Comments9 hits · 25 pts
SeverityFileLineSnippetContext
MEDIUMtests/annotation_test.py701 # Define a side effect function so return length based on batch length.COMMENT
MEDIUMtests/resolver_test.py2010 # Define a chunk that includes the entire text.COMMENT
MEDIUMtests/resolver_test.py2052 # Define a chunk that includes the entire text.COMMENT
MEDIUMtests/resolver_test.py2098 # Define a chunk that includes too many tokens.COMMENT
MEDIUMtests/resolver_test.py2139 # Define a correct chunk.COMMENT
MEDIUMtests/resolver_test.py2166 # Define a chunk that includes the entire text.COMMENT
MEDIUMtests/extract_schema_integration_test.py191 # Create a mock instance with required attributesCOMMENT
MEDIUMtests/extract_schema_integration_test.py242 # Create a mock Gemini schema with validate_format that issues warningsCOMMENT
MEDIUMlangextract/providers/ollama.py24 # Create an example for few-shot learningSTRING
Modern Structural Boilerplate22 hits · 22 pts
SeverityFileLineSnippetContext
LOWtests/openai_batch_test.py49 def set_content(self, file_id: str, text: str) -> None:CODE
LOWlangextract/plugins.py30__all__ = ["available_providers", "get_provider_class"]CODE
LOWlangextract/prompt_validation.py30__all__ = [CODE
LOWlangextract/prompting.py268 def _update_state(self, document_id: str, chunk_text: str) -> None:CODE
LOWlangextract/__init__.py30__all__ = [CODE
LOWlangextract/exceptions.py35__all__ = [CODE
LOWlangextract/schema.py47__all__ = [CODE
LOWlangextract/core/output_schema.py26__all__ = [CODE
LOWlangextract/core/__init__.py24__all__ = [CODE
LOWlangextract/core/types.py24__all__ = [CODE
LOWlangextract/core/base_model.py29__all__ = ['BaseLanguageModel']CODE
LOWlangextract/core/base_model.py125 def set_fence_output(self, fence_output: bool | None) -> None:CODE
LOWlangextract/core/tokenizer.py35__all__ = [CODE
LOWlangextract/core/exceptions.py23__all__ = [CODE
LOWlangextract/core/data.py30__all__ = [CODE
LOWlangextract/core/schema.py26__all__ = [CODE
LOWlangextract/providers/__init__.py33__all__ = [CODE
LOWlangextract/providers/gemini_batch.py452 def set_multi(self, items: Sequence[tuple[dict, str]]) -> None:CODE
LOWlangextract/providers/schemas/__init__.py24__all__ = ["GeminiSchema", "OpenAISchema"]CODE
LOWlangextract/_compat/__init__.py23__all__ = ["inference", "schema", "exceptions", "registry"]CODE
LOW…ovider_plugin/langextract_provider_example/__init__.py19__all__ = ["CustomGeminiProvider"]CODE
LOW.github/scripts/zenodo_publish.py138def update_metadata(draft_id: str) -> None:CODE
Decorative Section Separators5 hits · 21 pts
SeverityFileLineSnippetContext
MEDIUMtests/annotation_test.py503 # -------------------------------------------------------------------------COMMENT
MEDIUMtests/resolver_test.py667 # --------------------------------------------------------------------COMMENT
MEDIUMtests/resolver_test.py670 # --------------------------------------------------------------------COMMENT
MEDIUMtests/resolver_test.py673 # --------------------------------------------------------------------COMMENT
MEDIUMtests/resolver_test.py676 # --------------------------------------------------------------------COMMENT
Fake / Example Data13 hits · 12 pts
SeverityFileLineSnippetContext
LOWtests/annotation_test.py91 - patient: "Jane Doe"CODE
LOWtests/annotation_test.py118 extraction_text="Jane Doe",CODE
LOWtests/annotation_test.py217 - patient: "Jane Doe"CODE
LOWtests/annotation_test.py237 extraction_text="Jane Doe",CODE
LOWtests/annotation_test.py336 - patient: "Jane Doe"CODE
LOWtests/annotation_test.py371 extraction_text="Jane Doe",CODE
LOWtests/schema_test.py218 extraction_text="John Doe",CODE
LOWtests/resolver_test.py413 "patient": "Jane Doe",CODE
LOWtests/resolver_test.py430 extraction_text="Jane Doe",CODE
LOWtests/resolver_test.py454 "patient": "John Doe",CODE
LOWtests/resolver_test.py493 extraction_text="John Doe",CODE
LOWtests/data_lib_test.py195 extraction_text="placeholder",CODE
LOWtests/tokenizer_test.py812 expected_substring="Jane Doe",CODE
AI Structural Patterns10 hits · 10 pts
SeverityFileLineSnippetContext
LOWlangextract/annotation.py209CODE
LOWlangextract/annotation.py532CODE
LOWlangextract/extraction.py45CODE
LOWlangextract/resolver.py327CODE
LOWlangextract/resolver.py789CODE
LOWlangextract/providers/gemini.py166CODE
LOWlangextract/providers/openai.py106CODE
LOWlangextract/providers/ollama.py379CODE
LOWlangextract/providers/ollama.py476CODE
LOWlangextract/providers/ollama.py540CODE
Hallucination Indicators1 hit · 10 pts
SeverityFileLineSnippetContext
CRITICALlangextract/_compat/README.md16- `from langextract.inference import InferenceOutputError` → `from langextract.core.exceptions import InferenceOutputErrCODE
Cross-Language Confusion2 hits · 8 pts
SeverityFileLineSnippetContext
HIGHtests/test_kwargs_passthrough.py700 """Format key should be omitted from payload when None (not sent as null)."""STRING
HIGHlangextract/visualization.py492 let animationInterval = null;CODE
Modern AI Meta-Vocabulary3 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMlangextract/providers/ollama.py24 # Create an example for few-shot learningSTRING
MEDIUMdocs/examples/japanese_extraction.md20# Define example data (few-shot examples help the model understand the task)COMMENT
MEDIUMskills/langextract-usage/SKILL.md114 examples=examples, # few-shot examples (required)CODE
AI Slop Vocabulary2 hits · 4 pts
SeverityFileLineSnippetContext
MEDIUMlangextract/core/tokenizer.py278 # Fallback to the robust regex methodCOMMENT
MEDIUMbenchmarks/plotting.py37 """Generate comprehensive benchmark visualization.STRING
Redundant / Tautological Comments2 hits · 3 pts
SeverityFileLineSnippetContext
LOWlangextract/core/base_model.py220 # Check if we have a format_type attribute (providers should set this)COMMENT
LOWlangextract/providers/gemini_batch.py236 # Check if rule already existsCOMMENT