- Windows System (Tested on Windows 10)
pdflatex
TexLive (/wstandalone
package)magick
Image Magickchoco install imagemagick
gswin32c
Ghost Script (x86)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
codigo_uf | uf | nome | latitude | longitude | |
---|---|---|---|---|---|
11 | RO | Rondônia | -10.83 | -63.34 | |
12 | AC | Acre | -8.77 | -70.55 | |
13 | AM | Amazonas | -3.47 | -65.1 | |
14 | RR | Roraima | 1.99 | -61.33 | |
15 | PA | Pará | -3.79 | -52.48 | |
16 | AP | Amapá | 1.41 | -51.77 | |
17 | TO | Tocantins | -9.46 | -48.26 | |
21 | MA | Maranhão | -5.42 | -45.44 | |
22 | PI | Piauí | -6.6 | -42.28 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
library(dplyr) | |
sigmoid = function(x) { | |
1 / (1 + exp(-x)) | |
} | |
### | |
vals <- tibble(x = seq(-10, 10, 1), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
summary=[] | |
for sent,strength in sentence_rank.items(): | |
if strength in top_sent: | |
summary.append(sent) | |
else: | |
continue | |
for i in summary: | |
print(i,end=" ") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sentence_rank={} | |
for sent in doc.sents: | |
for word in sent : | |
if word.text.lower() in word_frequency.keys(): | |
if sent in sentence_rank.keys(): | |
sentence_rank[sent]+=word_frequency[word.text.lower()] | |
else: | |
sentence_rank[sent]=word_frequency[word.text.lower()] | |
top_sentences=(sorted(sentence_rank.values())[::-1]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val=sorted(word_frequency.values()) | |
higher_word_frequencies = [word for word,freq in word_frequency.items() if freq in val[-3:]] | |
print("\nWords with higher frequencies: ", higher_word_frequencies) | |
# gets relative frequencies of words | |
higher_frequency = val[-1] | |
for word in word_frequency.keys(): | |
word_frequency[word] = (word_frequency[word]/higher_frequency) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
corpus = [sent.text.lower() for sent in doc.sents ] | |
cv = CountVectorizer(stop_words=list(STOP_WORDS)) | |
cv_fit=cv.fit_transform(corpus) | |
word_list = cv.get_feature_names(); | |
count_list = cv_fit.toarray().sum(axis=0) | |
"""The zip(*iterables) function takes iterables as arguments and returns an iterator. | |
This iterator generates a series of tuples containing elements from each iterable. | |
Let's convert these tuples to {word:frequency} dictionary""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import spacy | |
from spacy.lang.pt.stop_words import STOP_WORDS | |
from sklearn.feature_extraction.text import CountVectorizer | |
import pt_core_news_sm | |
nlp = pt_core_news_sm.load() | |
with open("original_text.txt", "r", encoding="utf-8") as f: | |
text = " ".join(f.readlines()) | |
doc = nlp(text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ekphrasis.classes.preprocessor import TextPreProcessor | |
from ekphrasis.classes.tokenizer import SocialTokenizer | |
from ekphrasis.dicts.emoticons import emoticons | |
import numpy as np | |
import re | |
import io | |
label2emotion = {0: "others", 1: "happy", 2: "sad", 3: "angry"} | |
emotion2label = {"others": 0, "happy": 1, "sad": 2, "angry": 3} |
NewerOlder