- Adopted from: https://github.com/azagniotov/stubby4j/blob/master/docs/ADMIN_PORTAL.md
- Inspired by Swagger API docs style & structure: https://petstore.swagger.io/#/pet
This file contains hidden or 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
# Distancia Euclidiana | |
for i in range(1, 5): | |
dist = norm((x[0, :] - x[i, :]).A) | |
print(f"Distância(Consulta, Documento {i}) = {dist:.2f}") | |
# Função Auxiliar | |
def cosine_similarity(x, y): | |
x = x.A.ravel() | |
y = y.A.ravel() | |
return np.dot(x, y) / (norm(x) * norm(y)) |
This file contains hidden or 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
vectorizer = TfidfVectorizer(analyzer='word') | |
x = vectorizer.fit_transform(corpus) | |
'Corpus: ' + ' '.join(vectorizer.get_feature_names()) |
This file contains hidden or 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 = [ | |
"Food Trucks em Manaus", # Consulta | |
"Conheça alguns dos principais food parks espalhados por toda a cidade de Manaus", # Página 1 do Google | |
"O melhor food truck de Manaus (Em novo endereço)", # Página 1 do Google | |
"Como chegar a Bambina Food Truck em Manaus de Ônibus?", # Página 4 do Google | |
"Projeto de Lei regulamenta Food Trucks em Manaus" # Página 4 do Google | |
] |
This file contains hidden or 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
module.exports = { | |
consumer_key:process.env.CONSUMER_KEY, | |
consumer_secret:process.env.CONSUMER_SECRET, | |
access_token:process.env.ACESS_TOKEN, | |
access_token_secret:process.env.ACESS_TOKEN_SECRET | |
} |
This file contains hidden or 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
function post_tweet(tweet){ | |
twitter.post( | |
'statuses/update', | |
{'status': tweet} | |
) | |
} | |
function post_phrase(){ | |
let phrases = require('./scraping/pensador-phrases-2020-12-28.json') | |
let keys = Object.keys(phrases) |
This file contains hidden or 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
function follow_protocol(number=0){ | |
let query = coin_toss ? 'protocolo' : 'protocol' | |
.get( | |
'users/search', | |
{q: query, | |
page: number, | |
count: 20, | |
include_entities: false} |
This file contains hidden or 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
function follow_user(user_id){ | |
.post( | |
'friendships/create', | |
{user_id: user_id, | |
follow: false} | |
) | |
.then(result => { | |
let tweet_pt = `Seguindo @${result.data.screen_name}!?` | |
let tweet_en = `Following @${result.data.screen_name}!!` |
This file contains hidden or 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
.get( | |
'statuses/user_timeline', | |
{screen_name: 'vncsna', | |
count: 200, | |
exclude_replies: true} | |
) | |
.then(result => { | |
tweets = result.data | |
for (let tweet of tweets) { |
This file contains hidden or 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
function rogerio_skylab(id_str){ | |
.post( | |
'statuses/destroy/:id', | |
{id: id_str} | |
) | |
.then(result => { | |
console.log(result.data) | |
}) | |
.catch(error => { |