Horje
Removing punctuation with NLTK in Python Code Example
Removing punctuation with NLTK in Python
import string 
from nltk.tokenize import word_tokenize
s =  set(string.punctuation)          # !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
sentence = "Hey guys !, How are 'you' ?"
sentence = word_tokenize(sentence)
filtered_word = []
for i in sentence:
    if i not in s:
        filtered_word.append(i);
for word in filtered_word:
  print(word,end = " ")




Python

Related
pandas read csv without index Code Example pandas read csv without index Code Example
python datetime strptime hour minute second Code Example python datetime strptime hour minute second Code Example
python get minute from datetime Code Example python get minute from datetime Code Example
python day from date Code Example python day from date Code Example
godot restart scene Code Example godot restart scene Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
6