본문 바로가기

NLP ( 자연어 처리 )

katz-backoff Katz back-off is a generative n-gram language model that estimates the conditional probability of a word given its history in the n-gram. 위키에 있는 설명이다. 주로 n-gram 모델에서 많이 사용되며, 조건부 확률을 추정하는데 있어 dynamic 하게 smoothing 하는 기법으로 사용된다. 이 말이 어렵다면 좀더 쉽게 풀어서 설명을 해보자. lm 파일에 등록되지 않은 단어의 조합이 있다면 그 단어의 조합이 나올 확률은 0인가?? 그렇지 않다. 그렇다면 적절하게 어느정도의 확률을 줄것인가가 문제가 되는데 그 계산법 중 하나가 바로 Katz back-off 이다. 이처럼 dictinory 혹은 .. 더보기
ARPA Language models 너무 아무 정보 없이 시작했더니 삽질을 많이한듯... ㅋㅋ 어쩌다 확장자가 .lm 로 시작하는 파일을 구했고... 물어보기 보단 혼자 파봐야 겠다는 생각에이게 먼파일인지 한참을 찾다가 ARPA Format 형태로 작성된 파일이라는 것을 알게 되었다. 아!! 혹시 language model 이 뭐지?? 라고 생각하시는 분들을 위해!https://en.wikipedia.org/wiki/Language_model language model 에 대한 위키페이지인데 읽어보실 분들은 읽어보시구~그냥 특정 사전( 또는 Documents, resources 등에서라고 이해해도 될듯!) 에서의 단어들의 확률 분포( 출현 빈도 ) 이다. 그니까 ARPA Format 의 lm 파일은 이러한 단어들의 확률분포를 문서에 어떠한.. 더보기
Zipf's law 지프의 법칙 Zipf's law states that given some corpus of natural language utterances, the frequency of any word is inversely proportional to its rank in the frequency table. Rank 와 빈도수는 반비례 한다. ( 가장 핵심적인 표현인듯... 이거 하나로 지프의 법칙의 90%이상은 설명한 것이 아닐까라는 개인적인 생각... +_+ ) 다만 쫌 필자 입장에서 애매한건 rank 가 먼 의미지;; word in corpus 의 rank 는 어떤 의미일까;;; 흠...;;; Although Zipf’s Law holds for most languages, even for non-natur.. 더보기
Edit distance Edit distance 를 구하기 위해 java 로 짜보았다. class EditDistance { // ㄱ ㄲ ㄴ ㄷ ㄸ ㄹ ㅁ ㅂ ㅃ ㅅ ㅆ ㅇ ㅈ ㅉ ㅊ ㅋ ㅌ ㅍ ㅎ final static char[] ChoSung = { 0x3131, 0x3132, 0x3134, 0x3137, 0x3138, 0x3139, 0x3141, 0x3142, 0x3143, 0x3145, 0x3146, 0x3147, 0x3148, 0x3149, 0x314a, 0x314b, 0x314c, 0x314d, 0x314e }; // ㅏ ㅐ ㅑ ㅒ ㅓ ㅔ ㅕ ㅖ ㅗ ㅘ ㅙ ㅚ ㅛ ㅜ ㅝ ㅞ ㅟ ㅠ ㅡ ㅢ ㅣ final static char[] JwungSung = { 0x314f, 0x3150, 0x3151, 0x3152, 0x3.. 더보기
ngram-count 오늘은 SRI Language Modeling Toolkit 을 이용해서 ngram-count 를 해보는 것을 해보자!! 일단 SRILM 을 깔아야 한다. Download URL : http://www.speech.sri.com/projects/srilm/download.html 위에서 I accept the License 버튼을 누르고 다운 받으면 된다. 설치하는 법은 ... 설명하기가 번거로우니 참조할만한 블로그를 링크!! http://www.spencegreen.com/2012/02/01/installing-srilm-on-ubuntu-11-10/ 위에서는 Ubuntu 에서 설치했으니, 맥에서 하는경우 1~4번까지만 따라하고 바로 7번으로 건너뛰고 make 명령어만 치면 된다. ( 위 블로그 처럼 .. 더보기
n-gram An n-gram model is a type of probabilistic language model. More concisely, an n-gram model predicts based on . In probability terms, this is . When used for language modeling, independence assumptions are made so that each word depends only on the last n − 1 words. Applications and considerations[edit]n-gram models are widely used in statistical natural language processing. In speech recognition.. 더보기