1
0
mirror of https://github.com/QData/TextAttack.git synced 2021-10-13 00:05:06 +03:00

remove unnecessary messages

This commit is contained in:
uvafan
2019-11-07 17:39:38 -05:00
parent fa33dc1b09
commit d9f41007dd
6 changed files with 21 additions and 7 deletions

View File

@@ -5,5 +5,6 @@ scipy
torch==1.3.0
transformers==2.0.0
tensorflow-gpu
scikit-learn
# visdom
# visdom

View File

@@ -26,6 +26,14 @@ Description: # TextAttack
nltk.download('stopwords')
```
### Common Errors
#### Errors regarding GCC
If you see an error that GCC is incompatible, make sure your system has an up-to-date version of the GCC compiler. On distributed systems with a `module` system, typing `module load gcc` may be sufficient.
#### Errors regarding Java
Using the LanguageTool constraint relies on Java 8 internally (it's not ideal, we know). Please install Java 8 if you're interested in using the LanguageTool grammaticality constraint. If your system has the `module` command, try typing `module load java8`.
## Features
### Models

View File

@@ -1,6 +1,7 @@
README.md
setup.py
textattack/__init__.py
textattack/run_attack.py
textattack/tokenized_text.py
textattack/utils.py
textattack.egg-info/PKG-INFO
@@ -26,7 +27,12 @@ textattack/constraints/syntax/__init__.py
textattack/constraints/syntax/language_tool.py
textattack/datasets/__init__.py
textattack/datasets/dataset.py
textattack/datasets/yelp_sentiment.py
textattack/datasets/classification/__init__.py
textattack/datasets/classification/ag_news.py
textattack/datasets/classification/imdb_sentiment.py
textattack/datasets/classification/kaggle_fake_news.py
textattack/datasets/classification/movie_review_sentiment.py
textattack/datasets/classification/yelp_sentiment.py
textattack/models/__init__.py
textattack/models/bert_for_sentiment_classification.py
textattack/models/infer_sent.py
@@ -34,5 +40,4 @@ textattack/models/lstm_for_sentiment_classification.py
textattack/transformations/__init__.py
textattack/transformations/transformation.py
textattack/transformations/word_swap.py
textattack/transformations/word_swap_counterfit.py
textattack/transformations/word_swap_embedding.py

View File

@@ -1,6 +1,8 @@
language_check
nltk
numpy<1.17
scipy
torch==1.3.0
transformers==2.0.0
tensorflow-gpu
scikit-learn

View File

@@ -134,13 +134,13 @@ class InferSent(nn.Module):
assert hasattr(self, 'w2v_path'), 'w2v path not set'
word_dict = self.get_word_dict(sentences, tokenize)
self.word_vec = self.get_w2v(word_dict)
print('Vocab size : %s' % (len(self.word_vec)))
# print('Vocab size : %s' % (len(self.word_vec)))
# build w2v vocab with k most frequent words
def build_vocab_k_words(self, K):
assert hasattr(self, 'w2v_path'), 'w2v path not set'
self.word_vec = self.get_w2v_k(K)
print('Vocab size : %s' % (K))
# print('Vocab size : %s' % (K))
def update_vocab(self, sentences, tokenize=True):
assert hasattr(self, 'w2v_path'), 'warning : w2v path not set'

View File

@@ -11,8 +11,6 @@ class TokenizedText:
def words(self):
""" Returns the distinct words from self.text.
@TODO Should we ever consider case when substituting words?
"""
return self.raw_words