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 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 | |
# |
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
""" | |
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] | |
""" |
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
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 |
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
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 |
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
from datetime import datetime, timedelta | |
import random | |
''' | |
๊ตญ๋ฏผ๋ํ๊ต ์ํํธ์จ์ดํ๊ณผ 17ํ๋ฒ ๊น์ค์ฑ | |
๊ณผํ๊ณผ์ํํธ์จ์ด์ ์ฌ๊ณ ๊ณผ์ 2 : n๋ n์ n์ผ๋ก๋ถํฐ n์ผ ํ์ ๋ ์ง๋ฅผ ๊ตฌํ๋ผ! | |
''' | |
''' | |
1๋ 1์ 1์ผ๋ถํฐ ์ ๋ ฅํ ์ฐ๋๊น์ง์ ๋ ์ง์๋ฅผ ๊ณ์ฐํ๋ ํจ์ํ๋๋ค |