Postingan

Menampilkan postingan dari April, 2023

Implementation of Text Mining (baby steps)

STEP :  Tokenizing Stemming  Analyzing Result / Knowledge Install nltk : pip install nltk Install sklearn : pip install scikit-learn Open Visual Studio Code, then type this : import pandas as pd import nltk from nltk.sentiment.vader import SentimentIntensityAnalyzer from nltk.corpus import stopwords from nltk.tokenize import word_tokenize from nltk.stem import WordNetLemmatizer # download nltk corpus (first time only) import nltk nltk. download ( "all" ) # Load the amazon review dataset df = pd. read_csv (     "https://raw.githubusercontent.com/pycaret/pycaret/master/datasets/amazon.csv" ) def preprocess_text ( text ):     # Tokenize the text     tokens = word_tokenize (text. lower ())     # Remove stop words     filtered_tokens = [         token for token in tokens if token not in stopwords. words ( "english" )     ]     # Lemmatize the tokens     lemmatizer...