TypeError: 'NoneType' object is not iterable
See original GitHub issueHi,
Why do I get the error when running the following code?
`phrases = [“Can you recommend some upscale restaurants in Newyork?”, “What are the famous places we should not miss in Russia?” ]
for phrase in phrases: print(“-”*100) print(“Input_phrase: “, phrase) print(”-”*100) para_phrases = parrot.augment(input_phrase=phrase, use_gpu=False, do_diverse=True, diversity_ranker=“levenshtein”) for para_phrase in para_phrases: print(para_phrase)`
Error:
`TypeError Traceback (most recent call last) /home/user/Code/Parrot/main.ipynb Cell 4 in <cell line: 5>() 8 print(“-”*100) 9 para_phrases = parrot.augment(input_phrase=phrase, use_gpu=False, do_diverse=True, diversity_ranker=“levenshtein”) —> 10 for para_phrase in para_phrases: 11 print(para_phrase)
TypeError: ‘NoneType’ object is not iterable`
Issue Analytics
- State:
- Created a year ago
- Comments:5
Top GitHub Comments
If you look at the code, there are limits that could lead to None if not good candidates are found: https://github.com/PrithivirajDamodaran/Parrot_Paraphraser/blob/2cffbe911341e52dc73b77f9b0154c18d570603f/parrot/parrot.py#L130
You can bypass this by lowering those limits. For example:
Same here. This is so frustrating!!
what the parrot paraphraser usually returns: a list of tuples each tuple consists of two things : paraphrased string token_count
if we give max_return_phrases = 3, then it will return a list of 3 such tuples.
but it is randomly returning None for sentences and there is no definite pattern, if I rerun the cell for the same sentence, it then sometimes returns the paraphrases.