If you use analyze_classifier_coverage.py with --ngrams parameter (e.g. --ngrams 1 2 3) it throws an exception:
Traceback (most recent call last):
File "analyze_classifier_coverage.py", line 152, in
feat = bag_of_words(norm_words(t))
File "analyze_classifier_coverage.py", line 110, in norm_words
return reduce(operator.add, [words if n == 1 else ngrams(words, n) for n in args.ngrams])
TypeError: can only concatenate list (not "generator") to list
If you use analyze_classifier_coverage.py with --ngrams parameter (e.g. --ngrams 1 2 3) it throws an exception: Traceback (most recent call last): File "analyze_classifier_coverage.py", line 152, in
feat = bag_of_words(norm_words(t))
File "analyze_classifier_coverage.py", line 110, in norm_words
return reduce(operator.add, [words if n == 1 else ngrams(words, n) for n in args.ngrams])
TypeError: can only concatenate list (not "generator") to list
Made the code consistent with train_classifier.py