欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程语言 > python >内容正文

python

自然语言处理python进阶(二)

发布时间:2024/10/8 python 36 豆豆
生活随笔 收集整理的这篇文章主要介绍了 自然语言处理python进阶(二) 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

python字符串的简单使用

namesList = ['Tuffy','Ali','Nysha','Tim' ] sentence = 'My dog sleeps on sofa'names = ';'.join(namesList) print(type(names), ':', names) wordList = sentence.split(' ') print((type(wordList)), ':', wordList) additionExample = 'ganehsa' + 'ganesha' + 'ganesha' multiplicationExample = 'ganesha' * 2 print('Text Additions :', additionExample) print('Text Multiplication :', multiplicationExample) str = 'Python NLTK' print(str[1]) print(str[-3])

使用python读取pdf

from PyPDF2 import PdfFileReaderdef getTextPDF(pdfFileName, password = ''):# 打开pdf_file = open(pdfFileName, 'rb')# 读取read_pdf = PdfFileReader(pdf_file)if password != '':read_pdf.decryp

总结

以上是生活随笔为你收集整理的自然语言处理python进阶(二)的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。