├── tutorials ├── stopwords.txt ├── ngrams.txt ├── replacewords.txt ├── passwords.txt ├── usage_of_templatetagger.ipynb └── usage_of_templatetagger-ver_0_0_6+.ipynb ├── .gitattributes ├── ckonlpy ├── data │ ├── __init__.py │ ├── twitter │ │ ├── noun │ │ │ ├── spam.txt │ │ │ ├── twitter.txt │ │ │ ├── profane.txt │ │ │ ├── names.txt │ │ │ ├── lol.txt │ │ │ ├── company_names.txt │ │ │ ├── pokemon.txt │ │ │ ├── slangs.txt │ │ │ ├── geolocations.txt │ │ │ ├── kpop.txt │ │ │ ├── foreign.txt │ │ │ └── congress.txt │ │ ├── README.md │ │ ├── modifier │ │ │ └── modifier.txt │ │ └── josa │ │ │ └── josa.txt │ ├── templates │ │ └── twitter_templates0 │ └── tagset.py ├── tag │ ├── __init__.py │ ├── _twitter.py │ ├── _abstract.py │ └── _postprocess.py ├── custom_tag │ ├── __init__.py │ ├── _evaluator.py │ └── _template.py ├── __init__.py ├── dictionary.py └── utils.py ├── .gitignore ├── setup.py ├── README.md └── LICENSE /tutorials/stopwords.txt: -------------------------------------------------------------------------------- 1 | 은 2 | 는 3 | 이 Josa -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | tutorials/* linguist-vendored 2 | -------------------------------------------------------------------------------- /tutorials/ngrams.txt: -------------------------------------------------------------------------------- 1 | 바람 의 나라 2 | 미스 함무라비 Noun -------------------------------------------------------------------------------- /tutorials/replacewords.txt: -------------------------------------------------------------------------------- 1 | 아빠 아버지 2 | 엄마 Noun 어머니 -------------------------------------------------------------------------------- /ckonlpy/data/__init__.py: -------------------------------------------------------------------------------- 1 | from .tagset import twitter -------------------------------------------------------------------------------- /tutorials/passwords.txt: -------------------------------------------------------------------------------- 1 | 아이오아이 2 | 아이오아이 Noun 3 | 공연 -------------------------------------------------------------------------------- /ckonlpy/tag/__init__.py: -------------------------------------------------------------------------------- 1 | from ._twitter import Twitter 2 | from ._postprocess import Postprocessor -------------------------------------------------------------------------------- /ckonlpy/custom_tag/__init__.py: -------------------------------------------------------------------------------- 1 | from ._template import SimpleTemplateTagger 2 | from ._evaluator import SimpleEvaluator -------------------------------------------------------------------------------- /ckonlpy/data/twitter/noun/spam.txt: -------------------------------------------------------------------------------- 1 | 강랜 2 | 강림도령 3 | 강원랜드 4 | 나인카지노 5 | 다모아 6 | 도니캐시 7 | 로미로미 8 | 리스보아 9 | 베이강랜 10 | 블랙잭주소 11 | 세븐럭 12 | 섹밤 13 | 썬시티 14 | 아메 15 | 여탑 16 | 즐톡 17 | 카지노 18 | 태양성 19 | 토토 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # MacOS 2 | .DS_Store 3 | 4 | # Python 5 | .pyc 6 | __pycache__/ 7 | dist/ 8 | build/ 9 | *.egg-info/ 10 | *.pyc 11 | 12 | # Experiments 13 | tmp/ 14 | 15 | # Jupyter notebook 16 | .ipynb_checkpoints/ 17 | -------------------------------------------------------------------------------- /ckonlpy/data/twitter/noun/twitter.txt: -------------------------------------------------------------------------------- 1 | 계이 2 | 계폭 3 | 답멘 4 | 디엠 5 | 리튓 6 | 리트윗 7 | 맞팔 8 | 멘션 9 | 본계 10 | 봇 11 | 봇주 12 | 블언블 13 | 선팔 14 | 실트 15 | 인멘 16 | 친추 17 | 탐라 18 | 태그 19 | 튀터 20 | 트렌드 21 | 트윗 22 | 트친 23 | 트친분 24 | 트친소 25 | 팔로 26 | 팔로우 27 | 팔로워 28 | 폭트 29 | 해쉬 30 | 해쉬태그 31 | 해시 32 | 해시태그 33 | -------------------------------------------------------------------------------- /ckonlpy/data/templates/twitter_templates0: -------------------------------------------------------------------------------- 1 | Adjective 2 | Adverb 3 | Conjunction 4 | Exclamation 5 | KoreanParticle 6 | Noun 7 | Verb 8 | Noun Noun 9 | Noun Josa 10 | Noun Adjective 11 | Noun Verb 12 | Modifier Noun 13 | Noun Noun Adjective 14 | Noun Noun Josa 15 | Noun Noun Verb 16 | Modifier Noun Josa -------------------------------------------------------------------------------- /ckonlpy/data/twitter/README.md: -------------------------------------------------------------------------------- 1 | # Twitter-Korean-Text (Open-Korean-Text) 의 resources 2 | 3 | 현재 디렉토리에 있는 파일들은 구 [트위터한국어분석기][twitterlink] (현 [오픈한국어트위터분석기][openlink])의 언어자원 입니다. 4 | 5 | The files in this directory are language resource such as noun or josa dictionary that used in Twitter-Korean-Text (Open-Korean-Text). 6 | 7 | 8 | 9 | [twitterlink]: https://github.com/twitter/twitter-korean-text 10 | [openlink]: https://github.com/open-korean-text/open-korean-text -------------------------------------------------------------------------------- /ckonlpy/__init__.py: -------------------------------------------------------------------------------- 1 | name = "ckonlpy" 2 | __title__ = 'customized-konlpy' 3 | __version__ = '0.0.64' 4 | __author__ = 'Lovit' 5 | __license__ = 'GPL v3' 6 | __copyright__ = 'Copyright 2017 Lovit' 7 | 8 | from .dictionary import CustomizedDictionary 9 | from .utils import installpath 10 | from .utils import load_dictionary 11 | from .utils import loadtxt 12 | from .utils import load_wordset 13 | from .utils import load_replace_wordpair 14 | from .utils import load_ngram 15 | from . import custom_tag 16 | from . import tag -------------------------------------------------------------------------------- /ckonlpy/data/twitter/noun/profane.txt: -------------------------------------------------------------------------------- 1 | 개새끼 2 | 건마 3 | 고자 4 | 기모찌 5 | 꼬자 6 | 닝기미 7 | 대떡방 8 | 딜도 9 | 레즈비언 10 | 로리 11 | 로리콘 12 | 로리타 13 | 립카페 14 | 밍키넷 15 | 밤킹 16 | 빠굴 17 | 뽀르노 18 | 색파 19 | 섹스 20 | 소라넷 21 | 손페티쉬 22 | 시바 23 | 시발 24 | 시뱔 25 | 시벌 26 | 시벌탱 27 | 시부랄 28 | 시불 29 | 쌍욕 30 | 썅 31 | 씨발 32 | 씨불 33 | 씹걸레 34 | 씹덕 35 | 씹덕력 36 | 씹덕후 37 | 씹새끼야 38 | 씹새야 39 | 야걸 40 | 야동 41 | 야설 42 | 야애니 43 | 엔조이 44 | 오나니 45 | 오피 46 | 오피걸스 47 | 위꼴 48 | 은꼴 49 | 입싸방 50 | 젼나 51 | 조루 52 | 조루기 53 | 조온나 54 | 존나 55 | 존내 56 | 졸라 57 | 좆목질 58 | 죤나 59 | 질싸데이 60 | 질싸방 61 | 키스방 62 | 파이즈리 63 | 포르노 64 | 폰섹 65 | 휴게텔 66 | -------------------------------------------------------------------------------- /ckonlpy/data/tagset.py: -------------------------------------------------------------------------------- 1 | twitter = { 2 | "Adjective": "형용사", 3 | "Adverb": "부사", 4 | "Alpha": "알파벳", 5 | "Conjunction": "접속사", 6 | "Determiner": "관형사", 7 | "Eomi": "어미", 8 | "Exclamation": "감탄사", 9 | "Foreign": "외국어, 한자 및 기타기호", 10 | "Hashtag": "트위터 해쉬태그", 11 | "Josa": "조사", 12 | "KoreanParticle": "(ex: ㅋㅋ)", 13 | "Noun": "명사", 14 | "Number": "숫자", 15 | "Modifier": "관형사", 16 | "PreEomi": "선어말어미", 17 | "Punctuation": "구두점", 18 | "ScreenName": "트위터 아이디", 19 | "Suffix": "접미사", 20 | "Unknown": "미등록어", 21 | "Verb": "동사" 22 | } -------------------------------------------------------------------------------- /ckonlpy/data/twitter/noun/names.txt: -------------------------------------------------------------------------------- 1 | 가몽 2 | 가온 3 | 갓세븐 4 | 게임닉가 5 | 관우 6 | 귀여미 7 | 규 8 | 김준면 9 | 까까런 10 | 노컷 11 | 누너예 12 | 니노 13 | 다마고치 14 | 다이무스 15 | 대학생 16 | 데이브 17 | 도요토미 18 | 동운 19 | 동이 20 | 두주니 21 | 디시인사이드 22 | 디오 23 | 라몹 24 | 라스 25 | 라옵 26 | 멍구 27 | 메이든 28 | 명덕 29 | 명량 30 | 문민정부 31 | 미네 32 | 방엘리 33 | 병헌 34 | 붓다 35 | 비정상회담 36 | 빼빼로 37 | 삼풍 38 | 샤인온미 39 | 성식 40 | 성열 41 | 세라문 42 | 세라복 43 | 세종대왕 44 | 손권 45 | 손책 46 | 쇼미더머니 47 | 쇼챔 48 | 순규 49 | 스라소니 50 | 신동아 51 | 신쓰패밀리 52 | 신아라 53 | 아베 54 | 안상홍 55 | 안홍준 56 | 여누 57 | 여랑 58 | 여포 59 | 연합 60 | 오꾸닭 61 | 요섭 62 | 웃찾사 63 | 원식 64 | 유병언 65 | 유비 66 | 윤기형 67 | 이나단 68 | 이명박 69 | 이완용 70 | 임창용 71 | 자괴 72 | 자니윤 73 | 자대련 74 | 자유 75 | 재중이 76 | 전교조 77 | 정윤회 78 | 제갈량 79 | 조자룡 80 | 조조 81 | 준면 82 | 지오디 83 | 지존파 84 | 진영오 85 | 차작가 86 | 차트 87 | 창섭 88 | 챠트 89 | 첸 90 | 코르사주 91 | 하무열 92 | 하용파쿠 93 | 혁재 94 | 현이 95 | 현태 96 | 혜미 97 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import ckonlpy 2 | import setuptools 3 | from setuptools import setup, find_packages 4 | 5 | with open('README.md', encoding='utf-8') as fh: 6 | long_description = fh.read() 7 | 8 | setuptools.setup( 9 | name="customized-konlpy", 10 | version=ckonlpy.__version__, 11 | author=ckonlpy.__author__, 12 | author_email='soy.lovit@gmail.com', 13 | description="KoNLPy wrapping package", 14 | long_description=long_description, 15 | long_description_content_type="text/markdown", 16 | url='https://github.com/lovit/customized_konlpy', 17 | packages=setuptools.find_packages(), 18 | package_data={ 19 | 'ckonlpy':['data/*/*.txt', 'data/*/*/*.txt', 'data/templates/*'] 20 | }, 21 | install_requires=["Jpype1>=0.6.1", "konlpy>=0.4.4"], 22 | classifiers=( 23 | "Programming Language :: Python :: 3.6", 24 | "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", 25 | "Operating System :: OS Independent", 26 | ), 27 | ) 28 | -------------------------------------------------------------------------------- /ckonlpy/data/twitter/noun/lol.txt: -------------------------------------------------------------------------------- 1 | 가렌 2 | 갈리오 3 | 개이득 4 | 갱플랭크 5 | 겜알못 6 | 그라가스 7 | 그레이브즈 8 | 나미 9 | 나서스 10 | 너프 11 | 노틸러스 12 | 녹턴 13 | 누누 14 | 니달리 15 | 다데 16 | 다리우스 17 | 다이애나 18 | 드레이븐 19 | 득템 20 | 람머스 21 | 럭스 22 | 럼블 23 | 레넥톤 24 | 레오나 25 | 렙업 26 | 렝가 27 | 롤 28 | 루시안 29 | 룰루 30 | 르블랑 31 | 리븐 32 | 리신 33 | 마스터 34 | 마오카이 35 | 만렙 36 | 말자하 37 | 말파이트 38 | 모데카이저 39 | 몹 40 | 문도 41 | 물고기방 42 | 미스포츈 43 | 바이 44 | 반샷 45 | 발컨 46 | 백섭 47 | 베이가 48 | 베인 49 | 벨코즈 50 | 본캐 51 | 볼리베어 52 | 부캐 53 | 브라움 54 | 빅토르 55 | 뽀삐 56 | 뽀해 57 | 사이온 58 | 샤코 59 | 세주아니 60 | 소나 61 | 소라카 62 | 순삭 63 | 쉔 64 | 쉬바나 65 | 스웨인 66 | 스카너 67 | 시비르 68 | 신드라 69 | 신지드 70 | 아무무 71 | 아칼리 72 | 아트록스 73 | 알리스타 74 | 애니 75 | 애니비아 76 | 애쉬 77 | 앵벌이 78 | 야스오 79 | 엘리스 80 | 오공 81 | 오리아나 82 | 올라프 83 | 요릭 84 | 우디르 85 | 우르곳 86 | 우사기 87 | 워윅 88 | 이렐리아 89 | 이블린 90 | 이즈리얼 91 | 입롤 92 | 자르반 93 | 자이라 94 | 자크 95 | 잔나 96 | 장인 97 | 잭스 98 | 제라스 99 | 제이스 100 | 젠 101 | 직스 102 | 질리언 103 | 짜오 104 | 초가스 105 | 카르마 106 | 카사딘 107 | 카서스 108 | 카시오페아 109 | 카직스 110 | 카타리나 111 | 카타장인 112 | 캐리 113 | 케넨 114 | 케일 115 | 코그모 116 | 코르키 117 | 쿨타임 118 | 퀸 119 | 크리 120 | 크립 121 | 킬딸 122 | 타릭 123 | 탈론 124 | 트런들 125 | 트롤 126 | 트리스타나 127 | 트린다미어 128 | 트위스티드 129 | 티모 130 | 팀킬 131 | 판테온 132 | 페이커 133 | 페이트 134 | 평타 135 | 피들스틱 136 | 피오라 137 | 피즈 138 | 하드캐리 139 | 하이머딩거 140 | 헤카림 141 | 현질 142 | 현피 143 | 힡 144 | -------------------------------------------------------------------------------- /ckonlpy/tag/_twitter.py: -------------------------------------------------------------------------------- 1 | from ._abstract import AbstractTagger 2 | from konlpy.tag import Okt as KoNLPyTwitter 3 | from ckonlpy.custom_tag import SimpleTemplateTagger 4 | from ckonlpy.data.tagset import twitter as tagset 5 | from ckonlpy.dictionary import CustomizedDictionary 6 | from ckonlpy.utils import installpath 7 | from ckonlpy.utils import load_dictionary 8 | 9 | 10 | class Twitter(AbstractTagger): 11 | 12 | def __init__(self, dictionary=None, templates=None, use_twitter_dictionary=True): 13 | super().__init__(dictionary, templates, tagset) 14 | self._base = KoNLPyTwitter() 15 | self.use_twitter_dictionary = use_twitter_dictionary 16 | if use_twitter_dictionary: 17 | self._load_default_dictionary() 18 | self.template_tagger = SimpleTemplateTagger(self.dictionary, templates) 19 | 20 | def _load_default_dictionary(self): 21 | directory = '%s/data/twitter/' % installpath 22 | self.dictionary.add_dictionary( 23 | load_dictionary('%s/josa' % directory), 'Josa') 24 | self.dictionary.add_dictionary( 25 | load_dictionary('%s/noun' % directory, ignore_a_syllable=True), 'Noun') 26 | self.dictionary.add_dictionary( 27 | load_dictionary('%s/adverb' % directory), 'Adverb') 28 | #self.dictionary.add_dictionary( 29 | # load_dictionary(modifier_dir), 'Modifier') 30 | -------------------------------------------------------------------------------- /ckonlpy/data/twitter/noun/company_names.txt: -------------------------------------------------------------------------------- 1 | 가이오 2 | 게임파크 3 | 경동 4 | 광동 5 | 광주카 6 | 구글 7 | 귀뚜라미보일러 8 | 그라비티 9 | 금복주 10 | 금호 11 | 금호아시아나 12 | 네이버 13 | 넥센 14 | 넥슨 15 | 농심 16 | 다음카카오 17 | 대구텍 18 | 대림 19 | 대웅 20 | 두루넷 21 | 두산 22 | 디스플레이 23 | 락앤락 24 | 로엔 25 | 로케트전기 26 | 롯데 27 | 롯데리아 28 | 르까프 29 | 르노 30 | 메가박스 31 | 모나미 32 | 무학 33 | 뮌헨 34 | 미디어다음 35 | 미래에셋 36 | 미샤 37 | 미스터피자 38 | 베이 39 | 벡셀 40 | 보광 41 | 보일러 42 | 부방 43 | 부산 44 | 비씨 45 | 빅히트 46 | 산전 47 | 삼성 48 | 삼양 49 | 삼익 50 | 삼화 51 | 생명보험 52 | 설빙 53 | 손오공 54 | 수자원 55 | 스킨푸드 56 | 스탠다드차타드 57 | 스파 58 | 시스템스 59 | 신세계 60 | 신한 61 | 신화철강 62 | 싸이월드 63 | 쌍용 64 | 씨아이 65 | 아모레퍼시픽 66 | 아시아나 67 | 아이리버 68 | 아이코닉스 69 | 아진산업 70 | 안다미로 71 | 안랩 72 | 야후 73 | 어울림모터스 74 | 에너자이저 75 | 에듀 76 | 에버랜드 77 | 에스크 78 | 에쓰 79 | 에이스 80 | 엔씨 81 | 엔씨소프트 82 | 엔터테인먼트 83 | 엠코 84 | 영안 85 | 영어교실 86 | 오뚜기 87 | 오리온 88 | 오위즈 89 | 오일 90 | 오콘 91 | 우관 92 | 웅진 93 | 윕스 94 | 유한양행 95 | 윤선생 96 | 이랜드 97 | 이마트 98 | 이브자리 99 | 이스트 100 | 이스트소프트 101 | 인도양 102 | 인디자인 103 | 인스타 104 | 인스타그램 105 | 인크룩스 106 | 일동제약 107 | 일렉트로닉 108 | 잉카 109 | 재미나 110 | 제과식품 111 | 제주 112 | 진우 113 | 차타드 114 | 천재교육 115 | 카스 116 | 캐리비안 117 | 커뮤니케이션스 118 | 코바코 119 | 코스콤 120 | 코아로직 121 | 코오롱 122 | 코원 123 | 쿠쿠 124 | 큐브 125 | 크리에이션 126 | 키스웰 127 | 태광 128 | 테크론 129 | 투어 130 | 티웨이 131 | 판타그램 132 | 패이스북 133 | 팬택 134 | 페이스북 135 | 포스코 136 | 푸르넷 137 | 푸르덴셜 138 | 풀무원 139 | 프라우나 140 | 프로스펙스 141 | 프로토 142 | 하이트 143 | 한글과컴퓨터 144 | 한라 145 | 한솔 146 | 한진 147 | 한컴 148 | 한화 149 | 핫트랙스 150 | 홀딩스 151 | 홈플러스 152 | 휘닉스 153 | 휠라 154 | 휴맥스 155 | 힐리오 156 | -------------------------------------------------------------------------------- /ckonlpy/dictionary.py: -------------------------------------------------------------------------------- 1 | class CustomizedDictionary: 2 | def __init__(self, pos2words=None): 3 | self._pos2words = pos2words if pos2words else {} 4 | self._max_length = 0 5 | if pos2words: 6 | for words in pos2words.values(): 7 | self._max_length = self._get_max_length( 8 | words, self._max_length) 9 | 10 | def _get_max_length(self, words, base=0): 11 | return max(base, max((len(word) for word in words))) 12 | 13 | def add_dictionary(self, words, tag): 14 | if type(words) == str: 15 | words = [words] 16 | wordset = self._pos2words.get(tag, set()) 17 | wordset.update(set(words)) 18 | self._pos2words[tag] = wordset 19 | self._max_length = self._get_max_length(words, self._max_length) 20 | 21 | def load_dictionary(self, fname_list, tag): 22 | def load(fname): 23 | try: 24 | with open(fname, encoding='utf-8') as f: 25 | words = {word.strip() for word in f} 26 | return words 27 | except Exception as e: 28 | print('load_dictionary error: %s'%e) 29 | return [] 30 | 31 | wordset = self._pos2words.get(tag, set()) 32 | for fname in fname_list: 33 | wordset.update(load(fname)) 34 | self._pos2words[tag] = wordset 35 | 36 | def get_tags(self, word): 37 | return tuple(tag for tag, words 38 | in self._pos2words.items() if word in words) 39 | 40 | def is_tag(self, word, tag): 41 | return word in self._pos2words.get(tag, {}) -------------------------------------------------------------------------------- /ckonlpy/data/twitter/noun/pokemon.txt: -------------------------------------------------------------------------------- 1 | 거북손데스 2 | 거북손손 3 | 견고라스 4 | 고고트 5 | 고디모아젤 6 | 고디보미 7 | 고디탱 8 | 곤율거니 9 | 곤율랭 10 | 기가이어스 11 | 기기기어르 12 | 기기어르 13 | 기어르 14 | 깜놀버슬 15 | 깜눈크 16 | 깨봉이 17 | 꼬지보리 18 | 꼬지지 19 | 꽁어름 20 | 나루림 21 | 나룸퍼프 22 | 나목령 23 | 냐스퍼 24 | 냐오닉스 25 | 너트령 26 | 노보청 27 | 늑골라 28 | 다부니 29 | 단굴 30 | 단단지 31 | 단칼빙 32 | 달막화 33 | 대검귀 34 | 대로트 35 | 더스트나 36 | 던지미 37 | 데굴레오 38 | 데스니칸 39 | 데스마스 40 | 돌살이 41 | 동챙이 42 | 두까비 43 | 두더류 44 | 두르보 45 | 두르쿤 46 | 두빅굴 47 | 드래캄 48 | 드레디어 49 | 딱정곤 50 | 또르박쥐 51 | 라쥬르네 52 | 램프라 53 | 레오꼬 54 | 레파르다스 55 | 루차불 56 | 리그레 57 | 마디네 58 | 마라카치 59 | 맘박쥐 60 | 맘복치 61 | 메이클 62 | 멜리시 63 | 모아머 64 | 목도리키텔 65 | 몽나 66 | 몽얌나 67 | 뮤 68 | 뮤트 69 | 미끄네일 70 | 미끄메라 71 | 바닐리치 72 | 바닐프티 73 | 바라철록 74 | 바랜드 75 | 바오키 76 | 바오프 77 | 배바닐라 78 | 배쓰나이 79 | 벰크 80 | 보르쥐 81 | 볼케니온 82 | 부란다 83 | 분떠도리 84 | 분이벌레 85 | 불비달마 86 | 불켜미 87 | 불화살빈 88 | 블로스터 89 | 비비용 90 | 뽀록나 91 | 사랑동이 92 | 사철록 93 | 소미안 94 | 수레기 95 | 슈바르고 96 | 슈쁘 97 | 스완나 98 | 심보러 99 | 쌍검자비 100 | 쌍검킬 101 | 쌔비냥 102 | 아마루르가 103 | 아마루스 104 | 아케오스 105 | 아켄 106 | 악비르 107 | 악비아르 108 | 암트르 109 | 암팰리스 110 | 앗차키 111 | 앗차프 112 | 액슨도 113 | 야나키 114 | 엘풍 115 | 오케이징 116 | 완철포 117 | 요테리 118 | 유니란 119 | 유토브 120 | 으랏차 121 | 음뱃 122 | 음번 123 | 일레도리자드 124 | 저리릴 125 | 저리어 126 | 전툴라 127 | 제브라이카 128 | 줄뮤마 129 | 철시드 130 | 치라미 131 | 치릴리 132 | 칼라마네로 133 | 켄호로우 134 | 콘치 135 | 콩둘기 136 | 크레베이스 137 | 클레피 138 | 킬가르도 139 | 타격귀 140 | 탱그릴 141 | 탱탱겔 142 | 토쇠골 143 | 티고라스 144 | 파르빗 145 | 파르토 146 | 파이어로 147 | 파쪼옥 148 | 판짱 149 | 펌킨인 150 | 펜드라 151 | 프레프티르 152 | 프로토가 153 | 플라베베 154 | 플라엣테 155 | 플라제스 156 | 하데리어 157 | 헬가 158 | 호바귀 159 | 화염레오 160 | 후파 161 | 휠구 162 | -------------------------------------------------------------------------------- /ckonlpy/data/twitter/noun/slangs.txt: -------------------------------------------------------------------------------- 1 | 가까오떡 2 | 가드올려 3 | 갑툭튀 4 | 강전 5 | 강퇴 6 | 개독 7 | 개독교 8 | 개드립 9 | 개뿔 10 | 갠소 11 | 갠전 12 | 검열삭제 13 | 고고싱 14 | 고고씽 15 | 광삭 16 | 광탈 17 | 구우럼 18 | 귀차니즘 19 | 귀척 20 | 그거슨 21 | 글설리 22 | 김여사 23 | 까비 24 | 깝 25 | 깨알같다 26 | 내여귀 27 | 내한병크 28 | 냉무 29 | 넘사벽 30 | 네가지 31 | 네티즌 32 | 노잼 33 | 눈팅 34 | 닥본사 35 | 달린다 36 | 대인배 37 | 덕통 38 | 덕후 39 | 돋다 40 | 듣보잡 41 | 디시 42 | 떡밥 43 | 똘끼 44 | 루저 45 | 리게이 46 | 리얼돋다 47 | 링딩돋다 48 | 마초맨 49 | 머글 50 | 멘붕 51 | 몸짱 52 | 바두기 53 | 반모 54 | 반반무 55 | 반반무마니 56 | 반품남 57 | 반품녀 58 | 백퍼 59 | 버정 60 | 버카충 61 | 번개팅 62 | 볍신 63 | 병맛 64 | 병크 65 | 보슬아치 66 | 불곰국 67 | 브금 68 | 비메 69 | 빛삭 70 | 빵셔틀 71 | 뽀록 72 | 뽀샵 73 | 뿜다 74 | 사녹 75 | 사캐 76 | 삼일한 77 | 서이추 78 | 세크스 79 | 셀고 80 | 소비러 81 | 손꾸락 82 | 솔까말 83 | 수꼴 84 | 스압 85 | 스퇄 86 | 신컨 87 | 싸가지 88 | 싸나이 89 | 싸람 90 | 쌤 91 | 썩소 92 | 썸 93 | 아오안 94 | 안물 95 | 안물안궁 96 | 안습 97 | 앙망 98 | 야동 99 | 어빠 100 | 엄친딸 101 | 엑박 102 | 여병추 103 | 열공 104 | 열폭 105 | 오덕후 106 | 오빠미 107 | 오체통 108 | 오크 109 | 요뎡왕댜 110 | 우좀 111 | 웃대 112 | 은꼴사 113 | 이뭐병 114 | 일베충 115 | 입덕 116 | 자게이 117 | 자삭 118 | 잤잤 119 | 정팅 120 | 제곧내 121 | 존똑 122 | 존못 123 | 존예 124 | 존잘 125 | 존잘님 126 | 종결자 127 | 좆망 128 | 좌빨 129 | 좌좀 130 | 주작 131 | 즐 132 | 지름신 133 | 지못미 134 | 짐승남 135 | 짐승돌 136 | 짜져 137 | 짤 138 | 짤방 139 | 짱 140 | 짱짱맨 141 | 쩐다 142 | 쩔어요 143 | 찌르다 144 | 찌찌뽕 145 | 차도남 146 | 찰지구나 147 | 채금 148 | 천조국 149 | 최애캐 150 | 추카 151 | 충공깽 152 | 치맥 153 | 칼빵 154 | 캐 155 | 케바케 156 | 코렁탕 157 | 크리에이티브 158 | 크리처 159 | 크리티컬 160 | 클라스 161 | 퇴갤 162 | 트인낭 163 | 팀전 164 | 팬바부 165 | 퍽발 166 | 품절남 167 | 품절녀 168 | 플미표 169 | 피꺼솟 170 | 함덕 171 | 호접살 172 | 후드리챱챱 173 | 흑형 174 | 흠좀무 175 | -------------------------------------------------------------------------------- /ckonlpy/tag/_abstract.py: -------------------------------------------------------------------------------- 1 | from ckonlpy.custom_tag import SimpleTemplateTagger 2 | from ckonlpy.dictionary import CustomizedDictionary 3 | 4 | class AbstractTagger: 5 | 6 | def __init__(self, dictionary, templates, tagset): 7 | self.dictionary = dictionary if dictionary else CustomizedDictionary() 8 | self.template_tagger = SimpleTemplateTagger(self.dictionary, templates, tagset) 9 | self.tagset = tagset 10 | 11 | def pos(self, phrase, norm=False, stem=False, perfect_match=False): 12 | 13 | def has_None(wordpos_list): 14 | return len([True for _, pos, _, _ in wordpos_list if pos is None]) > 0 15 | 16 | eojeols = phrase.split() 17 | tagged = [] 18 | 19 | for eojeol in eojeols: 20 | 21 | wordpos_list = self.template_tagger.pos(eojeol, perfect_match) 22 | 23 | if not wordpos_list: 24 | tagged += self._base.pos(eojeol, norm=norm, stem=stem) 25 | continue 26 | 27 | for word, pos, _, _ in wordpos_list: 28 | if pos is not None: 29 | tagged.append((word, pos)) 30 | continue 31 | for word_, pos_ in self._base.pos(word, norm=norm, stem=stem): 32 | tagged.append((word_, pos_)) 33 | return tagged 34 | 35 | def nouns(self, phrase): 36 | tagged = self.pos(phrase) 37 | return [w for w, t in tagged if t == 'Noun'] 38 | 39 | def morphs(self, phrase, norm=False, stem=False): 40 | return [s for s, t in self.pos(phrase, norm=norm, stem=stem)] 41 | 42 | def phrases(self, phrase): 43 | # TODO 44 | return self._base.phrases(phrase) 45 | 46 | def add_dictionary(self, words, tag, force=False): 47 | if (not force) and (not (tag in self.tagset)): 48 | raise ValueError('%s is not available tag' % tag) 49 | if (force) and (not (tag in self.tagset)): 50 | self.template_tagger.add_a_template((tag,)) 51 | self.dictionary.add_dictionary(words, tag) 52 | 53 | def load_dictionary(self, fname_list, tag): 54 | if not (tag in self.tagset): 55 | raise ValueError('%s is not available tag' % tag) 56 | self.dictionary.load_dictionary(fname_list, tag) 57 | 58 | def add_a_template(self, a_template): 59 | self.template_tagger.add_a_template(a_template) 60 | 61 | def set_evaluator(self, my_weight_tuple, my_evaluate_function, test=True): 62 | self.template_tagger.set_evaluator(my_weight_tuple, my_evaluate_function, test) -------------------------------------------------------------------------------- /ckonlpy/utils.py: -------------------------------------------------------------------------------- 1 | import glob 2 | import os 3 | 4 | 5 | installpath = os.path.dirname(os.path.realpath(__file__)) 6 | 7 | def load_dictionary(directory, encoding='utf-8', ignore_a_syllable=False): 8 | fnames = glob.glob('%s/*.txt' % directory) 9 | words = set() 10 | for fname in fnames: 11 | try: 12 | with open(fname, encoding=encoding) as f: 13 | words_ = {line.strip() for line in f} 14 | if ignore_a_syllable: 15 | words_ = {w for w in words_ if len(w) > 1} 16 | words.update(words_) 17 | except Exception as e: 18 | print(e) 19 | continue 20 | return words 21 | 22 | def loadtxt(fname, encoding='utf-8'): 23 | try: 24 | with open(fname, encoding=encoding) as f: 25 | return [line.strip() for line in f] 26 | except Exception as e: 27 | print(e) 28 | return [] 29 | 30 | def load_wordset(fname, encoding='utf-8'): 31 | try: 32 | wordset = set() 33 | with open(fname, encoding=encoding) as f: 34 | for line in f: 35 | word = line.strip().split(' ') 36 | if len(word) == 1: 37 | wordset.add(word[0]) 38 | elif len(word) == 2: 39 | wordset.add(tuple(word)) 40 | return wordset 41 | except Exception as e: 42 | print(e) 43 | return set() 44 | 45 | def load_replace_wordpair(fname, encoding='utf-8'): 46 | try: 47 | replace_wordset = {} 48 | with open(fname, encoding=encoding) as f: 49 | for line in f: 50 | try: 51 | source, target = line.strip().split('\t') 52 | source = source.split(' ') 53 | if len(source) == 1: 54 | source = source[0] 55 | elif len(source) == 2: 56 | source = tuple(source) 57 | replace_wordset[source] = target 58 | except: 59 | continue 60 | return replace_wordset 61 | except Exception as e: 62 | print(e) 63 | return {} 64 | 65 | def load_ngram(fname, encoding='utf-8'): 66 | ngrams = [] 67 | with open(fname, encoding=encoding) as f: 68 | for line in f: 69 | try: 70 | if '\t' in line: 71 | words, tag = line.strip().split('\t', 1) 72 | words = tuple(words.split()) 73 | else: 74 | words = tuple(line.split()) 75 | tag = None 76 | if len(words) <= 1: 77 | continue 78 | if tag: 79 | ngrams.append((words, tag.strip())) 80 | else: 81 | ngrams.append(words) 82 | except Exception as e: 83 | print(e) 84 | continue 85 | return ngrams -------------------------------------------------------------------------------- /ckonlpy/custom_tag/_evaluator.py: -------------------------------------------------------------------------------- 1 | class SimpleEvaluator: 2 | def __init__(self, preference=None, tagset=None): 3 | self.weight = ( 4 | ('max_length_of_noun', 0.5), 5 | ('length_of_phrase', 0.1), 6 | ('exist_noun', 0.2), 7 | ('single_word', -0.1), 8 | ('has_force_tag', 10) 9 | ) 10 | # preference = { (word, pos) : score } 11 | self.preference = preference if preference else {} 12 | self.tagset = tagset if tagset else {} 13 | self.debug = False 14 | 15 | def select(self, candidates): 16 | 17 | def evaluating_format(wordpos_list): 18 | formed = ( 19 | wordpos_list, 20 | wordpos_list[0][2], 21 | wordpos_list[-1][3], 22 | self.evaluate(wordpos_list) 23 | ) 24 | return formed 25 | 26 | def is_overlab(b, e, target): 27 | return (b < target[2]) and (target[1] < e) 28 | 29 | scoreds = [evaluating_format(c) for c in candidates] 30 | 31 | # sorting rules. (score, begin index) 32 | scoreds = sorted(scoreds, key=lambda x:(-x[3], x[1])) 33 | 34 | selected = [] 35 | while scoreds: 36 | selected.append(scoreds.pop(0)) 37 | b = selected[-1][1] 38 | e = selected[-1][2] 39 | scoreds = [c for c in scoreds if not is_overlab(b, e, c)] 40 | 41 | # sort by begin index 42 | selected = sorted(selected, key=lambda x:x[1]) 43 | return selected 44 | 45 | def evaluate(self, wordpos_list): 46 | 47 | scores = ( 48 | _max_length_of_noun(wordpos_list), 49 | wordpos_list[-1][3] - wordpos_list[0][2], 50 | _num_of_nouns(wordpos_list) > 0, 51 | _num_of_words(wordpos_list) == 1, 52 | _has_force_tag(wordpos_list, self.tagset) 53 | ) 54 | 55 | score_sum = _wordpos_preference(wordpos_list, self.preference) 56 | 57 | if self.debug: 58 | print('\n{}'.format(wordpos_list)) 59 | for score, (field, weight) in zip(scores, self.weight): 60 | print('{}, w={}, s={}, prod={}'.format( 61 | field, weight, score, weight * score)) 62 | print('preference score = {}'.format(score_sum)) 63 | 64 | score_sum += sum((score * weight for score, (_, weight) 65 | in zip(scores, self.weight))) 66 | 67 | return score_sum 68 | 69 | def _max_length_of_noun(wordpos_list): 70 | satisfied = [len(wordpos[0]) for wordpos in wordpos_list if wordpos[1] == 'Noun'] 71 | return max(satisfied) if satisfied else 0 72 | 73 | def _num_of_nouns(wordpos_list): 74 | return len([wordpos for wordpos in wordpos_list if wordpos[1] == 'Noun']) 75 | 76 | def _num_of_words(wordpos_list): 77 | return len(wordpos_list) 78 | 79 | def _wordpos_preference(wordpos_list, preference): 80 | score = 0 81 | for word, pos, _, _ in wordpos_list: 82 | score += preference.get((word, pos), 0) 83 | return score 84 | 85 | def _has_force_tag(wordpos_list, tagset): 86 | return len([wordpos for wordpos in wordpos_list if not (wordpos[1] in tagset)]) > 0 -------------------------------------------------------------------------------- /ckonlpy/tag/_postprocess.py: -------------------------------------------------------------------------------- 1 | from collections import defaultdict 2 | 3 | class Postprocessor: 4 | def __init__(self, base_tagger, stopwords=None, 5 | passwords=None, passtags=None, replace=None, ngrams=None): 6 | self.base_tagger = base_tagger 7 | self.stopwords = stopwords if stopwords else None 8 | self.passwords = passwords if passwords else None 9 | self.passtags = passtags if passtags else None 10 | self.replace = replace if replace else None 11 | self.ngrams = self._prepare_ngram_converter(ngrams) 12 | 13 | def _prepare_ngram_converter(self, ngrams): 14 | if not ngrams: 15 | return None 16 | first_to_ngram = defaultdict(lambda: []) 17 | for ngram in ngrams: 18 | try: 19 | if isinstance(ngram[0], tuple) and isinstance(ngram[1], str): 20 | first_to_ngram[ngram[0][0]].append(ngram) 21 | elif isinstance(ngram, tuple) and isinstance(ngram[0], str): 22 | first_to_ngram[ngram[0]].append((ngram, 'Noun')) 23 | else: 24 | print('ngram format error : {}'.format(ngram)) 25 | except: 26 | print('ngram format error : {}'.format(ngram)) 27 | continue 28 | 29 | return dict(first_to_ngram) 30 | 31 | def _as_ngram(self, words): 32 | def same(wordpos_list, ngram_words): 33 | for wordpos, unigram_word in zip(wordpos_list, ngram_words): 34 | if (wordpos != unigram_word) and (wordpos[0] != unigram_word): 35 | return False 36 | return True 37 | 38 | words_ = [] 39 | n = len(words) 40 | idx = 0 41 | 42 | while idx < n: 43 | 44 | candidates = self.ngrams.get(words[idx][0], None) 45 | 46 | if not candidates: 47 | words_.append(words[idx]) 48 | idx += 1 49 | continue 50 | 51 | appended = False 52 | for ngram_words, ngram_pos in candidates: 53 | stride = len(ngram_words) 54 | sliced = words[idx:idx+stride] 55 | if same(sliced, ngram_words): 56 | words_.append((' - '.join([w for w, _ in sliced]), ngram_pos)) 57 | appended = True 58 | idx += stride 59 | break 60 | 61 | if not appended: 62 | words_.append(words[idx]) 63 | idx += 1 64 | 65 | return words_ 66 | 67 | def pos(self, phrase, **pos_options): 68 | def to_replace(w): 69 | if w in self.replace: 70 | w_ = self.replace[w] 71 | elif w[0] in self.replace: 72 | w_ = self.replace[w[0]] 73 | else: 74 | return w 75 | return (w_, w[1]) if isinstance(w_, str) else w_ 76 | 77 | words = self.base_tagger.pos(phrase, **pos_options) 78 | 79 | if self.ngrams: 80 | words = self._as_ngram(words) 81 | if self.stopwords: 82 | words = [w for w in words if not ((w in self.stopwords) or (w[0] in self.stopwords))] 83 | if self.passwords: 84 | words = [w for w in words if ((w in self.passwords) or (w[0] in self.passwords))] 85 | if self.passtags: 86 | words = [w for w in words if w[1] in self.passtags] 87 | if self.replace: 88 | words = [to_replace(w) for w in words] 89 | return words -------------------------------------------------------------------------------- /ckonlpy/data/twitter/modifier/modifier.txt: -------------------------------------------------------------------------------- 1 | 각 2 | 갓 3 | 갖은 4 | 걔 5 | 거런 6 | 경 7 | 고 8 | 고까짓 9 | 고깟 10 | 고따우 11 | 고따위 12 | 고딴 13 | 고런 14 | 고런조런 15 | 고론 16 | 고만 17 | 고얀 18 | 고연 19 | 고이안 20 | 고이얀 21 | 고이연 22 | 고이헌 23 | 고전 24 | 공 25 | 공공 26 | 구 27 | 구십 28 | 구십여 29 | 국한 30 | 귀 31 | 그 32 | 그까짓 33 | 그깐 34 | 그깟 35 | 그날그 36 | 그냥 37 | 그따위 38 | 그딴 39 | 그란 40 | 그런 41 | 그런그런 42 | 그런저런 43 | 그만 44 | 극 45 | 근 46 | 금새 47 | 기 48 | 기만 49 | 기백 50 | 기백만 51 | 기십 52 | 기십만 53 | 기천 54 | 기천만 55 | 긴긴 56 | 까짓 57 | 깟 58 | 내 59 | 너 60 | 너거 61 | 너댓 62 | 너댓째 63 | 너더댓 64 | 너더댓째 65 | 너덧 66 | 너덧째 67 | 넉 68 | 네 69 | 네까짓 70 | 네깐 71 | 네깟 72 | 네다섯 73 | 네다섯째 74 | 네댓 75 | 네댓째 76 | 네째 77 | 넨장 78 | 넨장맞을 79 | 넨장칠 80 | 넷째 81 | 넷쨋 82 | 넸 83 | 느그 84 | 느티 85 | 니 86 | 다른 87 | 다서여섯째 88 | 다섯 89 | 다섯째 90 | 단 91 | 단돈 92 | 닷 93 | 당 94 | 당해 95 | 대 96 | 대모한 97 | 대여섯 98 | 대여섯째 99 | 대엿 100 | 댓 101 | 댓째 102 | 뎌 103 | 도합 104 | 동 105 | 두 106 | 두서너 107 | 두서너째 108 | 두세 109 | 두세네 110 | 두세째 111 | 두어 112 | 두어째 113 | 두째 114 | 둘째 115 | 둘쨋 116 | 둬 117 | 둬째 118 | 뒷 119 | 따른 120 | 딱 121 | 딴 122 | 때늦은 123 | 때아닌 124 | 때이른 125 | 떡을할 126 | 또다른 127 | 또한 128 | 마흔 129 | 만 130 | 만여 131 | 많이 132 | 매 133 | 맨 134 | 맻 135 | 먼먼 136 | 멫 137 | 몇 138 | 몇대 139 | 몇몇 140 | 몇십 141 | 몇억만 142 | 몇째 143 | 몇천몇만 144 | 모 145 | 모두 146 | 모든 147 | 모모 148 | 모모한 149 | 모오든 150 | 몹쓸 151 | 무든 152 | 무스은 153 | 무슨 154 | 무슨무슨 155 | 무신 156 | 문 157 | 물경 158 | 뭇 159 | 뭔 160 | 믄 161 | 바른 162 | 반 163 | 배라먹을 164 | 백 165 | 백대 166 | 백여 167 | 벨 168 | 벼라별 169 | 변별 170 | 별 171 | 별별 172 | 별의별 173 | 본 174 | 븰 175 | 빌어먹을 176 | 사 177 | 사대 178 | 사십 179 | 사십여 180 | 사오 181 | 사이 182 | 삼 183 | 삼대 184 | 삼사 185 | 삼십 186 | 삼십여 187 | 새 188 | 서 189 | 서너 190 | 서너째 191 | 서른 192 | 서른한 193 | 석 194 | 설흔 195 | 성 196 | 세 197 | 세네 198 | 세네째 199 | 세째 200 | 셋째 201 | 셋쨋 202 | 소 203 | 속 204 | 수 205 | 수만 206 | 수백 207 | 수백만 208 | 수백억 209 | 수삼 210 | 수십 211 | 수십만 212 | 수십억 213 | 수십조 214 | 수억 215 | 수억만 216 | 수조 217 | 수천 218 | 수천만 219 | 수천수만 220 | 수천억 221 | 순 222 | 쉰 223 | 스무 224 | 스무남은 225 | 스무째 226 | 스물째 227 | 슥 228 | 시 229 | 신 230 | 십 231 | 십대 232 | 십여 233 | 썩을 234 | 아랫 235 | 아모 236 | 아무 237 | 아무런 238 | 아무아무 239 | 아홉 240 | 아홉째 241 | 아흔 242 | 암 243 | 애먼 244 | 야뜨 245 | 약 246 | 양 247 | 양대 248 | 어나 249 | 어느 250 | 어느어느 251 | 어는 252 | 어떤 253 | 어떨 254 | 어떻 255 | 어뜬 256 | 어만 257 | 어인 258 | 어쩐 259 | 어쩔 260 | 억 261 | 억만 262 | 억조 263 | 억천만 264 | 언 265 | 에문 266 | 여 267 | 여나무 268 | 여남 269 | 여남은 270 | 여남은째 271 | 여남째 272 | 여느 273 | 여늬 274 | 여덜아홉 275 | 여덟 276 | 여덟아홉 277 | 여덟아홉째 278 | 여덟째 279 | 여든 280 | 여라문 281 | 여러 282 | 여서일곱 283 | 여서일곱째 284 | 여섯 285 | 여섯째 286 | 여순 287 | 연 288 | 엳아홉 289 | 엳아홉째 290 | 열 291 | 열네 292 | 열두 293 | 열두어 294 | 열두째 295 | 열둘째 296 | 열세 297 | 열아문 298 | 열째 299 | 열한 300 | 열한째 301 | 염병할 302 | 엿 303 | 영 304 | 예 305 | 예닐곱 306 | 예닐곱째 307 | 예수남은 308 | 예순 309 | 예순한 310 | 예일곱 311 | 옛 312 | 오 313 | 오는 314 | 오대 315 | 오랜 316 | 오랫 317 | 오륙 318 | 오른 319 | 오만 320 | 오십 321 | 오십여 322 | 오오랜 323 | 온 324 | 온간 325 | 온갓 326 | 온갖 327 | 올 328 | 와이 329 | 왠 330 | 외딴 331 | 왼 332 | 왼갖 333 | 요 334 | 요까짓 335 | 요깟 336 | 요따위 337 | 요딴 338 | 요런 339 | 요런조런 340 | 요론 341 | 요만 342 | 울 343 | 워느 344 | 워떤 345 | 원 346 | 웬 347 | 윗 348 | 유세 349 | 육 350 | 육시랄 351 | 육십 352 | 육십여 353 | 육칠 354 | 으떤 355 | 으뜬 356 | 이 357 | 이까짓 358 | 이깐 359 | 이깟 360 | 이대 361 | 이따위 362 | 이딴 363 | 이러저런 364 | 이런 365 | 이런저런 366 | 이룻 367 | 이마 368 | 이만 369 | 이삼 370 | 이십 371 | 이십여 372 | 일 373 | 일고여덟 374 | 일고여덟째 375 | 일곱 376 | 일곱여덟째 377 | 일곱째 378 | 일대 379 | 일백 380 | 일백여 381 | 일여덟 382 | 일여덟째 383 | 일이 384 | 일천 385 | 일천여 386 | 일흔 387 | 작 388 | 장장 389 | 재한 390 | 저 391 | 저까짓 392 | 저깟 393 | 저따위 394 | 저딴 395 | 저런 396 | 저만 397 | 저지난 398 | 저희 399 | 전 400 | 전전 401 | 제 402 | 제까짓 403 | 제깟 404 | 제미붙을 405 | 제밀할 406 | 젠장맞을 407 | 젠장칠 408 | 조 409 | 조까짓 410 | 조깟 411 | 조따위 412 | 조딴 413 | 조런 414 | 조만 415 | 주 416 | 주된 417 | 주요 418 | 즈 419 | 즈믄 420 | 즉석 421 | 지 422 | 지까짓 423 | 지난 424 | 지지난 425 | 천 426 | 천여 427 | 첫 428 | 첫째 429 | 첫쨋 430 | 총 431 | 칠 432 | 칠십 433 | 칠십여 434 | 칠팔 435 | 타 436 | 특정한 437 | 팔 438 | 팔구 439 | 팔십 440 | 팔십여 441 | 표현 442 | 한 443 | 한갓 444 | 한개 445 | 한낱 446 | 한다는 447 | 한다하는 448 | 한두 449 | 한두어 450 | 한두째 451 | 한째 452 | 해 453 | 허튼 454 | 헌 455 | 현 456 | 흔 -------------------------------------------------------------------------------- /ckonlpy/data/twitter/josa/josa.txt: -------------------------------------------------------------------------------- 1 | 가 2 | 같이 3 | 같이나 4 | 같이는 5 | 같이는야 6 | 같이는커녕 7 | 같이도 8 | 같이만 9 | 같인 10 | 게 11 | 고 12 | 과 13 | 과는 14 | 과는커녕 15 | 과도 16 | 과를 17 | 과만 18 | 과만은 19 | 과의 20 | 까지 21 | 까지가 22 | 까지나 23 | 까지나마 24 | 까지는 25 | 까지는야 26 | 까지는커녕 27 | 까지도 28 | 까지든지 29 | 까지라고 30 | 까지라고는 31 | 까지라고만은 32 | 까지라도 33 | 까지로 34 | 까지로나 35 | 까지로나마 36 | 까지로는 37 | 까지로는야 38 | 까지로는커녕 39 | 까지로도 40 | 까지로든 41 | 까지로든지 42 | 까지로라서 43 | 까지로라야 44 | 까지로만 45 | 까지로만은 46 | 까지로서 47 | 까지로써 48 | 까지를 49 | 까지만 50 | 까지만은 51 | 까지만이라도 52 | 까지야 53 | 까지야말로 54 | 까지에 55 | 까지와 56 | 까지의 57 | 까지조차 58 | 까지조차도 59 | 까진 60 | 께 61 | 께서 62 | 께서는 63 | 께선 64 | 께옵서 65 | 께옵서는 66 | 께옵서는야 67 | 께옵서는커녕 68 | 께옵서도 69 | 께옵서만 70 | 께옵서만은 71 | 께옵서만이 72 | 께옵선 73 | 나 74 | 나마 75 | 난 76 | 냐 77 | 냥 78 | 네 79 | 는 80 | 는야 81 | 는커녕 82 | 니 83 | 니까 84 | 니깐 85 | 다 86 | 대로 87 | 대로가 88 | 대로는 89 | 대로의 90 | 더러 91 | 더러는 92 | 더러만은 93 | 도 94 | 두 95 | 든 96 | 든지 97 | 때믄에 98 | 라 99 | 라고 100 | 라고까지 101 | 라고까지는 102 | 라고는 103 | 라고만은 104 | 라곤 105 | 라기 106 | 라기보다는 107 | 라기보단 108 | 라네 109 | 라는 110 | 라니 111 | 라니까 112 | 라니깐 113 | 라던가 114 | 라도 115 | 라든가 116 | 라든지 117 | 라서 118 | 라야 119 | 라야만 120 | 라오 121 | 라지 122 | 라지요 123 | 랑 124 | 랑께 125 | 랑께요 126 | 랑은 127 | 래 128 | 로 129 | 로고 130 | 로구나 131 | 로구려 132 | 로구먼 133 | 로군 134 | 로군요 135 | 로는 136 | 로다 137 | 로되 138 | 로세 139 | 로운 140 | 롭고 141 | 를 142 | 마다 143 | 마다라도 144 | 마다를 145 | 마다에게 146 | 마다의 147 | 마따나 148 | 마저 149 | 마저나마라도 150 | 마저도 151 | 마저라도 152 | 마저야 153 | 만 154 | 만도 155 | 만에 156 | 만으로 157 | 만으로는 158 | 만으로도 159 | 만으로라도 160 | 만으로써 161 | 만으론 162 | 만은 163 | 만을 164 | 만의 165 | 만이 166 | 만이라도 167 | 만치 168 | 만큼 169 | 만큼도 170 | 만큼만 171 | 만큼씩 172 | 만큼은 173 | 만큼의 174 | 만큼이나 175 | 만큼이라도 176 | 만큼이야 177 | 말고 178 | 말고는 179 | 말고도 180 | 며 181 | 면 182 | 밖에 183 | 밖에는 184 | 밖에도 185 | 밖엔 186 | 보다 187 | 보다는 188 | 보다는야 189 | 보다도 190 | 보다만 191 | 보다야 192 | 보단 193 | 부터 194 | 부터가 195 | 부터나마 196 | 부터는 197 | 부터도 198 | 부터라도 199 | 부터를 200 | 부터만 201 | 부터만은 202 | 부터서는 203 | 부터야말로 204 | 부터의 205 | 부턴 206 | 서 207 | 스러운 208 | 스런 209 | 스럽게 210 | 스럽지 211 | 스럽지도 212 | 아 213 | 야 214 | 야말로 215 | 에 216 | 에가 217 | 에게 218 | 에게가 219 | 에게까지 220 | 에게까지는 221 | 에게까지는커녕 222 | 에게까지도 223 | 에게까지만 224 | 에게까지만은 225 | 에게나 226 | 에게는 227 | 에게는커녕 228 | 에게다 229 | 에게도 230 | 에게든 231 | 에게든지 232 | 에게라도 233 | 에게로 234 | 에게로는 235 | 에게마다 236 | 에게만 237 | 에게며 238 | 에게보다 239 | 에게보다는 240 | 에게부터 241 | 에게서 242 | 에게서가 243 | 에게서까지 244 | 에게서나 245 | 에게서는 246 | 에게서도 247 | 에게서든지 248 | 에게서라도 249 | 에게서만 250 | 에게서보다 251 | 에게서부터 252 | 에게서야 253 | 에게서와 254 | 에게서의 255 | 에게서처럼 256 | 에게선 257 | 에게야 258 | 에게와 259 | 에게의 260 | 에게처럼 261 | 에게하고 262 | 에게하며 263 | 에겐 264 | 에까지 265 | 에까지는 266 | 에까지도 267 | 에까지든지 268 | 에까지라도 269 | 에까지만 270 | 에까지만은 271 | 에까진 272 | 에나 273 | 에는 274 | 에다 275 | 에다가 276 | 에다가는 277 | 에다간 278 | 에도 279 | 에든 280 | 에든지 281 | 에라도 282 | 에로 283 | 에로의 284 | 에를 285 | 에만 286 | 에만은 287 | 에부터 288 | 에서 289 | 에서가 290 | 에서까지 291 | 에서까지도 292 | 에서나 293 | 에서나마 294 | 에서는 295 | 에서도 296 | 에서든지 297 | 에서라도 298 | 에서만 299 | 에서만도 300 | 에서만이 301 | 에서만큼 302 | 에서만큼은 303 | 에서보다 304 | 에서부터 305 | 에서부터는 306 | 에서부터도 307 | 에서부터라도 308 | 에서부터만 309 | 에서부터만은 310 | 에서야 311 | 에서와 312 | 에서와는 313 | 에서와의 314 | 에서의 315 | 에서조차 316 | 에서처럼 317 | 에선 318 | 에야 319 | 에여 320 | 에요 321 | 에의 322 | 에조차도 323 | 에하며 324 | 엔 325 | 엔들 326 | 엘 327 | 엘랑 328 | 여 329 | 여서 330 | 여서래 331 | 예여 332 | 예요 333 | 와 334 | 와는 335 | 와도 336 | 와라도 337 | 와를 338 | 와만 339 | 와만은 340 | 와에만 341 | 와의 342 | 와처럼 343 | 와한테 344 | 요 345 | 으로 346 | 으로가 347 | 으로까지 348 | 으로까지만은 349 | 으로나 350 | 으로나든지 351 | 으로는 352 | 으로도 353 | 으로든지 354 | 으로라도 355 | 으로랑 356 | 으로만 357 | 으로만은 358 | 으로부터 359 | 으로부터는 360 | 으로부터는커녕 361 | 으로부터도 362 | 으로부터만 363 | 으로부터만은 364 | 으로부터서는 365 | 으로부터서도 366 | 으로부터서만 367 | 으로부터의 368 | 으로서 369 | 으로서가 370 | 으로서나 371 | 으로서는 372 | 으로서도 373 | 으로서든지 374 | 으로서라도 375 | 으로서만 376 | 으로서만도 377 | 으로서만은 378 | 으로서야 379 | 으로서의 380 | 으로선 381 | 으로써 382 | 으로써나 383 | 으로써는 384 | 으로써라도 385 | 으로써만 386 | 으로써야 387 | 으로야 388 | 으로의 389 | 으론 390 | 은 391 | 은커녕 392 | 을 393 | 의 394 | 이 395 | 이고 396 | 이구나 397 | 이구만 398 | 이기도 399 | 이나 400 | 이나마 401 | 이네 402 | 이니 403 | 이니까 404 | 이다 405 | 이던 406 | 이든 407 | 이든지 408 | 이라 409 | 이라고 410 | 이라고는 411 | 이라고도 412 | 이라고만은 413 | 이라곤 414 | 이라기 415 | 이라기보다는 416 | 이라기보단 417 | 이라는 418 | 이라니 419 | 이라도 420 | 이라든지 421 | 이라서 422 | 이라야 423 | 이라야만 424 | 이란 425 | 이랑 426 | 이랑은 427 | 이래 428 | 이래도 429 | 이래서 430 | 이를 431 | 이며 432 | 이며에게 433 | 이며조차도 434 | 이야 435 | 이야말로 436 | 이어서 437 | 이에요 438 | 이여 439 | 이오니 440 | 이자나 441 | 이지롱 442 | 이지만 443 | 이하고 444 | 인 445 | 인가 446 | 인가가 447 | 인가요 448 | 인거 449 | 인걸 450 | 인게 451 | 인데 452 | 인들 453 | 인즉 454 | 인즉슨 455 | 인지 456 | 일랑 457 | 일랑은 458 | 일수록 459 | 일텐데 460 | 조차 461 | 조차가 462 | 조차도 463 | 조차를 464 | 조차의 465 | 죠 466 | 지 467 | 지는 468 | 지롱 469 | 지만 470 | 처검 471 | 처럼 472 | 처럼과 473 | 처럼도 474 | 처럼만 475 | 처럼만은 476 | 처럼은 477 | 처럼이라도 478 | 처럼이야 479 | 치고 480 | 치고는 481 | 커녕 482 | 커녕은 483 | 커니와 484 | 토록 485 | 플라마 486 | 하고 487 | 하고가 488 | 하고는 489 | 하고는커녕 490 | 하고도 491 | 하고라도 492 | 하고마저 493 | 하고만 494 | 하고만은 495 | 하고야 496 | 하고에게 497 | 하고의 498 | 하고조차 499 | 하고조차도 500 | 하곤 501 | 하듯 502 | 하오 503 | 하오니 504 | 한 505 | 한테 506 | 해 507 | 해도 508 | 해서 509 | 했기때문에 510 | 했기에 511 | 했어서 512 | 했지만 513 | -------------------------------------------------------------------------------- /ckonlpy/data/twitter/noun/geolocations.txt: -------------------------------------------------------------------------------- 1 | [1] 2 | 가락동 3 | 가리봉 4 | 가리봉동 5 | 가산동 6 | 가양 7 | 가양동 8 | 가회동 9 | 갈현 10 | 갈현동 11 | 강남구 12 | 강동 13 | 강동구 14 | 강북구 15 | 강서 16 | 강서구 17 | 강일 18 | 강일동 19 | 개봉동 20 | 개포 21 | 개포동 22 | 거여 23 | 거여동 24 | 경운동 25 | 고덕 26 | 고덕동 27 | 고척 28 | 고척동 29 | 공덕동 30 | 공릉 31 | 공릉동 32 | 공항동 33 | 관악구 34 | 광역지방자치단체 35 | 광장동 36 | 광진 37 | 광진구 38 | 광희동 39 | 교남 40 | 교남동 41 | 구기동 42 | 구로구 43 | 구로동 44 | 구산 45 | 구산동 46 | 구의 47 | 구의동 48 | 구파발 49 | 구파발동 50 | 군자동 51 | 궁동 52 | 그레이터 53 | 금정 54 | 금정구 55 | 금천 56 | 금천구 57 | 금호동 58 | 기장군 59 | 길음 60 | 길음동 61 | 낙성대 62 | 낙성대동 63 | 낙원동 64 | 난곡 65 | 난곡동 66 | 난향동 67 | 남가좌 68 | 남가좌동 69 | 남구 70 | 남대문로 71 | 남아메리카 72 | 남아프리카 73 | 남영 74 | 남영동 75 | 남현 76 | 남현동 77 | 내곡 78 | 내곡동 79 | 내슈빌 80 | 네바다 81 | 네브래스카 82 | 네비스 83 | 노량진동 84 | 노스다코타 85 | 노스캐롤라이나 86 | 노원 87 | 노원구 88 | 노유동 89 | 녹번 90 | 논현 91 | 논현동 92 | 뉴멕시코 93 | 뉴저지 94 | 뉴햄프셔 95 | 답십리 96 | 답십리동 97 | 당산동 98 | 대림동 99 | 대방동 100 | 대서양 101 | 대조동 102 | 대학동 103 | 대학로 104 | 대흥동 105 | 더반 106 | 덴버 107 | 델라웨어 108 | 델리 109 | 도곡 110 | 도림 111 | 도림동 112 | 도미니카 113 | 도버 114 | 도봉 115 | 도봉구 116 | 도봉동 117 | 도시구역 118 | 도화동 119 | 독산 120 | 돈암 121 | 돈암동 122 | 동대문구 123 | 동래 124 | 동래구 125 | 동선동 126 | 동성로 127 | 동작구 128 | 두레미 129 | 둔촌 130 | 둔촌동 131 | 둥관 132 | 등촌 133 | 등촌동 134 | 디모인 135 | 라고스 136 | 라호르 137 | 랜싱 138 | 레닌그라드 139 | 로드아일랜드 140 | 로밤바 141 | 로스엔젤레스 142 | 롤리 143 | 루이지애나 144 | 리가 145 | 리치먼드 146 | 리틀록 147 | 마장동 148 | 마천 149 | 마천동 150 | 마포 151 | 마포구 152 | 마푸토 153 | 망우 154 | 망우동 155 | 망원 156 | 망원동 157 | 매디슨 158 | 매사추세츠 159 | 맨하탄 160 | 맨해튼 161 | 메릴랜드 162 | 면목동 163 | 명동 164 | 명륜 165 | 명륜동 166 | 명일동 167 | 몬태나 168 | 몬트리올 169 | 몬트필리어 170 | 몽고메리 171 | 무악 172 | 무악동 173 | 묵동 174 | 문래 175 | 문래동 176 | 문정 177 | 문정동 178 | 뭄바이 179 | 미네소타 180 | 미성 181 | 미성동 182 | 미시간 183 | 미시시피 184 | 미아동 185 | 바부다 186 | 반포동 187 | 발산동 188 | 방갈로르 189 | 방배 190 | 방배동 191 | 방이 192 | 방이동 193 | 방학동 194 | 방화동 195 | 배턴루지 196 | 밸기에 197 | 버몬트 198 | 버지니아 199 | 번동 200 | 보고타 201 | 보광동 202 | 보라매동 203 | 보라카이 204 | 보문 205 | 보문동 206 | 봉천 207 | 봉천동 208 | 부산진 209 | 부산진구 210 | 부암 211 | 부암동 212 | 북가좌 213 | 북가좌동 214 | 북구 215 | 북아메리카 216 | 북아현 217 | 북아현동 218 | 불광 219 | 불광동 220 | 브리자빌 221 | 비즈마크 222 | 빈센트 223 | 사근 224 | 사근동 225 | 사나 226 | 사상구 227 | 사우스다코타 228 | 사우스캐롤라이나 229 | 사우스타라와 230 | 사직동 231 | 사하 232 | 사하구 233 | 삼각산 234 | 삼각산동 235 | 삼선 236 | 삼선동 237 | 삼성동 238 | 삼양동 239 | 삼전동 240 | 삼청 241 | 삼청동 242 | 상계동 243 | 상도동 244 | 상봉동 245 | 상암 246 | 상암동 247 | 상일 248 | 상일동 249 | 상트페테르부르크 250 | 상하이 251 | 새크라멘토 252 | 샌타페이 253 | 샤이엔 254 | 서강 255 | 서강동 256 | 서교 257 | 서교동 258 | 서대문구 259 | 서림 260 | 서림동 261 | 서빙고 262 | 서빙고동 263 | 서원동 264 | 서초구 265 | 석관 266 | 석관동 267 | 석촌 268 | 석촌동 269 | 성내 270 | 성내동 271 | 성동구 272 | 성북 273 | 성북구 274 | 성북동 275 | 성산 276 | 성산동 277 | 성수동 278 | 성현동 279 | 세곡 280 | 세곡동 281 | 세인트폴 282 | 세일럼 283 | 세종로 284 | 소공 285 | 소공동 286 | 소래 287 | 솔트레이크시티 288 | 송정 289 | 송정동 290 | 송중 291 | 송중동 292 | 송천 293 | 송천동 294 | 송파구 295 | 송파동 296 | 수궁동 297 | 수도동 298 | 수라트 299 | 수색동 300 | 수서동 301 | 수영구 302 | 숭인 303 | 숭인동 304 | 스프링필드 305 | 시안 306 | 시자치단체 307 | 시츄에이션 308 | 시흥동 309 | 신길 310 | 신길동 311 | 신내 312 | 신내동 313 | 신당동 314 | 신대방 315 | 신대방동 316 | 신도림 317 | 신도림동 318 | 신림 319 | 신림동 320 | 신문로1가 321 | 신문로2가 322 | 신베이시 323 | 신수동 324 | 신영 325 | 신영동 326 | 신원동 327 | 신월동 328 | 신정동 329 | 신천 330 | 신천동 331 | 신촌동 332 | 싱가폴 333 | 쌍문 334 | 쌍문동 335 | 쑤저우 336 | 아나폴리스 337 | 아마다바드 338 | 아시가바트 339 | 아이다호 340 | 아이오와 341 | 아칸소 342 | 아현 343 | 아현동 344 | 안암 345 | 안암동 346 | 알래스카 347 | 알렉산드리아 348 | 암사 349 | 암사동 350 | 압구정 351 | 압구정동 352 | 애리조나 353 | 앤티가 354 | 앨라배마 355 | 양곤 356 | 양재동 357 | 양천 358 | 양천구 359 | 양평 360 | 양평동 361 | 양화동 362 | 어스틴 363 | 엘에이 364 | 여의도동 365 | 역삼 366 | 역삼동 367 | 역촌 368 | 역촌동 369 | 연남 370 | 연남동 371 | 연방시 372 | 연제 373 | 연제구 374 | 염리 375 | 염리동 376 | 염창 377 | 염창동 378 | 영도 379 | 영도구 380 | 영등포 381 | 영등포구 382 | 영등포동 383 | 오거스타 384 | 오금동 385 | 오류동 386 | 오륜동 387 | 오리건 388 | 오클라호마시티 389 | 오하이오 390 | 옥수동 391 | 올림피아 392 | 올버니 393 | 와이오밍 394 | 완도 395 | 왕십리동 396 | 요코하마 397 | 요하네스버그 398 | 용강 399 | 용강동 400 | 용답 401 | 용답동 402 | 용문 403 | 용문동 404 | 용산 405 | 용산구 406 | 용산동 407 | 용신 408 | 용신동 409 | 우이 410 | 우이동 411 | 우장산 412 | 우장산동 413 | 우한 414 | 운니 415 | 운니동 416 | 원서동 417 | 원효로 418 | 원효로동 419 | 월계동 420 | 월곡 421 | 월곡동 422 | 웨스트버지니아 423 | 위스콘신 424 | 유타 425 | 율현 426 | 율현동 427 | 은천 428 | 은천동 429 | 을지로동 430 | 응봉 431 | 응봉동 432 | 응암 433 | 응암동 434 | 의주로 435 | 이란 436 | 이문동 437 | 이스탄불 438 | 이촌 439 | 이촌동 440 | 이태원 441 | 이태원동 442 | 이화동 443 | 인디애나 444 | 인디애나폴리스 445 | 인수동 446 | 인헌 447 | 인헌동 448 | 일리노이 449 | 일원동 450 | 자곡 451 | 자곡동 452 | 자이푸르 453 | 자치도 454 | 자치시 455 | 전라 456 | 제다 457 | 제퍼슨시티 458 | 조선민주주의인민공화국 459 | 종로구 460 | 중구 461 | 중랑 462 | 중랑구 463 | 중앙아메리카 464 | 중앙아프리카 465 | 중화민국 466 | 중화인민공화국 467 | 지중해 468 | 찰스턴 469 | 청두 470 | 첸나이 471 | 충남 472 | 충청 473 | 충청남도 474 | 충청북도 475 | 충칭 476 | 카라치 477 | 카사블랑카 478 | 카슨시티 479 | 캔자스 480 | 캘리포니아 481 | 컬럼비아 482 | 켄터키 483 | 코네티컷 484 | 콜럼버스 485 | 콜카타 486 | 콩코드 487 | 키시너우 488 | 키츠 489 | 타나바타 490 | 태평양 491 | 탤러해시 492 | 테네시 493 | 텍사스 494 | 톈진 495 | 토바고 496 | 토피카 497 | 트렌턴 498 | 트리니다드 499 | 특별구 500 | 특별수도권 501 | 특별행정구 502 | 팔라키르 503 | 펜실베이니아 504 | 포르토누보 505 | 포트빌라 506 | 푸네 507 | 프랭크퍼트 508 | 프로비던스 509 | 플로리다 510 | 하르툼 511 | 하이데라바드 512 | 하트퍼드 513 | 한산도 514 | 해리스버그 515 | 해운대구 516 | 헤르체고비나 517 | 헬레나 518 | 호놀룰루 519 | 호치민 520 | -------------------------------------------------------------------------------- /ckonlpy/data/twitter/noun/kpop.txt: -------------------------------------------------------------------------------- 1 | 간미연 2 | 강산에 3 | 강성민 4 | 강소리 5 | 강소영 6 | 강수지 7 | 강승모 8 | 강승희 9 | 강예서 10 | 강원래 11 | 강윤지 12 | 강인원 13 | 강지민 14 | 강지혜 15 | 갱키즈 16 | 건일 17 | 걸스토리 18 | 고나은 19 | 고유비 20 | 공찬 21 | 곽승남 22 | 구자억 23 | 구창모 24 | 군무 25 | 권지안 26 | 권진아 27 | 금가은 28 | 금단비 29 | 길건 30 | 길학미 31 | 김가영 32 | 김경식 33 | 김단아 34 | 김대진 35 | 김도균 36 | 김도현 37 | 김라나 38 | 김만준 39 | 김명철 40 | 김미연 41 | 김바다 42 | 김범룡 43 | 김보련 44 | 김보림 45 | 김사은 46 | 김상민 47 | 김석민 48 | 김성욱 49 | 김성재 50 | 김성필 51 | 김성희 52 | 김세헌 53 | 김송 54 | 김송이 55 | 김수근 56 | 김승미 57 | 김승진 58 | 김씨 59 | 김양 60 | 김여희 61 | 김완제 62 | 김용진 63 | 김윤호 64 | 김은정 65 | 김정미 66 | 김정수 67 | 김종서 68 | 김종완 69 | 김준선 70 | 김지숙 71 | 김진우 72 | 김추련 73 | 김추자 74 | 김태헌 75 | 김푸른 76 | 김해일 77 | 김현성 78 | 김형용 79 | 김형은 80 | 김혜림 81 | 김혜지 82 | 김희갑 83 | 나비드 84 | 나연 85 | 나윤선 86 | 나인뮤스 87 | 나희경 88 | 남녀공학 89 | 남상아 90 | 남석훈 91 | 남태현 92 | 낯선 93 | 노승호 94 | 노영국 95 | 노이즈 96 | 니나 97 | 니모 98 | 니케아 99 | 달빛요정역전만루홈런 100 | 달샤벳 101 | 더블에스 102 | 데니 103 | 데이라이트 104 | 도건우 105 | 도무송 106 | 듀스 107 | 디아 108 | 디알 109 | 디오 110 | 라니아 111 | 레이 112 | 렉시 113 | 로꼬 114 | 로지 115 | 로티플 116 | 루한 117 | 류시아 118 | 류케이 119 | 린아 120 | 맹세창 121 | 메이린 122 | 메이비 123 | 문관철 124 | 문수정 125 | 문주란 126 | 문준영 127 | 문지은 128 | 문차일드 129 | 문태현 130 | 문현아 131 | 미노 132 | 미스에이 133 | 민경훈 134 | 민효린 135 | 민훈기 136 | 민희 137 | 밀크 138 | 박가진 139 | 박강성 140 | 박광현 141 | 박구윤 142 | 박길라 143 | 박다예 144 | 박마루 145 | 박미경 146 | 박민정 147 | 박산다라 148 | 박상우 149 | 박상훈 150 | 박선아 151 | 박성식 152 | 박성신 153 | 박세미 154 | 박수빈 155 | 박시온 156 | 박시환 157 | 박영록 158 | 박원미 159 | 박은옥 160 | 박은우 161 | 박재정 162 | 박정수 163 | 박정운 164 | 박준하 165 | 박진섭 166 | 박태진 167 | 박한근 168 | 박혁동 169 | 박혜성 170 | 박혜신 171 | 박효신 172 | 방시혁 173 | 방용국 174 | 방준석 175 | 방탄소년단 176 | 배기성 177 | 배슬기 178 | 배틀 179 | 백설희 180 | 백수정 181 | 백영규 182 | 백예린 183 | 백은혜 184 | 백일하 185 | 백일희 186 | 백현 187 | 베니 188 | 베이비복스 189 | 베이지 190 | 브라운아이드걸스 191 | 비니 192 | 비원에이포 193 | 비키 194 | 빛과 195 | 빠순이 196 | 빽가 197 | 사오리 198 | 사이아트 199 | 산들 200 | 살찐 201 | 샤넌 202 | 샤인 203 | 샤크라 204 | 서문탁 205 | 서민우 206 | 서수남 207 | 서우영 208 | 서은광 209 | 서인아 210 | 서재혁 211 | 서재호 212 | 서정아 213 | 서지영 214 | 서지원 215 | 서태지와아이들 216 | 석준 217 | 선경 218 | 선동혁 219 | 선민 220 | 설주영 221 | 성대현 222 | 성은채 223 | 성제 224 | 성진우 225 | 성창수 226 | 세라 227 | 세리 228 | 세훈 229 | 션 230 | 션이슬로 231 | 소냐 232 | 소명 233 | 소율 234 | 손성아 235 | 손지창 236 | 솔리드 237 | 송아영 238 | 송창식 239 | 송홍섭 240 | 송희란 241 | 쇼콜라 242 | 수니질 243 | 수상한 244 | 수이 245 | 수호 246 | 숙희 247 | 숨셔 248 | 슈가 249 | 슈가제이 250 | 슈주 251 | 슈퍼쥬니어 252 | 스타제국 253 | 스테파니 254 | 승아 255 | 승희 256 | 시온 257 | 시우민 258 | 시원 259 | 신동욱 260 | 신성우 261 | 신수아 262 | 신신애 263 | 신영균 264 | 신우 265 | 신원균 266 | 신유 267 | 신유성 268 | 신정환 269 | 신철 270 | 신형원 271 | 신혜 272 | 신훈 273 | 심규선 274 | 심수봉 275 | 심은진 276 | 심태윤 277 | 써니힝 278 | 아지 279 | 악동뮤지션 280 | 악뮤 281 | 안다미 282 | 안선하 283 | 안소희 284 | 안정윤 285 | 안진경 286 | 안흥찬 287 | 알렉산더 288 | 알이에프 289 | 애이핑크 290 | 얀 291 | 양수경 292 | 에디 293 | 에이잭스 294 | 에이피스 295 | 에프티아일랜드 296 | 에피톤 297 | 엔알지 298 | 염따 299 | 영민 300 | 영지 301 | 예아라 302 | 오예리 303 | 오원빈 304 | 오준영 305 | 오하영 306 | 오현란 307 | 옥요한 308 | 온희정 309 | 올라이즈 310 | 와이지 311 | 왁스 312 | 요아리 313 | 요조 314 | 우연이 315 | 우은미 316 | 우효니 317 | 원더걸스 318 | 원미연 319 | 웨일 320 | 웬디 321 | 유영 322 | 유영진 323 | 유주용 324 | 유준성 325 | 유지애 326 | 유카 327 | 유해준 328 | 유현상 329 | 육성재 330 | 윤명운 331 | 윤시내 332 | 윤이지 333 | 윤준호 334 | 윤학 335 | 윤혁 336 | 은비 337 | 이광조 338 | 이규석 339 | 이기욱 340 | 이덕진 341 | 이동준 342 | 이동희 343 | 이무송 344 | 이미키 345 | 이보람 346 | 이부영 347 | 이비 348 | 이상미 349 | 이상원 350 | 이상훈 351 | 이석원 352 | 이성욱 353 | 이소라 354 | 이소민 355 | 이소은 356 | 이수미 357 | 이수완 358 | 이승열 359 | 이승희 360 | 이아영 361 | 이애숙 362 | 이영 363 | 이예린 364 | 이온 365 | 이원진 366 | 이유애린 367 | 이윤정 368 | 이은미 369 | 이자연 370 | 이정선 371 | 이정훈 372 | 이종원 373 | 이주노 374 | 이주원 375 | 이지은 376 | 이진관 377 | 이진성 378 | 이창민 379 | 이창섭 380 | 이탁 381 | 이태권 382 | 이하린 383 | 이해리 384 | 이해연 385 | 이헌승 386 | 이혁 387 | 이혁수 388 | 이혁준 389 | 이현 390 | 이현지 391 | 이혜영 392 | 이혜진 393 | 인피릿 394 | 인호진 395 | 일통 396 | 임백천 397 | 임상아 398 | 임성은 399 | 임정득 400 | 임종환 401 | 임주리 402 | 임주연 403 | 임지훈 404 | 임태경 405 | 임태린 406 | 임현식 407 | 장기호 408 | 장덕 409 | 장민경 410 | 장보영 411 | 장석현 412 | 장성재 413 | 장수원 414 | 장연주 415 | 장진영 416 | 장현승 417 | 장혜진 418 | 장희영 419 | 잼 420 | 전상환 421 | 전성초 422 | 전영록 423 | 전은미 424 | 전진영 425 | 정기고 426 | 정애리 427 | 정연승 428 | 정윤혜 429 | 정은선 430 | 정일훈 431 | 정재용 432 | 정재은 433 | 정지찬 434 | 정지훈 435 | 정차식 436 | 정해진 437 | 정호근 438 | 정희철 439 | 제이민 440 | 제이세라 441 | 제이큐티 442 | 젤로 443 | 젤리피쉬 444 | 조동진 445 | 조동희 446 | 조문근 447 | 조미미 448 | 조빈 449 | 조정현 450 | 조진원 451 | 조하문 452 | 조항조 453 | 조형우 454 | 조형진 455 | 죠앤 456 | 주노 457 | 주비 458 | 주찬권 459 | 주환 460 | 쥬디 461 | 지누 462 | 지니 463 | 지웅 464 | 지원이 465 | 지은아 466 | 지코 467 | 지해 468 | 지혁 469 | 진온 470 | 진유 471 | 차중락 472 | 찬열 473 | 채동하 474 | 채소연 475 | 채제민 476 | 천상지희 477 | 청림 478 | 청춘불패 479 | 첸 480 | 초신성 481 | 초아 482 | 최고은 483 | 최민환 484 | 최선원 485 | 최성수 486 | 최성원 487 | 최숙자 488 | 최영철 489 | 최용준 490 | 최유나 491 | 최진영 492 | 최진이 493 | 최진희 494 | 최헌 495 | 최현아 496 | 치치 497 | 치타 498 | 카밀라 499 | 카이 500 | 케이넌 501 | 케이윌 502 | 케이코아 503 | 코요태 504 | 코타 505 | 쿨 506 | 크리스 507 | 클레오 508 | 키로츠 509 | 키썸 510 | 타오 511 | 탑독 512 | 태군 513 | 태완 514 | 태원 515 | 터보 516 | 터틀맨 517 | 테이 518 | 투에이엠 519 | 투투 520 | 패티 521 | 팬싸 522 | 편승엽 523 | 표인봉 524 | 퓨리티 525 | 프니엘 526 | 프리스타 527 | 플레디스 528 | 플레이걸 529 | 피기돌스 530 | 피에스타 531 | 피쳐링 532 | 하명지 533 | 하민우 534 | 하수빈 535 | 하이옌 536 | 하청일 537 | 하현우 538 | 한돌 539 | 한예원 540 | 한윤성 541 | 한채원 542 | 한희준 543 | 허성욱 544 | 허영지 545 | 허재훈 546 | 허참 547 | 현철 548 | 형곤 549 | 혜나 550 | 혜원 551 | 혜은이 552 | 혜이니 553 | 홍경인 554 | 홍수철 555 | 황세옥 556 | 효은 557 | 후니훈 558 | 휘성 559 | 희영 560 | -------------------------------------------------------------------------------- /ckonlpy/custom_tag/_template.py: -------------------------------------------------------------------------------- 1 | from ckonlpy.utils import installpath 2 | from ckonlpy.utils import loadtxt 3 | from ._evaluator import SimpleEvaluator 4 | from pprint import pprint 5 | 6 | class SimpleTemplateTagger: 7 | 8 | def __init__(self, dictionary, templates=None, evaluator=None, tagset=None): 9 | 10 | if not evaluator: 11 | evaluator = SimpleEvaluator(tagset=tagset) 12 | 13 | if not tagset: 14 | tagset = {} 15 | 16 | self.dictionary = dictionary 17 | self.templates = _initialize_templates(templates, dictionary, tagset) 18 | self.evaluator = evaluator 19 | self.debug = False 20 | 21 | def pos(self, eojeol, perfect_match=False): 22 | 23 | if not eojeol: 24 | return [] 25 | 26 | n = len(eojeol) 27 | wordpos_nested_list = _match_words(eojeol, self.dictionary) 28 | matcheds = _match_templates(wordpos_nested_list, self.templates, self.debug) 29 | if perfect_match: 30 | matcheds = [matched for matched in matcheds 31 | if ((matched[0][2] == 0) and (matched[-1][3] == n))] 32 | if not matcheds: 33 | return [] 34 | matcheds = self.evaluator.select(matcheds) 35 | words = _append_unmatched(matcheds, eojeol) 36 | return words 37 | 38 | def add_a_template(self, a_template): 39 | if type(a_template) != tuple: 40 | a_template = tuple(a_template) 41 | if (a_template in self.templates) == False: 42 | self.templates.append(a_template) 43 | 44 | def set_evaluator(self, my_weight_tuple, my_evaluate_function, test=True): 45 | self.evaluator.weight = my_weight_tuple 46 | self.evaluator.evaluate = my_evaluate_function 47 | 48 | if not test: 49 | return 50 | 51 | for test_candidate in test_candidates: 52 | print('candidate') 53 | pprint(test_candidate) 54 | print('score = {}\n'.format(self.evaluator.evaluate(test_candidate))) 55 | 56 | test_candidates = [ 57 | [('이', 'Noun', 0, 1), ('것', 'Noun', 1, 2), ('은', 'Josa', 2, 3), ('테', 'Noun', 3, 4), ('스트', 'Noun', 4, 6)], 58 | [('이것', 'Noun', 0, 2), ('은', 'Josa', 2, 3), ('테', 'Noun', 3, 4), ('스트', 'Noun', 4, 6)], 59 | [('이것', 'Noun', 0, 2), ('은', 'Josa', 2, 3), ('테스트', 'Noun', 3, 6)] 60 | ] 61 | 62 | def _initialize_templates(templates, dictionary, tagset): 63 | if not templates: 64 | templatespath = '%s/data/templates/twitter_templates0' % installpath 65 | templates = loadtxt(templatespath) 66 | templates = [tuple(template.split()) for template in templates] 67 | 68 | single_words = [(pos, ) for pos in dictionary._pos2words 69 | if not (pos in tagset)] 70 | templates += [template for template in single_words 71 | if not template in templates] 72 | 73 | return templates 74 | 75 | def _match_words(eojeol, dictionary): 76 | n = len(eojeol) 77 | 78 | matched = [] 79 | for b in range(n): 80 | sublist = [] 81 | for e in range(b+1, min(n, b + dictionary._max_length) + 1): 82 | word = eojeol[b:e] 83 | for tag in dictionary.get_tags(word): 84 | sublist.append((word, tag, b, e)) 85 | matched.append(sublist) 86 | return matched 87 | 88 | def _match_templates(wordpos_nested_list, templates, debug=False): 89 | 90 | n = len(wordpos_nested_list) 91 | matcheds = [] 92 | 93 | # for each begin position 94 | for wordpos_list in wordpos_nested_list: 95 | # for each (word, pos, begin, end) 96 | for wordpos in wordpos_list: 97 | # for each template 98 | for template in templates: 99 | if template[0] == wordpos[1]: 100 | # skip a syllable single word 101 | if len(template) == 1 and len(wordpos[0]) == 1: 102 | continue 103 | expandeds = _expand( 104 | wordpos, template, wordpos_nested_list, n, debug) 105 | matcheds += expandeds 106 | 107 | return matcheds 108 | 109 | def _expand(wordpos, template, wordpos_nested_list, n, debug): 110 | 111 | def get_matched_wordpos(wordpos_list, tag): 112 | return [wordpos for wordpos in wordpos_list if wordpos[1] == tag] 113 | 114 | # Initialize candidates 115 | candidates = [[wordpos]] 116 | 117 | # Expansion 118 | for match_tag in template[1:]: 119 | candidates_ = [] 120 | for candidate in candidates: 121 | last_index = candidate[-1][3] 122 | if last_index >= n: 123 | continue 124 | expandables = get_matched_wordpos( 125 | wordpos_nested_list[last_index], match_tag) 126 | for expandable in expandables: 127 | expanded = [c for c in candidate] + [expandable] 128 | candidates_.append(expanded) 129 | candidates = candidates_ 130 | 131 | if debug and candidates: 132 | print('\ntemplate = {}'.format(template)) 133 | for candidate in candidates: 134 | print(candidate) 135 | 136 | return candidates 137 | 138 | def _append_unmatched(matcheds, eojeol): 139 | 140 | n = len(eojeol) 141 | words = [word for match, _, _, _ in matcheds for word in match] 142 | if not words: 143 | return [(eojeol, None, 0, n)] 144 | 145 | begin = 0 146 | unmatcheds = [] 147 | for word in words: 148 | if begin == word[2]: 149 | begin = word[3] 150 | continue 151 | unmatcheds.append((eojeol[begin:word[2]], None, begin, word[2])) 152 | begin = word[3] 153 | if begin < n: 154 | unmatcheds.append((eojeol[begin:], None, begin, n)) 155 | 156 | words += unmatcheds 157 | words = sorted(words, key=lambda x:x[2]) 158 | return words -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # customized KoNLPy 2 | 3 | 한국어 자연어처리를 할 수 있는 파이썬 패키지, KoNLPy의 customized version입니다. 4 | 5 | customized_KoNLPy는 확실히 알고 있는 단어들에 대해서는 라이브러리를 거치지 않고 주어진 어절을 아는 단어들로 토크나이징 / 품사판별을 하는 기능을 제공합니다. 이를 위해 template 기반 토크나이징을 수행합니다. 6 | 7 | 사전: {'아이오아이': 'Noun', '는': 'Josa'} 8 | 탬플릿: Noun + Josa 9 | 10 | 위와 같은 단어 리스트와 탬플릿이 있다면 '아이오아이는' 이라는 어절은 [('아이오아이', 'Noun'), ('는', 'Josa')]로 분리됩니다. 11 | 12 | ## Install 13 | 14 | $ git clone https://github.com/lovit/customized_konlpy.git 15 | 16 | $ pip install customized_konlpy 17 | 18 | ### Requires 19 | 20 | - JPype >= 0.6.1 21 | - KoNLPy >= 0.4.4 22 | 23 | ## Usage 24 | 25 | ### Part of speech tagging 26 | 27 | KoNLPy와 동일하게 Twitter.pos(phrase)를 입력합니다. 각 어절별로 사용자 사전에 알려진 단어가 인식되면 customized_tagger로 어절을 분리하며, 사용자 사전에 알려지지 않은 단어로 구성된 어절은 트위터 형태소 분석기로 처리합니다. 28 | 29 | ```python 30 | twitter.pos('우리아이오아이는 이뻐요') 31 | ``` 32 | 33 | [('우리', 'Noun'), ('아이오', 'Noun'), ('아이', 'Noun'), ('는', 'Josa'), ('이뻐', 'Adjective'), ('요', 'Eomi')] 34 | 35 | '아이오아이'가 알려진 단어가 아니었기 때문에 트위터 분석기에서 단어를 제대로 인식하지 못합니다. 아래의 사용자 사전으로 단어 추가를 한 뒤 동일한 작업을 수행하면 아래와 같은 결과를 얻을 수 있습니다. 36 | 37 | ```python 38 | twitter.pos('우리아이오아이는 이뻐요') 39 | ``` 40 | 41 | [('우리', 'Modifier'), ('아이오아이', 'Noun'), ('는', 'Josa'), ('이뻐', 'Adjective'), ('요', 'Eomi')] 42 | 43 | ```python 44 | twitter.pos('트와이스tt는 좋아요') 45 | ``` 46 | [('트와이스', 'Noun'), ('tt', 'Noun'), ('는', 'Josa'), ('좋', 'Adjective'), ('아요', 'Eomi')] 47 | 48 | ### Add words to dictioanry 49 | 50 | ckonlpy.tag의 Twitter는 add_dictionary를 통하여 str 혹은 list of str 형식의 사용자 사전을 추가할 수 있습니다. 51 | 52 | ```python 53 | from ckonlpy.tag import Twitter 54 | 55 | twitter.add_dictionary('아이오아이', 'Noun') 56 | twitter.add_dictionary(['트와이스', 'tt'], 'Noun') 57 | ``` 58 | 59 | 트위터 한국어 분석기에서 이용하지 않는 품사 (단어 클래스)를 추가하고 싶을 경우에는 반드시 force=True로 설정해야 합니다. 60 | 61 | ```python 62 | twitter.add_dictionary('lovit', 'Name', force=True) 63 | ``` 64 | 65 | ### Add template to customized tagger 66 | 67 | 현재 사용중인 탬플릿 기반 토크나이저는 코드 사용 중 탬플릿을 추가할 수 있습니다. 현재 사용중인 탬플릿의 리스트는 아래처럼 확인할 수 있습니다. 68 | 69 | ```python 70 | twitter.template_tagger.templates 71 | ``` 72 | 73 | [('Noun', 'Josa'), ('Modifier', 'Noun'), ('Modifier', 'Noun', 'Josa')] 74 | 75 | 탬플릿은 tuple of str 형식으로 입력합니다. 76 | 77 | ```python 78 | twitter.template_tagger.add_a_template(('Noun', 'Noun', 'Josa')) 79 | ``` 80 | 81 | ### Set templates tagger selector 82 | 83 | Templates를 이용하여도 후보가 여러 개 나올 수 있습니다. 여러 개 후보 중에서 best 를 선택하는 함수를 직접 디자인 할 수 도 있습니다. 이처럼 몇 개의 점수 기준을 만들고, 각 기준의 weight를 부여하는 방식은 트위터 분석기에서 이용하는 방식인데, 직관적이고 튜닝 가능해서 매우 좋은 방식이라 생각합니다. 84 | 85 | ```python 86 | my_weights = [ 87 | ('num_nouns', -0.1), 88 | ('num_words', -0.2), 89 | ('no_noun', -1), 90 | ('len_sum_of_nouns', 0.2) 91 | ] 92 | 93 | def my_evaluate_function(candidate): 94 | num_nouns = len([word for word, pos, begin, e in candidate if pos == 'Noun']) 95 | num_words = len(candidate) 96 | has_no_nouns = (num_nouns == 0) 97 | len_sum_of_nouns = 0 if has_no_nouns else sum( 98 | (len(word) for word, pos, _, _ in candidate if pos == 'Noun')) 99 | 100 | scores = (num_nouns, num_words, has_no_nouns, len_sum_of_nouns) 101 | score = sum((score * weight for score, (_, weight) in zip(scores, my_weights))) 102 | return score 103 | ``` 104 | 105 | 위의 예제처럼 my_weights 와 my_evaluate_function 함수를 정의하여 twitter.set_evaluator()에 입력하면, 해당 함수 기준으로 best candidate를 선택합니다. 106 | 107 | ```python 108 | twitter.set_evaluator(my_weights, my_evaluate_function) 109 | ``` 110 | 111 | ### Postprocessor 112 | 113 | passwords, stopwords, passtags, 단어 치환을 위한 후처리를 할 수 있습니다. 114 | 115 | passwords 에 등록된 단어, (단어, 품사)만 출력됩니다. 116 | 117 | ```python 118 | from ckonlpy.tag import Postprocessor 119 | 120 | passwords = {'아이오아이', ('정말', 'Noun')} 121 | postprocessor = Postprocessor(twitter, passwords = passwords) 122 | postprocessor.pos('우리아이오아이는 정말 이뻐요') 123 | # [('아이오아이', 'Noun'), ('정말', 'Noun')] 124 | ``` 125 | 126 | stopwords 에 등록된 단어, (단어, 품사)는 출력되지 않습니다. 127 | 128 | ```python 129 | stopwords = {'는'} 130 | postprocessor = Postprocessor(twitter, stopwords = stopwords) 131 | postprocessor.pos('우리아이오아이는 정말 이뻐요') 132 | # [('우리', 'Modifier'), ('아이오아이', 'Noun'), ('정말', 'Noun'), ('이뻐', 'Adjective'), ('요', 'Eomi')] 133 | ``` 134 | 135 | 특정 품사를 지정하면, 해당 품사만 출력됩니다. 136 | 137 | ```python 138 | passtags = {'Noun'} 139 | postprocessor = Postprocessor(twitter, passtags = passtags) 140 | postprocessor.pos('우리아이오아이는 정말 이뻐요') 141 | # [('아이오아이', 'Noun'), ('정말', 'Noun')] 142 | ``` 143 | 144 | 치환할 단어, (단어, 품사)를 dict 형식으로 정의하면 tag 에서 단어가 치환되어 출력됩니다. 145 | 146 | ```python 147 | replace = {'아이오아이': '아이돌', ('이뻐', 'Adjective'): '예쁘다'} 148 | postprocessor = Postprocessor(twitter, replace = replace) 149 | postprocessor.pos('우리아이오아이는 정말 이뻐요') 150 | # [('우리', 'Modifier'), ('아이돌', 'Noun'), ('는', 'Josa'), ('정말', 'Noun'), ('예쁘다', 'Adjective'), ('요', 'Eomi')] 151 | ``` 152 | 153 | 연속된 단어를 하나의 단어루 묶기 위해서 nested tuple 이나 tuple of str 형식의 ngram 을 입력할 수 있습니다. tuple of str 의 형식으로 입력된 ngram 은 Noun 으로 인식됩니다. 154 | 155 | ```python 156 | ngrams = [(('미스', '함무라비'), 'Noun'), ('바람', '의', '나라')] 157 | postprocessor = Postprocessor(twitter, ngrams = ngrams) 158 | postprocessor.pos('미스 함무라비는 재밌는 드라마입니다') 159 | # [('미스 - 함무라비', 'Noun'), ('는', 'Josa'), ('재밌는', 'Adjective'), ('드라마', 'Noun'), ('입니', 'Adjective'), ('다', 'Eomi')] 160 | ``` 161 | 162 | ### Loading wordset 163 | 164 | utils 에는 stopwords, passwords, replace word pair 를 파일로 저장하였을 경우, 이를 손쉽게 불러오는 함수가 있습니다. 165 | 166 | load_wordset 은 set of str 혹은 set of tuple 을 return 합니다. 예시의 passwords.txt 의 내용은 아래와 같습니다. 단어의 품사는 한 칸 띄어쓰기로 구분합니다. stopwords.txt 도 동일한 포멧입니다. 167 | 168 | 아이오아이 169 | 아이오아이 Noun 170 | 공연 171 | 172 | load_wordset 을 이용하는 예시코드 입니다. 173 | 174 | ```python 175 | from ckonlpy.utils import load_wordset 176 | 177 | passwords = load_wordset('./passwords.txt') 178 | print(passwords) # {('아이오아이', 'Noun'), '아이오아이', '공연'} 179 | 180 | stopwords = load_wordset('./stopwords.txt') 181 | print(stopwords) # {'은', '는', ('이', 'Josa')} 182 | ``` 183 | 184 | 치환할 단어쌍은 tap 구분이 되어있습니다. 치환될 단어에 품사 태그가 있을 경우 한 칸 띄어쓰기로 구분합니다. 185 | 186 | str\tstr 187 | str str\tstr 188 | 189 | 아래는 replacewords.txt 의 예시입니다. 190 | 191 | 아빠 아버지 192 | 엄마 Noun 어머니 193 | 194 | load_replace_wordpair 을 이용하는 예시코드 입니다. 195 | 196 | ```python 197 | from ckonlpy.utils import load_replace_wordpair 198 | 199 | replace = load_replace_wordpair('./replacewords.txt') 200 | print(replace) # {'아빠': '아버지', ('엄마', 'Noun'): '어머니'} 201 | ``` 202 | 203 | ngram 단어들의 각 단어는 한 칸 띄어쓰기로, ngram 의 품사는 tap 으로 구분되어 있습니다. 204 | 205 | str str 206 | str str\tstr 207 | 208 | 아래는 ngrams.txt 의 예시입니다. 209 | 210 | 바람 의 나라 211 | 미스 함무라비 Noun 212 | 213 | load_ngram 을 이용하는 예시코드 입니다. 214 | 215 | ```python 216 | from ckonlpy.utils import load_ngram 217 | 218 | ngrams = load_ngram('./ngrams.txt') 219 | print(ngrams) # [('바람', '의', '나라'), (('미스', '함무라비'), 'Noun')] 220 | ``` 221 | 222 | ## 0.0.6+ vs 0.0.5x 223 | 224 | 0.0.5x 에서의 변수와 함수의 이름, 변수의 타입 일부를 변경하였습니다. 225 | 226 | | 변경 전 | 변경 후 | 227 | | --- | --- | 228 | | ckonlpy.tag.Twitter._loaded_twitter_default_dictionary | ckonlpy.tag.Twitter.use_twitter_dictionary | 229 | | ckonlpy.tag.Twitter._dictionary | ckonlpy.tag.Twitter.dictionary | 230 | | ckonlpy.tag.Twitter._customized_tagger | ckonlpy.tag.Twitter.template_tagger | 231 | | ckonlpy.tag.Postprocessor.tag | ckonlpy.tag.Postprocessor.pos | 232 | | ckonlpy.custom_tag.SimpleSelector | ckonlpy.custom_tag.SimpleEvalator | 233 | | ckonlpy.custom_tag.SimpleSelector.score | ckonlpy.custom_tag.SimpleEvalator.evaluate | 234 | | ckonlpy.tag.Twitter.set_selector | ckonlpy.tag.AbstractTagger.set_evaluator | 235 | | ckonlpy.custom_tag.SimpleSelector.weight | ckonlpy.custom_tag.SimpleEvaluator.weight | 236 | 237 | | 변경 후 | 변경 이유 | 238 | | --- | --- | 239 | | ckonlpy.tag.Twitter.use_twitter_dictionary | konlpy.tag.Twitter 의 사전 사용 유무 | 240 | | ckonlpy.tag.Twitter.dictionary | public 으로 변환하였습니다 | 241 | | ckonlpy.tag.Twitter.template_tagger | Template 기반으로 작동하는 tagger 임을 명시하고, public 으로 변환하였습니다 | 242 | | ckonlpy.tag.Postprocessor.pos | 기본 tagger 의 결과를 후처리하는 기능이기 때문에 동일한 함수명으로 통일하였습니다 | 243 | | ckonlpy.custom_tag.SimpleEvalator | 클래스 이름을 Selector 에서 Evaluator 로 변경하였습니다 | 244 | | ckonlpy.custom_tag.SimpleEvalator.evaluate | 품사열 후보의 점수 계산 부분을 score --> evaluate 로 함수명을 변경하였습니다 | 245 | | ckonlpy.tag.AbstractTagger.set_evaluator | 품사열 후보의 점수 계산 함수를 설정하는 함수의 이름을 변경하였습니다. 해당 함수는 ckonlpy.tag.Twitter 에서 ckonlpy.tag.AbstractTagger 로 이동하였습니다 | 246 | | ckonlpy.custom_tag.SimpleEvaluator.weight | {str:float} 형식의 weight 를 [(str, float)] 형식으로 변경하였습니다 | 247 | -------------------------------------------------------------------------------- /ckonlpy/data/twitter/noun/foreign.txt: -------------------------------------------------------------------------------- 1 | 가나메 2 | 가우리 3 | 가이무 4 | 가츠라 5 | 가히리 6 | 간다르바 7 | 간바레 8 | 갓슈 9 | 갓시그마 10 | 갓즈니 11 | 강맹 12 | 개코셰 13 | 걸데 14 | 검은코노하 15 | 겁페 16 | 게이고 17 | 게이바 18 | 게이지 19 | 겜 20 | 겜판 21 | 고나리자 22 | 고록파 23 | 고바야시 24 | 고이치 25 | 고토 26 | 곤도 27 | 광충조수 28 | 괴도매즈 29 | 교육팟 30 | 구다사이 31 | 구울 32 | 굳나잇 33 | 굳럭 34 | 굳모닝 35 | 굿나잇 36 | 굿럭 37 | 굿모닝 38 | 권리모 39 | 규라큘라 40 | 규어 41 | 그라데이션 42 | 기리보이 43 | 기무라 44 | 기프티콘 45 | 김현아 46 | 까미유 47 | 까오숑와 48 | 꼬강이 49 | 꼬라지오 50 | 꽃감관 51 | 꽃보다남자 52 | 나니 53 | 나니가 54 | 나니나니 55 | 나레기 56 | 나루토 57 | 나뮤 58 | 나수니 59 | 나은 60 | 나이오비 61 | 나츠카와 62 | 나츠코 63 | 나카가와 64 | 나카노 65 | 나카무라 66 | 나카시마 67 | 나카지마 68 | 난다고레 69 | 난다요 70 | 난데스까 71 | 남작부인 72 | 낫닝겐 73 | 내요메 74 | 네이비 75 | 네코마 76 | 네코마져지 77 | 네타 78 | 노답 79 | 노도카 80 | 노야 81 | 노조무 82 | 노하우 83 | 논픽션 84 | 누 85 | 뉴 86 | 뉴짤 87 | 니시노야 88 | 니시무라 89 | 니코 90 | 니코니 91 | 니코니코니 92 | 닌타마 93 | 닝겐 94 | 다나카 95 | 다이스케 96 | 다이쑷키 97 | 다이죠브 98 | 다이키 99 | 다치바나 100 | 다카하시 101 | 단간론파 102 | 닼나 103 | 대쉬 104 | 댄스홀 105 | 덕질 106 | 덕춘이 107 | 던파 108 | 덤벨 109 | 데덴찌 110 | 데들리 111 | 데들리체이서 112 | 데미안 113 | 데샹 114 | 데오패 115 | 데오퓨 116 | 데이지 117 | 데코쨩 118 | 데키레바 119 | 도니타 120 | 도쿄구울 121 | 동하이 122 | 두유노 123 | 드렉타라 124 | 드로스트 125 | 드리프트 126 | 드리핑 127 | 등신대 128 | 디그 129 | 디노 130 | 디디알 131 | 디럭스 132 | 디버프 133 | 디비디 134 | 디스코 135 | 디아나 136 | 딥 137 | 딥슬립 138 | 따오밍스 139 | 라니티딘 140 | 라리을 141 | 라브베리 142 | 라이더 143 | 라이온킹 144 | 라일라 145 | 라임 146 | 라핀 147 | 란스타그램 148 | 랑그레이 149 | 래인 150 | 래프팅 151 | 랠리 152 | 램 153 | 랩퍼 154 | 러스터 155 | 러프 156 | 럽라 157 | 레개 158 | 레게 159 | 레나 160 | 레베카 161 | 레인 162 | 레트로 163 | 렉 164 | 로드리게즈 165 | 로빈 166 | 로슈포르 167 | 로쏘 168 | 로얄 169 | 로이머슈탱 170 | 로콩테 171 | 록 172 | 롱런 173 | 롸잇 174 | 루이자 175 | 루조로 176 | 루커스 177 | 루피 178 | 룬델하우스 179 | 룬에이지 180 | 뤼팽 181 | 류지 182 | 류헤이 183 | 리다 184 | 리들리 185 | 리리 186 | 리스닝 187 | 리스베트 188 | 리코 189 | 리퀘 190 | 리턴즈 191 | 리페이스 192 | 리플렉 193 | 린 194 | 립 195 | 릿카 196 | 마나미 197 | 마나베 198 | 마마루사 199 | 마마마 200 | 마블 201 | 마블짱 202 | 마사오미 203 | 마사카 204 | 마쓰다 205 | 마쓰모토 206 | 마쓰히로 207 | 마에다 208 | 마이크로폰 209 | 마지데 210 | 마지텐시 211 | 마츠오카 212 | 마카로니 213 | 마카롱 214 | 마코 215 | 마코토 216 | 마크 217 | 마키 218 | 마키시마 219 | 마키쨩 220 | 만칸쇼쿠 221 | 매스티지 222 | 매즈 223 | 매칭 224 | 맥북스텐드 225 | 맵 226 | 멀티미디어 227 | 메신저 228 | 메이 229 | 메탈코어 230 | 멘마 231 | 멘타 232 | 멘탈 233 | 멘트 234 | 멜론스밍 235 | 모게코엘 236 | 모노 237 | 모닝콜 238 | 모던 239 | 모바일 240 | 모에 241 | 모에모에 242 | 모짜르트 243 | 모차르트 244 | 모카 245 | 모터사이클 246 | 무라사키바라 247 | 무라카미 248 | 문화재단 249 | 미나모토 250 | 미나세상 251 | 미나즈키 252 | 미나토 253 | 미니디스크 254 | 미니어쳐 255 | 미래일기 256 | 미와코 257 | 미우라 258 | 미유키 259 | 미키 260 | 믹서기 261 | 민트 262 | 바게뜨 263 | 바게트 264 | 바닐라 265 | 바레타 266 | 바이럴 267 | 발디오스 268 | 발라드 269 | 발레리나 270 | 발렌타인데이 271 | 발렌틴 272 | 발키리 273 | 발트슈테텐 274 | 배트맨 275 | 백마스킹 276 | 백인하 277 | 버전 278 | 베르디아나 279 | 베스트 280 | 베이컨 281 | 베토벤 282 | 베티핑끄 283 | 벨져 284 | 보가드 285 | 보보스 286 | 보틀 287 | 볼 288 | 볼라벤 289 | 부츠 290 | 뷰 291 | 뷰사 292 | 브래들리 293 | 브랙스 294 | 브러쉬 295 | 브루탈 296 | 브루투스 297 | 브이 298 | 브이텍 299 | 블라썸 300 | 블랜드 301 | 블랜딩 302 | 블러드 303 | 블레싱 304 | 블록버스터 305 | 블루스 306 | 비긴즈 307 | 비디오테이프 308 | 비바 309 | 비비씨 310 | 비비안 311 | 비어 312 | 비엔날레 313 | 비트박스 314 | 빅터 315 | 사라도령 316 | 사랑비 317 | 사사키 318 | 사야카 319 | 사에루 320 | 사오랑 321 | 사와코 322 | 사요나라 323 | 사운드트랙 324 | 사이드암 325 | 사이버테러리즘 326 | 사이언스 327 | 사이토 328 | 사이퍼즈 329 | 사일런트 330 | 사카모토 331 | 사토 332 | 산가쿠 333 | 산케이 334 | 살란데르 335 | 샌더 336 | 샬럿 337 | 샵 338 | 서빙 339 | 서사학 340 | 서준 341 | 서천꽃밭 342 | 서천화랑부 343 | 서코 344 | 선글라스 345 | 선상 346 | 성애자 347 | 세레나 348 | 세리카 349 | 세이렌 350 | 세이쥬로 351 | 세이지 352 | 세일러문 353 | 세토 354 | 센죠가하라 355 | 셀 356 | 셀렉 357 | 셀폰 358 | 셋쇼마루 359 | 셧다 360 | 소년캐 361 | 소라치 362 | 소류 363 | 소스케 364 | 소진 365 | 쇼타 366 | 쇼파 367 | 수치사 368 | 순애 369 | 슈게이징 370 | 스게 371 | 스고이 372 | 스노보드 373 | 스노우 374 | 스래시 375 | 스루노 376 | 스마일 377 | 스몰 378 | 스에유키 379 | 스즈키 380 | 스캔 381 | 스컬 382 | 스케 383 | 스코시츠즈 384 | 스쿠버 385 | 스쿠페스 386 | 스쿨 387 | 스퀘어 388 | 스크리모 389 | 스크릴렉스 390 | 스키다요 391 | 스키다요오 392 | 스타워즈 393 | 스테이시아 394 | 스텔라 395 | 스토리보드 396 | 스파클링 397 | 스프레이 398 | 스피겔 399 | 시디즈 400 | 시라이 401 | 시로 402 | 시리어스 403 | 시린메드 404 | 시모노 405 | 시미즈 406 | 시바툴 407 | 시어터 408 | 시저 409 | 시진핑 410 | 시퀀스 411 | 시키나미 412 | 신카이 413 | 실버 414 | 싱글 415 | 싱잉인더레인 416 | 싸이언스 417 | 쌈배이 418 | 썬더 419 | 썬더볼트 420 | 쎄이 421 | 씨쥐 422 | 아나타노 423 | 아노하나 424 | 아뒤 425 | 아따시 426 | 아라마키 427 | 아라비안 428 | 아라키타 429 | 아로마 430 | 아로이 431 | 아롱이 432 | 아메미야 433 | 아미 434 | 아바타 435 | 아벨 436 | 아사누마 437 | 아사히나 438 | 아세타미노핀 439 | 아스카 440 | 아앙 441 | 아야나미 442 | 아오미네 443 | 아이디 444 | 아이라이너 445 | 아이렌 446 | 아이시떼루 447 | 아이에프 448 | 아이컨택 449 | 아임인러브 450 | 아즈마 451 | 아츠야 452 | 아카기 453 | 아카네 454 | 아카시 455 | 아크네 456 | 악마재신변 457 | 악작극지문 458 | 안티아스 459 | 알라딘 460 | 알러뷰 461 | 애니메이션 462 | 애비뉴 463 | 애스크 464 | 애시드 465 | 애크미 466 | 앤 467 | 앤솔로지 468 | 앤캐 469 | 앱 470 | 야마구치 471 | 야마다 472 | 야마모토 473 | 야마사키 474 | 야마시타 475 | 야마자키 476 | 야매 477 | 야스토모 478 | 야오 479 | 야토가미 480 | 얀데레 481 | 양웬리 482 | 어덜트 483 | 어드벤처 484 | 언라 485 | 언럭키 486 | 얼터너티브 487 | 업겟 488 | 업데 489 | 업로드 490 | 업리프팅 491 | 에나 492 | 에노모토 493 | 에노시마 494 | 에디터 495 | 에바초호기 496 | 에블바디 497 | 에스 498 | 에스퍼맨 499 | 에이전트 500 | 에이지 501 | 엑설런트 502 | 엔도 503 | 엔쥬 504 | 엔터스 505 | 엘 506 | 엘리셔 507 | 엘사 508 | 엘펜리트 509 | 엘프 510 | 엘피 511 | 엠피디 512 | 여캐 513 | 열그리나 514 | 영스트리트 515 | 영웅서기 516 | 오가와 517 | 오노디 518 | 오디어스 519 | 오레키 520 | 오리진 521 | 오마이갓 522 | 오오사루 523 | 오왕자 524 | 오이이와 525 | 오이카와 526 | 오즈의마법사 527 | 오체분시 528 | 오카다 529 | 오카모토 530 | 오키아유 531 | 오타 532 | 오타쿠 533 | 오토 534 | 오티피 535 | 오프닝 536 | 오하아사 537 | 온라인과 538 | 온톨로지 539 | 와따시 540 | 와루이 541 | 와이브로 542 | 와카 543 | 와타나베 544 | 와타누키 545 | 와타시 546 | 와타시와 547 | 왕하 548 | 요나가 549 | 요스케요스케이 550 | 요시 551 | 요시다 552 | 우라하라 553 | 우레시이 554 | 우로빠 555 | 우키타케 556 | 우파루파 557 | 워렌 558 | 워커힐 559 | 웨슬리 560 | 웹 561 | 웹마스터 562 | 웹사이트 563 | 웹캠 564 | 윈드서핑 565 | 윌리암스 566 | 윌리엄스 567 | 유고 568 | 유노 569 | 유니크 570 | 유로비트 571 | 유부녀 572 | 유스케 573 | 유카타 574 | 유카토 575 | 유키무라 576 | 유키오 577 | 유투브 578 | 유툽 579 | 유튜브 580 | 유틸리티 581 | 은영전 582 | 은지 583 | 은혼 584 | 이글 585 | 이다테 586 | 이르샤 587 | 이마이 588 | 이메일 589 | 이벤 590 | 이벤트 591 | 이슈 592 | 이시미도 593 | 이시이 594 | 이시카와 595 | 이시쿠로 596 | 이쓰미 597 | 이영싫 598 | 이오리 599 | 이오링 600 | 이자성 601 | 이즈미 602 | 이지 603 | 이진기 604 | 이케다 605 | 이퀜시아 606 | 이탈리안 607 | 이터니티 608 | 이트레인 609 | 이혜리 610 | 이호원 611 | 인셉션 612 | 인스티즈 613 | 인스피릿 614 | 인슾 615 | 인터라켄 616 | 인텔리전트 617 | 인포 618 | 일러레 619 | 일러스트레이터 620 | 일렉트로니카 621 | 일리네어 622 | 일옥 623 | 일코 624 | 일쿠페스 625 | 잇끼 626 | 자네트 627 | 자캐 628 | 자키 629 | 자트 630 | 작붕이 631 | 잡스 632 | 장성려 633 | 저커버그 634 | 정대룡 635 | 정수정 636 | 제나 637 | 제네수스 638 | 제로스 639 | 제서연 640 | 젠틀 641 | 젤 642 | 져지 643 | 졔드 644 | 조이 645 | 조커 646 | 종인 647 | 주블 648 | 주커버그 649 | 쥬니어 650 | 쥬다르 651 | 쥬리 652 | 쥬시로 653 | 쥰코 654 | 즈슈 655 | 지드니 656 | 지메일 657 | 지호 658 | 직캠 659 | 진궁 660 | 진삼국무쌍 661 | 집시덴져 662 | 차애 663 | 챌피 664 | 챗 665 | 챠밍 666 | 청덕 667 | 체리 668 | 체어 669 | 체인지 670 | 츠네모리 671 | 츠라렌 672 | 츠바사 673 | 츠바키 674 | 츠보미 675 | 츠카사 676 | 치르노 677 | 치인트 678 | 치즈루 679 | 치카 680 | 치타루 681 | 카게야마 682 | 카구라 683 | 카네키 684 | 카를 685 | 카리 686 | 카리쓰마 687 | 카린 688 | 카먼 689 | 카무이 690 | 카미유 691 | 카미조 692 | 카밍 693 | 카사마츠 694 | 카스트레 695 | 카오루 696 | 카와이 697 | 카와이이 698 | 카이 699 | 카이바 700 | 카일에반 701 | 카카시 702 | 카커 703 | 칸타빌레 704 | 캇키 705 | 캐쉬백 706 | 캐치프레이즈 707 | 캔 708 | 캔들 709 | 캔들리나 710 | 캠 711 | 캡쳐 712 | 커뮤 713 | 컨택 714 | 컨테이너 715 | 컨템포러리 716 | 컨트리 717 | 컬러링 718 | 컴백홈 719 | 컾캐 720 | 케텍스 721 | 켄 722 | 켄가키미 723 | 코나타 724 | 코난 725 | 코노야로 726 | 코다 727 | 코다카 728 | 코마에다 729 | 코셰 730 | 코우이치 731 | 코이즈미 732 | 코지 733 | 코코팜 734 | 코타니 735 | 콘도미니엄 736 | 콘솔 737 | 콘티 738 | 콜 739 | 콜드컵 740 | 콜라주 741 | 콜레트 742 | 콤 743 | 쿄코 744 | 쿠거 745 | 쿠나기사 746 | 쿠다사이 747 | 쿠다사잇 748 | 쿠로다 749 | 쿠로사와 750 | 쿠로오 751 | 쿠로칭 752 | 쿠로코 753 | 쿠로하 754 | 쿠리야마 755 | 쿠크다스 756 | 쿨러 757 | 쿨프레소 758 | 퀄 759 | 퀘 760 | 퀸에이리언 761 | 큐션 762 | 큐티하니 763 | 크라운 764 | 크래커 765 | 크랭크 766 | 크러쉬네이터 767 | 크럼핑 768 | 크레디크카드 769 | 크레용 770 | 크레인 771 | 크레졸 772 | 크레파스 773 | 크로스미라쥬 774 | 크로켓 775 | 크로키 776 | 크롬 777 | 크루 778 | 크리스마스 779 | 크리스마스실 780 | 크리스마스이브 781 | 크리스마스카드 782 | 크리스마스캐럴 783 | 크리스천 784 | 크리스털 785 | 크리스털글라스 786 | 크림 787 | 클레르 788 | 클레어 789 | 클리어 790 | 클릭 791 | 키다 792 | 키리고 793 | 키리쯔쿠 794 | 키사라키 795 | 키스미 796 | 키스케 797 | 키홀 798 | 킨고 799 | 킨들 800 | 킬라킬 801 | 타노시이 802 | 타란자 803 | 타무라 804 | 타블렛 805 | 타이레놀 806 | 타이렐 807 | 타이요 808 | 타이포그래피 809 | 타쟈도르 810 | 타츠야 811 | 타치바나 812 | 타카네 813 | 타카라 814 | 타카스 815 | 타카스기 816 | 타카야마 817 | 타케시 818 | 타팬 819 | 탈랜트 820 | 탈타 821 | 탐정뎐 822 | 터치회 823 | 턴테이블리즘 824 | 테리 825 | 테스타로사 826 | 테이큰 827 | 테츠로 828 | 테크노 829 | 테팔 830 | 텐트 831 | 토가시 832 | 토도 833 | 토도마키 834 | 토리코 835 | 토모 836 | 토오루 837 | 토우코 838 | 토이펠 839 | 토지코 840 | 토카 841 | 토크 842 | 토큰 843 | 투게더 844 | 투피엠 845 | 트래블 846 | 트래픽 847 | 트랙백 848 | 트랜스 849 | 트러블 850 | 트레블 851 | 트레이싱 852 | 트레일러 853 | 트리플지 854 | 트릭시 855 | 트페 856 | 티나 857 | 티비 858 | 티아 859 | 티져 860 | 티키믹 861 | 틱톡 862 | 틴 863 | 팁 864 | 파니포니 865 | 파라메트릭 866 | 파라섹트 867 | 파스타 868 | 판하 869 | 팝업 870 | 팡틴 871 | 패러글라이딩 872 | 패리스 873 | 패스워드 874 | 패스트 875 | 팬덤 876 | 팬스가 877 | 팬싸인회 878 | 팬코 879 | 팰리스 880 | 퍼시발 881 | 퍼시벌 882 | 펑크 883 | 페가수스 884 | 페르세우스 885 | 페르소나 886 | 페이보릿 887 | 페이스 888 | 페일 889 | 페일에일 890 | 페제 891 | 펜트하우스 892 | 포르짜 893 | 포맷 894 | 포스트잇 895 | 포스팅 896 | 포유첸 897 | 포커 898 | 포켓몬 899 | 포키몬 900 | 포터블 901 | 폰 902 | 폰팅 903 | 폴 904 | 폴라 905 | 폿도 906 | 푸드 907 | 퓸 908 | 프란치스코 909 | 프로그레시브 910 | 프로즌 911 | 프록시 912 | 프롬 913 | 프리드 914 | 프리스타일 915 | 프트티라 916 | 프폭 917 | 플라쥬 918 | 플래시 919 | 플래시백 920 | 플래시포워드 921 | 플랭크 922 | 플롯 923 | 플미 924 | 플사 925 | 플삼 926 | 플텍 927 | 플픽 928 | 플하 929 | 피드백 930 | 피쉬 931 | 피오 932 | 피처 933 | 피카 934 | 피카추 935 | 피티오 936 | 피팅 937 | 피피티 938 | 핀업 939 | 하나요 940 | 하데스 941 | 하드 942 | 하드코어 943 | 하랑 944 | 하만카돈 945 | 하메스 946 | 하세가와 947 | 하야시 948 | 하얏트 949 | 하이바라 950 | 하이스쿨 951 | 하이염 952 | 하이큐 953 | 하이킥 954 | 하이터치 955 | 하이파이브 956 | 하이파이브회 957 | 하이퍼 958 | 하이퍼마켓 959 | 하젠 960 | 하치만 961 | 하치켄 962 | 하코네 963 | 하쿠류 964 | 하타케 965 | 하토니 966 | 한쿠페스 967 | 핼로 968 | 햄스터 969 | 허니 970 | 허니버터칩 971 | 헤이노 972 | 헤이로 973 | 헤일로 974 | 호무라 975 | 호시이 976 | 호시조라 977 | 호카게 978 | 호타로 979 | 호타루 980 | 혼또니 981 | 홀든 982 | 홀로그래피 983 | 회장버젼 984 | 효가 985 | 효도르 986 | 후루코토 987 | 후부키 988 | 후비안 989 | 후지와라 990 | 후지타 991 | 후카 992 | 후코이단 993 | 후쿠다 994 | 훌리 995 | 휴대폰 996 | 흑염룡 997 | 흡혈규 998 | 히나타 999 | 히노 1000 | 히데아키 1001 | 히무로 1002 | 히이라기 1003 | 히키가야 1004 | 히타기 1005 | 힐 1006 | 힛더 1007 | -------------------------------------------------------------------------------- /ckonlpy/data/twitter/noun/congress.txt: -------------------------------------------------------------------------------- 1 | 갈봉근 2 | 강강강 3 | 강경식 4 | 강경옥 5 | 강근호 6 | 강금식 7 | 강기갑 8 | 강기문 9 | 강기윤 10 | 강기정 11 | 강기천 12 | 강기필 13 | 강길만 14 | 강길부 15 | 강동원 16 | 강명순 17 | 강문봉 18 | 강문용 19 | 강병규 20 | 강보성 21 | 강봉균 22 | 강봉옥 23 | 강봉용 24 | 강부자 25 | 강삼재 26 | 강상욱 27 | 강석호 28 | 강석훈 29 | 강선규 30 | 강선명 31 | 강선영 32 | 강성구 33 | 강성모 34 | 강성원 35 | 강성재 36 | 강성종 37 | 강성천 38 | 강성태 39 | 강세형 40 | 강수림 41 | 강숙자 42 | 강승구 43 | 강승규 44 | 강신성일 45 | 강신옥 46 | 강신조 47 | 강영훈 48 | 강용석 49 | 강용식 50 | 강우혁 51 | 강욱중 52 | 강운태 53 | 강원채 54 | 강은희 55 | 강인섭 56 | 강재구 57 | 강재량 58 | 강재섭 59 | 강종무 60 | 강종희 61 | 강창성 62 | 강창용 63 | 강창일 64 | 강창희 65 | 강철선 66 | 강택수 67 | 강필선 68 | 강현욱 69 | 강혜숙 70 | 강희찬 71 | 경대수 72 | 계광순 73 | 고경화 74 | 고귀남 75 | 고기봉 76 | 고담룡 77 | 고몽우 78 | 고병현 79 | 고세진 80 | 고승덕 81 | 고영구 82 | 고영완 83 | 고우진 84 | 고원준 85 | 고재청 86 | 고재필 87 | 고정훈 88 | 고조흥 89 | 고진부 90 | 고진화 91 | 고판남 92 | 고한준 93 | 고형곤 94 | 고홍길 95 | 고흥길 96 | 고흥문 97 | 고희동 98 | 고희선 99 | 공성진 100 | 공정식 101 | 곽상훈 102 | 곽성문 103 | 곽영달 104 | 곽의영 105 | 곽정숙 106 | 곽정출 107 | 곽정현 108 | 곽치영 109 | 곽태진 110 | 구논회 111 | 구덕환 112 | 구범모 113 | 구본철 114 | 구상찬 115 | 구용상 116 | 구용현 117 | 구을회 118 | 구임회 119 | 구자춘 120 | 구종태 121 | 구중회 122 | 구창림 123 | 구천서 124 | 구철회 125 | 구태회 126 | 구흥남 127 | 국종남 128 | 국창근 129 | 국쾌남 130 | 권갑주 131 | 권경석 132 | 권기술 133 | 권노갑 134 | 권달수 135 | 권동철 136 | 권병노 137 | 권복인 138 | 권선택 139 | 권성기 140 | 권성동 141 | 권수창 142 | 권영길 143 | 권영세 144 | 권영우 145 | 권영자 146 | 권영진 147 | 권오병 148 | 권오석 149 | 권오을 150 | 권오종 151 | 권오태 152 | 권오훈 153 | 권은희 154 | 권익현 155 | 권정달 156 | 권중돈 157 | 권중동 158 | 권철현 159 | 권태망 160 | 권태욱 161 | 권태희 162 | 권택기 163 | 권해옥 164 | 권헌성 165 | 권효섭 166 | 금진호 167 | 기세풍 168 | 길병전 169 | 길승흠 170 | 길재호 171 | 길전식 172 | 길정우 173 | 김갑수 174 | 김경도 175 | 김경배 176 | 김경인 177 | 김경재 178 | 김경천 179 | 김경협 180 | 김고성 181 | 김공평 182 | 김관영 183 | 김광림 184 | 김광수 185 | 김광원 186 | 김광일 187 | 김광준 188 | 김광진 189 | 김교중 190 | 김교현 191 | 김교흥 192 | 김규남 193 | 김규만 194 | 김규원 195 | 김근수 196 | 김근태 197 | 김금래 198 | 김기도 199 | 김기령 200 | 김기배 201 | 김기석 202 | 김기선 203 | 김기섭 204 | 김기수 205 | 김기식 206 | 김기용 207 | 김기재 208 | 김기준 209 | 김기철 210 | 김기춘 211 | 김기현 212 | 김기형 213 | 김길곤 214 | 김길준 215 | 김길홍 216 | 김길환 217 | 김낙성 218 | 김낙순 219 | 김낙오 220 | 김남중 221 | 김노식 222 | 김녹영 223 | 김달범 224 | 김달수 225 | 김달호 226 | 김대식 227 | 김대중 228 | 김대진 229 | 김덕규 230 | 김덕룡 231 | 김덕배 232 | 김덕열 233 | 김도언 234 | 김도연 235 | 김도읍 236 | 김도창 237 | 김동권 238 | 김동규 239 | 김동근 240 | 김동길 241 | 김동석 242 | 김동성 243 | 김동영 244 | 김동오 245 | 김동완 246 | 김동욱 247 | 김동원 248 | 김동인 249 | 김동주 250 | 김동준 251 | 김동철 252 | 김동호 253 | 김동환 254 | 김두섭 255 | 김두윤 256 | 김두종 257 | 김두진 258 | 김두한 259 | 김두현 260 | 김득수 261 | 김락기 262 | 김만제 263 | 김말룡 264 | 김맹곤 265 | 김명규 266 | 김명동 267 | 김명섭 268 | 김명수 269 | 김명연 270 | 김명윤 271 | 김명자 272 | 김명주 273 | 김명회 274 | 김모임 275 | 김무성 276 | 김문기 277 | 김문석 278 | 김문수 279 | 김문옥 280 | 김문용 281 | 김문원 282 | 김문평 283 | 김미희 284 | 김민기 285 | 김민석 286 | 김방림 287 | 김범명 288 | 김범부 289 | 김법린 290 | 김병로 291 | 김병룡 292 | 김병수 293 | 김병순 294 | 김병열 295 | 김병오 296 | 김병윤 297 | 김병진 298 | 김병철 299 | 김병태 300 | 김병호 301 | 김병회 302 | 김보영 303 | 김복동 304 | 김봉기 305 | 김봉두 306 | 김봉욱 307 | 김봉재 308 | 김봉조 309 | 김봉호 310 | 김봉환 311 | 김부겸 312 | 김사만 313 | 김사성 314 | 김사용 315 | 김삼봉 316 | 김삼상 317 | 김상구 318 | 김상년 319 | 김상덕 320 | 김상도 321 | 김상돈 322 | 김상민 323 | 김상석 324 | 김상순 325 | 김상영 326 | 김상우 327 | 김상진 328 | 김상현 329 | 김상호 330 | 김상훈 331 | 김상흠 332 | 김상희 333 | 김석우 334 | 김석원 335 | 김석주 336 | 김석준 337 | 김석진 338 | 김선길 339 | 김선동 340 | 김선동(새누리당) 341 | 김선동(통합진보당) 342 | 김선미 343 | 김선우 344 | 김선주 345 | 김선태 346 | 김성곤 347 | 김성기 348 | 김성동 349 | 김성두 350 | 김성락 351 | 김성룡 352 | 김성복 353 | 김성삼 354 | 김성수 355 | 김성숙 356 | 김성순 357 | 김성식 358 | 김성용 359 | 김성조 360 | 김성주 361 | 김성진 362 | 김성찬 363 | 김성철 364 | 김성탁 365 | 김성태 366 | 김성호 367 | 김성환 368 | 김성회 369 | 김성희 370 | 김세련 371 | 김세배 372 | 김세연 373 | 김세영 374 | 김세웅 375 | 김소남 376 | 김송자 377 | 김수선 378 | 김수학 379 | 김수한 380 | 김숙현 381 | 김순규 382 | 김승남 383 | 김승목 384 | 김시현 385 | 김애실 386 | 김약수 387 | 김양배 388 | 김양수 389 | 김영광 390 | 김영구 391 | 김영기 392 | 김영대 393 | 김영덕 394 | 김영도 395 | 김영동 396 | 김영록 397 | 김영배 398 | 김영병 399 | 김영복 400 | 김영삼 401 | 김영상 402 | 김영생 403 | 김영선 404 | 김영수 405 | 김영숙 406 | 김영우 407 | 김영일 408 | 김영자 409 | 김영작 410 | 김영정 411 | 김영주 412 | 김영준 413 | 김영진 414 | 김영춘 415 | 김영환 416 | 김옥두 417 | 김옥선 418 | 김옥열 419 | 김옥이 420 | 김옥자 421 | 김옥주 422 | 김옥천 423 | 김옥형 424 | 김완태 425 | 김용갑 426 | 김용구 427 | 김용균 428 | 김용대 429 | 김용덕 430 | 김용무 431 | 김용성 432 | 김용수 433 | 김용순 434 | 김용오 435 | 김용우 436 | 김용익 437 | 김용재 438 | 김용주 439 | 김용진 440 | 김용채 441 | 김용태 442 | 김용학 443 | 김용현 444 | 김용호 445 | 김용화 446 | 김용환 447 | 김우경 448 | 김우남 449 | 김우동 450 | 김우석 451 | 김우성 452 | 김우식 453 | 김우영 454 | 김우평 455 | 김운용 456 | 김운환 457 | 김웅권 458 | 김웅진 459 | 김원규 460 | 김원기 461 | 김원길 462 | 김원만 463 | 김원웅 464 | 김원전 465 | 김원중 466 | 김원태 467 | 김유복 468 | 김유상 469 | 김유정 470 | 김유진 471 | 김유탁 472 | 김유택 473 | 김윤덕 474 | 김윤식 475 | 김윤하 476 | 김윤환 477 | 김은하 478 | 김을동 479 | 김응조 480 | 김응주 481 | 김의재 482 | 김의준 483 | 김의택 484 | 김이권 485 | 김익기 486 | 김익노 487 | 김익준 488 | 김인곤 489 | 김인기 490 | 김인선 491 | 김인식 492 | 김인영 493 | 김인태 494 | 김인호 495 | 김일동 496 | 김일윤 497 | 김일주 498 | 김임식 499 | 김장곤 500 | 김장섭 501 | 김장수 502 | 김장숙 503 | 김장실 504 | 김장열 505 | 김재경 506 | 김재곤 507 | 김재광 508 | 김재규 509 | 김재균 510 | 김재소 511 | 김재순 512 | 김재식 513 | 김재연 514 | 김재영 515 | 김재원 516 | 김재위 517 | 김재윤 518 | 김재천 519 | 김재춘 520 | 김재학 521 | 김재호 522 | 김재홍 523 | 김재화 524 | 김재황 525 | 김정 526 | 김정권 527 | 김정균 528 | 김정근 529 | 김정기 530 | 김정길 531 | 김정남 532 | 김정두 533 | 김정례 534 | 김정록 535 | 김정부 536 | 김정수 537 | 김정숙 538 | 김정식 539 | 김정실 540 | 김정열 541 | 김정호 542 | 김정환 543 | 김정훈 544 | 김제남 545 | 김제능 546 | 김제만 547 | 김제원 548 | 김제태 549 | 김종갑 550 | 김종경 551 | 김종곤 552 | 김종규 553 | 김종기 554 | 김종길 555 | 김종률 556 | 김종무 557 | 김종문 558 | 김종배 559 | 김종선 560 | 김종순 561 | 김종식 562 | 김종신 563 | 김종열 564 | 김종완 565 | 김종익 566 | 김종인 567 | 김종철 568 | 김종태 569 | 김종필 570 | 김종하 571 | 김종학 572 | 김종해 573 | 김종호 574 | 김종환 575 | 김종회 576 | 김종훈 577 | 김주묵 578 | 김주인 579 | 김주호 580 | 김준섭 581 | 김준연 582 | 김준태 583 | 김준희 584 | 김중권 585 | 김중기 586 | 김중위 587 | 김중태 588 | 김중한 589 | 김지준 590 | 김지태 591 | 김지호 592 | 김진구 593 | 김진기 594 | 김진만 595 | 김진배 596 | 김진복 597 | 김진봉 598 | 김진애 599 | 김진영 600 | 김진원 601 | 김진재 602 | 김진태 603 | 김진표 604 | 김찬두 605 | 김찬우 606 | 김찬진 607 | 김창규 608 | 김창근 609 | 김창동 610 | 김창수 611 | 김창욱 612 | 김창환 613 | 김채겸 614 | 김채용 615 | 김천수 616 | 김철수 617 | 김철안 618 | 김철주 619 | 김춘수 620 | 김춘진 621 | 김춘호 622 | 김충수 623 | 김충일 624 | 김충조 625 | 김충현 626 | 김충환 627 | 김칠성 628 | 김칠환 629 | 김태규 630 | 김태년 631 | 김태랑 632 | 김태수 633 | 김태식 634 | 김태용 635 | 김태원 636 | 김태호 637 | 김태홍 638 | 김태환 639 | 김태흠 640 | 김태희 641 | 김택기 642 | 김택수 643 | 김택술 644 | 김택천 645 | 김택하 646 | 김판석 647 | 김판술 648 | 김학송 649 | 김학용 650 | 김학원 651 | 김학재 652 | 김학준 653 | 김한규 654 | 김한길 655 | 김한선 656 | 김한수 657 | 김한표 658 | 김해석 659 | 김행자 660 | 김향수 661 | 김허남 662 | 김헌식 663 | 김혁규 664 | 김현 665 | 김현규 666 | 김현기 667 | 김현미 668 | 김현배 669 | 김현수 670 | 김현숙 671 | 김현욱 672 | 김현자 673 | 김형경 674 | 김형광 675 | 김형덕 676 | 김형돈 677 | 김형두 678 | 김형래 679 | 김형섭 680 | 김형오 681 | 김형욱 682 | 김형일 683 | 김형주 684 | 김형태 685 | 김형효 686 | 김혜성 687 | 김호연 688 | 김호일 689 | 김호칠 690 | 김홍만 691 | 김홍식 692 | 김홍신 693 | 김홍업 694 | 김홍용 695 | 김홍일 696 | 김화남 697 | 김화중 698 | 김황식 699 | 김회선 700 | 김효석 701 | 김효영 702 | 김효재 703 | 김희국 704 | 김희선 705 | 김희정 706 | 김희철 707 | 나경원 708 | 나길조 709 | 나병선 710 | 나상근 711 | 나석호 712 | 나성린 713 | 나오연 714 | 나용균 715 | 나웅배 716 | 나창주 717 | 나창헌 718 | 나판수 719 | 나희집 720 | 남경필 721 | 남궁석 722 | 남궁진 723 | 남궁현 724 | 남상돈 725 | 남송학 726 | 남인순 727 | 남재두 728 | 남재한 729 | 남재희 730 | 남평우 731 | 노기용 732 | 노기태 733 | 노무현 734 | 노승우 735 | 노승환 736 | 노영민 737 | 노웅래 738 | 노인도 739 | 노인환 740 | 노일환 741 | 노재봉 742 | 노재필 743 | 노진환 744 | 노차태 745 | 노철래 746 | 노태극 747 | 노태우 748 | 노현송 749 | 노회찬 750 | 노흥준 751 | 단병호 752 | 도영심 753 | 도종이 754 | 도종환 755 | 도진희 756 | 류갑종 757 | 류경현 758 | 류광열 759 | 류광현 760 | 류근찬 761 | 류근환 762 | 류기수 763 | 류기정 764 | 류덕천 765 | 류돈우 766 | 류래완 767 | 류범수 768 | 류상호 769 | 류선호 770 | 류성갑 771 | 류성걸 772 | 류수환 773 | 류순식 774 | 류승규 775 | 류승번 776 | 류승원 777 | 류인곤 778 | 류인범 779 | 류인태 780 | 류인학 781 | 류재건 782 | 류재희 783 | 류제연 784 | 류종수 785 | 류준상 786 | 류지영 787 | 류지원 788 | 류진산 789 | 류창열 790 | 류치송 791 | 류한열 792 | 류홍열 793 | 류흥수 794 | 마달천 795 | 맹은재 796 | 맹형규 797 | 명화섭 798 | 모윤숙 799 | 목요상 800 | 문국현 801 | 문대성 802 | 문동환 803 | 문명호 804 | 문병양 805 | 문병하 806 | 문병호 807 | 문부식 808 | 문석호 809 | 문시환 810 | 문용주 811 | 문재인 812 | 문정림 813 | 문정수 814 | 문종두 815 | 문준식 816 | 문창모 817 | 문창탁 818 | 문태갑 819 | 문태준 820 | 문학진 821 | 문형태 822 | 문희갑 823 | 문희상 824 | 민경식 825 | 민관식 826 | 민기식 827 | 민병권 828 | 민병기 829 | 민병두 830 | 민병주 831 | 민병초 832 | 민봉기 833 | 민영남 834 | 민영복 835 | 민의원 836 | 민장식 837 | 민태구 838 | 민현주 839 | 민홍철 840 | 박경석 841 | 박경섭 842 | 박경수 843 | 박경원 844 | 박계동 845 | 박관용 846 | 박광태 847 | 박구일 848 | 박권흠 849 | 박권희 850 | 박귀수 851 | 박규상 852 | 박규식 853 | 박근혜 854 | 박근호 855 | 박금자 856 | 박기배 857 | 박기운 858 | 박기정 859 | 박기종 860 | 박기춘 861 | 박기출 862 | 박남춘 863 | 박노준 864 | 박대동 865 | 박대출 866 | 박대해 867 | 박덕영 868 | 박덕흠 869 | 박동앙 870 | 박동진 871 | 박두선 872 | 박만원 873 | 박명광 874 | 박명근 875 | 박명서 876 | 박명환 877 | 박민기 878 | 박민수 879 | 박민식 880 | 박범계 881 | 박범진 882 | 박병배 883 | 박병석 884 | 박병선 885 | 박병윤 886 | 박병일 887 | 박병효 888 | 박보환 889 | 박삼준 890 | 박삼철 891 | 박상규 892 | 박상길 893 | 박상돈 894 | 박상묵 895 | 박상복 896 | 박상영 897 | 박상은 898 | 박상천 899 | 박상희 900 | 박석무 901 | 박선숙 902 | 박선영 903 | 박성범 904 | 박성우 905 | 박성태 906 | 박성하 907 | 박성호 908 | 박성효 909 | 박세경 910 | 박세동 911 | 박세일 912 | 박세직 913 | 박세환 914 | 박수현 915 | 박숙현 916 | 박순석 917 | 박순자 918 | 박순천 919 | 박승국 920 | 박승규 921 | 박승웅 922 | 박승재 923 | 박승하 924 | 박승환 925 | 박시균 926 | 박신원 927 | 박양수 928 | 박양재 929 | 박영교 930 | 박영래 931 | 박영록 932 | 박영선 933 | 박영숙 934 | 박영아 935 | 박영종 936 | 박영출 937 | 박완규 938 | 박완주 939 | 박왕식 940 | 박용기 941 | 박용만 942 | 박용익 943 | 박용호 944 | 박우경 945 | 박우병 946 | 박우순 947 | 박원석 948 | 박원탁 949 | 박원홍 950 | 박유재 951 | 박윤원 952 | 박윤종 953 | 박은수 954 | 박은태 955 | 박익주 956 | 박인상 957 | 박인숙 958 | 박재규 959 | 박재완 960 | 박재우 961 | 박재욱 962 | 박재홍 963 | 박정규 964 | 박정근 965 | 박정수 966 | 박정자 967 | 박정훈 968 | 박제상 969 | 박제환 970 | 박종관 971 | 박종규 972 | 박종근 973 | 박종길 974 | 박종남 975 | 박종문 976 | 박종완 977 | 박종우 978 | 박종웅 979 | 박종율 980 | 박종진 981 | 박종태 982 | 박종환 983 | 박종희 984 | 박주선 985 | 박주운 986 | 박주천 987 | 박주현 988 | 박준 989 | 박준규 990 | 박준병 991 | 박준선 992 | 박준호 993 | 박중한 994 | 박지원 995 | 박진 996 | 박진구 997 | 박찬석 998 | 박찬숙 999 | 박찬종 1000 | 박찬주 1001 | 박찬현 1002 | 박찬희 1003 | 박창달 1004 | 박창식 1005 | 박창화 1006 | 박철규 1007 | 박철언 1008 | 박철웅 1009 | 박충모 1010 | 박충순 1011 | 박충식 1012 | 박태권 1013 | 박태영 1014 | 박태원 1015 | 박태준 1016 | 박팔봉 1017 | 박한상 1018 | 박해극 1019 | 박해정 1020 | 박해충 1021 | 박헌기 1022 | 박혁규 1023 | 박현서 1024 | 박현숙 1025 | 박현태 1026 | 박형규 1027 | 박형근 1028 | 박형오 1029 | 박형준 1030 | 박혜경 1031 | 박혜자 1032 | 박홍근 1033 | 박홍수 1034 | 박환생 1035 | 박흥규 1036 | 박희부 1037 | 박희수 1038 | 박희태 1039 | 반재현 1040 | 반형식 1041 | 방만수 1042 | 방성출 1043 | 방용석 1044 | 방일홍 1045 | 배기선 1046 | 배기운 1047 | 배길도 1048 | 배길랑 1049 | 배명국 1050 | 배상연 1051 | 배성기 1052 | 배성동 1053 | 배영식 1054 | 배은희 1055 | 배일도 1056 | 배재정 1057 | 배종무 1058 | 배중혁 1059 | 배헌 1060 | 백관수 1061 | 백군기 1062 | 백낙준 1063 | 백남식 1064 | 백남억 1065 | 백남채 1066 | 백남치 1067 | 백남훈 1068 | 백두진 1069 | 백상규 1070 | 백성운 1071 | 백승홍 1072 | 백영훈 1073 | 백원우 1074 | 백재현 1075 | 백찬기 1076 | 백형남 1077 | 변광호 1078 | 변우량 1079 | 변웅전 1080 | 변재일 1081 | 변정일 1082 | 변종봉 1083 | 변진갑 1084 | 복기왕 1085 | 봉두완 1086 | 부좌현 1087 | 서갑원 1088 | 서경원 1089 | 서동진 1090 | 서민호 1091 | 서범석 1092 | 서병균 1093 | 서병수 1094 | 서상국 1095 | 서상기 1096 | 서상덕 1097 | 서상린 1098 | 서상목 1099 | 서상섭 1100 | 서상일 1101 | 서상호 1102 | 서석재 1103 | 서성달 1104 | 서수종 1105 | 서순영 1106 | 서연귀 1107 | 서영교 1108 | 서영훈 1109 | 서영희 1110 | 서용교 1111 | 서용길 1112 | 서우석 1113 | 서이환 1114 | 서인석 1115 | 서인홍 1116 | 서임수 1117 | 서장주 1118 | 서재관 1119 | 서정귀 1120 | 서정원 1121 | 서정화 1122 | 서정희 1123 | 서종열 1124 | 서종표 1125 | 서청원 1126 | 서태원 1127 | 서한두 1128 | 서한샘 1129 | 서혜석 1130 | 서호석 1131 | 석준규 1132 | 선경식 1133 | 선병렬 1134 | 선우련 1135 | 설두하 1136 | 설송웅 1137 | 설인수 1138 | 설창수 1139 | 설훈 1140 | 성기선 1141 | 성낙서 1142 | 성낙현 1143 | 성득환 1144 | 성무용 1145 | 성완종 1146 | 성원경 1147 | 성윤환 1148 | 성태경 1149 | 소선규 1150 | 손권배 1151 | 손도심 1152 | 손문경 1153 | 손범규 1154 | 손봉숙 1155 | 손석두 1156 | 손세일 1157 | 손숙미 1158 | 손승덕 1159 | 손영수 1160 | 손인춘 1161 | 손재학 1162 | 손재형 1163 | 손정혁 1164 | 손주항 1165 | 손주환 1166 | 손준현 1167 | 손창규 1168 | 손춘호 1169 | 손치호 1170 | 손태곤 1171 | 손태인 1172 | 손학규 1173 | 손희정 1174 | 송경섭 1175 | 송관수 1176 | 송광호 1177 | 송능운 1178 | 송두호 1179 | 송민순 1180 | 송방용 1181 | 송병대 1182 | 송봉해 1183 | 송석찬 1184 | 송업교 1185 | 송영근 1186 | 송영길 1187 | 송영선 1188 | 송영주 1189 | 송영준 1190 | 송영진 1191 | 송용식 1192 | 송우범 1193 | 송원영 1194 | 송을상 1195 | 송지영 1196 | 송진백 1197 | 송창식 1198 | 송천영 1199 | 송필만 1200 | 송한철 1201 | 송현섭 1202 | 송호림 1203 | 송호창 1204 | 송효순 1205 | 송훈석 1206 | 신각휴 1207 | 신건 1208 | 신경림 1209 | 신경민 1210 | 신경설 1211 | 신경식 1212 | 신계륜 1213 | 신광균 1214 | 신광순 1215 | 신국환 1216 | 신권우 1217 | 신규식 1218 | 신기남 1219 | 신기복 1220 | 신기석 1221 | 신기하 1222 | 신낙균 1223 | 신능순 1224 | 신달수 1225 | 신도성 1226 | 신도환 1227 | 신동관 1228 | 신동순 1229 | 신동우 1230 | 신동욱 1231 | 신동준 1232 | 신민선 1233 | 신방현 1234 | 신범식 1235 | 신병열 1236 | 신상식 1237 | 신상우 1238 | 신상진 1239 | 신상철 1240 | 신상초 1241 | 신상학 1242 | 신석빈 1243 | 신성균 1244 | 신성범 1245 | 신순범 1246 | 신영국 1247 | 신영균 1248 | 신영수 1249 | 신영순 1250 | 신영주 1251 | 신오철 1252 | 신옥철 1253 | 신용남 1254 | 신용욱 1255 | 신용훈 1256 | 신원식 1257 | 신윤창 1258 | 신의식 1259 | 신의진 1260 | 신익희 1261 | 신인우 1262 | 신장용 1263 | 신재기 1264 | 신재휴 1265 | 신정호 1266 | 신준원 1267 | 신중목 1268 | 신중식 1269 | 신중하 1270 | 신지호 1271 | 신진수 1272 | 신진욱 1273 | 신철균 1274 | 신태권 1275 | 신하균 1276 | 신하철 1277 | 신학용 1278 | 신행용 1279 | 신현돈 1280 | 신현모 1281 | 신현태 1282 | 신현확 1283 | 신형식 1284 | 심국무 1285 | 심규섭 1286 | 심규철 1287 | 심기섭 1288 | 심길섭 1289 | 심대평 1290 | 심명보 1291 | 심봉섭 1292 | 심상우 1293 | 심상정 1294 | 심완구 1295 | 심윤조 1296 | 심융택 1297 | 심재권 1298 | 심재덕 1299 | 심재엽 1300 | 심재철 1301 | 심정구 1302 | 심종석 1303 | 심학봉 1304 | 심헌섭 1305 | 심현직 1306 | 안갑준 1307 | 안건일 1308 | 안경률 1309 | 안교덕 1310 | 안규백 1311 | 안균섭 1312 | 안대륜 1313 | 안덕기 1314 | 안덕수 1315 | 안동선 1316 | 안동준 1317 | 안만복 1318 | 안명옥 1319 | 안무혁 1320 | 안민석 1321 | 안병규 1322 | 안병엽 1323 | 안상수 1324 | 안상한 1325 | 안상현 1326 | 안영근 1327 | 안영기 1328 | 안영화 1329 | 안용대 1330 | 안용백 1331 | 안재홍 1332 | 안종범 1333 | 안종열 1334 | 안준기 1335 | 안준상 1336 | 안찬희 1337 | 안춘생 1338 | 안택수 1339 | 안형환 1340 | 안호상 1341 | 안홍준 1342 | 안효대 1343 | 안희옥 1344 | 양경자 1345 | 양극필 1346 | 양달승 1347 | 양덕인 1348 | 양문희 1349 | 양병일 1350 | 양병직 1351 | 양성우 1352 | 양성철 1353 | 양순직 1354 | 양승부 1355 | 양승조 1356 | 양영주 1357 | 양우정 1358 | 양일동 1359 | 양재권 1360 | 양재하 1361 | 양정규 1362 | 양정례 1363 | 양찬우 1364 | 양창식 1365 | 양춘근 1366 | 양해준 1367 | 양형일 1368 | 양회수 1369 | 양회영 1370 | 어준선 1371 | 엄경섭 1372 | 엄기표 1373 | 엄대섭 1374 | 엄민영 1375 | 엄병학 1376 | 엄상섭 1377 | 엄영달 1378 | 엄정주 1379 | 엄호성 1380 | 여상규 1381 | 여영복 1382 | 여운홍 1383 | 연병호 1384 | 연제원 1385 | 연주흠 1386 | 염길정 1387 | 염동연 1388 | 염동열 1389 | 염우량 1390 | 예춘호 1391 | 오경의 1392 | 오경훈 1393 | 오기열 1394 | 오범수 1395 | 오병윤 1396 | 오상직 1397 | 오상현 1398 | 오석주 1399 | 오성환 1400 | 오세응 1401 | 오세훈 1402 | 오시덕 1403 | 오양순 1404 | 오영식 1405 | 오용국 1406 | 오용운 1407 | 오원선 1408 | 오위영 1409 | 오유방 1410 | 오의관 1411 | 오장섭 1412 | 오재영 1413 | 오정국 1414 | 오정근 1415 | 오제도 1416 | 오제세 1417 | 오주환 1418 | 오준석 1419 | 오중열 1420 | 오치성 1421 | 오택관 1422 | 오택열 1423 | 오하영 1424 | 오학진 1425 | 오한구 1426 | 오형근 1427 | 오홍석 1428 | 옥만호 1429 | 옥조남 1430 | 왕상은 1431 | 우갑린 1432 | 우돈규 1433 | 우병규 1434 | 우상호 1435 | 우원식 1436 | 우윤근 1437 | 우제창 1438 | 우제항 1439 | 우홍구 1440 | 우희창 1441 | 원광호 1442 | 원세훈 1443 | 원용균 1444 | 원용석 1445 | 원용한 1446 | 원유철 1447 | 원장길 1448 | 원철희 1449 | 원혜영 1450 | 원희룡 1451 | 원희목 1452 | 유기수 1453 | 유기준 1454 | 유기천 1455 | 유기홍 1456 | 유대운 1457 | 유민상 1458 | 유봉순 1459 | 유봉영 1460 | 유삼남 1461 | 유선호 1462 | 유성권 1463 | 유성근 1464 | 유성범 1465 | 유성엽 1466 | 유성환 1467 | 유수현 1468 | 유수호 1469 | 유승민 1470 | 유승우 1471 | 유승준 1472 | 유승희 1473 | 유시민 1474 | 유영준 1475 | 유옥우 1476 | 유용근 1477 | 유용식 1478 | 유용태 1479 | 유원일 1480 | 유은혜 1481 | 유인태 1482 | 유일호 1483 | 유재건 1484 | 유재규 1485 | 유재중 1486 | 유정복 1487 | 유정현 1488 | 유진영 1489 | 유진오 1490 | 유진홍 1491 | 유필우 1492 | 유학성 1493 | 유한열 1494 | 유흥수 1495 | 육완국 1496 | 육인수 1497 | 육홍균 1498 | 윤건영 1499 | 윤경식 1500 | 윤관석 1501 | 윤국노 1502 | 윤금순 1503 | 윤기대 1504 | 윤기섭 1505 | 윤길중 1506 | 윤두환 1507 | 윤만석 1508 | 윤명운 1509 | 윤명희 1510 | 윤병구 1511 | 윤병한 1512 | 윤병호 1513 | 윤보선 1514 | 윤상일 1515 | 윤상현 1516 | 윤석구 1517 | 윤석민 1518 | 윤석순 1519 | 윤석용 1520 | 윤성순 1521 | 윤성한 1522 | 윤여준 1523 | 윤여훈 1524 | 윤영 1525 | 윤영석 1526 | 윤영선 1527 | 윤영탁 1528 | 윤용구 1529 | 윤원중 1530 | 윤원호 1531 | 윤인식 1532 | 윤일상 1533 | 윤재근 1534 | 윤재기 1535 | 윤재명 1536 | 윤재옥 1537 | 윤재욱 1538 | 윤정구 1539 | 윤제술 1540 | 윤종수 1541 | 윤주영 1542 | 윤진식 1543 | 윤천주 1544 | 윤철상 1545 | 윤추섭 1546 | 윤치영 1547 | 윤치형 1548 | 윤태균 1549 | 윤태일 1550 | 윤택중 1551 | 윤한도 1552 | 윤항열 1553 | 윤형남 1554 | 윤호중 1555 | 윤후덕 1556 | 은수미 1557 | 이갑성 1558 | 이갑식 1559 | 이강두 1560 | 이강래 1561 | 이강우 1562 | 이강후 1563 | 이강희 1564 | 이건개 1565 | 이건영 1566 | 이건일 1567 | 이건호 1568 | 이경숙 1569 | 이경재 1570 | 이경호 1571 | 이계경 1572 | 이계안 1573 | 이계진 1574 | 이관형 1575 | 이광노 1576 | 이광재 1577 | 이광철 1578 | 이교선 1579 | 이교성 1580 | 이교승 1581 | 이구수 1582 | 이국헌 1583 | 이군현 1584 | 이규갑 1585 | 이규영 1586 | 이규정 1587 | 이규택 1588 | 이근식 1589 | 이근진 1590 | 이긍규 1591 | 이긍종 1592 | 이기문 1593 | 이기붕 1594 | 이기빈 1595 | 이기우 1596 | 이기택 1597 | 이길범 1598 | 이길재 1599 | 이낙연 1600 | 이낙훈 1601 | 이남규 1602 | 이남준 1603 | 이노근 1604 | 이달곤 1605 | 이대순 1606 | 이대엽 1607 | 이대우 1608 | 이덕모 1609 | 이덕호 1610 | 이도선 1611 | 이도영 1612 | 이도환 1613 | 이돈만 1614 | 이돈해 1615 | 이동근 1616 | 이동녕 1617 | 이동복 1618 | 이동원 1619 | 이동진 1620 | 이동환 1621 | 이두아 1622 | 이만근 1623 | 이만섭 1624 | 이만우 1625 | 이만재 1626 | 이매리 1627 | 이명규 1628 | 이명박 1629 | 이명수 1630 | 이명춘 1631 | 이목희 1632 | 이무영 1633 | 이문원 1634 | 이미경 1635 | 이민섭 1636 | 이민우 1637 | 이민헌 1638 | 이방호 1639 | 이백일 1640 | 이범관 1641 | 이범교 1642 | 이범래 1643 | 이범석 1644 | 이범승 1645 | 이범준 1646 | 이병관 1647 | 이병국 1648 | 이병석 1649 | 이병옥 1650 | 이병용 1651 | 이병주 1652 | 이병직 1653 | 이병하 1654 | 이병헌 1655 | 이병홍 1656 | 이병희 1657 | 이복성 1658 | 이봉모 1659 | 이부영 1660 | 이사철 1661 | 이사형 1662 | 이상경 1663 | 이상권 1664 | 이상규 1665 | 이상돈 1666 | 이상두 1667 | 이상득 1668 | 이상락 1669 | 이상만 1670 | 이상면 1671 | 이상무 1672 | 이상민 1673 | 이상배 1674 | 이상선 1675 | 이상수 1676 | 이상신 1677 | 이상열 1678 | 이상옥 1679 | 이상용 1680 | 이상익 1681 | 이상일 1682 | 이상재 1683 | 이상조 1684 | 이상직 1685 | 이상철 1686 | 이상하 1687 | 이상현 1688 | 이상회 1689 | 이상희 1690 | 이석 1691 | 이석기 1692 | 이석용 1693 | 이석제 1694 | 이석주 1695 | 이석현 1696 | 이성구 1697 | 이성권 1698 | 이성규 1699 | 이성근 1700 | 이성남 1701 | 이성득 1702 | 이성배 1703 | 이성수 1704 | 이성열 1705 | 이성우 1706 | 이성일 1707 | 이성재 1708 | 이성주 1709 | 이성학 1710 | 이성헌 1711 | 이성호 1712 | 이세규 1713 | 이세기 1714 | 이수담 1715 | 이수인 1716 | 이수종 1717 | 이숙종 1718 | 이순재 1719 | 이순희 1720 | 이승만 1721 | 이승무 1722 | 이승복 1723 | 이승윤 1724 | 이승철 1725 | 이승춘 1726 | 이승희 1727 | 이시목 1728 | 이시종 1729 | 이신범 1730 | 이신행 1731 | 이애주 1732 | 이양우 1733 | 이양호 1734 | 이양희 1735 | 이언주 1736 | 이에리사 1737 | 이연석 1738 | 이연숙 1739 | 이영권 1740 | 이영근 1741 | 이영문 1742 | 이영섭 1743 | 이영순 1744 | 이영애 1745 | 이영언 1746 | 이영욱 1747 | 이영일 1748 | 이영준 1749 | 이영진 1750 | 이영창 1751 | 이영표 1752 | 이영호 1753 | 이영희 1754 | 이옥동 1755 | 이완구 1756 | 이완영 1757 | 이요한 1758 | 이용경 1759 | 이용곤 1760 | 이용범 1761 | 이용삼 1762 | 이용설 1763 | 이용섭 1764 | 이용준 1765 | 이용택 1766 | 이용호 1767 | 이용훈 1768 | 이용희 1769 | 이우재 1770 | 이우정 1771 | 이우줄 1772 | 이우태 1773 | 이우헌 1774 | 이우현 1775 | 이웅희 1776 | 이원만 1777 | 이원배 1778 | 이원범 1779 | 이원복 1780 | 이원성 1781 | 이원엽 1782 | 이원영 1783 | 이원우 1784 | 이원욱 1785 | 이원장 1786 | 이원조 1787 | 이원창 1788 | 이원형 1789 | 이원홍 1790 | 이유선 1791 | 이윤기 1792 | 이윤석 1793 | 이윤성 1794 | 이윤수 1795 | 이윤영 1796 | 이윤용 1797 | 이윤자 1798 | 이윤학 1799 | 이은영 1800 | 이은재 1801 | 이은태 1802 | 이응선 1803 | 이의상 1804 | 이의영 1805 | 이의익 1806 | 이이재 1807 | 이익흥 1808 | 이인 1809 | 이인구 1810 | 이인근 1811 | 이인기 1812 | 이인영 1813 | 이인제 1814 | 이자스민 1815 | 이자헌 1816 | 이장우 1817 | 이장희 1818 | 이재균 1819 | 이재근 1820 | 이재만 1821 | 이재명 1822 | 이재선 1823 | 이재연 1824 | 이재영 1825 | 이재오 1826 | 이재옥 1827 | 이재우 1828 | 이재웅 1829 | 이재정 1830 | 이재창 1831 | 이재학 1832 | 이재현 1833 | 이재형 1834 | 이재환 1835 | 이재황 1836 | 이정기 1837 | 이정래 1838 | 이정무 1839 | 이정빈 1840 | 이정석 1841 | 이정선 1842 | 이정식 1843 | 이정우 1844 | 이정원 1845 | 이정일 1846 | 이정현 1847 | 이정휴 1848 | 이정희 1849 | 이존화 1850 | 이종걸 1851 | 이종구 1852 | 이종극 1853 | 이종근 1854 | 이종남 1855 | 이종률 1856 | 이종린 1857 | 이종성 1858 | 이종수 1859 | 이종순 1860 | 이종식 1861 | 이종영 1862 | 이종우 1863 | 이종욱 1864 | 이종율 1865 | 이종준 1866 | 이종진 1867 | 이종찬 1868 | 이종혁 1869 | 이종현 1870 | 이종훈 1871 | 이주영 1872 | 이주형 1873 | 이주호 1874 | 이준섭 1875 | 이중재 1876 | 이중희 1877 | 이진구 1878 | 이진복 1879 | 이진삼 1880 | 이진수 1881 | 이진연 1882 | 이진용 1883 | 이진우 1884 | 이진희 1885 | 이찬구 1886 | 이찬열 1887 | 이찬우 1888 | 이찬진 1889 | 이찬혁 1890 | 이창복 1891 | 이채오 1892 | 이채익 1893 | 이철승 1894 | 이철용 1895 | 이철우 1896 | 이철희 1897 | 이춘구 1898 | 이춘기 1899 | 이춘석 1900 | 이춘식 1901 | 이충환 1902 | 이치호 1903 | 이태구 1904 | 이태섭 1905 | 이태용 1906 | 이택돈 1907 | 이택석 1908 | 이택희 1909 | 이판열 1910 | 이필선 1911 | 이필우 1912 | 이필호 1913 | 이학림 1914 | 이학만 1915 | 이학봉 1916 | 이학영 1917 | 이학원 1918 | 이학재 1919 | 이한구 1920 | 이한동 1921 | 이한성 1922 | 이한정 1923 | 이한창 1924 | 이항발 1925 | 이해구 1926 | 이해랑 1927 | 이해봉 1928 | 이해원 1929 | 이해찬 1930 | 이행구 1931 | 이헌기 1932 | 이헌승 1933 | 이현수 1934 | 이현재 1935 | 이협우 1936 | 이형모 1937 | 이형배 1938 | 이형우 1939 | 이형진 1940 | 이혜훈 1941 | 이호근 1942 | 이호동 1943 | 이호범 1944 | 이호석 1945 | 이호웅 1946 | 이호정 1947 | 이호종 1948 | 이홍구 1949 | 이홍배 1950 | 이화수 1951 | 이화영 1952 | 이환의 1953 | 이회창 1954 | 이효상 1955 | 이효익 1956 | 이후락 1957 | 이훈구 1958 | 이훈평 1959 | 이흥수 1960 | 이희규 1961 | 이희승 1962 | 이희일 1963 | 이희천 1964 | 인재근 1965 | 인태식 1966 | 임갑수 1967 | 임기봉 1968 | 임기태 1969 | 임내현 1970 | 임덕규 1971 | 임동규 1972 | 임두빈 1973 | 임두성 1974 | 임무웅 1975 | 임문석 1976 | 임방현 1977 | 임병수 1978 | 임복진 1979 | 임사빈 1980 | 임석규 1981 | 임수경 1982 | 임영득 1983 | 임영신 1984 | 임영호 1985 | 임용순 1986 | 임우영 1987 | 임인규 1988 | 임인배 1989 | 임인채 1990 | 임재정 1991 | 임종기 1992 | 임종석 1993 | 임종인 1994 | 임진출 1995 | 임차주 1996 | 임채정 1997 | 임채홍 1998 | 임철순 1999 | 임철호 2000 | 임춘원 2001 | 임충식 2002 | 임태희 2003 | 임해규 2004 | 임흥순 2005 | 장건상 2006 | 장경근 2007 | 장경모 2008 | 장경수 2009 | 장경순 2010 | 장경우 2011 | 장광근 2012 | 장기선 2013 | 장기영 2014 | 장기욱 2015 | 장덕진 2016 | 장동식 2017 | 장면 2018 | 장병만 2019 | 장병완 2020 | 장복심 2021 | 장석윤 2022 | 장석화 2023 | 장성만 2024 | 장성민 2025 | 장성원 2026 | 장세환 2027 | 장승태 2028 | 장연송 2029 | 장영근 2030 | 장영달 2031 | 장영순 2032 | 장영신 2033 | 장영철 2034 | 장윤석 2035 | 장을병 2036 | 장익현 2037 | 장재식 2038 | 장정곤 2039 | 장정언 2040 | 장제원 2041 | 장준익 2042 | 장준하 2043 | 장준한 2044 | 장지량 2045 | 장창국 2046 | 장춘근 2047 | 장충준 2048 | 장치훈 2049 | 장태완 2050 | 장택상 2051 | 장하나 2052 | 장향숙 2053 | 장홍염 2054 | 전갑길 2055 | 전만중 2056 | 전병우 2057 | 전병헌 2058 | 전부일 2059 | 전상요 2060 | 전석봉 2061 | 전석홍 2062 | 전순옥 2063 | 전여옥 2064 | 전영석 2065 | 전용순 2066 | 전용원 2067 | 전용학 2068 | 전재구 2069 | 전재희 2070 | 전정구 2071 | 전정희 2072 | 전종천 2073 | 전진한 2074 | 전하진 2075 | 전해철 2076 | 전현희 2077 | 전형산 2078 | 전혜숙 2079 | 전휴상 2080 | 정간용 2081 | 정갑윤 2082 | 정갑주 2083 | 정광호 2084 | 정구삼 2085 | 정구영 2086 | 정구중 2087 | 정국교 2088 | 정규상 2089 | 정규헌 2090 | 정균식 2091 | 정균환 2092 | 정긍모 2093 | 정기영 2094 | 정기원 2095 | 정기호 2096 | 정길영 2097 | 정낙필 2098 | 정낙훈 2099 | 정남국 2100 | 정남규 2101 | 정남택 2102 | 정대천 2103 | 정대철 2104 | 정덕구 2105 | 정도영 2106 | 정동성 2107 | 정동영 2108 | 정동윤 2109 | 정동채 2110 | 정동호 2111 | 정두언 2112 | 정래정 2113 | 정래혁 2114 | 정명선 2115 | 정명섭 2116 | 정몽준 2117 | 정무식 2118 | 정문갑 2119 | 정문채 2120 | 정문헌 2121 | 정문화 2122 | 정문흠 2123 | 정미경 2124 | 정범구 2125 | 정병국 2126 | 정병학 2127 | 정복향 2128 | 정봉주 2129 | 정상구 2130 | 정상열 2131 | 정상용 2132 | 정상천 2133 | 정상희 2134 | 정석모 2135 | 정선호 2136 | 정성태 2137 | 정성호 2138 | 정세균 2139 | 정세환 2140 | 정수성 2141 | 정순덕 2142 | 정순응 2143 | 정순조 2144 | 정시봉 2145 | 정시채 2146 | 정양석 2147 | 정양숙 2148 | 정영훈 2149 | 정영희 2150 | 정옥순 2151 | 정옥임 2152 | 정우식 2153 | 정우일 2154 | 정우택 2155 | 정운갑 2156 | 정운근 2157 | 정원민 2158 | 정의용 2159 | 정의화 2160 | 정인봉 2161 | 정인소 2162 | 정인식 2163 | 정일권 2164 | 정일영 2165 | 정일형 2166 | 정장선 2167 | 정장현 2168 | 정재문 2169 | 정재완 2170 | 정재원 2171 | 정재철 2172 | 정재호 2173 | 정정훈 2174 | 정존수 2175 | 정종복 2176 | 정종택 2177 | 정주영 2178 | 정주일 2179 | 정준모 2180 | 정준현 2181 | 정중섭 2182 | 정직래 2183 | 정진근 2184 | 정진길 2185 | 정진동 2186 | 정진석 2187 | 정진섭 2188 | 정진화 2189 | 정진후 2190 | 정창현 2191 | 정창화 2192 | 정철기 2193 | 정청래 2194 | 정태근 2195 | 정태성 2196 | 정태영 2197 | 정판국 2198 | 정필근 2199 | 정하균 2200 | 정한용 2201 | 정해걸 2202 | 정해남 2203 | 정해영 2204 | 정해준 2205 | 정헌조 2206 | 정헌주 2207 | 정현경 2208 | 정현모 2209 | 정형근 2210 | 정호근 2211 | 정호선 2212 | 정호용 2213 | 정호준 2214 | 정화원 2215 | 정휘동 2216 | 정희경 2217 | 정희섭 2218 | 정희수 2219 | 정희채 2220 | 정희택 2221 | 제정구 2222 | 제종길 2223 | 제헌국회 2224 | 조경규 2225 | 조경목 2226 | 조경태 2227 | 조경한 2228 | 조광섭 2229 | 조광희 2230 | 조국현 2231 | 조규갑 2232 | 조규설 2233 | 조규완 2234 | 조규창 2235 | 조기상 2236 | 조남수 2237 | 조남욱 2238 | 조남조 2239 | 조남철 2240 | 조대연 2241 | 조덕현 2242 | 조만종 2243 | 조만후 2244 | 조명철 2245 | 조명환 2246 | 조문환 2247 | 조배숙 2248 | 조병규 2249 | 조병문 2250 | 조병봉 2251 | 조병옥 2252 | 조병한 2253 | 조봉암 2254 | 조부영 2255 | 조상래 2256 | 조상현 2257 | 조상호 2258 | 조성래 2259 | 조성준 2260 | 조성태 2261 | 조세형 2262 | 조소앙 2263 | 조순승 2264 | 조순형 2265 | 조순환 2266 | 조승수 2267 | 조승형 2268 | 조시원 2269 | 조시형 2270 | 조연하 2271 | 조영규 2272 | 조영수 2273 | 조영장 2274 | 조영재 2275 | 조영택 2276 | 조옥현 2277 | 조용직 2278 | 조웅규 2279 | 조원진 2280 | 조윤선 2281 | 조윤형 2282 | 조익현 2283 | 조일문 2284 | 조일재 2285 | 조일제 2286 | 조일현 2287 | 조일환 2288 | 조재면 2289 | 조재봉 2290 | 조재천 2291 | 조재환 2292 | 조전혁 2293 | 조정구 2294 | 조정무 2295 | 조정식 2296 | 조정제 2297 | 조정훈 2298 | 조종석 2299 | 조종승 2300 | 조종익 2301 | 조종호 2302 | 조주영 2303 | 조주형 2304 | 조중연 2305 | 조중현 2306 | 조진래 2307 | 조진형 2308 | 조찬형 2309 | 조창대 2310 | 조철구 2311 | 조한백 2312 | 조한천 2313 | 조해진 2314 | 조헌수 2315 | 조헌영 2316 | 조현룡 2317 | 조형부 2318 | 조홍규 2319 | 조홍래 2320 | 조흥만 2321 | 조희욱 2322 | 조희철 2323 | 주광덕 2324 | 주금용 2325 | 주기용 2326 | 주도윤 2327 | 주병환 2328 | 주성영 2329 | 주승용 2330 | 주양자 2331 | 주영관 2332 | 주영순 2333 | 주요한 2334 | 주진우 2335 | 주호영 2336 | 지갑종 2337 | 지대섭 2338 | 지병문 2339 | 지연태 2340 | 지연해 2341 | 지영진 2342 | 지정도 2343 | 지종걸 2344 | 지청천 2345 | 진경탁 2346 | 진기배 2347 | 진석중 2348 | 진선미 2349 | 진성준 2350 | 진성호 2351 | 진수희 2352 | 진영 2353 | 진의종 2354 | 진직현 2355 | 진치범 2356 | 진헌식 2357 | 진형하 2358 | 차경모 2359 | 차명진 2360 | 차수명 2361 | 차지철 2362 | 차형근 2363 | 차화준 2364 | 참의원 2365 | 채문식 2366 | 채수찬 2367 | 채영석 2368 | 채영철 2369 | 채일병 2370 | 천명기 2371 | 천병규 2372 | 천세기 2373 | 천영성 2374 | 천영세 2375 | 천용택 2376 | 천정배 2377 | 최각규 2378 | 최갑환 2379 | 최경록 2380 | 최경식 2381 | 최경환 2382 | 최경희 2383 | 최구식 2384 | 최국현 2385 | 최규남 2386 | 최규성 2387 | 최규식 2388 | 최규옥 2389 | 최기선 2390 | 최달희 2391 | 최대현 2392 | 최돈웅 2393 | 최동익 2394 | 최두고 2395 | 최두환 2396 | 최락도 2397 | 최락철 2398 | 최면수 2399 | 최명헌 2400 | 최무룡 2401 | 최문순 2402 | 최민희 2403 | 최범술 2404 | 최병국 2405 | 최병권 2406 | 최병길 2407 | 최병렬 2408 | 최병욱 2409 | 최병주 2410 | 최봉구 2411 | 최봉식 2412 | 최봉홍 2413 | 최상업 2414 | 최상용 2415 | 최상진 2416 | 최상채 2417 | 최서일 2418 | 최석림 2419 | 최석홍 2420 | 최석화 2421 | 최선영 2422 | 최성석 2423 | 최성욱 2424 | 최성웅 2425 | 최세경 2426 | 최수용 2427 | 최수환 2428 | 최순영 2429 | 최순주 2430 | 최연희 2431 | 최영근 2432 | 최영덕 2433 | 최영두 2434 | 최영철 2435 | 최영한 2436 | 최영희 2437 | 최용규 2438 | 최용근 2439 | 최용수 2440 | 최용안 2441 | 최우근 2442 | 최욱철 2443 | 최운교 2444 | 최운지 2445 | 최원봉 2446 | 최원수 2447 | 최원식 2448 | 최원호 2449 | 최윤동 2450 | 최윤호 2451 | 최이호 2452 | 최익규 2453 | 최인규 2454 | 최인기 2455 | 최재구 2456 | 최재성 2457 | 최재승 2458 | 최재욱 2459 | 최재천 2460 | 최정기 2461 | 최정식 2462 | 최종성 2463 | 최종원 2464 | 최주일 2465 | 최준길 2466 | 최창규 2467 | 최창섭 2468 | 최창윤 2469 | 최철국 2470 | 최치환 2471 | 최태규 2472 | 최태능 2473 | 최태호 2474 | 최하영 2475 | 최해용 2476 | 최헌길 2477 | 최형우 2478 | 최희송 2479 | 최희준 2480 | 추미애 2481 | 태완선 2482 | 편용호 2483 | 편정희 2484 | 표양문 2485 | 표현태 2486 | 하경근 2487 | 하근수 2488 | 하대돈 2489 | 하만복 2490 | 하상훈 2491 | 하순봉 2492 | 하을춘 2493 | 하태경 2494 | 하태환 2495 | 한갑수 2496 | 한건수 2497 | 한광석 2498 | 한광옥 2499 | 한광원 2500 | 한국원 2501 | 한근조 2502 | 한기춘 2503 | 한기호 2504 | 한동석 2505 | 한명숙 2506 | 한병기 2507 | 한병도 2508 | 한병채 2509 | 한상준 2510 | 한석범 2511 | 한석봉 2512 | 한선교 2513 | 한승수 2514 | 한암회 2515 | 한양순 2516 | 한영수 2517 | 한영애 2518 | 한옥신 2519 | 한원석 2520 | 한이헌 2521 | 한정애 2522 | 한종건 2523 | 한충수 2524 | 한태연 2525 | 한태일 2526 | 한통숙 2527 | 한필수 2528 | 한호선 2529 | 한화갑 2530 | 한희석 2531 | 함덕용 2532 | 함두영 2533 | 함명수 2534 | 함석재 2535 | 함승희 2536 | 함재훈 2537 | 함종빈 2538 | 함종한 2539 | 함진규 2540 | 허경구 2541 | 허경만 2542 | 허남훈 2543 | 허대범 2544 | 허만기 2545 | 허무인 2546 | 허범도 2547 | 허삼수 2548 | 허세욱 2549 | 허영호 2550 | 허운나 2551 | 허원제 2552 | 허윤수 2553 | 허재홍 2554 | 허천 2555 | 허청일 2556 | 허태열 2557 | 허화평 2558 | 현경대 2559 | 현경병 2560 | 현경자 2561 | 현기순 2562 | 현기환 2563 | 현석호 2564 | 현승일 2565 | 현애자 2566 | 현영희 2567 | 현오봉 2568 | 현정주 2569 | 현홍주 2570 | 홍광표 2571 | 홍기훈 2572 | 홍길선 2573 | 홍문종 2574 | 홍문중 2575 | 홍문표 2576 | 홍미영 2577 | 홍범희 2578 | 홍병각 2579 | 홍병철 2580 | 홍봉진 2581 | 홍사덕 2582 | 홍성우 2583 | 홍성표 2584 | 홍성하 2585 | 홍세기 2586 | 홍순영 2587 | 홍순옥 2588 | 홍순철 2589 | 홍순희 2590 | 홍승만 2591 | 홍승업 2592 | 홍영기 2593 | 홍영표 2594 | 홍용준 2595 | 홍우준 2596 | 홍의락 2597 | 홍익표 2598 | 홍인길 2599 | 홍일표 2600 | 홍장표 2601 | 홍재형 2602 | 홍정욱 2603 | 홍정표 2604 | 홍종욱 2605 | 홍종학 2606 | 홍준표 2607 | 홍지만 2608 | 홍창선 2609 | 홍창섭 2610 | 홍춘식 2611 | 홍희덕 2612 | 홍희종 2613 | 홍희표 2614 | 황경수 2615 | 황규선 2616 | 황낙주 2617 | 황남팔 2618 | 황대봉 2619 | 황두연 2620 | 황명수 2621 | 황병규 2622 | 황병우 2623 | 황병준 2624 | 황병태 2625 | 황산성 2626 | 황성균 2627 | 황성수 2628 | 황숙현 2629 | 황승민 2630 | 황영철 2631 | 황우여 2632 | 황윤기 2633 | 황윤호 2634 | 황은환 2635 | 황의성 2636 | 황인성 2637 | 황인원 2638 | 황재홍 2639 | 황종율 2640 | 황주홍 2641 | 황진하 2642 | 황창주 2643 | 황철수 2644 | 황학성 2645 | 황학수 2646 | 황한수 2647 | 황호동 2648 | 황호영 2649 | 황호현 2650 | -------------------------------------------------------------------------------- /tutorials/usage_of_templatetagger.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "## KoNLPy.Twitter" 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "KoNLPy의 [트위터 한국어 분석기][twitterlink] ([현 오픈 한국어 분석기][openlink])는 속도도 빠르고 다양한 사전도 확보하고 있는 한국어 분석기입니다. 하지만 컴파일이 되어 있는 형태로 KoNLPy에 들어가 있기 때문에 사용자 사전의 추가가 힘들고\\*, 내가 원하는 임의의 태그를 지정할 수 없습니다. \n", 15 | "\n", 16 | "customized_KoNLPy는 확실히 알고 있는 단어들에 대해서는 라이브러리를 거치지 않고 주어진 어절을 아는 단어들로 토크나이징 / 품사판별을 하는 기능을 제공합니다. 이를 위해 template 기반 토크나이징을 수행합니다. \n", 17 | "\n", 18 | " 사전: {'아이오아이': 'Noun', '는': 'Josa'}\n", 19 | " 탬플릿: Noun + Josa\n", 20 | " \n", 21 | "위와 같은 단어 리스트와 탬플릿이 있다면 '아이오아이는' 이라는 어절은 [('아이오아이', 'Noun'), ('는', 'Josa')]로 분리됩니다. \n", 22 | "\n", 23 | "\\* Scala 코드를 이용할 경우에는 사용자 사전의 추가가 매우 쉽습니다 [참고][openlink]\n", 24 | "\n", 25 | "[twitterlink]: https://github.com/twitter/twitter-korean-text\n", 26 | "[openlink]: https://github.com/open-korean-text/open-korean-text" 27 | ] 28 | }, 29 | { 30 | "cell_type": "markdown", 31 | "metadata": {}, 32 | "source": [ 33 | "KoNLPy의 버전은 0.4.4 기준입니다. KoNLPy의 Twitter를 이용하여 '우리아이오아이는 정말 이뻐요'라는 문장을 처리하면 '아이오' + '아이'로 명사가 잘못 인식됩니다. 트와이스의 'tt' 역시 명사보다는 영어로 인식됩니다. 한국어 분석기 이지만, tt는 명사로 미리 분류하고 싶습니다. " 34 | ] 35 | }, 36 | { 37 | "cell_type": "code", 38 | "execution_count": 1, 39 | "metadata": {}, 40 | "outputs": [ 41 | { 42 | "data": { 43 | "text/plain": [ 44 | "'0.4.4'" 45 | ] 46 | }, 47 | "execution_count": 1, 48 | "metadata": {}, 49 | "output_type": "execute_result" 50 | } 51 | ], 52 | "source": [ 53 | "from pprint import pprint\n", 54 | "import konlpy\n", 55 | "konlpy.__version__" 56 | ] 57 | }, 58 | { 59 | "cell_type": "code", 60 | "execution_count": 2, 61 | "metadata": {}, 62 | "outputs": [ 63 | { 64 | "name": "stdout", 65 | "output_type": "stream", 66 | "text": [ 67 | "[('우리', 'Noun'), ('아이오', 'Noun'), ('아이', 'Noun'), ('는', 'Josa'), ('정말', 'Noun'), ('이뻐', 'Adjective'), ('요', 'Eomi')] \n", 68 | "\n", 69 | "[('트', 'Noun'), ('둥이', 'Noun'), ('꺼', 'Suffix'), ('tt', 'Alpha'), ('도', 'Noun'), ('좋', 'Adjective'), ('아요', 'Eomi')]\n" 70 | ] 71 | } 72 | ], 73 | "source": [ 74 | "from konlpy.tag import Twitter as OriginalTwitter\n", 75 | "\n", 76 | "twitter_original = OriginalTwitter()\n", 77 | "print(twitter_original.pos('우리아이오아이는 정말 이뻐요'),'\\n')\n", 78 | "print(twitter_original.pos('트둥이꺼 tt도 좋아요'))" 79 | ] 80 | }, 81 | { 82 | "cell_type": "markdown", 83 | "metadata": {}, 84 | "source": [ 85 | "customized_KoNLPy 에는 현재 트위터 한국어 분석기 만을 이용하는 wrapping class만 제공되고 있습니다. customized_KoNLPy의 Twitter는 본래 KoNLPy의 tag에 추가되는 함수가 있습니다. \n", 86 | "\n", 87 | "Twitter.add_dictionary(words, tag)는 사용자가 사전을 추가할 수 있는 부분입니다. 단어를 하나씩 추가할 수 있습니다. 추가한 뒤 Twitter의 숨김 변수인 \\_dictionary.\\_pos2words를 확인해보면 입력한 단어들을 볼 수 있습니다. " 88 | ] 89 | }, 90 | { 91 | "cell_type": "markdown", 92 | "metadata": {}, 93 | "source": [ 94 | "## ckonlpy.Twitter\n", 95 | "\n", 96 | "### Add word to custom-dictionary" 97 | ] 98 | }, 99 | { 100 | "cell_type": "markdown", 101 | "metadata": {}, 102 | "source": [ 103 | "git clone을 한 상태에서 tutorial code를 이용하신다면 아래의 코드를 실행하여 path를 추가하십시요" 104 | ] 105 | }, 106 | { 107 | "cell_type": "code", 108 | "execution_count": 3, 109 | "metadata": { 110 | "collapsed": true 111 | }, 112 | "outputs": [], 113 | "source": [ 114 | "import sys\n", 115 | "sys.path.insert(0, '../')" 116 | ] 117 | }, 118 | { 119 | "cell_type": "code", 120 | "execution_count": 4, 121 | "metadata": {}, 122 | "outputs": [ 123 | { 124 | "name": "stdout", 125 | "output_type": "stream", 126 | "text": [ 127 | "{'Josa': {'는', '은'},\n", 128 | " 'Modifier': {'이번', '우리', '이'},\n", 129 | " 'Noun': {'아이', '번것', '행사', '아이오아이', '것'}}\n" 130 | ] 131 | } 132 | ], 133 | "source": [ 134 | "from ckonlpy.tag import Twitter\n", 135 | "\n", 136 | "# use_twitter_dictionary 의 default 는 True 입니다.\n", 137 | "twitter = Twitter(use_twitter_dictionary=False)\n", 138 | "\n", 139 | "twitter.add_dictionary('이', 'Modifier')\n", 140 | "twitter.add_dictionary('우리', 'Modifier')\n", 141 | "twitter.add_dictionary('이번', 'Modifier')\n", 142 | "twitter.add_dictionary('아이오아이', 'Noun')\n", 143 | "twitter.add_dictionary('행사', 'Noun')\n", 144 | "twitter.add_dictionary('아이', 'Noun')\n", 145 | "twitter.add_dictionary('번것', 'Noun')\n", 146 | "twitter.add_dictionary('것', 'Noun')\n", 147 | "twitter.add_dictionary('은', 'Josa')\n", 148 | "twitter.add_dictionary('는', 'Josa')\n", 149 | "\n", 150 | "if twitter._loaded_twitter_default_dictionary:\n", 151 | " pprint(twitter._dictionary._pos2words.keys())\n", 152 | "else:\n", 153 | " pprint(twitter._dictionary._pos2words)" 154 | ] 155 | }, 156 | { 157 | "cell_type": "markdown", 158 | "metadata": {}, 159 | "source": [ 160 | "사전을 추가한 뒤, '아이오아이'가 명사로 제대로 인식됨을 확인할 수 있습니다. " 161 | ] 162 | }, 163 | { 164 | "cell_type": "code", 165 | "execution_count": 5, 166 | "metadata": {}, 167 | "outputs": [ 168 | { 169 | "data": { 170 | "text/plain": [ 171 | "[('우리', 'Modifier'),\n", 172 | " ('아이오아이', 'Noun'),\n", 173 | " ('는', 'Josa'),\n", 174 | " ('정말', 'Noun'),\n", 175 | " ('이뻐', 'Adjective'),\n", 176 | " ('요', 'Eomi')]" 177 | ] 178 | }, 179 | "execution_count": 5, 180 | "metadata": {}, 181 | "output_type": "execute_result" 182 | } 183 | ], 184 | "source": [ 185 | "twitter.pos('우리아이오아이는 정말 이뻐요')" 186 | ] 187 | }, 188 | { 189 | "cell_type": "code", 190 | "execution_count": 6, 191 | "metadata": {}, 192 | "outputs": [ 193 | { 194 | "data": { 195 | "text/plain": [ 196 | "[('아이오아이', 'Noun'), ('이뻐', 'Adjective'), ('요', 'Eomi')]" 197 | ] 198 | }, 199 | "execution_count": 6, 200 | "metadata": {}, 201 | "output_type": "execute_result" 202 | } 203 | ], 204 | "source": [ 205 | "twitter.pos('아이오아이 이뻐요')" 206 | ] 207 | }, 208 | { 209 | "cell_type": "markdown", 210 | "metadata": {}, 211 | "source": [ 212 | "사전을 추가할 때, 하나의 품사에 대하여 동시에 여러 개의 단어셋을 입력할 수도 있습니다.\n", 213 | "\n", 214 | "Twitter.add_dictionary(words, tag)는 한번에 list of str 형식의 여러 개의 단어들을 입력할 수도 있습니다. " 215 | ] 216 | }, 217 | { 218 | "cell_type": "code", 219 | "execution_count": 7, 220 | "metadata": {}, 221 | "outputs": [ 222 | { 223 | "name": "stdout", 224 | "output_type": "stream", 225 | "text": [ 226 | "{'Josa': {'는', '은'},\n", 227 | " 'Modifier': {'이번', '우리', '이'},\n", 228 | " 'Noun': {'아이', '번것', '꺼', '트둥이', 'tt', '행사', '아이오아이', '것', '우리', '트와이스'}}\n" 229 | ] 230 | } 231 | ], 232 | "source": [ 233 | "twitter.add_dictionary(['트와이스', 'tt', '트둥이', '꺼', '우리'], 'Noun')\n", 234 | "pprint(twitter._dictionary._pos2words)" 235 | ] 236 | }, 237 | { 238 | "cell_type": "code", 239 | "execution_count": 8, 240 | "metadata": {}, 241 | "outputs": [ 242 | { 243 | "data": { 244 | "text/plain": [ 245 | "[('트와이스', 'Noun'),\n", 246 | " ('tt', 'Noun'),\n", 247 | " ('는', 'Josa'),\n", 248 | " ('좋', 'Adjective'),\n", 249 | " ('아요', 'Eomi')]" 250 | ] 251 | }, 252 | "execution_count": 8, 253 | "metadata": {}, 254 | "output_type": "execute_result" 255 | } 256 | ], 257 | "source": [ 258 | "twitter.pos('트와이스tt는 좋아요')" 259 | ] 260 | }, 261 | { 262 | "cell_type": "markdown", 263 | "metadata": {}, 264 | "source": [ 265 | "### Use KoNLPy.Twitter dictionary" 266 | ] 267 | }, 268 | { 269 | "cell_type": "markdown", 270 | "metadata": {}, 271 | "source": [ 272 | "트위터 분석기의 조사사전을 이용할 수도 있습니다. Twitter()를 만들 때 argument를 넣을 수 있습니다. " 273 | ] 274 | }, 275 | { 276 | "cell_type": "code", 277 | "execution_count": 9, 278 | "metadata": {}, 279 | "outputs": [ 280 | { 281 | "data": { 282 | "text/plain": [ 283 | "512" 284 | ] 285 | }, 286 | "execution_count": 9, 287 | "metadata": {}, 288 | "output_type": "execute_result" 289 | } 290 | ], 291 | "source": [ 292 | "twitter1 = Twitter(use_twitter_dictionary=True)\n", 293 | "len(twitter1._dictionary._pos2words['Josa'])" 294 | ] 295 | }, 296 | { 297 | "cell_type": "markdown", 298 | "metadata": {}, 299 | "source": [ 300 | "하지만 아직 '우리트둥이꺼tt는' 이라는 어절이 제대로 인식되지 않습니다. 그 이유는 templates에 'Noun + Noun + Josa'가 없었기 때문입니다. 이 경우에는 KoNLPy에 해당 어절을 분석하라고 보냅니다. 하지만 '트둥이'라는 단어를 알지 못해서 제대로 인식되지 않습니다. " 301 | ] 302 | }, 303 | { 304 | "cell_type": "code", 305 | "execution_count": 10, 306 | "metadata": {}, 307 | "outputs": [ 308 | { 309 | "data": { 310 | "text/plain": [ 311 | "[('우', 'Adverb'),\n", 312 | " ('리트', 'Noun'),\n", 313 | " ('둥이', 'Noun'),\n", 314 | " ('꺼', 'Suffix'),\n", 315 | " ('tt', 'Alpha'),\n", 316 | " ('는', 'Verb'),\n", 317 | " ('좋', 'Adjective'),\n", 318 | " ('아요', 'Eomi')]" 319 | ] 320 | }, 321 | "execution_count": 10, 322 | "metadata": {}, 323 | "output_type": "execute_result" 324 | } 325 | ], 326 | "source": [ 327 | "twitter.pos('우리트둥이꺼tt는 좋아요')" 328 | ] 329 | }, 330 | { 331 | "cell_type": "markdown", 332 | "metadata": {}, 333 | "source": [ 334 | "### Template\n", 335 | "현재는 customized_tagger로 탬플릿 기반 토크나이저를 이용하고 있습니다. 어떤 탬플릿이 들어있는지 확인하기 위해서는 아래 부분을 확인하면 됩니다. \n", 336 | "\n", 337 | " twitter._customized_tagger.templates\n", 338 | " \n", 339 | "현재는 다음의 탬플릿이 입력되어 있습니다. " 340 | ] 341 | }, 342 | { 343 | "cell_type": "code", 344 | "execution_count": 11, 345 | "metadata": {}, 346 | "outputs": [ 347 | { 348 | "data": { 349 | "text/plain": [ 350 | "[('Noun',),\n", 351 | " ('Noun', 'Noun'),\n", 352 | " ('Noun', 'Josa'),\n", 353 | " ('Noun', 'Josa', 'Noun'),\n", 354 | " ('Noun', 'Noun', 'Josa'),\n", 355 | " ('Modifier', 'Noun'),\n", 356 | " ('Modifier', 'Noun', 'Noun'),\n", 357 | " ('Modifier', 'Noun', 'Josa'),\n", 358 | " ('Modifier', 'Noun', 'Noun', 'Josa')]" 359 | ] 360 | }, 361 | "execution_count": 11, 362 | "metadata": {}, 363 | "output_type": "execute_result" 364 | } 365 | ], 366 | "source": [ 367 | "twitter._customized_tagger.templates" 368 | ] 369 | }, 370 | { 371 | "cell_type": "markdown", 372 | "metadata": {}, 373 | "source": [ 374 | "기본 탬플릿은 customized_konlpy/data/templates/twitter_templates0 에 저장되어 있습니다. text 형식의 파일이며, 띄어쓰기로 아래와 같은 기본 템플릿을 지정하면 됩니다. " 375 | ] 376 | }, 377 | { 378 | "cell_type": "code", 379 | "execution_count": 12, 380 | "metadata": {}, 381 | "outputs": [ 382 | { 383 | "name": "stdout", 384 | "output_type": "stream", 385 | "text": [ 386 | "Noun\r\n", 387 | "Noun Noun\r\n", 388 | "Noun Josa\r\n", 389 | "Noun Josa Noun\r\n", 390 | "Noun Noun Josa\r\n", 391 | "Modifier Noun\r\n", 392 | "Modifier Noun Noun\r\n", 393 | "Modifier Noun Josa\r\n", 394 | "Modifier Noun Noun Josa" 395 | ] 396 | } 397 | ], 398 | "source": [ 399 | "cat ../ckonlpy/data/templates/twitter_templates0" 400 | ] 401 | }, 402 | { 403 | "cell_type": "markdown", 404 | "metadata": {}, 405 | "source": [ 406 | "작업 중 탬플릿을 추가하고 싶다면, 탬플릿은 하나 단위로 tuple of str의 형식으로 입력할 수 있습니다. \\_customized_tagger.add_a_templated()은 중복되는 탬플릿이 아닌지 확인한 다음 탬플릿을 추가하는 함수입니다. " 407 | ] 408 | }, 409 | { 410 | "cell_type": "code", 411 | "execution_count": 13, 412 | "metadata": {}, 413 | "outputs": [ 414 | { 415 | "data": { 416 | "text/plain": [ 417 | "[('Noun',),\n", 418 | " ('Noun', 'Noun'),\n", 419 | " ('Noun', 'Josa'),\n", 420 | " ('Noun', 'Josa', 'Noun'),\n", 421 | " ('Noun', 'Noun', 'Josa'),\n", 422 | " ('Modifier', 'Noun'),\n", 423 | " ('Modifier', 'Noun', 'Noun'),\n", 424 | " ('Modifier', 'Noun', 'Josa'),\n", 425 | " ('Modifier', 'Noun', 'Noun', 'Josa'),\n", 426 | " ('Modifier', 'Noun', 'Noun', 'Noun', 'Josa')]" 427 | ] 428 | }, 429 | "execution_count": 13, 430 | "metadata": {}, 431 | "output_type": "execute_result" 432 | } 433 | ], 434 | "source": [ 435 | "twitter._customized_tagger.add_a_template(('Modifier', 'Noun', 'Noun', 'Noun', 'Josa'))\n", 436 | "twitter._customized_tagger.templates" 437 | ] 438 | }, 439 | { 440 | "cell_type": "markdown", 441 | "metadata": {}, 442 | "source": [ 443 | "('Noun', 'Noun', 'Josa')가 입력되었고, '트와이스', 'tt'가 명사인지 알고 있기 때문에 아래 문장은 제대로 인식이 됩니다. " 444 | ] 445 | }, 446 | { 447 | "cell_type": "code", 448 | "execution_count": 14, 449 | "metadata": {}, 450 | "outputs": [ 451 | { 452 | "data": { 453 | "text/plain": [ 454 | "[('우리', 'Modifier'),\n", 455 | " ('트둥이', 'Noun'),\n", 456 | " ('꺼', 'Noun'),\n", 457 | " ('tt', 'Noun'),\n", 458 | " ('는', 'Josa'),\n", 459 | " ('좋', 'Adjective'),\n", 460 | " ('아요', 'Eomi')]" 461 | ] 462 | }, 463 | "execution_count": 14, 464 | "metadata": {}, 465 | "output_type": "execute_result" 466 | } 467 | ], 468 | "source": [ 469 | "twitter.pos('우리트둥이꺼tt는 좋아요')" 470 | ] 471 | }, 472 | { 473 | "cell_type": "markdown", 474 | "metadata": {}, 475 | "source": [ 476 | "### Out of tags\n", 477 | "\n", 478 | "사전을 추가할 때, 트위터 한국어 분석기에 존재하지 않는 태그가 들어가는 것을 방지하기 위해 tag의 값을 확인하는 부분이 구현되어 있습니다. \n", 479 | "\n", 480 | " twitter.tagset\n", 481 | " \n", 482 | " >>> {'Adjective': '형용사',\n", 483 | " 'Adverb': '부사',\n", 484 | " 'Alpha': '알파벳',\n", 485 | " 'Conjunction': '접속사',\n", 486 | " 'Determiner': '관형사',\n", 487 | " 'Eomi': '어미',\n", 488 | " 'Exclamation': '감탄사',\n", 489 | " 'Foreign': '외국어, 한자 및 기타기호',\n", 490 | " 'Hashtag': '트위터 해쉬태그',\n", 491 | " 'Josa': '조사',\n", 492 | " 'KoreanParticle': '(ex: ㅋㅋ)',\n", 493 | " 'Modifier': '관형사',\n", 494 | " 'Noun': '명사',\n", 495 | " 'Number': '숫자',\n", 496 | " 'PreEomi': '선어말어미',\n", 497 | " 'Punctuation': '구두점',\n", 498 | " 'ScreenName': '트위터 아이디',\n", 499 | " 'Suffix': '접미사',\n", 500 | " 'Unknown': '미등록어',\n", 501 | " 'Verb': '동사'}\n", 502 | " \n", 503 | "twitter.tagset에 등록되어 있지 않는 품사에 대해서는 ValueError를 raise 합니다. " 504 | ] 505 | }, 506 | { 507 | "cell_type": "code", 508 | "execution_count": 15, 509 | "metadata": {}, 510 | "outputs": [ 511 | { 512 | "ename": "ValueError", 513 | "evalue": "Name is not available tag", 514 | "output_type": "error", 515 | "traceback": [ 516 | "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", 517 | "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", 518 | "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mtwitter\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0madd_dictionary\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'lovit'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'Name'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", 519 | "\u001b[0;32m/mnt/lovit/git/customized_konlpy/ckonlpy/tag/_twitter.py\u001b[0m in \u001b[0;36madd_dictionary\u001b[0;34m(self, words, tag, force)\u001b[0m\n\u001b[1;32m 56\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0madd_dictionary\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mwords\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtag\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mforce\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 57\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;32mnot\u001b[0m \u001b[0mforce\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;32mnot\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mtag\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtagset\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 58\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'%s is not available tag'\u001b[0m \u001b[0;34m%\u001b[0m \u001b[0mtag\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 59\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_dictionary\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0madd_dictionary\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mwords\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtag\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 60\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", 520 | "\u001b[0;31mValueError\u001b[0m: Name is not available tag" 521 | ] 522 | } 523 | ], 524 | "source": [ 525 | "twitter.add_dictionary('lovit', 'Name')" 526 | ] 527 | }, 528 | { 529 | "cell_type": "markdown", 530 | "metadata": {}, 531 | "source": [ 532 | "하지만 Twitter.add_dictionary(words, tag, force=True)로 단어를 사전에 입력하면 알려지지 않은 품사라 하더라도 입력할 수 있습니다. " 533 | ] 534 | }, 535 | { 536 | "cell_type": "code", 537 | "execution_count": 16, 538 | "metadata": {}, 539 | "outputs": [ 540 | { 541 | "name": "stdout", 542 | "output_type": "stream", 543 | "text": [ 544 | "dict_keys(['Modifier', 'Noun', 'Josa', 'Name'])\n" 545 | ] 546 | } 547 | ], 548 | "source": [ 549 | "twitter.add_dictionary('lovit', 'Name', force=True)\n", 550 | "print(twitter._dictionary._pos2words.keys())" 551 | ] 552 | }, 553 | { 554 | "cell_type": "markdown", 555 | "metadata": {}, 556 | "source": [ 557 | "'Name'이라는 클래스 (더이상 품사가 아니므로)를 이용하는 탬플릿을 하나 입력한 뒤 pos에 입력하면 어절 'lovit은' customized_tagger에 의하여 처리가 되고, 사용자 사전에 알려지지 않은 어절인 '졸려'는 본래의 트위터 분석기에 의하여 처리가 됩니다. " 558 | ] 559 | }, 560 | { 561 | "cell_type": "code", 562 | "execution_count": 17, 563 | "metadata": {}, 564 | "outputs": [ 565 | { 566 | "name": "stdout", 567 | "output_type": "stream", 568 | "text": [ 569 | "[('Noun',),\n", 570 | " ('Noun', 'Noun'),\n", 571 | " ('Noun', 'Josa'),\n", 572 | " ('Noun', 'Josa', 'Noun'),\n", 573 | " ('Noun', 'Noun', 'Josa'),\n", 574 | " ('Modifier', 'Noun'),\n", 575 | " ('Modifier', 'Noun', 'Noun'),\n", 576 | " ('Modifier', 'Noun', 'Josa'),\n", 577 | " ('Modifier', 'Noun', 'Noun', 'Josa'),\n", 578 | " ('Modifier', 'Noun', 'Noun', 'Noun', 'Josa'),\n", 579 | " ('Name', 'Josa')]\n" 580 | ] 581 | }, 582 | { 583 | "data": { 584 | "text/plain": [ 585 | "[('lovit', 'Name'),\n", 586 | " ('은', 'Josa'),\n", 587 | " ('이름', 'Noun'),\n", 588 | " ('입니', 'Adjective'),\n", 589 | " ('다', 'Eomi'),\n", 590 | " ('.', 'Punctuation')]" 591 | ] 592 | }, 593 | "execution_count": 17, 594 | "metadata": {}, 595 | "output_type": "execute_result" 596 | } 597 | ], 598 | "source": [ 599 | "twitter._customized_tagger.add_a_template(('Name', 'Josa'))\n", 600 | "pprint(twitter._customized_tagger.templates)\n", 601 | "twitter.pos('lovit은 이름입니다.')" 602 | ] 603 | }, 604 | { 605 | "cell_type": "markdown", 606 | "metadata": {}, 607 | "source": [ 608 | "### Scoring\n", 609 | "\n", 610 | "Templates를 이용하여도 후보가 여러 개 나올 수 있습니다. 여러 개 후보 중에서 best 를 선택하는 함수를 직접 디자인 할 수 도 있습니다. 이처럼 몇 개의 점수 기준을 만들고, 각 기준의 weight를 부여하는 방식은 트위터 분석기에서 이용하는 방식인데, 직관적이고 튜닝 가능해서 매우 좋은 방식이라 생각합니다. " 611 | ] 612 | }, 613 | { 614 | "cell_type": "code", 615 | "execution_count": 18, 616 | "metadata": {}, 617 | "outputs": [ 618 | { 619 | "name": "stdout", 620 | "output_type": "stream", 621 | "text": [ 622 | "[('이', 'Noun'), ('것', 'Noun'), ('은', 'Josa'), ('테', 'Noun'), ('스트', 'Noun')]\n", 623 | "[('이것', 'Noun'), ('은', 'Josa'), ('테', 'Noun'), ('스트', 'Noun')]\n", 624 | "[('이것', 'Noun'), ('은', 'Josa'), ('테스트', 'Noun')]\n", 625 | "best: [('이것', 'Noun'), ('은', 'Josa'), ('테스트', 'Noun')]\n" 626 | ] 627 | } 628 | ], 629 | "source": [ 630 | "score_weights = {\n", 631 | " 'num_nouns': -0.1,\n", 632 | " 'num_words': -0.2,\n", 633 | " 'no_noun': -1\n", 634 | "}\n", 635 | "\n", 636 | "def my_score(candidate):\n", 637 | " num_nouns = len([w for w,t in candidate if t == 'Noun'])\n", 638 | " num_words = len(candidate)\n", 639 | " no_noun = 1 if num_nouns == 0 else 0\n", 640 | " \n", 641 | " score = (num_nouns * score_weights['num_nouns'] \n", 642 | " + num_words * score_weights['num_words']\n", 643 | " + no_noun * score_weights['no_noun'])\n", 644 | " return score\n", 645 | "\n", 646 | "twitter.set_selector(score_weights, my_score)" 647 | ] 648 | }, 649 | { 650 | "cell_type": "markdown", 651 | "metadata": {}, 652 | "source": [ 653 | "### Stem, Norm\n", 654 | "\n", 655 | "pos 함수에서 norm, stem 옵션을 사용할 수 있습니다." 656 | ] 657 | }, 658 | { 659 | "cell_type": "code", 660 | "execution_count": 19, 661 | "metadata": {}, 662 | "outputs": [ 663 | { 664 | "data": { 665 | "text/plain": [ 666 | "[('이', 'Determiner'),\n", 667 | " ('것', 'Noun'),\n", 668 | " ('은', 'Josa'),\n", 669 | " ('테스트', 'Noun'),\n", 670 | " ('이다', 'Adjective')]" 671 | ] 672 | }, 673 | "execution_count": 19, 674 | "metadata": {}, 675 | "output_type": "execute_result" 676 | } 677 | ], 678 | "source": [ 679 | "twitter.pos('이것은테스트입니다', norm=True, stem=True)" 680 | ] 681 | }, 682 | { 683 | "cell_type": "code", 684 | "execution_count": 20, 685 | "metadata": {}, 686 | "outputs": [ 687 | { 688 | "data": { 689 | "text/plain": [ 690 | "[('이', 'Determiner'),\n", 691 | " ('것', 'Noun'),\n", 692 | " ('은', 'Josa'),\n", 693 | " ('테스트', 'Noun'),\n", 694 | " ('입니', 'Adjective'),\n", 695 | " ('다', 'Eomi')]" 696 | ] 697 | }, 698 | "execution_count": 20, 699 | "metadata": {}, 700 | "output_type": "execute_result" 701 | } 702 | ], 703 | "source": [ 704 | "twitter.pos('이것은테스트입니다', norm=True, stem=False)" 705 | ] 706 | }, 707 | { 708 | "cell_type": "code", 709 | "execution_count": 21, 710 | "metadata": {}, 711 | "outputs": [ 712 | { 713 | "data": { 714 | "text/plain": [ 715 | "[('이', 'Determiner'),\n", 716 | " ('것', 'Noun'),\n", 717 | " ('은', 'Josa'),\n", 718 | " ('테스트', 'Noun'),\n", 719 | " ('이다', 'Adjective')]" 720 | ] 721 | }, 722 | "execution_count": 21, 723 | "metadata": {}, 724 | "output_type": "execute_result" 725 | } 726 | ], 727 | "source": [ 728 | "twitter.pos('이것은테스트입니다', norm=False, stem=True)" 729 | ] 730 | }, 731 | { 732 | "cell_type": "code", 733 | "execution_count": 22, 734 | "metadata": {}, 735 | "outputs": [ 736 | { 737 | "data": { 738 | "text/plain": [ 739 | "['이', '것', '은', '테스트', '입니', '다']" 740 | ] 741 | }, 742 | "execution_count": 22, 743 | "metadata": {}, 744 | "output_type": "execute_result" 745 | } 746 | ], 747 | "source": [ 748 | "twitter.morphs('이것은테스트입니다', norm=True, stem=True)" 749 | ] 750 | }, 751 | { 752 | "cell_type": "markdown", 753 | "metadata": {}, 754 | "source": [ 755 | "### Postprocessing\n", 756 | "\n", 757 | "passwords, stopwords, 특정 품사, 혹은 미리 정의된 사전을 이용하여 단어를 변환하여 출력합니다. \n", 758 | "\n", 759 | "passwords 는 단어, (단어, 품사)를 입력하면 해당 단어 외에는 출력하지 않습니다. " 760 | ] 761 | }, 762 | { 763 | "cell_type": "code", 764 | "execution_count": 23, 765 | "metadata": {}, 766 | "outputs": [ 767 | { 768 | "name": "stdout", 769 | "output_type": "stream", 770 | "text": [ 771 | "before : [('우리', 'Modifier'), ('아이오아이', 'Noun'), ('는', 'Josa'), ('정말', 'Noun'), ('이뻐', 'Adjective'), ('요', 'Eomi')]\n", 772 | "\n", 773 | "after : [('아이오아이', 'Noun'), ('정말', 'Noun')]\n" 774 | ] 775 | } 776 | ], 777 | "source": [ 778 | "from ckonlpy.tag import Postprocessor\n", 779 | "\n", 780 | "passwords = {'아이오아이', ('정말', 'Noun')}\n", 781 | "postprocessor = Postprocessor(\n", 782 | " base_tagger = twitter,\n", 783 | " passwords = passwords\n", 784 | ")\n", 785 | "\n", 786 | "sent = '우리아이오아이는 정말 이뻐요'\n", 787 | "print('before : %s\\n' % twitter.pos(sent))\n", 788 | "print('after : %s' % postprocessor.tag(sent))" 789 | ] 790 | }, 791 | { 792 | "cell_type": "markdown", 793 | "metadata": {}, 794 | "source": [ 795 | "stopwords 에 등록된 단어, (단어, 품사)는 tag 결과에서 제외됩니다. " 796 | ] 797 | }, 798 | { 799 | "cell_type": "code", 800 | "execution_count": 24, 801 | "metadata": {}, 802 | "outputs": [ 803 | { 804 | "name": "stdout", 805 | "output_type": "stream", 806 | "text": [ 807 | "before : [('우리', 'Modifier'), ('아이오아이', 'Noun'), ('는', 'Josa'), ('정말', 'Noun'), ('이뻐', 'Adjective'), ('요', 'Eomi')]\n", 808 | "\n", 809 | "after : [('우리', 'Modifier'), ('아이오아이', 'Noun'), ('정말', 'Noun'), ('이뻐', 'Adjective'), ('요', 'Eomi')]\n" 810 | ] 811 | } 812 | ], 813 | "source": [ 814 | "stopwords = {'는'}\n", 815 | "\n", 816 | "postprocessor = Postprocessor(\n", 817 | " base_tagger = twitter,\n", 818 | " stopwords = stopwords\n", 819 | ")\n", 820 | "\n", 821 | "sent = '우리아이오아이는 정말 이뻐요'\n", 822 | "print('before : %s\\n' % twitter.pos(sent))\n", 823 | "print('after : %s' % postprocessor.tag(sent))" 824 | ] 825 | }, 826 | { 827 | "cell_type": "markdown", 828 | "metadata": {}, 829 | "source": [ 830 | "특정 품사를 지정하면 해당 품사만 tag 에서 출력됩니다. " 831 | ] 832 | }, 833 | { 834 | "cell_type": "code", 835 | "execution_count": 25, 836 | "metadata": {}, 837 | "outputs": [ 838 | { 839 | "name": "stdout", 840 | "output_type": "stream", 841 | "text": [ 842 | "before : [('우리', 'Modifier'), ('아이오아이', 'Noun'), ('는', 'Josa'), ('정말', 'Noun'), ('이뻐', 'Adjective'), ('요', 'Eomi')]\n", 843 | "\n", 844 | "after : [('아이오아이', 'Noun'), ('정말', 'Noun')]\n" 845 | ] 846 | } 847 | ], 848 | "source": [ 849 | "passtags = {'Noun'}\n", 850 | "\n", 851 | "postprocessor = Postprocessor(\n", 852 | " base_tagger = twitter,\n", 853 | " passtags = passtags\n", 854 | ")\n", 855 | "\n", 856 | "sent = '우리아이오아이는 정말 이뻐요'\n", 857 | "print('before : %s\\n' % twitter.pos(sent))\n", 858 | "print('after : %s' % postprocessor.tag(sent))" 859 | ] 860 | }, 861 | { 862 | "cell_type": "markdown", 863 | "metadata": {}, 864 | "source": [ 865 | "치환할 단어, (단어, 품사)를 dict 형식으로 정의하면 tag 에서 단어가 치환되어 출력됩니다. " 866 | ] 867 | }, 868 | { 869 | "cell_type": "code", 870 | "execution_count": 26, 871 | "metadata": {}, 872 | "outputs": [ 873 | { 874 | "name": "stdout", 875 | "output_type": "stream", 876 | "text": [ 877 | "before : [('우리', 'Modifier'), ('아이오아이', 'Noun'), ('는', 'Josa'), ('정말', 'Noun'), ('이뻐', 'Adjective'), ('요', 'Eomi')]\n", 878 | "\n", 879 | "after : [('우리', 'Modifier'), ('아이돌', 'Noun'), ('는', 'Josa'), ('정말', 'Noun'), ('예쁘다', 'Adjective'), ('요', 'Eomi')]\n" 880 | ] 881 | } 882 | ], 883 | "source": [ 884 | "replace = {\n", 885 | " '아이오아이': '아이돌',\n", 886 | " ('이뻐', 'Adjective'): '예쁘다'\n", 887 | "}\n", 888 | "\n", 889 | "postprocessor = Postprocessor(\n", 890 | " base_tagger = twitter,\n", 891 | " replace = replace\n", 892 | ")\n", 893 | "\n", 894 | "sent = '우리아이오아이는 정말 이뻐요'\n", 895 | "print('before : %s\\n' % twitter.pos(sent))\n", 896 | "print('after : %s' % postprocessor.tag(sent))" 897 | ] 898 | }, 899 | { 900 | "cell_type": "markdown", 901 | "metadata": {}, 902 | "source": [ 903 | "## Loading wordset\n", 904 | "\n", 905 | "utils 에는 stopwords, passwords, replace word pair 를 파일로 저장하였을 경우, 이를 손쉽게 불러오는 함수가 있습니다.\n", 906 | "\n", 907 | "load_wordset 은 set of str 혹은 set of tuple 을 return 합니다. 예시의 passwords.txt 의 내용은 아래와 같습니다. 단어의 품사는 한 칸 띄어쓰기로 구분합니다.\n", 908 | "\n", 909 | " 아이오아이\n", 910 | " 아이오아이 Noun\n", 911 | " 공연" 912 | ] 913 | }, 914 | { 915 | "cell_type": "code", 916 | "execution_count": 27, 917 | "metadata": {}, 918 | "outputs": [ 919 | { 920 | "name": "stdout", 921 | "output_type": "stream", 922 | "text": [ 923 | "{('아이오아이', 'Noun'), '공연', '아이오아이'}\n" 924 | ] 925 | } 926 | ], 927 | "source": [ 928 | "from ckonlpy.utils import load_wordset\n", 929 | "from ckonlpy.utils import load_replace_wordpair\n", 930 | "\n", 931 | "passwords = load_wordset('./passwords.txt')\n", 932 | "print(passwords)" 933 | ] 934 | }, 935 | { 936 | "cell_type": "markdown", 937 | "metadata": {}, 938 | "source": [ 939 | "stopwords.txt 의 포멧은 passwords.txt 와 같습니다. 단어의 품사가 있을 경우 한 칸 띄어쓰기로 구분합니다.\n", 940 | "\n", 941 | " 은\n", 942 | " 는\n", 943 | " 이 Josa" 944 | ] 945 | }, 946 | { 947 | "cell_type": "code", 948 | "execution_count": 28, 949 | "metadata": {}, 950 | "outputs": [ 951 | { 952 | "name": "stdout", 953 | "output_type": "stream", 954 | "text": [ 955 | "{'는', '은', ('이', 'Josa')}\n" 956 | ] 957 | } 958 | ], 959 | "source": [ 960 | "stopwords = load_wordset('./stopwords.txt')\n", 961 | "print(stopwords)" 962 | ] 963 | }, 964 | { 965 | "cell_type": "markdown", 966 | "metadata": {}, 967 | "source": [ 968 | "치환할 단어쌍은 tap 구분이 되어있습니다. 치환될 단어에 품사 태그가 있을 경우 한 칸 띄어쓰기로 구분합니다.\n", 969 | "\n", 970 | " str\\tstr\n", 971 | " str str\\tstr\n", 972 | "\n", 973 | "아래는 replacewords.txt 의 예시입니다.\n", 974 | "\n", 975 | " 아빠\t아버지\n", 976 | " 엄마 Noun\t어머니" 977 | ] 978 | }, 979 | { 980 | "cell_type": "code", 981 | "execution_count": 29, 982 | "metadata": {}, 983 | "outputs": [ 984 | { 985 | "name": "stdout", 986 | "output_type": "stream", 987 | "text": [ 988 | "{'아빠': '아버지', ('엄마', 'Noun'): '어머니'}\n" 989 | ] 990 | } 991 | ], 992 | "source": [ 993 | "replace = load_replace_wordpair('./replacewords.txt')\n", 994 | "print(replace)" 995 | ] 996 | }, 997 | { 998 | "cell_type": "code", 999 | "execution_count": null, 1000 | "metadata": { 1001 | "collapsed": true 1002 | }, 1003 | "outputs": [], 1004 | "source": [] 1005 | } 1006 | ], 1007 | "metadata": { 1008 | "kernelspec": { 1009 | "display_name": "Python 3", 1010 | "language": "python", 1011 | "name": "python3" 1012 | }, 1013 | "language_info": { 1014 | "codemirror_mode": { 1015 | "name": "ipython", 1016 | "version": 3 1017 | }, 1018 | "file_extension": ".py", 1019 | "mimetype": "text/x-python", 1020 | "name": "python", 1021 | "nbconvert_exporter": "python", 1022 | "pygments_lexer": "ipython3", 1023 | "version": "3.6.2" 1024 | } 1025 | }, 1026 | "nbformat": 4, 1027 | "nbformat_minor": 1 1028 | } 1029 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . -------------------------------------------------------------------------------- /tutorials/usage_of_templatetagger-ver_0_0_6+.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "## KoNLPy.Twitter" 8 | ] 9 | }, 10 | { 11 | "cell_type": "markdown", 12 | "metadata": {}, 13 | "source": [ 14 | "KoNLPy의 [트위터 한국어 분석기][twitterlink] ([현 오픈 한국어 분석기][openlink])는 속도도 빠르고 다양한 사전도 확보하고 있는 한국어 분석기입니다. 하지만 컴파일이 되어 있는 형태로 KoNLPy에 들어가 있기 때문에 사용자 사전의 추가가 힘들고\\*, 내가 원하는 임의의 태그를 지정할 수 없습니다. \n", 15 | "\n", 16 | "customized_KoNLPy는 확실히 알고 있는 단어들에 대해서는 라이브러리를 거치지 않고 주어진 어절을 아는 단어들로 토크나이징 / 품사판별을 하는 기능을 제공합니다. 이를 위해 template 기반 토크나이징을 수행합니다. \n", 17 | "\n", 18 | " 사전: {'아이오아이': 'Noun', '는': 'Josa'}\n", 19 | " 탬플릿: Noun + Josa\n", 20 | " \n", 21 | "위와 같은 단어 리스트와 탬플릿이 있다면 '아이오아이는' 이라는 어절은 [('아이오아이', 'Noun'), ('는', 'Josa')]로 분리됩니다. \n", 22 | "\n", 23 | "\\* Scala 코드를 이용할 경우에는 사용자 사전의 추가가 매우 쉽습니다 [참고][openlink]\n", 24 | "\n", 25 | "[twitterlink]: https://github.com/twitter/twitter-korean-text\n", 26 | "[openlink]: https://github.com/open-korean-text/open-korean-text" 27 | ] 28 | }, 29 | { 30 | "cell_type": "markdown", 31 | "metadata": {}, 32 | "source": [ 33 | "KoNLPy의 버전은 0.4.4 기준입니다. KoNLPy의 Twitter를 이용하여 '우리아이오아이는 정말 이뻐요'라는 문장을 처리하면 '아이오' + '아이'로 명사가 잘못 인식됩니다. 트와이스의 'tt' 역시 명사보다는 영어로 인식됩니다. 한국어 분석기 이지만, tt는 명사로 미리 분류하고 싶습니다. " 34 | ] 35 | }, 36 | { 37 | "cell_type": "code", 38 | "execution_count": 1, 39 | "metadata": {}, 40 | "outputs": [ 41 | { 42 | "data": { 43 | "text/plain": [ 44 | "'0.5.1'" 45 | ] 46 | }, 47 | "execution_count": 1, 48 | "metadata": {}, 49 | "output_type": "execute_result" 50 | } 51 | ], 52 | "source": [ 53 | "from pprint import pprint\n", 54 | "import konlpy\n", 55 | "konlpy.__version__" 56 | ] 57 | }, 58 | { 59 | "cell_type": "code", 60 | "execution_count": 2, 61 | "metadata": {}, 62 | "outputs": [ 63 | { 64 | "name": "stderr", 65 | "output_type": "stream", 66 | "text": [ 67 | "/home/lovit/anaconda2/envs/scrapper/lib/python3.6/site-packages/konlpy/tag/_okt.py:16: UserWarning: \"Twitter\" has changed to \"Okt\" since KoNLPy v0.4.5.\n", 68 | " warn('\"Twitter\" has changed to \"Okt\" since KoNLPy v0.4.5.')\n" 69 | ] 70 | }, 71 | { 72 | "name": "stdout", 73 | "output_type": "stream", 74 | "text": [ 75 | "[('우리', 'Noun'), ('아이오', 'Noun'), ('아이', 'Noun'), ('는', 'Josa'), ('정말', 'Noun'), ('이뻐요', 'Adjective')] \n", 76 | "\n", 77 | "[('트', 'Noun'), ('둥이', 'Noun'), ('꺼', 'Suffix'), ('tt', 'Alpha'), ('도', 'Noun'), ('좋아요', 'Adjective')]\n" 78 | ] 79 | } 80 | ], 81 | "source": [ 82 | "from konlpy.tag import Twitter as OriginalTwitter\n", 83 | "\n", 84 | "twitter_original = OriginalTwitter()\n", 85 | "print(twitter_original.pos('우리아이오아이는 정말 이뻐요'),'\\n')\n", 86 | "print(twitter_original.pos('트둥이꺼 tt도 좋아요'))" 87 | ] 88 | }, 89 | { 90 | "cell_type": "markdown", 91 | "metadata": {}, 92 | "source": [ 93 | "customized_KoNLPy 에는 현재 트위터 한국어 분석기 만을 이용하는 wrapping class만 제공되고 있습니다. customized_KoNLPy의 Twitter는 본래 KoNLPy의 tag에 추가되는 함수가 있습니다. \n", 94 | "\n", 95 | "Twitter.add_dictionary(words, tag)는 사용자가 사전을 추가할 수 있는 부분입니다. 단어를 하나씩 추가할 수 있습니다. 추가한 뒤 Twitter의 숨김 변수인 \\_dictionary.\\_pos2words를 확인해보면 입력한 단어들을 볼 수 있습니다. " 96 | ] 97 | }, 98 | { 99 | "cell_type": "markdown", 100 | "metadata": {}, 101 | "source": [ 102 | "## ckonlpy.Twitter\n", 103 | "\n", 104 | "### Add word to custom-dictionary" 105 | ] 106 | }, 107 | { 108 | "cell_type": "markdown", 109 | "metadata": {}, 110 | "source": [ 111 | "git clone을 한 상태에서 tutorial code를 이용하신다면 아래의 코드를 실행하여 path를 추가하십시요" 112 | ] 113 | }, 114 | { 115 | "cell_type": "code", 116 | "execution_count": 3, 117 | "metadata": {}, 118 | "outputs": [ 119 | { 120 | "name": "stdout", 121 | "output_type": "stream", 122 | "text": [ 123 | "ckonlpy version = 0.0.63\n" 124 | ] 125 | } 126 | ], 127 | "source": [ 128 | "import sys\n", 129 | "sys.path.insert(0, '../')\n", 130 | "\n", 131 | "import ckonlpy\n", 132 | "print('ckonlpy version = {}'.format(ckonlpy.__version__))" 133 | ] 134 | }, 135 | { 136 | "cell_type": "code", 137 | "execution_count": 4, 138 | "metadata": {}, 139 | "outputs": [ 140 | { 141 | "name": "stdout", 142 | "output_type": "stream", 143 | "text": [ 144 | "{'Josa': {'는', '은'},\n", 145 | " 'Modifier': {'우리', '이', '이번'},\n", 146 | " 'Noun': {'것', '아이오아이', '행사', '아이', '번것'}}\n" 147 | ] 148 | }, 149 | { 150 | "name": "stderr", 151 | "output_type": "stream", 152 | "text": [ 153 | "/home/lovit/anaconda2/envs/scrapper/lib/python3.6/site-packages/konlpy/tag/_okt.py:16: UserWarning: \"Twitter\" has changed to \"Okt\" since KoNLPy v0.4.5.\n", 154 | " warn('\"Twitter\" has changed to \"Okt\" since KoNLPy v0.4.5.')\n" 155 | ] 156 | } 157 | ], 158 | "source": [ 159 | "from ckonlpy.tag import Twitter\n", 160 | "\n", 161 | "# use_twitter_dictionary 의 default 는 True 입니다.\n", 162 | "twitter = Twitter(use_twitter_dictionary=False)\n", 163 | "\n", 164 | "twitter.add_dictionary('이', 'Modifier')\n", 165 | "twitter.add_dictionary('우리', 'Modifier')\n", 166 | "twitter.add_dictionary('이번', 'Modifier')\n", 167 | "twitter.add_dictionary('아이오아이', 'Noun')\n", 168 | "twitter.add_dictionary('행사', 'Noun')\n", 169 | "twitter.add_dictionary('아이', 'Noun')\n", 170 | "twitter.add_dictionary('번것', 'Noun')\n", 171 | "twitter.add_dictionary('것', 'Noun')\n", 172 | "twitter.add_dictionary('은', 'Josa')\n", 173 | "twitter.add_dictionary('는', 'Josa')\n", 174 | "\n", 175 | "if twitter.use_twitter_dictionary:\n", 176 | " pprint(twitter.dictionary._pos2words.keys())\n", 177 | "else:\n", 178 | " pprint(twitter.dictionary._pos2words)" 179 | ] 180 | }, 181 | { 182 | "cell_type": "markdown", 183 | "metadata": {}, 184 | "source": [ 185 | "사전을 추가한 뒤, '아이오아이'가 명사로 제대로 인식됨을 확인할 수 있습니다. " 186 | ] 187 | }, 188 | { 189 | "cell_type": "code", 190 | "execution_count": 5, 191 | "metadata": {}, 192 | "outputs": [ 193 | { 194 | "data": { 195 | "text/plain": [ 196 | "[('우리', 'Modifier'),\n", 197 | " ('아이오아이', 'Noun'),\n", 198 | " ('는', 'Josa'),\n", 199 | " ('정말', 'Noun'),\n", 200 | " ('이뻐요', 'Adjective')]" 201 | ] 202 | }, 203 | "execution_count": 5, 204 | "metadata": {}, 205 | "output_type": "execute_result" 206 | } 207 | ], 208 | "source": [ 209 | "twitter.pos('우리아이오아이는 정말 이뻐요')" 210 | ] 211 | }, 212 | { 213 | "cell_type": "code", 214 | "execution_count": 6, 215 | "metadata": {}, 216 | "outputs": [ 217 | { 218 | "data": { 219 | "text/plain": [ 220 | "[('아이오아이', 'Noun'), ('이뻐요', 'Adjective')]" 221 | ] 222 | }, 223 | "execution_count": 6, 224 | "metadata": {}, 225 | "output_type": "execute_result" 226 | } 227 | ], 228 | "source": [ 229 | "twitter.pos('아이오아이 이뻐요')" 230 | ] 231 | }, 232 | { 233 | "cell_type": "markdown", 234 | "metadata": {}, 235 | "source": [ 236 | "사전을 추가할 때, 하나의 품사에 대하여 동시에 여러 개의 단어셋을 입력할 수도 있습니다.\n", 237 | "\n", 238 | "Twitter.add_dictionary(words, tag)는 한번에 list of str 형식의 여러 개의 단어들을 입력할 수도 있습니다. " 239 | ] 240 | }, 241 | { 242 | "cell_type": "code", 243 | "execution_count": 7, 244 | "metadata": {}, 245 | "outputs": [ 246 | { 247 | "name": "stdout", 248 | "output_type": "stream", 249 | "text": [ 250 | "{'Josa': {'는', '은'},\n", 251 | " 'Modifier': {'우리', '이', '이번'},\n", 252 | " 'Noun': {'꺼', 'tt', '행사', '번것', '트둥이', '것', '아이오아이', '트와이스', '아이', '우리'}}\n" 253 | ] 254 | } 255 | ], 256 | "source": [ 257 | "twitter.add_dictionary(['트와이스', 'tt', '트둥이', '꺼', '우리'], 'Noun')\n", 258 | "pprint(twitter.dictionary._pos2words)" 259 | ] 260 | }, 261 | { 262 | "cell_type": "code", 263 | "execution_count": 8, 264 | "metadata": {}, 265 | "outputs": [ 266 | { 267 | "data": { 268 | "text/plain": [ 269 | "[('트와이스', 'Noun'), ('tt', 'Noun'), ('는', 'Josa'), ('좋아요', 'Adjective')]" 270 | ] 271 | }, 272 | "execution_count": 8, 273 | "metadata": {}, 274 | "output_type": "execute_result" 275 | } 276 | ], 277 | "source": [ 278 | "twitter.pos('트와이스tt는 좋아요')" 279 | ] 280 | }, 281 | { 282 | "cell_type": "markdown", 283 | "metadata": {}, 284 | "source": [ 285 | "### Use KoNLPy.Twitter dictionary" 286 | ] 287 | }, 288 | { 289 | "cell_type": "markdown", 290 | "metadata": {}, 291 | "source": [ 292 | "트위터 분석기의 조사사전을 이용할 수도 있습니다. Twitter()를 만들 때 argument를 넣을 수 있습니다. " 293 | ] 294 | }, 295 | { 296 | "cell_type": "code", 297 | "execution_count": 9, 298 | "metadata": {}, 299 | "outputs": [ 300 | { 301 | "name": "stderr", 302 | "output_type": "stream", 303 | "text": [ 304 | "/home/lovit/anaconda2/envs/scrapper/lib/python3.6/site-packages/konlpy/tag/_okt.py:16: UserWarning: \"Twitter\" has changed to \"Okt\" since KoNLPy v0.4.5.\n", 305 | " warn('\"Twitter\" has changed to \"Okt\" since KoNLPy v0.4.5.')\n" 306 | ] 307 | }, 308 | { 309 | "data": { 310 | "text/plain": [ 311 | "512" 312 | ] 313 | }, 314 | "execution_count": 9, 315 | "metadata": {}, 316 | "output_type": "execute_result" 317 | } 318 | ], 319 | "source": [ 320 | "twitter1 = Twitter(use_twitter_dictionary=True)\n", 321 | "len(twitter1.dictionary._pos2words['Josa'])" 322 | ] 323 | }, 324 | { 325 | "cell_type": "markdown", 326 | "metadata": {}, 327 | "source": [ 328 | "### Template\n", 329 | "현재는 customized_tagger로 탬플릿 기반 토크나이저를 이용하고 있습니다. 어떤 탬플릿이 들어있는지 확인하기 위해서는 아래 부분을 확인하면 됩니다. \n", 330 | "\n", 331 | " twitter._customized_tagger.templates\n", 332 | " \n", 333 | "현재는 다음의 탬플릿이 입력되어 있습니다. " 334 | ] 335 | }, 336 | { 337 | "cell_type": "code", 338 | "execution_count": 10, 339 | "metadata": {}, 340 | "outputs": [ 341 | { 342 | "data": { 343 | "text/plain": [ 344 | "[('Adjective',),\n", 345 | " ('Adverb',),\n", 346 | " ('Conjunction',),\n", 347 | " ('Exclamation',),\n", 348 | " ('KoreanParticle',),\n", 349 | " ('Noun',),\n", 350 | " ('Verb',),\n", 351 | " ('Noun', 'Noun'),\n", 352 | " ('Noun', 'Josa'),\n", 353 | " ('Noun', 'Adjective'),\n", 354 | " ('Noun', 'Verb'),\n", 355 | " ('Modifier', 'Noun'),\n", 356 | " ('Noun', 'Noun', 'Adjective'),\n", 357 | " ('Noun', 'Noun', 'Josa'),\n", 358 | " ('Noun', 'Noun', 'Verb'),\n", 359 | " ('Modifier', 'Noun', 'Josa')]" 360 | ] 361 | }, 362 | "execution_count": 10, 363 | "metadata": {}, 364 | "output_type": "execute_result" 365 | } 366 | ], 367 | "source": [ 368 | "twitter.template_tagger.templates" 369 | ] 370 | }, 371 | { 372 | "cell_type": "markdown", 373 | "metadata": {}, 374 | "source": [ 375 | "기본 탬플릿은 customized_konlpy/data/templates/twitter_templates0 에 저장되어 있습니다. text 형식의 파일이며, 띄어쓰기로 아래와 같은 기본 템플릿을 지정하면 됩니다. " 376 | ] 377 | }, 378 | { 379 | "cell_type": "code", 380 | "execution_count": 11, 381 | "metadata": {}, 382 | "outputs": [ 383 | { 384 | "name": "stdout", 385 | "output_type": "stream", 386 | "text": [ 387 | "Adjective\r\n", 388 | "Adverb\r\n", 389 | "Conjunction\r\n", 390 | "Exclamation\r\n", 391 | "KoreanParticle\r\n", 392 | "Noun\r\n", 393 | "Verb\r\n", 394 | "Noun Noun\r\n", 395 | "Noun Josa\r\n", 396 | "Noun Adjective\r\n", 397 | "Noun Verb\r\n", 398 | "Modifier Noun\r\n", 399 | "Noun Noun Adjective\r\n", 400 | "Noun Noun Josa\r\n", 401 | "Noun Noun Verb\r\n", 402 | "Modifier Noun Josa" 403 | ] 404 | } 405 | ], 406 | "source": [ 407 | "cat ../ckonlpy/data/templates/twitter_templates0" 408 | ] 409 | }, 410 | { 411 | "cell_type": "markdown", 412 | "metadata": {}, 413 | "source": [ 414 | "('Noun', 'Noun', 'Josa')가 입력되었고, '트와이스', 'tt'가 명사인지 알고 있기 때문에 아래 문장은 제대로 인식이 됩니다. " 415 | ] 416 | }, 417 | { 418 | "cell_type": "code", 419 | "execution_count": 12, 420 | "metadata": {}, 421 | "outputs": [ 422 | { 423 | "data": { 424 | "text/plain": [ 425 | "[('우리', 'Noun'),\n", 426 | " ('트둥이', 'Noun'),\n", 427 | " ('tt', 'Noun'),\n", 428 | " ('는', 'Josa'),\n", 429 | " ('좋아요', 'Adjective')]" 430 | ] 431 | }, 432 | "execution_count": 12, 433 | "metadata": {}, 434 | "output_type": "execute_result" 435 | } 436 | ], 437 | "source": [ 438 | "twitter.pos('우리트둥이tt는 좋아요')" 439 | ] 440 | }, 441 | { 442 | "cell_type": "markdown", 443 | "metadata": {}, 444 | "source": [ 445 | "(Noun, Noun, Noun, Josa) 가 template 에 없지만, (Noun, ) 과 (Noun, Noun, Josa) 가 있기 때문에 매칭이 됩니다. " 446 | ] 447 | }, 448 | { 449 | "cell_type": "code", 450 | "execution_count": 13, 451 | "metadata": {}, 452 | "outputs": [ 453 | { 454 | "data": { 455 | "text/plain": [ 456 | "[('우리', 'Noun'),\n", 457 | " ('트둥이', 'Noun'),\n", 458 | " ('tt', 'Noun'),\n", 459 | " ('는', 'Josa'),\n", 460 | " ('좋아요', 'Adjective')]" 461 | ] 462 | }, 463 | "execution_count": 13, 464 | "metadata": {}, 465 | "output_type": "execute_result" 466 | } 467 | ], 468 | "source": [ 469 | "twitter.pos('우리트둥이tt는 좋아요')" 470 | ] 471 | }, 472 | { 473 | "cell_type": "markdown", 474 | "metadata": {}, 475 | "source": [ 476 | "버전 0.0.5x 까지는 어절 전체가 template 에 매칭될 때에만 template tagger 를 이용하였습니다. 하지만, 0.0.6+ 이상에서는 어절의 중간에 template matching 이 되어도 template tagger 를 이용합니다.\n", 477 | "\n", 478 | "이전처럼 어절 전체가 template 으로 완전히 매칭될 때만 template tagger 를 이용하고 싶다면 perfect_match = True 로 설정합니다.\n", 479 | "\n", 480 | "(Noun, Noun, Noun, Josa) template 은 없기 때문에 perfect_match = True 로 설정하면, 어절을 base tagger 를 이용하여 품사 판별을 수행합니다." 481 | ] 482 | }, 483 | { 484 | "cell_type": "code", 485 | "execution_count": 14, 486 | "metadata": {}, 487 | "outputs": [ 488 | { 489 | "data": { 490 | "text/plain": [ 491 | "[('우', 'Adverb'),\n", 492 | " ('리트', 'Noun'),\n", 493 | " ('둥이', 'Noun'),\n", 494 | " ('tt', 'Alpha'),\n", 495 | " ('는', 'Verb'),\n", 496 | " ('좋아요', 'Adjective')]" 497 | ] 498 | }, 499 | "execution_count": 14, 500 | "metadata": {}, 501 | "output_type": "execute_result" 502 | } 503 | ], 504 | "source": [ 505 | "twitter.pos('우리트둥이tt는 좋아요', perfect_match=True)" 506 | ] 507 | }, 508 | { 509 | "cell_type": "markdown", 510 | "metadata": {}, 511 | "source": [ 512 | "작업 중 탬플릿을 추가하고 싶다면, 탬플릿은 하나 단위로 tuple of str의 형식으로 입력할 수 있습니다.\n", 513 | "\n", 514 | "\\_customized_tagger.add_a_templated()은 중복되는 탬플릿이 아닌지 확인한 다음 탬플릿을 추가하는 함수입니다. \n", 515 | "\n", 516 | "\n" 517 | ] 518 | }, 519 | { 520 | "cell_type": "code", 521 | "execution_count": 15, 522 | "metadata": {}, 523 | "outputs": [ 524 | { 525 | "data": { 526 | "text/plain": [ 527 | "[('Adjective',),\n", 528 | " ('Adverb',),\n", 529 | " ('Conjunction',),\n", 530 | " ('Exclamation',),\n", 531 | " ('KoreanParticle',),\n", 532 | " ('Noun',),\n", 533 | " ('Verb',),\n", 534 | " ('Noun', 'Noun'),\n", 535 | " ('Noun', 'Josa'),\n", 536 | " ('Noun', 'Adjective'),\n", 537 | " ('Noun', 'Verb'),\n", 538 | " ('Modifier', 'Noun'),\n", 539 | " ('Noun', 'Noun', 'Adjective'),\n", 540 | " ('Noun', 'Noun', 'Josa'),\n", 541 | " ('Noun', 'Noun', 'Verb'),\n", 542 | " ('Modifier', 'Noun', 'Josa'),\n", 543 | " ('Noun', 'Noun', 'Noun', 'Josa')]" 544 | ] 545 | }, 546 | "execution_count": 15, 547 | "metadata": {}, 548 | "output_type": "execute_result" 549 | } 550 | ], 551 | "source": [ 552 | "twitter.template_tagger.add_a_template(('Noun', 'Noun', 'Noun', 'Josa'))\n", 553 | "twitter.template_tagger.templates" 554 | ] 555 | }, 556 | { 557 | "cell_type": "markdown", 558 | "metadata": {}, 559 | "source": [ 560 | "Template 을 추가하면 perfect_match 일 때에도 매칭이 되는 template 이 있기 때문에 동일한 결과가 출력됩니다." 561 | ] 562 | }, 563 | { 564 | "cell_type": "code", 565 | "execution_count": 16, 566 | "metadata": {}, 567 | "outputs": [ 568 | { 569 | "data": { 570 | "text/plain": [ 571 | "[('우리', 'Noun'),\n", 572 | " ('트둥이', 'Noun'),\n", 573 | " ('tt', 'Noun'),\n", 574 | " ('는', 'Josa'),\n", 575 | " ('좋아요', 'Adjective')]" 576 | ] 577 | }, 578 | "execution_count": 16, 579 | "metadata": {}, 580 | "output_type": "execute_result" 581 | } 582 | ], 583 | "source": [ 584 | "twitter.pos('우리트둥이tt는 좋아요', perfect_match=True)" 585 | ] 586 | }, 587 | { 588 | "cell_type": "markdown", 589 | "metadata": {}, 590 | "source": [ 591 | "### Out of tags\n", 592 | "\n", 593 | "사전을 추가할 때, 트위터 한국어 분석기에 존재하지 않는 태그가 들어가는 것을 방지하기 위해 tag의 값을 확인하는 부분이 구현되어 있습니다. \n", 594 | "\n", 595 | " twitter.tagset\n", 596 | " \n", 597 | " >>> {'Adjective': '형용사',\n", 598 | " 'Adverb': '부사',\n", 599 | " 'Alpha': '알파벳',\n", 600 | " 'Conjunction': '접속사',\n", 601 | " 'Determiner': '관형사',\n", 602 | " 'Eomi': '어미',\n", 603 | " 'Exclamation': '감탄사',\n", 604 | " 'Foreign': '외국어, 한자 및 기타기호',\n", 605 | " 'Hashtag': '트위터 해쉬태그',\n", 606 | " 'Josa': '조사',\n", 607 | " 'KoreanParticle': '(ex: ㅋㅋ)',\n", 608 | " 'Modifier': '관형사',\n", 609 | " 'Noun': '명사',\n", 610 | " 'Number': '숫자',\n", 611 | " 'PreEomi': '선어말어미',\n", 612 | " 'Punctuation': '구두점',\n", 613 | " 'ScreenName': '트위터 아이디',\n", 614 | " 'Suffix': '접미사',\n", 615 | " 'Unknown': '미등록어',\n", 616 | " 'Verb': '동사'}\n", 617 | " \n", 618 | "twitter.tagset에 등록되어 있지 않는 품사에 대해서는 ValueError를 raise 합니다. " 619 | ] 620 | }, 621 | { 622 | "cell_type": "code", 623 | "execution_count": 17, 624 | "metadata": {}, 625 | "outputs": [ 626 | { 627 | "ename": "ValueError", 628 | "evalue": "Name is not available tag", 629 | "output_type": "error", 630 | "traceback": [ 631 | "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", 632 | "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", 633 | "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mtwitter\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0madd_dictionary\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'lovit'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'Name'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", 634 | "\u001b[0;32m/mnt/lovit/git/customized-konlpy/ckonlpy/tag/_abstract.py\u001b[0m in \u001b[0;36madd_dictionary\u001b[0;34m(self, words, tag, force)\u001b[0m\n\u001b[1;32m 46\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0madd_dictionary\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mwords\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtag\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mforce\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 47\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;32mnot\u001b[0m \u001b[0mforce\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;32mnot\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mtag\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtagset\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 48\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0mValueError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'%s is not available tag'\u001b[0m \u001b[0;34m%\u001b[0m \u001b[0mtag\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 49\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mforce\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;32mnot\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mtag\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtagset\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 50\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtemplate_tagger\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0madd_a_template\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtag\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", 635 | "\u001b[0;31mValueError\u001b[0m: Name is not available tag" 636 | ] 637 | } 638 | ], 639 | "source": [ 640 | "twitter.add_dictionary('lovit', 'Name')" 641 | ] 642 | }, 643 | { 644 | "cell_type": "markdown", 645 | "metadata": {}, 646 | "source": [ 647 | "하지만 Twitter.add_dictionary(words, tag, force=True)로 단어를 사전에 입력하면 알려지지 않은 품사라 하더라도 입력할 수 있습니다. " 648 | ] 649 | }, 650 | { 651 | "cell_type": "code", 652 | "execution_count": 18, 653 | "metadata": {}, 654 | "outputs": [ 655 | { 656 | "name": "stdout", 657 | "output_type": "stream", 658 | "text": [ 659 | "dict_keys(['Modifier', 'Noun', 'Josa', 'Name'])\n" 660 | ] 661 | } 662 | ], 663 | "source": [ 664 | "twitter.add_dictionary('lovit', 'Name', force=True)\n", 665 | "print(twitter.dictionary._pos2words.keys())" 666 | ] 667 | }, 668 | { 669 | "cell_type": "markdown", 670 | "metadata": {}, 671 | "source": [ 672 | "알려지지 않은 품사를 단어 사전에 추가하면 template 에 해당 단어가 잡힐 수 있도록 자동으로 (tag,) 라는 템플릿이 추가됩니다." 673 | ] 674 | }, 675 | { 676 | "cell_type": "code", 677 | "execution_count": 19, 678 | "metadata": {}, 679 | "outputs": [ 680 | { 681 | "data": { 682 | "text/plain": [ 683 | "[('Adjective',),\n", 684 | " ('Adverb',),\n", 685 | " ('Conjunction',),\n", 686 | " ('Exclamation',),\n", 687 | " ('KoreanParticle',),\n", 688 | " ('Noun',),\n", 689 | " ('Verb',),\n", 690 | " ('Noun', 'Noun'),\n", 691 | " ('Noun', 'Josa'),\n", 692 | " ('Noun', 'Adjective'),\n", 693 | " ('Noun', 'Verb'),\n", 694 | " ('Modifier', 'Noun'),\n", 695 | " ('Noun', 'Noun', 'Adjective'),\n", 696 | " ('Noun', 'Noun', 'Josa'),\n", 697 | " ('Noun', 'Noun', 'Verb'),\n", 698 | " ('Modifier', 'Noun', 'Josa'),\n", 699 | " ('Noun', 'Noun', 'Noun', 'Josa'),\n", 700 | " ('Name',)]" 701 | ] 702 | }, 703 | "execution_count": 19, 704 | "metadata": {}, 705 | "output_type": "execute_result" 706 | } 707 | ], 708 | "source": [ 709 | "twitter.template_tagger.templates" 710 | ] 711 | }, 712 | { 713 | "cell_type": "markdown", 714 | "metadata": {}, 715 | "source": [ 716 | "하지만 아래 문장에서 ('Name', 'Josa') 라는 template 이 없기 때문에 '은'이 명사로 처리됩니다." 717 | ] 718 | }, 719 | { 720 | "cell_type": "code", 721 | "execution_count": 20, 722 | "metadata": {}, 723 | "outputs": [ 724 | { 725 | "data": { 726 | "text/plain": [ 727 | "[('lovit', 'Name'), ('은', 'Noun'), ('이름', 'Noun'), ('입니다', 'Adjective')]" 728 | ] 729 | }, 730 | "execution_count": 20, 731 | "metadata": {}, 732 | "output_type": "execute_result" 733 | } 734 | ], 735 | "source": [ 736 | "twitter.pos('lovit은 이름입니다')" 737 | ] 738 | }, 739 | { 740 | "cell_type": "markdown", 741 | "metadata": {}, 742 | "source": [ 743 | "'Name'이라는 클래스 (더이상 품사가 아니므로)를 이용하는 탬플릿을 하나 입력한 뒤 pos에 입력하면 어절 'lovit은' customized_tagger에 의하여 처리가 되고, 사용자 사전에 알려지지 않은 어절은 본래의 트위터 분석기에 의하여 처리가 됩니다. " 744 | ] 745 | }, 746 | { 747 | "cell_type": "code", 748 | "execution_count": 21, 749 | "metadata": {}, 750 | "outputs": [ 751 | { 752 | "name": "stdout", 753 | "output_type": "stream", 754 | "text": [ 755 | "[('Adjective',),\n", 756 | " ('Adverb',),\n", 757 | " ('Conjunction',),\n", 758 | " ('Exclamation',),\n", 759 | " ('KoreanParticle',),\n", 760 | " ('Noun',),\n", 761 | " ('Verb',),\n", 762 | " ('Noun', 'Noun'),\n", 763 | " ('Noun', 'Josa'),\n", 764 | " ('Noun', 'Adjective'),\n", 765 | " ('Noun', 'Verb'),\n", 766 | " ('Modifier', 'Noun'),\n", 767 | " ('Noun', 'Noun', 'Adjective'),\n", 768 | " ('Noun', 'Noun', 'Josa'),\n", 769 | " ('Noun', 'Noun', 'Verb'),\n", 770 | " ('Modifier', 'Noun', 'Josa'),\n", 771 | " ('Noun', 'Noun', 'Noun', 'Josa'),\n", 772 | " ('Name',),\n", 773 | " ('Name', 'Josa')]\n" 774 | ] 775 | }, 776 | { 777 | "data": { 778 | "text/plain": [ 779 | "[('lovit', 'Name'),\n", 780 | " ('은', 'Josa'),\n", 781 | " ('이름', 'Noun'),\n", 782 | " ('입니다', 'Adjective'),\n", 783 | " ('.', 'Punctuation')]" 784 | ] 785 | }, 786 | "execution_count": 21, 787 | "metadata": {}, 788 | "output_type": "execute_result" 789 | } 790 | ], 791 | "source": [ 792 | "twitter.template_tagger.add_a_template(('Name', 'Josa'))\n", 793 | "pprint(twitter.template_tagger.templates)\n", 794 | "twitter.pos('lovit은 이름입니다.')" 795 | ] 796 | }, 797 | { 798 | "cell_type": "markdown", 799 | "metadata": {}, 800 | "source": [ 801 | "### Scoring\n", 802 | "\n", 803 | "Templates를 이용하여도 후보가 여러 개 나올 수 있습니다. 여러 개 후보 중에서 best 를 선택하는 함수를 직접 디자인 할 수 도 있습니다. 이처럼 몇 개의 점수 기준을 만들고, 각 기준의 weight를 부여하는 방식은 트위터 분석기에서 이용하는 방식인데, 직관적이고 튜닝 가능해서 매우 좋은 방식이라 생각합니다. " 804 | ] 805 | }, 806 | { 807 | "cell_type": "code", 808 | "execution_count": 22, 809 | "metadata": {}, 810 | "outputs": [ 811 | { 812 | "name": "stdout", 813 | "output_type": "stream", 814 | "text": [ 815 | "candidate\n", 816 | "[('이', 'Noun', 0, 1),\n", 817 | " ('것', 'Noun', 1, 2),\n", 818 | " ('은', 'Josa', 2, 3),\n", 819 | " ('테', 'Noun', 3, 4),\n", 820 | " ('스트', 'Noun', 4, 6)]\n", 821 | "score = -0.3999999999999999\n", 822 | "\n", 823 | "candidate\n", 824 | "[('이것', 'Noun', 0, 2),\n", 825 | " ('은', 'Josa', 2, 3),\n", 826 | " ('테', 'Noun', 3, 4),\n", 827 | " ('스트', 'Noun', 4, 6)]\n", 828 | "score = -0.10000000000000009\n", 829 | "\n", 830 | "candidate\n", 831 | "[('이것', 'Noun', 0, 2), ('은', 'Josa', 2, 3), ('테스트', 'Noun', 3, 6)]\n", 832 | "score = 0.19999999999999996\n", 833 | "\n" 834 | ] 835 | } 836 | ], 837 | "source": [ 838 | "my_weights = [\n", 839 | " ('num_nouns', -0.1), \n", 840 | " ('num_words', -0.2),\n", 841 | " ('no_noun', -1),\n", 842 | " ('len_sum_of_nouns', 0.2)\n", 843 | "]\n", 844 | "\n", 845 | "def my_evaluate_function(candidate):\n", 846 | " num_nouns = len([word for word, pos, begin, e in candidate if pos == 'Noun'])\n", 847 | " num_words = len(candidate)\n", 848 | " has_no_nouns = (num_nouns == 0)\n", 849 | " len_sum_of_nouns = 0 if has_no_nouns else sum(\n", 850 | " (len(word) for word, pos, _, _ in candidate if pos == 'Noun'))\n", 851 | "\n", 852 | " scores = (num_nouns, num_words, has_no_nouns, len_sum_of_nouns)\n", 853 | " score = sum((score * weight for score, (_, weight) in zip(scores, my_weights)))\n", 854 | " return score\n", 855 | "\n", 856 | "twitter.set_evaluator(my_weights, my_evaluate_function, test=True)" 857 | ] 858 | }, 859 | { 860 | "cell_type": "markdown", 861 | "metadata": {}, 862 | "source": [ 863 | "### Stem, Norm\n", 864 | "\n", 865 | "pos 함수에서 norm, stem 옵션을 사용할 수 있습니다." 866 | ] 867 | }, 868 | { 869 | "cell_type": "code", 870 | "execution_count": 23, 871 | "metadata": {}, 872 | "outputs": [ 873 | { 874 | "data": { 875 | "text/plain": [ 876 | "[('테스트', 'Noun'), ('이다', 'Adjective')]" 877 | ] 878 | }, 879 | "execution_count": 23, 880 | "metadata": {}, 881 | "output_type": "execute_result" 882 | } 883 | ], 884 | "source": [ 885 | "twitter.pos('테스트입니다', norm=True, stem=True)" 886 | ] 887 | }, 888 | { 889 | "cell_type": "code", 890 | "execution_count": 24, 891 | "metadata": {}, 892 | "outputs": [ 893 | { 894 | "data": { 895 | "text/plain": [ 896 | "[('테스트', 'Noun'), ('입니다', 'Adjective')]" 897 | ] 898 | }, 899 | "execution_count": 24, 900 | "metadata": {}, 901 | "output_type": "execute_result" 902 | } 903 | ], 904 | "source": [ 905 | "twitter.pos('테스트입니다', norm=True, stem=False)" 906 | ] 907 | }, 908 | { 909 | "cell_type": "code", 910 | "execution_count": 25, 911 | "metadata": {}, 912 | "outputs": [ 913 | { 914 | "data": { 915 | "text/plain": [ 916 | "[('테스트', 'Noun'), ('이다', 'Adjective')]" 917 | ] 918 | }, 919 | "execution_count": 25, 920 | "metadata": {}, 921 | "output_type": "execute_result" 922 | } 923 | ], 924 | "source": [ 925 | "twitter.pos('테스트입니다', norm=False, stem=True)" 926 | ] 927 | }, 928 | { 929 | "cell_type": "markdown", 930 | "metadata": {}, 931 | "source": [ 932 | "### Postprocessing\n", 933 | "\n", 934 | "passwords, stopwords, 특정 품사, 혹은 미리 정의된 사전을 이용하여 단어를 변환하여 출력합니다. \n", 935 | "\n", 936 | "passwords 는 단어, (단어, 품사)를 입력하면 해당 단어 외에는 출력하지 않습니다. " 937 | ] 938 | }, 939 | { 940 | "cell_type": "code", 941 | "execution_count": 26, 942 | "metadata": {}, 943 | "outputs": [ 944 | { 945 | "name": "stdout", 946 | "output_type": "stream", 947 | "text": [ 948 | "before : [('우리', 'Noun'), ('아이오아이', 'Noun'), ('는', 'Verb'), ('정말', 'Noun'), ('이뻐요', 'Adjective')]\n", 949 | "\n", 950 | "after : [('아이오아이', 'Noun'), ('정말', 'Noun')]\n" 951 | ] 952 | } 953 | ], 954 | "source": [ 955 | "from ckonlpy.tag import Postprocessor\n", 956 | "\n", 957 | "passwords = {'아이오아이', ('정말', 'Noun')}\n", 958 | "postprocessor = Postprocessor(\n", 959 | " base_tagger = twitter,\n", 960 | " passwords = passwords\n", 961 | ")\n", 962 | "\n", 963 | "sent = '우리아이오아이는 정말 이뻐요'\n", 964 | "print('before : %s\\n' % twitter.pos(sent))\n", 965 | "print('after : %s' % postprocessor.pos(sent))" 966 | ] 967 | }, 968 | { 969 | "cell_type": "markdown", 970 | "metadata": {}, 971 | "source": [ 972 | "stopwords 에 등록된 단어, (단어, 품사)는 pos 결과에서 제외됩니다. " 973 | ] 974 | }, 975 | { 976 | "cell_type": "code", 977 | "execution_count": 27, 978 | "metadata": {}, 979 | "outputs": [ 980 | { 981 | "name": "stdout", 982 | "output_type": "stream", 983 | "text": [ 984 | "before : [('우리', 'Noun'), ('아이오아이', 'Noun'), ('는', 'Verb'), ('정말', 'Noun'), ('이뻐요', 'Adjective')]\n", 985 | "\n", 986 | "after : [('우리', 'Noun'), ('아이오아이', 'Noun'), ('정말', 'Noun'), ('이뻐요', 'Adjective')]\n" 987 | ] 988 | } 989 | ], 990 | "source": [ 991 | "stopwords = {'는'}\n", 992 | "\n", 993 | "postprocessor = Postprocessor(\n", 994 | " base_tagger = twitter,\n", 995 | " stopwords = stopwords\n", 996 | ")\n", 997 | "\n", 998 | "sent = '우리아이오아이는 정말 이뻐요'\n", 999 | "print('before : %s\\n' % twitter.pos(sent))\n", 1000 | "print('after : %s' % postprocessor.pos(sent))" 1001 | ] 1002 | }, 1003 | { 1004 | "cell_type": "markdown", 1005 | "metadata": {}, 1006 | "source": [ 1007 | "특정 품사를 지정하면 해당 품사만 pos 에서 출력됩니다. " 1008 | ] 1009 | }, 1010 | { 1011 | "cell_type": "code", 1012 | "execution_count": 28, 1013 | "metadata": {}, 1014 | "outputs": [ 1015 | { 1016 | "name": "stdout", 1017 | "output_type": "stream", 1018 | "text": [ 1019 | "before : [('우리', 'Noun'), ('아이오아이', 'Noun'), ('는', 'Verb'), ('정말', 'Noun'), ('이뻐요', 'Adjective')]\n", 1020 | "\n", 1021 | "after : [('우리', 'Noun'), ('아이오아이', 'Noun'), ('정말', 'Noun')]\n" 1022 | ] 1023 | } 1024 | ], 1025 | "source": [ 1026 | "passtags = {'Noun'}\n", 1027 | "\n", 1028 | "postprocessor = Postprocessor(\n", 1029 | " base_tagger = twitter,\n", 1030 | " passtags = passtags\n", 1031 | ")\n", 1032 | "\n", 1033 | "sent = '우리아이오아이는 정말 이뻐요'\n", 1034 | "print('before : %s\\n' % twitter.pos(sent))\n", 1035 | "print('after : %s' % postprocessor.pos(sent))" 1036 | ] 1037 | }, 1038 | { 1039 | "cell_type": "markdown", 1040 | "metadata": {}, 1041 | "source": [ 1042 | "치환할 단어, (단어, 품사)를 dict 형식으로 정의하면 pos 에서 단어가 치환되어 출력됩니다. " 1043 | ] 1044 | }, 1045 | { 1046 | "cell_type": "code", 1047 | "execution_count": 29, 1048 | "metadata": {}, 1049 | "outputs": [ 1050 | { 1051 | "name": "stdout", 1052 | "output_type": "stream", 1053 | "text": [ 1054 | "before : [('우리', 'Noun'), ('아이오아이', 'Noun'), ('는', 'Verb'), ('정말', 'Noun'), ('이뻐요', 'Adjective')]\n", 1055 | "\n", 1056 | "after : [('우리', 'Noun'), ('아이돌', 'Noun'), ('는', 'Verb'), ('정말', 'Noun'), ('이뻐요', 'Adjective')]\n" 1057 | ] 1058 | } 1059 | ], 1060 | "source": [ 1061 | "replace = {\n", 1062 | " '아이오아이': '아이돌',\n", 1063 | " ('이뻐', 'Adjective'): '예쁘다'\n", 1064 | "}\n", 1065 | "\n", 1066 | "postprocessor = Postprocessor(\n", 1067 | " base_tagger = twitter,\n", 1068 | " replace = replace\n", 1069 | ")\n", 1070 | "\n", 1071 | "sent = '우리아이오아이는 정말 이뻐요'\n", 1072 | "print('before : %s\\n' % twitter.pos(sent))\n", 1073 | "print('after : %s' % postprocessor.pos(sent))" 1074 | ] 1075 | }, 1076 | { 1077 | "cell_type": "markdown", 1078 | "metadata": {}, 1079 | "source": [ 1080 | "하나의 단어로 묶을 단어열을 tuple of str 로 만든 뒤, 품사와 함께 nested tuple 로 만듭니다. ngram 에 입력된 단어열은 ngram pos tag 로 합쳐져 출력됩니다. ngram pos tag 는 임의의 태그 이름을 넣을 수 있습니다." 1081 | ] 1082 | }, 1083 | { 1084 | "cell_type": "code", 1085 | "execution_count": 30, 1086 | "metadata": {}, 1087 | "outputs": [ 1088 | { 1089 | "name": "stdout", 1090 | "output_type": "stream", 1091 | "text": [ 1092 | "before : [('미스', 'Noun'), ('함무라비', 'Noun'), ('는', 'Josa'), ('재밌는', 'Adjective'), ('드라마', 'Noun'), ('입니다', 'Adjective')]\n", 1093 | "\n", 1094 | "after : [('미스 - 함무라비', 'Noun'), ('는', 'Josa'), ('재밌는', 'Adjective'), ('드라마', 'Noun'), ('입니다', 'Adjective')]\n", 1095 | "\n", 1096 | "\n", 1097 | "before : [('바람', 'Noun'), ('의', 'Josa'), ('나라', 'Noun'), ('는', 'Josa'), ('게임', 'Noun'), ('이름', 'Noun'), ('입니다', 'Adjective')]\n", 1098 | "\n", 1099 | "after : [('바람 - 의 - 나라', 'Game'), ('는', 'Josa'), ('게임', 'Noun'), ('이름', 'Noun'), ('입니다', 'Adjective')]\n" 1100 | ] 1101 | } 1102 | ], 1103 | "source": [ 1104 | "ngrams = [(('미스', '함무라비'), 'Noun'), (('바람', '의', '나라'), 'Game')]\n", 1105 | "\n", 1106 | "postprocessor = Postprocessor(\n", 1107 | " base_tagger = twitter,\n", 1108 | " ngrams = ngrams\n", 1109 | ")\n", 1110 | "\n", 1111 | "sent = '미스 함무라비는 재밌는 드라마입니다'\n", 1112 | "print('before : %s\\n' % twitter.pos(sent))\n", 1113 | "print('after : %s\\n\\n' % postprocessor.pos(sent))\n", 1114 | "\n", 1115 | "sent = '바람의 나라는 게임이름 입니다'\n", 1116 | "print('before : %s\\n' % twitter.pos(sent))\n", 1117 | "print('after : %s' % postprocessor.pos(sent))" 1118 | ] 1119 | }, 1120 | { 1121 | "cell_type": "markdown", 1122 | "metadata": {}, 1123 | "source": [ 1124 | "단어열만 입력한 경우에는 ngram 의 품사를 명사로 가정합니다." 1125 | ] 1126 | }, 1127 | { 1128 | "cell_type": "code", 1129 | "execution_count": 31, 1130 | "metadata": {}, 1131 | "outputs": [ 1132 | { 1133 | "name": "stdout", 1134 | "output_type": "stream", 1135 | "text": [ 1136 | "before : [('미스', 'Noun'), ('함무라비', 'Noun'), ('는', 'Josa'), ('재밌는', 'Adjective'), ('드라마', 'Noun'), ('입니다', 'Adjective')]\n", 1137 | "\n", 1138 | "after : [('미스 - 함무라비', 'Noun'), ('는', 'Josa'), ('재밌는', 'Adjective'), ('드라마', 'Noun'), ('입니다', 'Adjective')]\n", 1139 | "\n", 1140 | "\n", 1141 | "before : [('바람', 'Noun'), ('의', 'Josa'), ('나라', 'Noun'), ('는', 'Josa'), ('게임', 'Noun'), ('이름', 'Noun'), ('입니다', 'Adjective')]\n", 1142 | "\n", 1143 | "after : [('바람 - 의 - 나라', 'Noun'), ('는', 'Josa'), ('게임', 'Noun'), ('이름', 'Noun'), ('입니다', 'Adjective')]\n" 1144 | ] 1145 | } 1146 | ], 1147 | "source": [ 1148 | "ngrams = [('미스', '함무라비'), ('바람', '의', '나라')]\n", 1149 | "\n", 1150 | "postprocessor = Postprocessor(\n", 1151 | " base_tagger = twitter,\n", 1152 | " ngrams = ngrams\n", 1153 | ")\n", 1154 | "\n", 1155 | "sent = '미스 함무라비는 재밌는 드라마입니다'\n", 1156 | "print('before : %s\\n' % twitter.pos(sent))\n", 1157 | "print('after : %s\\n\\n' % postprocessor.pos(sent))\n", 1158 | "\n", 1159 | "sent = '바람의 나라는 게임이름 입니다'\n", 1160 | "print('before : %s\\n' % twitter.pos(sent))\n", 1161 | "print('after : %s' % postprocessor.pos(sent))" 1162 | ] 1163 | }, 1164 | { 1165 | "cell_type": "markdown", 1166 | "metadata": {}, 1167 | "source": [ 1168 | "## Loading wordset\n", 1169 | "\n", 1170 | "utils 에는 stopwords, passwords, replace word pair 를 파일로 저장하였을 경우, 이를 손쉽게 불러오는 함수가 있습니다.\n", 1171 | "\n", 1172 | "load_wordset 은 set of str 혹은 set of tuple 을 return 합니다. 예시의 passwords.txt 의 내용은 아래와 같습니다. 단어의 품사는 한 칸 띄어쓰기로 구분합니다.\n", 1173 | "\n", 1174 | " 아이오아이\n", 1175 | " 아이오아이 Noun\n", 1176 | " 공연" 1177 | ] 1178 | }, 1179 | { 1180 | "cell_type": "code", 1181 | "execution_count": 32, 1182 | "metadata": {}, 1183 | "outputs": [ 1184 | { 1185 | "name": "stdout", 1186 | "output_type": "stream", 1187 | "text": [ 1188 | "{'공연', '아이오아이', ('아이오아이', 'Noun')}\n" 1189 | ] 1190 | } 1191 | ], 1192 | "source": [ 1193 | "from ckonlpy.utils import load_wordset\n", 1194 | "\n", 1195 | "passwords = load_wordset('./passwords.txt')\n", 1196 | "print(passwords)" 1197 | ] 1198 | }, 1199 | { 1200 | "cell_type": "markdown", 1201 | "metadata": {}, 1202 | "source": [ 1203 | "stopwords.txt 의 포멧은 passwords.txt 와 같습니다. 단어의 품사가 있을 경우 한 칸 띄어쓰기로 구분합니다.\n", 1204 | "\n", 1205 | " 은\n", 1206 | " 는\n", 1207 | " 이 Josa" 1208 | ] 1209 | }, 1210 | { 1211 | "cell_type": "code", 1212 | "execution_count": 33, 1213 | "metadata": {}, 1214 | "outputs": [ 1215 | { 1216 | "name": "stdout", 1217 | "output_type": "stream", 1218 | "text": [ 1219 | "{('이', 'Josa'), '는', '은'}\n" 1220 | ] 1221 | } 1222 | ], 1223 | "source": [ 1224 | "stopwords = load_wordset('./stopwords.txt')\n", 1225 | "print(stopwords)" 1226 | ] 1227 | }, 1228 | { 1229 | "cell_type": "markdown", 1230 | "metadata": {}, 1231 | "source": [ 1232 | "치환할 단어쌍은 tap 구분이 되어있습니다. 치환될 단어에 품사 태그가 있을 경우 한 칸 띄어쓰기로 구분합니다.\n", 1233 | "\n", 1234 | " str\\tstr\n", 1235 | " str str\\tstr\n", 1236 | "\n", 1237 | "아래는 replacewords.txt 의 예시입니다.\n", 1238 | "\n", 1239 | " 아빠\t아버지\n", 1240 | " 엄마 Noun\t어머니" 1241 | ] 1242 | }, 1243 | { 1244 | "cell_type": "code", 1245 | "execution_count": 34, 1246 | "metadata": {}, 1247 | "outputs": [ 1248 | { 1249 | "name": "stdout", 1250 | "output_type": "stream", 1251 | "text": [ 1252 | "{'아빠': '아버지', ('엄마', 'Noun'): '어머니'}\n" 1253 | ] 1254 | } 1255 | ], 1256 | "source": [ 1257 | "from ckonlpy.utils import load_replace_wordpair\n", 1258 | "\n", 1259 | "replace = load_replace_wordpair('./replacewords.txt')\n", 1260 | "print(replace)" 1261 | ] 1262 | }, 1263 | { 1264 | "cell_type": "markdown", 1265 | "metadata": {}, 1266 | "source": [ 1267 | "ngram 은 띄어쓰기 단위로 ngram 의 구성 단어를 기술합니다. tap 기준으로 ngram pos tag 를 저장합니다. pos tag 가 없다면 단어열만 포함합니다.\n", 1268 | "\n", 1269 | " str str\n", 1270 | " str str str\\tstr" 1271 | ] 1272 | }, 1273 | { 1274 | "cell_type": "code", 1275 | "execution_count": 35, 1276 | "metadata": {}, 1277 | "outputs": [ 1278 | { 1279 | "name": "stdout", 1280 | "output_type": "stream", 1281 | "text": [ 1282 | "[('바람', '의', '나라'), (('미스', '함무라비'), 'Noun')]\n" 1283 | ] 1284 | } 1285 | ], 1286 | "source": [ 1287 | "from ckonlpy.utils import load_ngram\n", 1288 | "\n", 1289 | "ngrams = load_ngram('./ngrams.txt')\n", 1290 | "pprint(ngrams)" 1291 | ] 1292 | }, 1293 | { 1294 | "cell_type": "code", 1295 | "execution_count": null, 1296 | "metadata": { 1297 | "collapsed": true 1298 | }, 1299 | "outputs": [], 1300 | "source": [] 1301 | } 1302 | ], 1303 | "metadata": { 1304 | "anaconda-cloud": {}, 1305 | "kernelspec": { 1306 | "display_name": "Python 3", 1307 | "language": "python", 1308 | "name": "python3" 1309 | }, 1310 | "language_info": { 1311 | "codemirror_mode": { 1312 | "name": "ipython", 1313 | "version": 3 1314 | }, 1315 | "file_extension": ".py", 1316 | "mimetype": "text/x-python", 1317 | "name": "python", 1318 | "nbconvert_exporter": "python", 1319 | "pygments_lexer": "ipython3", 1320 | "version": "3.6.2" 1321 | } 1322 | }, 1323 | "nbformat": 4, 1324 | "nbformat_minor": 1 1325 | } 1326 | --------------------------------------------------------------------------------