CountVectorizer получает пустой словарный запас - PullRequest
0 голосов
/ 26 октября 2018

Это может быть простой вопрос, но, очевидно, я получил пустой словарь для подбора в CountVectorizer ().

Код:

a = [[], []]

b = [[[], [], [], [], [], [], []], [[], [], [], [], [], [], [], []]]

try:
            CountVectorizer().fit(chain.from_iterable(a))
            return doing(b)
            value = []
            for x in b:
                bb = [" ".join(fx) for fx in x]
                test = self.CountVectorizer().transform(bb)
                value.append(test)
            return value
        except ValueError:
            print("Value Error: Empty Vocabulary", file=sys.stderr)
             ***what to include here so that they will continue doing the next process and output nothing for the vectors?***
...