<jupyter_start><jupyter_text>---title: "Basic-tokenisation"author: "<NAME>"date: 2020-09-04description: "-"type: technical_notedraft: false---<jupyter_code>import math
import statistics
import numpy as np
import scipy.stats
import pandas as pd
import sklearn
import re
Sms_content=['What is going on','How is your life','oh! god what is happening']
df=pd.DataFrame(Sms_content,columns={'sms'})
df
def tokenize(text):
    tokens=re.split('\W+',text)
    return tokens

df['tokenized_text']=df['sms'].apply(lambda row : tokenize(row.lower()))
df.head()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15517241379310345, 'fraction_numerical': 0.013793103448275862, 'mean_word_length': 6.958904109589041, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '373881', 'license': 'MIT', 'n_tokens_mistral': 208, 'n_tokens_neox': 202, 'n_words': 46, 'path': 'content/python/sklearn/.ipynb_checkpoints/Basic_tokenisation-checkpoint.ipynb', 'repo_name': 'Palaniappan12345/mlnotes', 'size': '587'}