π¦
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
""" | |
<Script description here> | |
""" | |
import argparse | |
import logging | |
import sys | |
try: | |
import requests # example of required library | |
except ImportError: |
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
#!/usr/bin/env bash | |
# Template from: https://sharats.me/posts/shell-script-best-practices/ | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
if [[ "${TRACE-0}" == "1" ]]; then | |
set -o xtrace | |
fi |
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
#!/usr/bin/env bash | |
# From official documentation: https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html | |
sudo apt install wget | |
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg | |
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.2.2-amd64.deb | |
sudo dpkg -i elasticsearch-8.2.2-amd64.deb | |
sudo /bin/systemctl daemon-reload |
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
#!/usr/bin/env bash | |
# Code from: | |
# https://www.codegrepper.com/code-examples/whatever/python+++++ModuleNotFoundError%3A+No+module+named+%27_ctypes%27 | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get dist-upgrade | |
sudo apt-get install build-essential python3-dev python3-setuptools python3-pip python3-smbus | |
sudo apt-get install libncursesw5-dev libgdbm-dev libc6-dev |
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
$ python garrascobike/04_recommendation_trainer.py --presence_data_path ./data/03_correlation_data/presence_dataset/20210331124802/presences.csv \ | |
--output_path ./data/04_recommendation_models/knn/ |
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
$ python garrascobike/03_correlation_extraction.py --es_host localhost \ | |
--es_port 9200 \ | |
--es_index_list my_index opt_my_2nd_index |
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
# folder garrascobike-core | |
$ python garrascobike/02_es_uploader.py --es_index my_index \ | |
--es_host http://localhost \ | |
--es_port 9200 \ | |
--input_file ./data/02_entities_extractions/extraction.parquet |
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
# Build the dataset, the results will be under `./dataset/` path | |
$ python src/dataset_builder.py | |
100%|βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 4/4 [00:00<00:00, 84.56it/s] | |
100%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 16/16 [00:00<00:00, 348.01it/s] | |
100%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 1/1 [00:00<00:00, 963.54it/s] | |
100%|βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 3/3 [00:00<00:00, 23.11it/s] | |
$ ls dataset/20210211210341 | |
comments.csv submissions.csv |
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
# Init | |
$ git clone https://github.com/pistocop/subreddit-comments-dl.git | |
$ cd subreddit-comments-dl | |
$ pip install -r requirements.txt | |
# Download the AskReddit comments of the last 30 submissions | |
$ python src/subreddit_downloader.py AskReddit --batch-size 10 --laps 3 --reddit-id <reddit_id> --reddit-secret <reddit_secret> --reddit-username <reddit_username> | |
2021-02-11 19:54:44.175 | INFO | __main__:main:241 - Start download: UTC range: [None, None], direction: `before`, batch size: 10, total submissions to fetch: 30 | |
2021-02-11 19:54:49.769 | INFO | codetiming._timer:stop:57 - Lap 0/3 completed in 0.1m | [new/tot]: 0/0 |
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
# Init | |
$ git clone https://github.com/pistocop/subreddit-comments-dl.git | |
$ cd subreddit-comments-dl | |
$ pip install -r requirements.txt | |
# Download the AskReddit comments of the last 30 submissions | |
$ python src/subreddit_downloader.py AskReddit --batch-size 10 --laps 3 --reddit-id <reddit_id> --reddit-secret <reddit_secret> --reddit-username <reddit_username> |
NewerOlder