问题遇到的现象和发生背景 :counter函数报错
问题相关代码,请勿粘贴截图
from collections import counter
counter=counter(seg_list)
运行结果及报错内容 :counter函数调用报错
Building prefix dict from the default dictionary ...
Loading model from cache C:\Users\ADMINI~1\AppData\Local\Temp\jieba.cache
Loading model cost 1.428 seconds.
Prefix dict has been built successfully.
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\test\yuyue.py", line 16, in <module>
counter=counter(seg_list)
NameError: name 'counter' is not defined
我的解答思路和尝试过的方法 :看了很多网上的方法,安装os库什么的都试过了,不太行
我想要达到的结果:希望运行counter函数