当前位置:   article > 正文

开源免费文本数据标注工具使用:paddlehub snownlp_paddlehub 免费

paddlehub 免费

第一个snownlp

# pip install snownlp -i https://mirror.baidu.com/pypi/simple
from snownlp import SnowNLP
text="大牛市来啦,发财啦"
nlp=SnowNLP(text)
print(nlp.sentiments)

第二个 paddlehub

会有很多包搭配的问题:

  1. #https://blog.csdn.net/u010751000/article/details/106747421?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_baidulandingword~default-0-106747421-blog-120609993.pc_relevant_blogantidownloadv1&spm=1001.2101.3001.4242.1&utm_relevant_index=2
  2. # from snownlp import SnowNLP
  3. # text="大牛市来啦,发财啦"
  4. # nlp=SnowNLP(text)
  5. # print(nlp.sentiments)
  6. # pip install paddlehub==1.8.0 -i https://mirror.baidu.com/pypi/simple
  7. # pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple
  8. # pip install protobuf==3.20.1 -i https://mirror.baidu.com/pypi/simple
  9. # pip install opencv-contrib-python -i https://mirror.baidu.com/pypi/simple
  10. # python -m pip install -U pip -i https://mirror.baidu.com/pypi/simple
  11. import paddlehub as hub
  12. import paddlehub as hub
  13. # 加载模型
  14. senta = hub.Module(name="senta_lstm")
  15. # 待分类文本
  16. test_text = [
  17. "三百多块比亚迪一股分红一毛,四百多的宁王分二毛呵呵这就是成长性",
  18. "刘背离死叉",
  19. "牛市来了",
  20. "$上证指数(SH000001)$主力这几天紧张、小心的计划割韭菜!小散们马上清仓",
  21. "散户明摆着被洗了一把,还没察觉呢,早盘低开回踩一"
  22. ]
  23. # 情感分类
  24. results = senta.sentiment_classify(data={"text": test_text})
  25. # 得到结果
  26. for result in results:
  27. print(result)

具体的包的 配置:

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/695640
推荐阅读
相关标签
  

闽ICP备14008679号