advanced mul media
play

Advanced Mul,media Text Classifica,on Tamara Berg Slide - PowerPoint PPT Presentation

Advanced Mul,media Text Classifica,on Tamara Berg Slide from Dan Klein Slide from Dan Klein Today! Slide from Dan Klein What does


  1. Advanced ¡Mul,media ¡ Text ¡Classifica,on ¡ Tamara ¡Berg ¡

  2. Slide ¡from ¡Dan ¡Klein ¡

  3. Slide ¡from ¡Dan ¡Klein ¡

  4. Today! ¡ Slide ¡from ¡Dan ¡Klein ¡

  5. What ¡does ¡categoriza,on/classifica,on ¡ mean? ¡

  6. Slide ¡from ¡Dan ¡Klein ¡

  7. Slide ¡from ¡Dan ¡Klein ¡

  8. Slide ¡from ¡Dan ¡Klein ¡

  9. Slide ¡from ¡Dan ¡Klein ¡

  10. Slide ¡from ¡Min-­‑Yen ¡Kan ¡

  11. hFp://yann.lecun.com/exdb/mnist/index.html ¡ Slide ¡from ¡Dan ¡Klein ¡

  12. Slide ¡from ¡Dan ¡Klein ¡

  13. Slide ¡from ¡Min-­‑Yen ¡Kan ¡

  14. Slide ¡from ¡Min-­‑Yen ¡Kan ¡

  15. Slide ¡from ¡Min-­‑Yen ¡Kan ¡

  16. • Machine ¡Learning ¡-­‑ ¡how ¡to ¡select ¡a ¡model ¡on ¡ the ¡basis ¡of ¡data ¡/ ¡experience ¡ ¡ ¡Learning ¡parameters ¡(e.g. ¡probabili,es) ¡ ¡ ¡Learning ¡structure ¡(e.g. ¡dependencies) ¡ ¡ ¡Learning ¡hidden ¡concepts ¡(e.g. ¡clustering) ¡ Slide ¡from ¡Min-­‑Yen ¡Kan ¡

  17. Classifiers ¡ • Today ¡we’ll ¡talk ¡about ¡2 ¡simple ¡kinds ¡of ¡ classifiers ¡ – Nearest ¡Neighbor ¡Classifier ¡ – Naïve ¡Bayes ¡Classifier ¡

  18. Classifiers ¡ • Today ¡we’ll ¡talk ¡about ¡2 ¡simple ¡kinds ¡of ¡ classifiers ¡ – Nearest ¡Neighbor ¡Classifier ¡ – Naïve ¡Bayes ¡Classifier ¡

  19. Document ¡Vectors ¡

  20. Document ¡Vectors ¡ • Represent ¡document ¡as ¡a ¡“bag ¡of ¡words” ¡

  21. Example ¡ • Doc1 ¡= ¡“the ¡quick ¡brown ¡fox ¡jumped” ¡ • Doc2 ¡= ¡“brown ¡quick ¡jumped ¡fox ¡the” ¡

  22. Example ¡ • Doc1 ¡= ¡“the ¡quick ¡brown ¡fox ¡jumped” ¡ • Doc2 ¡= ¡“brown ¡quick ¡jumped ¡fox ¡the” ¡ Would ¡a ¡bag ¡of ¡words ¡model ¡represent ¡these ¡ two ¡documents ¡differently? ¡ ¡

  23. Document ¡Vectors ¡ • Documents ¡are ¡represented ¡as ¡“bags ¡of ¡words” ¡ • Represented ¡as ¡vectors ¡when ¡used ¡computa8onally ¡ • Each ¡vector ¡holds ¡a ¡place ¡for ¡every ¡term ¡in ¡the ¡collec,on ¡ • Therefore, ¡most ¡vectors ¡are ¡sparse ¡ Slide ¡from ¡Mitch ¡Marcus ¡

  24. Document ¡Vectors ¡ • Documents ¡are ¡represented ¡as ¡“bags ¡of ¡words” ¡ • Represented ¡as ¡vectors ¡when ¡used ¡computa8onally ¡ • Each ¡vector ¡holds ¡a ¡place ¡for ¡every ¡term ¡in ¡the ¡collec,on ¡ • Therefore, ¡most ¡vectors ¡are ¡sparse ¡ Lexicon ¡– ¡the ¡vocabulary ¡set ¡that ¡you ¡consider ¡to ¡be ¡valid ¡ words ¡in ¡your ¡documents. ¡ ¡ ¡Usually ¡stemmed ¡(e.g. ¡running-­‑>run) ¡ Slide ¡from ¡Mitch ¡Marcus ¡

  25. Document ¡Vectors: ¡ One ¡loca,on ¡for ¡each ¡word. ¡ ¡ nova galaxy heat h’wood film role diet fur A A 10 5 3 B B 5 10 C C 10 8 7 D D 9 10 5 “Nova” ¡occurs ¡10 ¡,mes ¡in ¡text ¡A ¡ E E 10 10 “Galaxy” ¡occurs ¡5 ¡,mes ¡in ¡text ¡A ¡ “Heat” ¡occurs ¡3 ¡,mes ¡in ¡text ¡A ¡ F F 9 10 (Blank ¡means ¡0 ¡occurrences.) ¡ G G 5 7 9 H H 6 10 2 8 I I 7 5 1 3 Slide ¡from ¡Mitch ¡Marcus ¡

  26. Document ¡Vectors: ¡ One ¡loca,on ¡for ¡each ¡word. ¡ ¡ nova galaxy heat h’wood film role diet fur A A 10 5 3 B B 5 10 C C 10 8 7 D D 9 10 5 “Nova” ¡occurs ¡10 ¡,mes ¡in ¡text ¡A ¡ E E 10 10 “Galaxy” ¡occurs ¡5 ¡,mes ¡in ¡text ¡A ¡ “Heat” ¡occurs ¡3 ¡,mes ¡in ¡text ¡A ¡ F F 9 10 (Blank ¡means ¡0 ¡occurrences.) ¡ G G 5 7 9 H H 6 10 2 8 I I 7 5 1 3 Slide ¡from ¡Mitch ¡Marcus ¡

  27. Document ¡Vectors ¡ ¡ Document ids nova galaxy heat h’wood film role diet fur A A 10 5 3 B B 5 10 C C 10 8 7 D D 9 10 5 E E 10 10 F F 9 10 G G 5 7 9 H H 6 10 2 8 I I 7 5 1 3 Slide ¡from ¡Mitch ¡Marcus ¡

  28. Vector ¡Space ¡Model ¡ • Documents ¡are ¡represented ¡as ¡ vectors ¡in ¡term ¡space ¡ • Terms ¡are ¡usually ¡stems ¡ • Documents ¡represented ¡by ¡vectors ¡of ¡terms ¡ • A ¡vector ¡distance ¡measures ¡similarity ¡between ¡documents ¡ ¡ • Document ¡similarity ¡is ¡based ¡on ¡length ¡and ¡direc,on ¡of ¡their ¡vectors ¡ • Terms ¡in ¡a ¡vector ¡can ¡be ¡“weighted” ¡in ¡many ¡ways ¡ Slide ¡from ¡Mitch ¡Marcus ¡

  29. Document ¡Vectors ¡ ¡ Document ids nova galaxy heat h’wood film role diet fur A A 10 5 3 B B 5 10 C C 10 8 7 D D 9 10 5 E E 10 10 F F 9 10 G G 5 7 9 H H 6 10 2 8 I I 7 5 1 3 Slide ¡from ¡Mitch ¡Marcus ¡

  30. Similarity ¡between ¡documents ¡ A ¡= ¡[10 ¡5 ¡3 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9 ¡0 ¡0]; ¡ E ¡= ¡[0 ¡0 ¡0 ¡0 ¡0 ¡10 ¡10 ¡0]; ¡ a ⋅ b Angle ¡between ¡vectors: ¡Cos(θ) ¡= ¡ ¡ a b Dot ¡Product: ¡ a 2 1 + a 2 2 + ... + a 2 Length ¡(Euclidean ¡norm): ¡ a = n

  34. Some ¡words ¡give ¡more ¡informa,on ¡ than ¡others ¡ • Does ¡the ¡fact ¡that ¡two ¡documents ¡both ¡ contain ¡the ¡word ¡“the” ¡tell ¡us ¡anything? ¡How ¡ about ¡“and”? ¡Stop ¡words ¡(noise ¡words): ¡ Words ¡that ¡are ¡probably ¡not ¡useful ¡for ¡ processing. ¡Filtered ¡out ¡before ¡natural ¡ language ¡is ¡applied. ¡ • Other ¡words ¡can ¡be ¡more ¡or ¡less ¡informa,ve. ¡ ¡ No ¡defini,ve ¡list ¡but ¡might ¡include ¡things ¡like: ¡ ¡ hFp://www.dcs.gla.ac.uk/idom/ir_resources/linguis,c_u,ls/stop_words ¡

  35. Some ¡words ¡give ¡more ¡informa,on ¡ than ¡others ¡ • Does ¡the ¡fact ¡that ¡two ¡documents ¡both ¡ contain ¡the ¡word ¡“the” ¡tell ¡us ¡anything? ¡How ¡ about ¡“and”? ¡Stop ¡words ¡(noise ¡words): ¡ Words ¡that ¡are ¡probably ¡not ¡useful ¡for ¡ processing. ¡Filtered ¡out ¡before ¡natural ¡ language ¡is ¡applied. ¡ • Other ¡words ¡can ¡be ¡more ¡or ¡less ¡informa,ve. ¡ ¡ No ¡defini,ve ¡list ¡but ¡might ¡include ¡things ¡like: ¡ ¡ hFp://www.dcs.gla.ac.uk/idom/ir_resources/linguis,c_u,ls/stop_words ¡

  36. Vector ¡Space ¡Model ¡ • Documents ¡are ¡represented ¡as ¡ vectors ¡in ¡term ¡space ¡ • Terms ¡are ¡usually ¡stems ¡ • Documents ¡represented ¡by ¡vectors ¡of ¡terms ¡ • A ¡vector ¡distance ¡measures ¡similarity ¡between ¡documents ¡ ¡ • Document ¡similarity ¡is ¡based ¡on ¡length ¡and ¡direc,on ¡of ¡their ¡vectors ¡ • Terms ¡in ¡a ¡vector ¡can ¡be ¡“weighted” ¡in ¡many ¡ways ¡ Slide ¡from ¡Mitch ¡Marcus ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend