Fix outdated examples, broken links, and stale references across docs - #839
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reviewed
docs/0_get_started/,docs/1start/, anddocs/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'spython=3.8are both stale —setup.pyhas required>=3.9since 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-modelwas renamed totextattack eval(confirmed againstEvalModelCommand.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 nonexistenttransformers.models.wrappermodule (should betextattack.models.wrappers), and a malformed:ref:TextFooler attackrole with no matching target.what_is_an_adversarial_attack.md: a copy-pasteable CLI example had its--flaghyphens 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 attransformation.rstfor adding new transformation docs — that file doesn't exist; it'sdocs/api/transformations.rst.FAQ.md/attacks4Components.md/attack_recipes_cmd.md: "16 adversarial attacks" is stale — confirmed 21 CLI-registered recipes viaATTACK_RECIPE_NAMES+ 3 Python-only multi-lingual recipes (French/Spanish/Chinese) = 24. Added the missinga2t,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 referenceddistilbert-base-uncased-cola— a grammatical acceptability model, unrelated to QQP/paraphrase identification. Fixed todistilbert-base-cased-qqp(confirmed this model exists on the Hub).models.md:github.com/huggingface/nlpis HuggingFace's old, renamed repo (confirmed it 301-redirects togithub.com/huggingface/datasets); updated both the link text and href.Verification
ATTACK_RECIPE_NAMES,EvalModelCommand's registered name,setup.py'spython_requires) or a live HTTP request (HF model pages, GitHub repo redirect)🤖 Generated with Claude Code