Skip to content

Instantly share code, notes, and snippets.

View codertimo's full-sized avatar
๐Ÿ˜‚
Crazy at NLP

Junseong Kim codertimo

๐Ÿ˜‚
Crazy at NLP
View GitHub Profile
#!/usr/bin/env python
# coding=utf-8
# Copyright 2020 The HuggingFace Team All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@codertimo
codertimo / train.py
Created February 23, 2018 08:15
Keras accuracy metric for sequence predicting with padding
"""
Description:
When we handle the word sequence predicting problem on Keras, we add paddings at the last of blank space.
But this makes wrong calculation at Keras default accuracy function. (It calculate the padding as correct too).
To solved that problem, I made new custom function for word sequence predicting problem.
It isn't calculate accuracy of the padding section, only calculate at actual word part
Junseong Kim, [email protected]
"""
@codertimo
codertimo / encryption_algorithm.py
Created June 7, 2017 14:05
[KMU_SW_17] ์‹œ์ € ์•”ํ˜ธ ์•Œ๊ณ ๋ฆฌ์ฆ˜
def is_small(n):
if 97 <= n <= 122:
return True
else:
return False
def shift(c, shift_count):
if not (65 <= ord(c) <= 90 or 97 <= ord(c) <= 122):
return c
@codertimo
codertimo / encryption_algorithm.py
Created June 7, 2017 14:05
[KMU_SW_17] ์‹œ์ € ์•”ํ˜ธ ์•Œ๊ณ ๋ฆฌ์ฆ˜
def is_small(n):
if 97 <= n <= 122:
return True
else:
return False
def shift(c, shift_count):
if not (65 <= ord(c) <= 90 or 97 <= ord(c) <= 122):
return c
@codertimo
codertimo / cal_day.py
Last active April 12, 2017 09:12
KMU SW17 ๊ณผํ•™๊ณผ์†Œํ”„ํŠธ์›จ์–ด์ ์‚ฌ๊ณ  lab2 / n๋…„ n์›” n์ผ๋กœ๋ถ€ํ„ฐ n์ผํ›„์˜ ๋‚ ์งœ๋Š”???
from datetime import datetime, timedelta
import random
'''
๊ตญ๋ฏผ๋Œ€ํ•™๊ต ์†Œํ”„ํŠธ์›จ์–ดํ•™๊ณผ 17ํ•™๋ฒˆ ๊น€์ค€์„ฑ
๊ณผํ•™๊ณผ์†Œํ”„ํŠธ์›จ์–ด์ ์‚ฌ๊ณ  ๊ณผ์ œ2 : n๋…„ n์›” n์ผ๋กœ๋ถ€ํ„ฐ n์ผ ํ›„์˜ ๋‚ ์งœ๋ฅผ ๊ตฌํ•˜๋ผ!
'''
'''
1๋…„ 1์›” 1์ผ๋ถ€ํ„ฐ ์ž…๋ ฅํ•œ ์—ฐ๋„๊นŒ์ง€์˜ ๋‚ ์งœ์ˆ˜๋ฅผ ๊ณ„์‚ฐํ•˜๋Š” ํ•จ์ˆ˜ํž™๋‹ˆ๋‹ค