👨🏻‍🏫IT 활동/인공지능교육 - NLP

    [NLP] Day 28 - Project 5

    Project 5자동분류 성능평가Naive BayesIn [665]:import os def getFileList(base='./', ext='.txt'): fileList = list() for file in os.listdir(base): if file.endswith(ext): # == if file.split('.')[-1] == ext: fileList.append('{0}/{1}'.format(base, file)) return fileList In [666]:def getContent(file): with open(file, encoding='utf-8') as f: content = f.read() return content In [667]:cat = getFileList('./News')..

    [NLP] Day 27 - Evaluation

    Evaluation file:///Users/charming/Downloads/6.%20%ED%9B%88%EB%A0%A8,%20%EA%B2%80%EC%82%AC,%20%EA%B7%9C%EC%B9%99%ED%99%94[%EC%A0%95%EA%B7%9C%ED%99%94]%20(2%EA%B0%95%20%ED%8E%B8%ED%96%A5%EA%B3%BC%20%EB%B6%84%EC%82%B0).pdfError ( Bias and Variance ) 분산 줄이는 법 : 데이터를 더 모으기편향 줄이는 법 : 모델을 더 복잡하게 훈련시키기둘은 트레이드 오프 관계Accuracy :데이터의 분포나 편향에 따라 정확도가 높아지기도 한다. 이를 그냥 믿으면 안된다. ( = Overfitting 일 수도 있다는 것 )Perfor..

    [NLP] Day 25 - Project 4

    Projcet 4¶스팸 자동 분류스팸 / 햄 데이터 수집 ( 제목 )글자가 깨지면import htmlhtml.parser.unescape(문자열)In [1]:from selenium import webdriver driver = webdriver.Chrome(executable_path='/Users/charming/Python/3. Koipa AI Learning/NLP/chromedriver') driver.get('https://nid.naver.com/nidlogin.login?mode=form') In [2]:driver.get('https://mail.naver.com/?n=1552462013012&v=f#%7B%22fClass%22%3A%22list%22%2C%22oParameter%22%3..

    [NLP] Day 24 - Naive bayes

    Naive BayesMLE : 데이터만 가지고 ( 반드시 데이터가 있어야 추정 가능, 없으면 동작 X )MAP : 데이터와 사전 정보를 가지고 ( 데이터가 없어도 사전 정보를 가지고 알아낼 수 있음 ) 조금 더 Optimal하다.Naive assumption : 입력데이터끼리 conditional independence 하다고 가정한다. ( 실생활에서느 그렇지 않지만 계산을 위해 )Ex) 대출, 광고 모두 스팸이라면 둘 사이는 원래 강한 상관관계가 존재한다.Combination을 아래와 같이 구할 수 있는 것이다.( 특정 정보가 주어졌을 때, (사전 정보= 스팸이라고 알려줬을 때, 대출과 광고는 독립이다.) ) 𝑃(𝑥1|𝑥2,𝑦)=𝑃(𝑥1|𝑦) 로 볼 수 있는 것이다.따라서 𝑃(𝑥1|𝑥2,𝑦)=𝑃(𝑥1|..

    [NLP] Day 23 - Project 3

    Project 3뉴스 자동 분류처음은 이전 Project 2와 동일하다 print문은 결과가 너무 길어서 없앴다. In [2]:import os def getFileList(base='./', ext='.txt'): fileList = list() for file in os.listdir(base): if file.endswith(ext): # == if file.split('.')[-1] == ext: fileList.append('{0}/{1}'.format(base, file)) return fileList In [3]:# def getNewsRank(): # for file in os.listdir(base): # with open(file,encoding='utf-8') as f: # conte..