Skip to content

Instantly share code, notes, and snippets.

View ArtemisDicoTiar's full-sized avatar
🌟
Moving Forward

John JongYoon Kim ArtemisDicoTiar

🌟
Moving Forward
View GitHub Profile
# Solves the exact evaluation of any tic tac toe position
import copy
# Square definitions
X_SQUARE = 'X'
O_SQUARE = 'O'
BLANK = '_'
# Evaluation definitions
We can't make this file beautiful and searchable because it's too large.
,idx,f_name,txt
0,0,0147NewsData.txt,"하필 지방선거 전날 북미회담… 야당엔 초대형 악재? 한국당 “의도 개입된 날짜 선정” 민주당 “평화 여는 역사적 계기”
6·13 지방선거 전날인 다음 달 12일에 북·미 정상회담 개최가 확정되자 여야의 표정은 크게 엇갈렸다. 더불어민주당은 북·미 정상회담이 지방선거에서 호재로 작용할 것이라는 기대감을 감추지 않았다. 자유한국당과 바른미래당은 국제 이슈가 지방선거에 큰 영향을 주지 않을 것이라고 평가절하했다. 특히 한국당은 겉으로는 “미·북 정상회담의 성공을 기대한다”고 밝혔으나 당내에서는 “왜 하필 그날 열리는 것이냐”는 볼멘소리가 흘러나왔다.
추미애 민주당 대표는 11일 국회에서 열린 최고위원회의에서 “북·미 정상회담은 한·미 정상회담에서 열리기 시작한 평화의 문이 활짝 열리는 역사적 계기가 될 것”이라고 의미를 부여했다.
민주당은 북·미 정상회담에서 가시적 성과가 나온다면 민주당의 상승세가 더욱 거세질 것이라고 전망했다. 민주당 핵심 관계자는 “한반도 평화 모드에 대한 기대감이 이미 당 지지율에 반영됐다고 봐야 한다”면서도 “회담 성과가 예상을 뛰어넘을 경우 지방선거에서 엄청난 파괴력을 발휘할 것”이라고 말했다. 하지만 회담의 결과가 기대에 못 미칠 경우 역풍이 불 수 있다는 걱정도 없지 않다.
@ArtemisDicoTiar
ArtemisDicoTiar / bert_nsp.py
Created August 20, 2021 14:58
bert: next sentence prediction
from transformers import BertTokenizer, BertForNextSentencePrediction
from torch.nn import functional as F
BATCH = [
("I understand Tesla's vision.", "Haha, that's a nice [MASK]."), # pun?
("the man went to [MASK] store", "he bought a gallon [MASK] milk"), # is next
("the man [MASK] to the store", "penguin [MASK] are flight ##less birds") # not next
]
BERT_MODEL = "bert-base-uncased"
🌞 Morning 79 commits ███▌░░░░░░░░░░░░░░░░░ 17.1%
🌆 Daytime 166 commits ███████▌░░░░░░░░░░░░░ 35.9%
🌃 Evening 174 commits ███████▉░░░░░░░░░░░░░ 37.6%
🌙 Night 44 commits █▉░░░░░░░░░░░░░░░░░░░ 9.5%
@ArtemisDicoTiar
ArtemisDicoTiar / study.py
Created August 9, 2021 23:12
huggingface custom dataset loading script
# coding=utf-8
"""TODO: Add a description here."""
import csv
import json
import os
import datasets
import sys
import warnings
import numpy as np
import pandas as pd
import statsmodels.api as sm
from scipy.optimize import brute
from statsmodels.tsa.arima.model import ARIMA
warnings.simplefilter("ignore", category='UserWarning')
@ArtemisDicoTiar
ArtemisDicoTiar / CSSE_Arima.py
Last active August 4, 2021 11:57
CSSE_Arima.py
from datetime import datetime
import multiprocessing
from datetime import timedelta
from functools import partial
from multiprocessing import Manager
import pandas as pd
from LostChapter.secrets import controller
from LostChapter.utils.ARIMAPredictor import get_arima_predictions