Skip to content

Commit

Permalink
Merge pull request #757 from QData/doc-update
Browse files Browse the repository at this point in the history
update docs with missing api
  • Loading branch information
qiyanjun authored Nov 5, 2023
2 parents db4ae20 + c9a84b7 commit 5c0499e
Show file tree
Hide file tree
Showing 14 changed files with 60 additions and 10 deletions.
10 changes: 10 additions & 0 deletions docs/api/transformations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,13 @@ Composite Transformation
.. autoclass:: textattack.transformations.CompositeTransformation
:members:



.. toctree::
:maxdepth: 6

textattack.transformations.sentence_transformations
textattack.transformations.word_insertions
textattack.transformations.word_merges
textattack.transformations.word_swaps

2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ TextAttack Documentation


.. toctree::
:maxdepth: 6
:maxdepth: 7
:glob:
:caption: Full Reference

Expand Down
8 changes: 8 additions & 0 deletions textattack/attack_recipes/chinese_recipe.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
"""
Attack Chinese Recipe
=====================
(Contextualized Perturbation for Chinese NLP Adversarial Attack)
"""

import string

from textattack import Attack
Expand Down
8 changes: 8 additions & 0 deletions textattack/attack_recipes/french_recipe.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
"""
Attack French Recipe
====================
(Contextualized Perturbation for French NLP Adversarial Attack)
"""

from textattack import Attack
from textattack.constraints.pre_transformation import (
RepeatModification,
Expand Down
8 changes: 8 additions & 0 deletions textattack/attack_recipes/spanish_recipe.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
"""
Attack Spanish Recipe
=====================
(Contextualized Perturbation for Spanish NLP Adversarial Attack)
"""

from textattack import Attack
from textattack.constraints.pre_transformation import (
RepeatModification,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Sentence Encoder
---------------------
Sentence Encoder Constraint
----------------------------
"""


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
BERT for Sentence Similarity
sBERT for Sentence Similarity
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"""

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Determine if an attack has been successful in Hard Label Classficiation.
----------------------------------------------------
------------------------------------------------------------------------
"""


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Determine if maintaining the same predicted label
Determine if maintaining the same predicted label (input reduction)
---------------------------------------------------------------------
"""

Expand Down
4 changes: 2 additions & 2 deletions textattack/search_methods/population_based_search.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Population based Search
==========================
Population based Search abstract class
=======================================
"""

from abc import ABC, abstractmethod
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
"""
Word Swap by chinese homophone
-------------------------------------
"""


import os

import pandas as pd
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""
Word Swap by chinese morphonym
-------------------------------------
"""

from textattack.shared.data import MORPHONYM_LS

from . import WordSwap
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
"""
Word Swap by chinese hownet
-------------------------------------
"""

import OpenHowNet

from . import WordSwap
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Word Swap by BERT-Masked LM.
-------------------------------
Word Swap by chinese BERT-Masked LM.
-------------------------------------
"""

from transformers import pipeline
Expand Down

0 comments on commit 5c0499e

Please sign in to comment.