<jupyter_start><jupyter_text>Dataset 🧾<jupyter_code>!gdown --id 1DHjy_vso6DhuN3xMsz6_TerdgHibVuqi<jupyter_output>Downloading...
From: https://drive.google.com/uc?id=1DHjy_vso6DhuN3xMsz6_TerdgHibVuqi
To: /content/Musical_instruments_reviews.csv

0.00B [00:00, ?B/s]
6.09MB [00:00, 95.4MB/s]<jupyter_text>Reading the data 💿<jupyter_code>import pandas as pd
df = pd.read_csv('/content/Musical_instruments_reviews.csv') 
df.head() 
df = df[['reviewText', 'overall']] 
df.head()<jupyter_output><empty_output><jupyter_text>OneShot is all you need 🤫<jupyter_code>!pip install git+https://github.com/nakshatrasinghh/OneShot.git
!python -m spacy download en_core_web_md
import OneShot as osx
import re
def get_clean(x):
    x = str(x).lower().replace('\\', '').replace('_', ' ')
    x = osx.cont_exp(x)
    x = osx.remove_emails(x)
    x = osx.remove_urls(x)
    x = osx.remove_html_tags(x)
    x = osx.remove_rt(x)
    x = osx.remove_mentions(x)
    x = osx.remove_accented_chars(x)
    x = osx.remove_special_chars(x)
    x = osx.remove_stopwords(x)
    x = osx.remove_dups_char(x)
    x = re.sub("(.)\\1{2,}", "\\1", x)
    return x 
df['Cleaned_reviewText'] = df['reviewText'].apply(lambda x: get_clean(x)) 
df.head()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16183574879227053, 'fraction_numerical': 0.02254428341384863, 'mean_word_length': 4.919047619047619, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '587249', 'license': 'MIT', 'n_tokens_mistral': 583, 'n_tokens_neox': 562, 'n_words': 81, 'path': 'example.ipynb', 'repo_name': 'nakshatrasinghh/Preprocessing_Nakshatra', 'size': '1242'}