[Python] Unidecode 특수 문자나 기호 등의 유니코드를 아스키로 변환
By 지훈현서 | 2022년 1월 19일 |
파이썬으로 작업을 하다보면 "kožušček" 와 같은 유럽권 문자나 '나 "와 같은 따옴표 같은데 실제 코드로 들여다 보면,UniCode의 특별 코드를 이용하는 경우가 있습니다.이런 경우 바로 찾기가 쉽지 않습니다. title 에 해당 유니코드 문자를 포함하고 있을 경우, title = title.replace('’', "'") title = title.replace('“', '"') title = title.replace('”', '"')이와 같이 일일이 바꾸는 것도 뭔가 찜찜합니다. 이런 경우 ASCII 로 알아서 변환을 해 주는 모듈이 바로Unidecode 라는 모듈입니다. from unidecode import unidecode라고 import 한 후,
[Python] 파이썬으로 페이스북 메신저로 메시지 보내기 2
By 지훈현서 | 2017년 6월 29일 |
지난번에 파이썬으로 페이스북 메신저로 메시지 보내기를 살펴보았습니다. 그런데 이것을 테스트 하면 할 수록, Client() 생성자에 10여초 이상 걸리고send()를 하는데 적게는 2초, 많게는 6초 이상 시간이 소요되는 것이었습니다. 버전은 0.9.3 이었습니다.어찐된 것인지 조사를 하다가fbchat 모듈을 살펴보는데... 아뿔사. 일이주 지난 것 같은데 버전업이 되었네요. 아마도 내부 프로토콜이 변경된 느낌입니다. 결국 지난번 샘플 코드는 #!/usr/bin/env python# encoding=utf-8 from fbchat import Clientfc = Client('[email protected]', '______')friends = fc.getUsers('____')friend =
mac os x xgboost installation
By 공부가 본업. | 2017년 8월 6일 |
brew tap homebrew/versions; brew install gcc --without-multilib pip install xgboost또는 잘 안되는 지도 모른다. 방법은 잘 되는 듯.
가장 쉬운 드랍아웃 [Keras]
By Imagination is more important than knowledge (지식보다 상상) | 2020년 1월 10일 |
가장 쉬운 드랍아웃 [Keras] 딥러닝에서 과적합(overfitting)을 피할 수 있는 방법으로서 드랍아웃 방법이 아주 유명하다. https://en.wikipedia.org/wiki/Dropout_(neural_networks)https://en.wikipedia.org/wiki/Regularization_(mathematics)https://machinelearningmastery.com/dropout-regularization-deep-learning-models-keras/https://machinelearningmastery.com/how-to-reduce-overfitting-with-dropout-regularization-in-keras/http://incredible.egloos.com