Skip to content

Commit 13f8f38

Browse files
committed
make release-tag: Merge branch 'master' into stable
2 parents d1f81cd + ab59451 commit 13f8f38

File tree

89 files changed

+5116
-3325
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+5116
-3325
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ data/
22
exp-*/
33
.remote-sync.json
44
.idea/
5+
scripts/
6+
*.ipynb
57

68
# Byte-compiled / optimized / DLL files
79
__pycache__/

BENCHMARK.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ python -m fibber.benchmark.benchmark \
7171
--dataset mr \
7272
--strategy ASRSStrategy \
7373
--output_dir exp-mr \
74-
--num_paraphrases_per_text 20 \
74+
--max_paraphrases 20 \
7575
--subsample_testset 100 \
7676
--gpt2_gpu 0 \
7777
--bert_gpu 0 \

HISTORY.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# History
22

3+
## Version 0.4.0 - 2022-06-29
4+
This release includes the following updates
5+
6+
## New Features
7+
- Add RewriteRollbackStrategy, SAPStrategy.
8+
- Redesign defense strategy API.
9+
- Add AdvTrainStrategy, SEMStrategy, SAPDStrategy
10+
11+
312
## Version 0.3.1 - 2021-07-20
413
This release includes the following updates
514

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ from fibber.fibber import Fibber
138138
arg_dict = {
139139
"use_gpu_id": 0,
140140
"gpt2_gpu_id": 0,
141-
"bert_gpu_id": 0,
141+
"transformer_clf_gpu_id": 0,
142142
"ce_gpu_id": 0,
143143
"strategy_gpu_id": 0,
144144
"asrs_block_size": 3,
@@ -147,7 +147,7 @@ arg_dict = {
147147
"asrs_sim_threshold": 0.95,
148148
"asrs_ppl_weight": 5,
149149
"asrs_clf_weight": 3
150-
"asrs_sim_metric": "CESemanticSimilarityMetric"
150+
"asrs_sim_metric": "CESimilarityMetric"
151151
}
152152

153153
# create a fibber object.
@@ -189,29 +189,29 @@ The output is a tuple of (str, list, list).
189189
# Evaluation metrics of these 5 paraphrase_list.
190190

191191
{'EditingDistance': 8,
192-
'USESemanticSimilarityMetric': 0.9523628950119019,
193-
'GloVeSemanticSimilarityMetric': 0.9795315341042675,
194-
'GPT2GrammarQualityMetric': 1.492070198059082,
192+
'USESimilarityMetric': 0.9523628950119019,
193+
'GloVeSimilarityMetric': 0.9795315341042675,
194+
'GPT2PerplexityMetric': 1.492070198059082,
195195
'BertClassifier': 0},
196196
{'EditingDistance': 9,
197-
'USESemanticSimilarityMetric': 0.9372092485427856,
198-
'GloVeSemanticSimilarityMetric': 0.9575780832312993,
199-
'GPT2GrammarQualityMetric': 0.9813404679298401,
197+
'USESimilarityMetric': 0.9372092485427856,
198+
'GloVeSimilarityMetric': 0.9575780832312993,
199+
'GPT2PerplexityMetric': 0.9813404679298401,
200200
'BertClassifier': 1},
201201
{'EditingDistance': 11,
202-
'USESemanticSimilarityMetric': 0.9265919327735901,
203-
'GloVeSemanticSimilarityMetric': 0.9710499628056698,
204-
'GPT2GrammarQualityMetric': 1.325406551361084,
202+
'USESimilarityMetric': 0.9265919327735901,
203+
'GloVeSimilarityMetric': 0.9710499628056698,
204+
'GPT2PerplexityMetric': 1.325406551361084,
205205
'BertClassifier': 0},
206206
{'EditingDistance': 7,
207-
'USESemanticSimilarityMetric': 0.8913971185684204,
208-
'GloVeSemanticSimilarityMetric': 0.9800737898362042,
209-
'GPT2GrammarQualityMetric': 1.2504483461380005,
207+
'USESimilarityMetric': 0.8913971185684204,
208+
'GloVeSimilarityMetric': 0.9800737898362042,
209+
'GPT2PerplexityMetric': 1.2504483461380005,
210210
'BertClassifier': 1},
211211
{'EditingDistance': 8,
212-
'USESemanticSimilarityMetric': 0.9124080538749695,
213-
'GloVeSemanticSimilarityMetric': 0.9744155151490856,
214-
'GPT2GrammarQualityMetric': 1.1626977920532227,
212+
'USESimilarityMetric': 0.9124080538749695,
213+
'GloVeSimilarityMetric': 0.9744155151490856,
214+
'GPT2PerplexityMetric': 1.1626977920532227,
215215
'BertClassifier': 0}]
216216
```
217217

fibber/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
__author__ = 'MIT Data To AI Lab'
44
__email__ = 'dailabmit@gmail.com'
5-
__version__ = '0.3.1'
5+
__version__ = '0.4.0.dev0'
66

77
import os
88

@@ -18,7 +18,3 @@ def get_root_dir():
1818

1919
# change cache directory
2020
nltk.data.path += [os.path.join(get_root_dir(), "common", "nltk_data")]
21-
os.environ['TRANSFORMERS_CACHE'] = os.path.join(
22-
get_root_dir(), "common", "transformers_pretrained")
23-
os.environ['TFHUB_CACHE_DIR'] = os.path.join(get_root_dir(), "common", "tfhub_pretrained")
24-
os.environ['CORENLP_HOME'] = os.path.join(get_root_dir(), "common", "stanford-corenlp-4.1.0")

fibber/benchmark/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
from fibber.benchmark.benchmark import Benchmark
1+
from fibber.benchmark.benchmark_adversarial_attack import Benchmark
22

33
__all__ = ["Benchmark"]

0 commit comments

Comments
 (0)