Skip to content
Snippets Groups Projects
Commit 83984e11 authored by Benoît Courty's avatar Benoît Courty
Browse files

removing subfolder etudes-amendements

parent d8af0311
Branches
Tags
No related merge requests found
__version__ = "0.0.1"
# AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"load_data": "02_word_count.ipynb",
"amdt": "02_word_count.ipynb",
"build_word_cloud": "02_word_count.ipynb"}
modules = ["word_count.py"]
doc_url = "https://leximpact.github.io/etudes-amendements/"
git_url = "https://github.com/leximpact/etudes-amendements/tree/main/"
def custom_doc_links(name): return None
# AUTOGENERATED! DO NOT EDIT! File to edit: notebook/02_word_count.ipynb (unless otherwise specified).
__all__ = ['load_data', 'amdt', 'build_word_cloud']
# Cell
import pickle
import pandas as pd
from urllib.request import urlopen
from collections import Counter
from wordcloud import WordCloud
# Cell
amdt = None
def load_data():
global amdt
data_words = pickle.load(urlopen("https://github.com/leximpact/etudes-amendements/raw/nbdev/notebook/data/amdt_data_words.pickle"))
amdt = pd.read_csv('https://github.com/leximpact/etudes-amendements/raw/nbdev/notebook/data/amdt_sans_stopword.csv.gz')
word_count = Counter(data_words)
word_count.most_common(30)
# Cell
# Import the wordcloud library
# Cell
def build_word_cloud():
# Join the different processed titles together.
long_string = ' '.join(list(amdt['txt_sans_stopword'].values))
# Create a WordCloud object
wordcloud = WordCloud(background_color="white", width=1000, height=800, max_words=5000, contour_width=3, contour_color='steelblue')
# Generate a word cloud
wordcloud.generate(long_string)
# Visualize the word cloud
return wordcloud
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment