TensorFlow code and pre-trained models for BERT
This report summarizes scanner evidence for google-research/bert, a Python project with 40,018 GitHub stars. SynthScan examined 7,499 lines of code across 18 source files, recording 112 pattern matches distributed across 9 syntactic categories. The legacy adjusted pattern signal is 20.0 (Elevated pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Payload schema: 1.0.0 · Engine: 2.0.0 · Scoring: heuristic-density-v1 · Scan date: 2026-11-27.
Can maintainers explain intent, assumptions, and trade-offs? 72 finding(s).
Are imports declared and package/API names verified? 36 finding(s).
Are wrappers, guards, and repeated structures necessary? 31 finding(s).
Which changes need focused human review? 112 finding(s).
Run additional scans to build a history of the legacy pattern signal. Score changes are not a measure of AI adoption or code quality.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 112 distinct pattern matches across 9 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. 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 configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | run_classifier_with_tfhub.py | 17 | CODE | |
| LOW | run_classifier_with_tfhub.py | 18 | CODE | |
| LOW | run_classifier_with_tfhub.py | 19 | CODE | |
| LOW | modeling_test.py | 15 | CODE | |
| LOW | modeling_test.py | 16 | CODE | |
| LOW | modeling_test.py | 17 | CODE | |
| LOW | extract_features.py | 17 | CODE | |
| LOW | extract_features.py | 18 | CODE | |
| LOW | extract_features.py | 19 | CODE | |
| LOW | optimization_test.py | 15 | CODE | |
| LOW | optimization_test.py | 16 | CODE | |
| LOW | optimization_test.py | 17 | CODE | |
| LOW | optimization.py | 17 | CODE | |
| LOW | optimization.py | 18 | CODE | |
| LOW | optimization.py | 19 | CODE | |
| LOW | tokenization_test.py | 15 | CODE | |
| LOW | tokenization_test.py | 16 | CODE | |
| LOW | tokenization_test.py | 17 | CODE | |
| LOW | run_squad.py | 17 | CODE | |
| LOW | run_squad.py | 18 | CODE | |
| LOW | run_squad.py | 19 | CODE | |
| LOW | tokenization.py | 17 | CODE | |
| LOW | tokenization.py | 18 | CODE | |
| LOW | tokenization.py | 19 | CODE | |
| LOW | run_pretraining.py | 17 | CODE | |
| LOW | run_pretraining.py | 18 | CODE | |
| LOW | run_pretraining.py | 19 | CODE | |
| LOW | run_classifier.py | 17 | CODE | |
| LOW | run_classifier.py | 18 | CODE | |
| LOW | run_classifier.py | 19 | CODE | |
| LOW | create_pretraining_data.py | 17 | CODE | |
| LOW | create_pretraining_data.py | 18 | CODE | |
| LOW | create_pretraining_data.py | 19 | CODE | |
| LOW | modeling.py | 17 | CODE | |
| LOW | modeling.py | 18 | CODE | |
| LOW | modeling.py | 19 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | modeling.py | 281 | Maps a string to a Python function, e.g., "relu" => `tf.nn.relu`. Args: activation_string: String name of the act | STRING |
| HIGH | modeling.py | 438 | Performs various post-processing on a word embedding tensor. Args: input_tensor: float Tensor of shape [batch_siz | STRING |
| HIGH | modeling.py | 572 | Performs multi-headed attention from `from_tensor` to `to_tensor`. This is an implementation of multi-headed attentio | STRING |
| HIGH | modeling.py | 765 | Multi-headed, multi-layer Transformer from "Attention is All You Need". This is almost an exact implementation of the | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | extract_features.py | 0 | creates an `input_fn` closure to be passed to tpuestimator. | STRING |
| HIGH | run_squad.py | 0 | creates an `input_fn` closure to be passed to tpuestimator. | STRING |
| HIGH | run_pretraining.py | 0 | creates an `input_fn` closure to be passed to tpuestimator. | STRING |
| HIGH | run_classifier.py | 0 | creates an `input_fn` closure to be passed to tpuestimator. | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | run_classifier_with_tfhub.py | 146 | def create_tokenizer_from_hub_module(bert_hub_module_handle): | CODE |
| LOW | modeling_test.py | 129 | def test_config_to_json_string(self): | CODE |
| LOW | modeling_test.py | 162 | def assert_all_tensors_reachable(self, sess, outputs): | CODE |
| LOW | extract_features.py | 210 | def convert_examples_to_features(examples, seq_length, tokenizer): | CODE |
| LOW | tokenization_test.py | 58 | def test_basic_tokenizer_lower(self): | CODE |
| LOW | tokenization_test.py | 66 | def test_basic_tokenizer_no_lower(self): | CODE |
| LOW | tokenization_test.py | 93 | def test_convert_tokens_to_ids(self): | CODE |
| LOW | run_squad.py | 309 | def convert_examples_to_features(examples, tokenizer, max_seq_length, | CODE |
| LOW | tokenization.py | 28 | def validate_case_matches_checkpoint(do_lower_case, init_checkpoint): | CODE |
| LOW | run_classifier.py | 177 | class DataProcessor(object): | CODE |
| LOW | run_classifier.py | 479 | def file_based_convert_examples_to_features( | CODE |
| LOW | run_classifier.py | 509 | def file_based_input_fn_builder(input_file, seq_length, is_training, | CODE |
| LOW | run_classifier.py | 767 | def convert_examples_to_features(examples, label_list, max_seq_length, | CODE |
| LOW | create_pretraining_data.py | 96 | def write_instance_to_example_files(instances, tokenizer, max_seq_length, | CODE |
| LOW | create_pretraining_data.py | 179 | def create_training_instances(input_files, tokenizer, max_seq_length, | CODE |
| LOW | create_pretraining_data.py | 223 | def create_instances_from_document( | CODE |
| LOW | create_pretraining_data.py | 342 | def create_masked_lm_predictions(tokens, masked_lm_prob, | CODE |
| LOW | modeling.py | 317 | def get_assignment_map_from_checkpoint(tvars, init_checkpoint): | CODE |
| LOW | modeling.py | 524 | def create_attention_mask_from_input_mask(from_tensor, to_mask): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | run_classifier_with_tfhub.py | 1 | # coding=utf-8 | COMMENT |
| LOW | modeling_test.py | 1 | # coding=utf-8 | COMMENT |
| LOW | extract_features.py | 1 | # coding=utf-8 | COMMENT |
| LOW | extract_features.py | 221 | if tokens_b: | COMMENT |
| LOW | optimization_test.py | 1 | # coding=utf-8 | COMMENT |
| LOW | optimization.py | 1 | # coding=utf-8 | COMMENT |
| LOW | tokenization_test.py | 1 | # coding=utf-8 | COMMENT |
| LOW | run_squad.py | 1 | # coding=utf-8 | COMMENT |
| LOW | run_squad.py | 481 | # whitespace-tokenized words. But then after WordPiece tokenization, we can | COMMENT |
| LOW | run_squad.py | 521 | # Span C: and bought a gallon of | COMMENT |
| LOW | run_squad.py | 921 | COMMENT | |
| LOW | run_squad.py | 941 | # | COMMENT |
| LOW | __init__.py | 1 | # coding=utf-8 | COMMENT |
| LOW | tokenization.py | 1 | # coding=utf-8 | COMMENT |
| LOW | run_pretraining.py | 1 | # coding=utf-8 | COMMENT |
| LOW | run_classifier.py | 1 | # coding=utf-8 | COMMENT |
| LOW | run_classifier.py | 401 | # Account for [CLS], [SEP], [SEP] with "- 3" | COMMENT |
| LOW | create_pretraining_data.py | 1 | # coding=utf-8 | COMMENT |
| LOW | modeling.py | 1 | # coding=utf-8 | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | modeling_test.py | 194 | CODE | |
| LOW | modeling_test.py | 257 | CODE | |
| LOW | extract_features.py | 343 | CODE | |
| LOW | run_squad.py | 227 | CODE | |
| LOW | run_squad.py | 309 | CODE | |
| LOW | run_squad.py | 741 | CODE | |
| LOW | tokenization.py | 78 | CODE | |
| LOW | tokenization.py | 98 | CODE | |
| LOW | tokenization.py | 308 | CODE | |
| LOW | run_classifier.py | 783 | CODE | |
| LOW | create_pretraining_data.py | 96 | CODE | |
| LOW | create_pretraining_data.py | 179 | CODE | |
| LOW | create_pretraining_data.py | 223 | CODE | |
| LOW | create_pretraining_data.py | 342 | CODE | |
| LOW | modeling.py | 280 | CODE | |
| LOW | modeling.py | 754 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | modeling_test.py | 33 | CODE | |
| LOW | modeling.py | 359 | CODE | |
| LOW | modeling.py | 521 | CODE | |
| LOW | modeling.py | 428 | CODE | |
| LOW | modeling.py | 558 | CODE | |
| LOW | modeling.py | 754 | CODE | |
| LOW | modeling.py | 34 | CODE | |
| LOW | modeling.py | 100 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | run_squad.py | 500 | # "Japanese", we just use "Japanese" as the annotation. This is fairly rare | COMMENT |
| LOW | run_squad.py | 874 | # just create a nonce prediction in this case to avoid failure. | COMMENT |
| LOW | run_squad.py | 953 | # can fail in certain cases in which case we just return `orig_text`. | COMMENT |
| LOW | modeling.py | 297 | # function, so we just return it. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | run_classifier.py | 711 | # This function is not used by this file but is still used by the Colab and | COMMENT |
| MEDIUM | run_classifier.py | 765 | # This function is not used by this file but is still used by the Colab and | COMMENT |