Skip to content

Commit

Permalink
Merge pull request #559 from QData/tutorial-dependency
Browse files Browse the repository at this point in the history
add   "textattack[tensorflow]" option in all tutorials
  • Loading branch information
qiyanjun committed Oct 31, 2021
2 parents 1918bfd + 128066d commit c014fc1
Show file tree
Hide file tree
Showing 11 changed files with 302 additions and 267 deletions.
10 changes: 5 additions & 5 deletions docs/2notebook/0_End_to_End.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"source": [
"!pip3 install textattack[tensorflow]"
],
"execution_count": 1,
"execution_count": null,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -346,7 +346,7 @@
"source": [
"!textattack peek-dataset --dataset-from-huggingface rotten_tomatoes"
],
"execution_count": 2,
"execution_count": null,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -437,7 +437,7 @@
"source": [
"!textattack train --model-name-or-path distilbert-base-uncased --dataset rotten_tomatoes --model-num-labels 2 --model-max-length 64 --per-device-train-batch-size 128 --num-epochs 3"
],
"execution_count": 5,
"execution_count": null,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -518,7 +518,7 @@
"source": [
"!textattack eval --num-examples 1000 --model ./outputs/2021-10-13-17-37-27-247436/best_model/ --dataset-from-huggingface rotten_tomatoes --dataset-split test"
],
"execution_count": 6,
"execution_count": null,
"outputs": [
{
"output_type": "stream",
Expand Down Expand Up @@ -567,7 +567,7 @@
"source": [
"!textattack attack --recipe textfooler --num-examples 100 --model ./outputs/2021-10-13-17-37-27-247436/best_model/ --dataset-from-huggingface rotten_tomatoes --dataset-split test"
],
"execution_count": 8,
"execution_count": null,
"outputs": [
{
"output_type": "stream",
Expand Down
4 changes: 2 additions & 2 deletions docs/2notebook/1_Introduction_and_Transformations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"id": "urhoEHXJf8YK"
},
"source": [
"Installation of Attack-api branch"
"Please remember to run **pip3 install textattack[tensorflow]** in your notebook enviroment before the following codes:"
]
},
{
Expand Down Expand Up @@ -915,7 +915,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.7.7"
}
},
"nbformat": 4,
Expand Down
4 changes: 3 additions & 1 deletion docs/2notebook/2_Constraints.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
"id": "LbiCxZmP_mmD"
},
"source": [
"Please remember to run **pip3 install textattack[tensorflow]** in your notebook enviroment before the following codes:\n",
"\n",
"### Classes of constraints\n",
"\n",
"TextAttack evaluates constraints using methods from three groups:\n",
Expand Down Expand Up @@ -1151,7 +1153,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.7.7"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
Expand Down

0 comments on commit c014fc1

Please sign in to comment.