This document summarizes some potentially useful papers and code repositories on Sentiment analysis / document classification
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
# List unique values in a DataFrame column | |
# h/t @makmanalp for the updated syntax! | |
df['Column Name'].unique() | |
# Convert Series datatype to numeric (will error if column has non-numeric values) | |
# h/t @makmanalp | |
pd.to_numeric(df['Column Name']) | |
# Convert Series datatype to numeric, changing non-numeric values to NaN | |
# h/t @makmanalp for the updated syntax! |
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
# List unique values in a DataFrame column | |
# h/t @makmanalp for the updated syntax! | |
df['Column Name'].unique() | |
# Convert Series datatype to numeric (will error if column has non-numeric values) | |
# h/t @makmanalp | |
pd.to_numeric(df['Column Name']) | |
# Convert Series datatype to numeric, changing non-numeric values to NaN | |
# h/t @makmanalp for the updated syntax! |
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
# coding: utf-8 | |
# Author: Axel ARONIO DE ROMBLAY <[email protected]> | |
# License: BSD 3 clause | |
import numpy as np | |
import pandas as pd | |
import warnings | |
import os |
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
def getTopNewEntities(conn, country, category=None, window=-2, limit=100, count=None): | |
numday = window | |
now = pendulum.now(tz='Europe/Paris') | |
all_en = [] | |
cur = conn.cursor() | |
for i in range(0, abs(numday)): | |
from_date = now.subtract(days=abs(numday + i)).to_datetime_string() | |
to_date = now.subtract(days=abs(numday + i + 1)).to_datetime_string() | |
query = getQueryTopEntity(from_date, to_date, country, category) |
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
SPONSORED_HASHTAGS = ["#ad", "#brandambassador", "#collaboration", "#disclosure", "#gift", "#gifted", "#giftedby", | |
"#giftfrom", "#partner", "#promo", "#promotion", "#sp", "#spon", "#sponsored", "#sponsor", | |
"#sponsorship", "#sponsoreret", "#sponsoredpost", ""] | |
SPONSORED_PHRASES = ["brought to you by", "compensated by", "gift from", "gifted by", "in collaboration with", | |
"collaborated with", "in partnership with", "paid ad", "paid advertisement", "paid by", | |
"paid for by", "paid partnership with", "paid post", "paid promo", "paid promotion", | |
"paid sponsorship", "partnered up with", "partnered with", "partnering with", "partnership with", | |
"sponsored by", "sponsored post", "teamed up with", "teamed with", "teaming up with", | |
"teaming with", "brand partner", "working with", "promo code", "coupon code", "discount code", |
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
#!/bin/bash | |
#Ubuntu28.04 | |
curl -O http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb | |
sudo dpkg -i cuda-repo-ubuntu1804_10.0.130-1_amd64.deb | |
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub | |
sudo apt-get update | |
sudo apt-get install cuda | |
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch |
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
#!/bin/bash | |
#Ubuntu28.04 | |
curl -O http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb | |
sudo dpkg -i cuda-repo-ubuntu1804_10.0.130-1_amd64.deb | |
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub | |
sudo apt-get update | |
sudo apt-get install cuda | |
conda install pytorch torchvision cudatoolkit=10.1 -c pytorch |
OlderNewer