Error : TypeError: 'int' object is not subscriptable while using lops in python

Error : TypeError: 'int' object is not subscriptable while using lops in python

我正在使用 python,我有一个这样的嵌套列表

clusters_appearance_list = [[[0, 0], ['jack']], [[0, 0], ['study']], [[0, 4], ['small', 'modest', 'little']], [[0, 5], ['big', 'large']]]

我想计算文本中每个簇的出现频率。我的代码是这样的

for cluster in clusters_appearance_list:
  for word_cluster in cluster:
    for word in words_cluster[1]:
        for sentence in stemmed_sentences_list:
            if word in sentence[1]:
                count = count+1
     clusters_appearance_list.append(count)
     count = 0
print(clusters_appearance_list)

我收到错误

for word in cluster[1]:
TypeError: 'int' object is not subscriptable

应该是

for cluster in clusters_appearance_list:
    for word in cluster[1]:

不是

for cluster in clusters_appearance_list:
   for word_cluster in cluster:
     for word in words_cluster[1]: