这段代码看不懂什么意思?

来源: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

0
2
慕少4732649
不写注释的代码 本来就难懂啊 ~ 主要是意图 和语法无关
2019-04-15
共2条回复

NLP实践TensorFlow打造聊天机器人

解析自然语言处理( NLP )常用技术,从0搭建聊天机器人应用并部署上线,可用于毕设。

673 学习 · 281 问题

查看课程