MCPcopy Create free account

hub / github.com/PhantomInsights/mexican-government-report / functions

Functions13 in github.com/PhantomInsights/mexican-government-report

↓ 1 callersFunctionclean_word
Cleans the word by replacing non-friendly characters. Parameters ---------- word : str The word to be cleaned. Returns -
scripts/step3.py:193
↓ 1 callersFunctionextract_text
Read the PDF contents and extract the text that we need.
scripts/step1.py:34
↓ 1 callersFunctionget_entities
Get the entities and save them to .csv Parameters ---------- doc : spacy.doc A doc object.
scripts/step2.py:56
↓ 1 callersFunctionget_sentences
Get the sentences, score and save them to .csv You will require to download the dataset (zip) from the following url: https://www.kaggle.com
scripts/step2.py:75
↓ 1 callersFunctionget_tokens
Get the tokens and save them to .csv Parameters ---------- doc : spacy.doc A doc object.
scripts/step2.py:33
↓ 1 callersFunctionmain
Loads the model and processes it. The model used can be installed by running this command on your CMD/Terminal: python -m spacy download
scripts/step2.py:10
Functionget_entity_counts
Gets the number of counts per entity. Parameters ---------- df : pandas.DataFrame The DataFrame to be analyzed.
scripts/step3.py:109
Functionget_state_counts
Gets the number of counts per state. Parameters ---------- df : pandas.DataFrame The DataFrame to be analyzed.
scripts/step3.py:126
Functionget_word_counts
Gets the total word count and the total unique lemmas. Parameters ---------- df : pandas.DataFrame The DataFrame to be analyzed.
scripts/step3.py:63
Functionplot_donut
Generates a donut plot with the counts of 3 categories. Parameters ---------- df : pandas.DataFrame The DataFrame to be plotted.
scripts/step3.py:242
Functionplot_map
Generates a map using the state counts. You will require to download the following file and extract its contents to a folder named: mexicostates
scripts/step3.py:153
Functionplot_most_used_words
Generates a bar plot with the counts of the most used lemmas. Parameters ---------- df : pandas.DataFrame The DataFrame to be plo
scripts/step3.py:83
Functionplot_sentiment_analysis
Generates a bar plot with the sentiment scores of each sentence. Parameters ---------- df : pandas.DataFrame The DataFrame to be
scripts/step3.py:214