1. 首页
  2. 存储
  3. 其他
  4. Python中文分词工具myjieba.py

Python中文分词工具myjieba.py

上传者: 2023-03-12 12:41:30上传 PY文件 234B 热度 8次
# Python中文分词工具myjieba.py
import jieba

def cut_sentence(sentence):
    """
    对句子进行分词
    """
    words = jieba.cut(sentence)
    return words

if __name__ == "__main__":
    sentence = "我爱自然语言处理"
    words = cut_sentence(sentence)
    print("/".join(words))
下载地址
用户评论