<jupyter_start><jupyter_text>Day 4 My Notes For day 3 homework need to do the calculations for all genres in the Brown corpus<jupyter_code>%matplotlib inline
%pprint
from __future__ import division #Python 2 users only
import nltk, matplotlib, re, pprint
from nltk import word_tokenize
from nltk.corpus import stopwords
from nltk.corpus import brown
from nltk.corpus import wordnet as wn
from nltk.book import *
from urllib import request
from bs4 import BeautifulSoup

# See my notes on Chapter 3 to see Gutenberg text import from the web.
# She experiences the same difficulty that I did with the filename

# UTF8 is the most common encoding used.
# Collocations have a high frequency of appearing together, so for Crime and Punishment this returns a lot of names.
# This could be useful in a program to guess the next word.
# A lot of time is spent on preparing and cleaning the raw data, so it is in the easiest format to be used.
# You always have to do this.
# It's all in the preparation<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.037109375, 'fraction_numerical': 0.005859375, 'mean_word_length': 4.631868131868132, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '426822', 'license': 'MIT', 'n_tokens_mistral': 300, 'n_tokens_neox': 289, 'n_words': 161, 'path': 'summer-of-code/week-03/.ipynb_checkpoints/Day 4 my notes-checkpoint.ipynb', 'repo_name': 'ejmavis/toolkitten', 'size': '1024'}