Comments (4)
same issue here:
python code/augment.py --input=data/train_original.txt --num_aug=15 --alpha_sr=0.1
Traceback (most recent call last):
File "code/augment.py", line 75, in
gen_eda(args.input, output, alpha_sr=alpha_sr, alpha_ri=alpha_ri, alpha_rs=alpha_rs, alpha_rd=alpha_rd, num_aug=num_aug)
File "code/augment.py", line 64, in gen_eda
aug_sentences = eda(sentence, alpha_sr=alpha_sr, alpha_ri=alpha_ri, alpha_rs=alpha_rs, p_rd=alpha_rd, num_aug=num_aug)
File "/Users/bernardogarcia/GitHub/eda_nlp/code/eda.py", line 194, in eda
a_words = random_insertion(words, n_ri)
File "/Users/bernardogarcia/GitHub/eda_nlp/code/eda.py", line 153, in random_insertion
add_word(new_words)
File "/Users/bernardogarcia/GitHub/eda_nlp/code/eda.py", line 160, in add_word
random_word = new_words[random.randint(0, len(new_words)-1)]
File "/Users/bernardogarcia/opt/anaconda3/envs/nlp-news_filter/lib/python3.7/random.py", line 222, in randint
return self.randrange(a, b+1)
File "/Users/bernardogarcia/opt/anaconda3/envs/nlp-news_filter/lib/python3.7/random.py", line 200, in randrange
raise ValueError("empty range for randrange() (%d,%d, %d)" % (istart, istop, width))
ValueError: empty range for randrange() (0,0, 0)
from eda_nlp.
In code/eda.py, the main function eda starts with below in line 175
sentence = get_only_chars(sentence)
get_only_chars function performs preprocessing to remove non-alphabetic characters from text. Therefore, if you input text data consisting of only non-alphabetic characters, len(words)-1 becomes -1 in the code below in line 117 and etc. and an error occurs.
rand_int = random.randint(0, len(words)-1)
If you input text data that consists only of non-alphabetic characters, you can avoid this error by modifying the get_only_chars function in line 45, so that the data is excluded from removal as follows.
if char in 'qwertyuiopasdfghjklzxcvbnm123456789(). ':
from eda_nlp.
i have same problem,big probability is your data problem. if you are sentence is null or particular token ,like "------".
check your data.
from eda_nlp.
I also have this problem, could this problem refers to dataset?
because my dataset has three columns but the dataset in this repository has two columns.
would you please help me.
from eda_nlp.
Related Issues (20)
- Confirmation abt data augmentation HOT 4
- Possibility of masking some tokens? HOT 1
- What is the role of label here?
- empty range for randrange() HOT 2
- Performance on trec dataset drops significantly after using eda HOT 2
- random_insertion should take stop words into account HOT 2
- BERT + EDA ? HOT 2
- performance gain of each eda method HOT 2
- A little suggestion about error exception
- Mechanism to choose between EDA tasks HOT 2
- Run augmentation on my dataset, unsure how to procceed. HOT 1
- Semi-supervised HOT 1
- Languages supported HOT 1
- Something about the best parameters HOT 1
- Random Insertion can't insert word into the last position ?
- Supported languages.
- Need Code for paper "Good-Enough Example Extrapolation"
- Liencese of this repo HOT 1
- Tips for Non-English Augmentation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eda_nlp.