[英]Removing all English and other punctuation form the text file in Jupyter
I have a text file I wanted to work on some NLP task.我有一个文本文件,我想处理一些 NLP 任务。 But I am processing for Local language.
但我正在处理本地语言。 That file contains lots of English words and Punctuation marks.
该文件包含大量英文单词和标点符号。 I wanted to get rid of all the Latin and other punctuation from that text file.
我想从那个文本文件中去掉所有的拉丁文和其他标点符号。 How this is possible using Jupyter notebook TIA
使用 Jupyter notebook TIA 如何实现这一点
Sure, you can accomplish this with just Python当然,您只需 Python 即可完成此操作
text = "Hello, World!!"
# put everything you wish to filter out in this list
filterList = [',', '!']
filteredList = filter(lambda c: c not in filterList, text)
print(''.join(filteredList))
Will give Hello World
会给
Hello World
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.