<jupyter_start><jupyter_text>Example usageHere we are demostrating how to use `pycounts_Abhiket` to count word in a file and to plot the frequency of top 5 words  Imports<jupyter_code>from pycounts_Abhiket.pycounts_Abhiket import count_words
from pycounts_Abhiket.plotting import plot_words<jupyter_output><empty_output><jupyter_text>Create a text file We will first create a text file that quotes Eienstein<jupyter_code>quote = """Insanity is doing the same thing 
over and over and expecting different results."""
with open("E:/MDS/TERM4/DSCI_524/pycounts_Abhiket/tests/einstein.txt", "w") as file:
        file.write(quote)<jupyter_output><empty_output><jupyter_text>Count Words We can count the words in a text file using count_words(),note the count is after removing the punctution marks<jupyter_code>counts = count_words("E:/MDS/TERM4/DSCI_524/pycounts_Abhiket/tests/einstein.txt")
print(counts)<jupyter_output>Counter({'over': 2, 'and': 2, 'insanity': 1, 'is': 1, 'doing': 1, 'the': 1, 'same': 1, 'thing': 1, 'expecting': 1, 'different': 1, 'results': 1})<jupyter_text>Plotting the word counts We will plot the frequency of the top 5 words using plot_words<jupyter_code>fig = plot_words(counts, n =5 )<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10734463276836158, 'fraction_numerical': 0.01775625504439064, 'mean_word_length': 6.898089171974522, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '229421', 'license': 'MIT', 'n_tokens_mistral': 465, 'n_tokens_neox': 435, 'n_words': 126, 'path': 'docs/example.ipynb', 'repo_name': 'abhiket/pycounts', 'size': '1239'}