这段代码看不懂什么意思?
来源:6-6 数据处理-句子编码化处理(训练字典)

慕虎2364166
2018-12-26
f isinstance(max_features, int): ###???
count = sorted(list(count.items()), key=lambda x:x[1])
if max_features is not None and len(count) > max_features:
count = count[-int(max_features):] #???
for w, _ in count:
self.dict[w] = len(self.dict)
else:
for w in sorted(count.keys()):
self.dict[w] = len(self.dict)
self.fited = True
写回答
1回答
-
StephenLee147
2019-01-04
再去学学python
022019-04-15
相似问题