Skip to content

Fix outdated examples, broken links, and stale references across docs - #839

Merged
qiyanjun merged 2 commits into
QData:masterfrom
qiyanjun:docs/content-accuracy-fixes
Aug 14, 2026
Merged

Fix outdated examples, broken links, and stale references across docs#839
qiyanjun merged 2 commits into
QData:masterfrom
qiyanjun:docs/content-accuracy-fixes

Conversation

@qiyanjun

Copy link
Copy Markdown
Member

Summary

Reviewed docs/0_get_started/, docs/1start/, and docs/3recipes/ for outdated code examples, broken external links, and stale version/count references. Every item below was verified against current code or a live HTTP request before fixing — none of these are guesses.

What was found and fixed

  • installation.md: "Python 3.6 or above" and the conda example's python=3.8 are both stale — setup.py has required >=3.9 since the black-version-upgrade PR (chore: pin black/isort/flake8 to modern versions #833). Bumped both to 3.9.
  • command_line_usage.md: textattack eval-model was renamed to textattack eval (confirmed against EvalModelCommand.register_subcommand's actual registered subparser name — it's literally "eval", not "eval-model").
  • quick_api_tour.rst: fixed two Sphinx cross-references pointing at a nonexistent transformers.models.wrapper module (should be textattack.models.wrappers), and a malformed :ref:TextFooler attack role with no matching target.
  • what_is_an_adversarial_attack.md: a copy-pasteable CLI example had its --flag hyphens autocorrected to em-dashes at some point (attack — model lstm-mr — num-examples...), making it non-functional if pasted as-is. Restored --.
  • support.md: pointed contributors at transformation.rst for adding new transformation docs — that file doesn't exist; it's docs/api/transformations.rst.
  • FAQ.md / attacks4Components.md / attack_recipes_cmd.md: "16 adversarial attacks" is stale — confirmed 21 CLI-registered recipes via ATTACK_RECIPE_NAMES + 3 Python-only multi-lingual recipes (French/Spanish/Chinese) = 24. Added the missing a2t, leap, and multi-lingual recipe rows to both HTML comparison tables, which listed neither despite both existing in the codebase already.
  • attack_recipes.rst: fixed a stale recipe-numbering gap (17-19 should've been 18-20 after an earlier recipe was inserted above without renumbering everything below it); the list is now sequential 0-23.
  • attack_recipes_cmd.md: the DeepWordBug example labeled "on DistilBERT trained on the Quora Question Pairs paraphrase identification dataset" actually referenced distilbert-base-uncased-cola — a grammatical acceptability model, unrelated to QQP/paraphrase identification. Fixed to distilbert-base-cased-qqp (confirmed this model exists on the Hub).
  • models.md: github.com/huggingface/nlp is HuggingFace's old, renamed repo (confirmed it 301-redirects to github.com/huggingface/datasets); updated both the link text and href.

Verification

  • Every factual claim above checked against either the actual codebase (ATTACK_RECIPE_NAMES, EvalModelCommand's registered name, setup.py's python_requires) or a live HTTP request (HF model pages, GitHub repo redirect)
  • Full clean Sphinx rebuild afterward introduces no new warnings in any of these files — cross-checked against the pre-existing warning list from Fix all Sphinx build warnings/errors (19 -> 0) #837 (which touches an entirely different set of files) to confirm no overlap

🤖 Generated with Claude Code

qiyanjun and others added 2 commits August 14, 2026 17:46
Reviewed docs/0_get_started/, docs/1start/, and docs/3recipes/ for
outdated code examples, broken external links, and stale version/
count references. Each item verified against current code or a live
request before fixing:

- installation.md: "Python 3.6 or above" and the conda example's
  `python=3.8` are both stale; setup.py has required >=3.9 since the
  black-version-upgrade PR. Bumped both to 3.9.
- command_line_usage.md: `textattack eval-model` was renamed to
  `textattack eval` (confirmed against
  EvalModelCommand.register_subcommand's actual registered name).
- quick_api_tour.rst: fixed two cross-references pointing at a
  nonexistent `transformers.models.wrapper` module (should be
  `textattack.models.wrappers`), and a malformed `:ref:TextFooler
  attack` role with no matching target.
- what_is_an_adversarial_attack.md: a copy-pasteable CLI example had
  its `--flag` hyphens autocorrected to em-dashes at some point
  ("attack — model lstm-mr — num-examples..."), making it
  non-functional if pasted as-is. Restored `--`.
- support.md: pointed contributors at `transformation.rst`, which
  doesn't exist (it's `docs/api/transformations.rst`).
- FAQ.md / attacks4Components.md / attack_recipes_cmd.md: "16 adversarial
  attacks" is stale (confirmed 21 CLI-registered recipes via
  ATTACK_RECIPE_NAMES + 3 Python-only multi-lingual recipes = 24);
  added the missing `a2t`, `leap`, and French/Spanish/Chinese recipe
  rows to both HTML comparison tables, which listed neither despite
  both existing in the codebase.
- attack_recipes.rst: fixed a stale recipe-numbering gap (17-19 should
  have been 18-20 after an earlier recipe was inserted above without
  renumbering everything below it); now sequential 0-23.
- attack_recipes_cmd.md: the DeepWordBug example labeled "on DistilBERT
  trained on the Quora Question Pairs paraphrase identification
  dataset" used `distilbert-base-uncased-cola` (a *grammatical
  acceptability* model, unrelated to QQP/paraphrase); fixed to
  `distilbert-base-cased-qqp`, confirmed to exist on the Hub.
- models.md: `github.com/huggingface/nlp` is HuggingFace's old,
  renamed repo (confirmed it 301-redirects to
  `github.com/huggingface/datasets`); updated both link text and href.

Verified: full clean Sphinx rebuild afterward introduces no new
warnings in any of these files (cross-checked against the existing,
separately-tracked warning list from PR QData#837, which touches different
files entirely).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Unlike other recipes, which are locked to one task and one goal function,
BadCharacters2021 takes a goal_function_type argument and can attack
classification, NER, or seq2seq/translation models. Added a note in each
of the three recipe tables/lists explaining why it doesn't fit the
classification/seq2seq split used elsewhere.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@qiyanjun
qiyanjun merged commit 2ea2b64 into QData:master Aug 14, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant