본문 바로가기

Computer/NLP11

python editdistance library 속도 비교(timeit) python editdistance library를 검색하면 다양한 라이브러리가 나옵니다. 그중 editditsance, python-Levenshtein에 대해 속도 비교한 내용입니다. timeit을 배우려고 timeit으로 속도 비교를 해봤습니다. 참고 1, editdistance, https://github.com/roy-ht/editdistance 참고 2, python-Levenshtein, https://maxbachmann.github.io/Levenshtein/ 참고 3, timeit, https://docs.python.org/ko/3/library/timeit.html [timeit — 작은 코드 조각의 실행 시간 측정 — Python 3.11.1 문서 timeit — 작은 코드 조각의.. 2022. 12. 8.
Bert Examples 1) huggingface bert를 많이 사용 huggingface.co/transformers/notebooks.html 🤗 Transformers Notebooks You can find here a list of the official notebooks provided by Hugging Face. Also, we would like to list here interesting content created by the community. I... huggingface.co 2) best practice: bert를 classification에 사용 colab.research.google.com/github/huggingface/notebooks/blob/master/examples/text_cla.. 2021. 4. 30.
jaro-winkler similarity(jaro-winkler distance) 프로젝트 중 알게된 edit distance 비교 방법이 있어서 정리해본다.(사실 매번 Damerau–Levenshtein distance만 사용했었다...) jaro similarity(jaro distance) jaro distance는 두 단어간의 transpositions에 집중한 알고리즘이다.(insertion, deletion, substitution은 고려하지 않음) transposition은 간단히 위치 교환이라고 생각하면 된다. 아래와 같이 두 단어가 있을 때, transpositions은 총 2회 발생한다.(a=> b, b => a) word1 : a ---- bword2 : b ---- a jaro distance는 두 단어가 비슷할수록 1에 가까운 값을 가지고, 다를수록 0에 가까운.. 2018. 5. 13.
noisy channel model and spell correction 잠깐 보고 정리해봅니다...(기억력의 한계를 극복해보고자...) ref : https://web.stanford.edu/~jurafsky/slp3/5.pdf일단 noisy channel model은 "original word가 noisy channel에 의해 noisy word(distorted 됐다고 표현)가 되고, 이를 decoder를 통해 original word와 가장 비슷한 것을 추측"하는 모델인데... 스펠러와 연결지어 생각해보면... 1) misspelled word : noisy word(noisy channel을 통해 distorted된 word)2) noise는 substitutions or other changes to the letters(original word에서 distorte.. 2018. 5. 8.