1 / 21

Chapter 3. Quantitative Text Summaries 3.6 ~ 3.7

Chapter 3. Quantitative Text Summaries 3.6 ~ 3.7. 서울시립대 전자전기컴퓨터공학과 데이터마이닝 연구실 G201149027 노준호. Hashes (1 / 2). Arrays 장점 문장을 단어로 구분하여 저장할 때 , 순서가 중요 . 단 점 Term frequency 를 저 장 할 때 , Array 로는 문제가 있음 Hashes Index 를 숫자 (0, 1, 2, …) 대신 String 으로 대체 Term frequency 저장이 쉬워짐

amiel
Download Presentation

Chapter 3. Quantitative Text Summaries 3.6 ~ 3.7

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 3. Quantitative Text Summaries3.6 ~ 3.7 서울시립대 전자전기컴퓨터공학과 데이터마이닝 연구실 G201149027 노준호

  2. Hashes (1 / 2) • Arrays • 장점 • 문장을 단어로 구분하여 저장할 때, 순서가 중요. • 단점 • Term frequency를 저장할 때, Array로는 문제가 있음 • Hashes • Index를 숫자(0, 1, 2, …)대신 String으로 대체 • Term frequency저장이 쉬워짐 • key, value가 pair로 이루어져 있음

  3. Hashes (2 / 2) • perlcode • output

  4. Using a Hash (1 / 4) • perl code • output • 단어를 알파벳 순서대로 정렬

  5. Using a Hash (2 / 4) • perl code • output • tf순서대로 정렬

  6. Using a Hash (3 / 4) • perl code • output • tf순서 알파벳 순서대로 정렬

  7. Using a Hash (4 / 4) • perlcode • output

  8. Zipf’s law for A Christmas Carol (1 / 4) • Zipf’s law • Zipf’s law : tf, rank의 연관관계 • data • Charles Dickens’s A Christmas Carol • tf, rank를 알기 위하여 hash 사용 • 문제점 • Punctuation (how?) • --  공백처리 • - - (아무 처리 안 함) • 단어 끝의 ‘  Christmas’ 일 때만 제거 • 단어 시작의 ‘  ‘change, ‘em, ‘prentices 를 제외하고 제거

  9. Punctuation 확인 • perl code

  10. --(dash) 확인 • output

  11. -(hyphenated words) 확인 • output

  12. 단어 끝의 ‘ 확인 • output

  13. 단어 시작의 `확인 • output • ‘change(exchange), ‘em(them), ‘prentices(apprentices) • change와 ‘change는 서로 다른 의미

  14. Zipf’s law for A Christmas Carol (2 / 4) • -- 공백처리 • -  - (아무 처리 안 함) • 단어 끝의 ‘  Christmas’ 일 때만 제거 • 단어 시작의 ‘  ‘change, ‘em, ‘prentices 를 제외하고 제거

  15. Zipf’s law for A Christmas Carol (3 / 4) • perl code

  16. Zipf’s law for A Christmas Carol (4 / 4) • output

  17. Perl for Word Games (1 / 5) • Word Games • Data • Moby Word Lists 중 CROSSWD.TXT • An Aid to Crossword Puzzles • 원하는 단어를 찾아야 함. • ex) ??j??n? : 3번째 j, 6번째 n이 들어가는 길이가 7인 단어 • Word Anagrams • 단어를 글자 별로 sort • ex)abracadabra  aaaaabbcdrr • Finding Words In a Set of Letters • 주어진 단어 글자들의 subset 단어를 찾음 • ex) algorithm  hag, laigh, alright, …

  18. Perl for Word Games (2 / 5) • An Aid to Crossword Puzzles • perl code • output

  19. Perl for Word Games (3 / 5) • Word Anagrams • perlcode • output

  20. Perl for Word Games (4 / 5) • Finding Words In a Set of Letters • 각각의 subset을 regex로 만듬 • ex) pull  llpu  l, p, u, ll, lp, lu, pu, … • 2n - 1 개의 subset이 생김 • 2n– 1번 CROSSWORD.txt 와 비교해야 됨 • (trick 사용) CROSSWORD.txt에 있는 단어를 regex로 만들고주어진 단어와 비교 • ex) 주어진 단어 : algorithm  aghilmort • pull  llpu  regex : /.*l.*l.*p.*u.*/ (x) • hag  agh  regex : /.*a.*g.*h.*/ (o)

  21. Perl for Word Games (5 / 5) • perl code • output

More Related