Web Spidering Aj. Khuanlux MitsophonsiriCS.426 INFORMATION RETRIEVAL.

Slides:



Advertisements
งานนำเสนอที่คล้ายกัน
วิธีการตั้งค่าและทดสอบ เครื่องคอมพิวเตอร์ก่อนใช้งาน
Advertisements

THE PARTS OF A FLOWERING PLANT AND THEIR FUNTION.
Texture การประมวลผลภาพแบบดิจิตอล Ian Thomas
Stack.
1 ProQuest Nursing & Allied Health Source โดย ภวัต เรืองยิ่ง แผนก ฝึกอบรมฐานข้อมูล บริษัท บุ๊คโปรโมชั่น แอนด์ เซอร์วิส จำกัด ปรับปรุงครั้งล่าสุด.
AVL Tree.
Data Transmission Encoding Techniques and Transmission mode
Chapter 19 Network Layer: Logical Addressing
การจัดการเอกสารด้วยไลบรารี 1. โครงสร้างของ Live.citcoms.nu.ac.th.
INC341 State space representation & First-order System
ASP:ACCESS Database.
ASP:ACCESS Database.
– Web Programming and Web Database
โดย อ.ปริญญา น้อยดอนไพร V
Asst.Prof. Dr.Surasak Mungsing
Install Driver Token Key
แนวทางการปฏิบัติโครงการจูงมือ น้องน้อยบนดอยสูง 1.
List ADTs By Pantharee S..
ProQuest Nursing & Allied Health Source
How to use HyperText Markup Language
การสร้าง WebPage ด้วย Java Script Wachirawut Thamviset.
Chapter 3 Simple Supervised learning
In-Class Exercises Discrete Mathematics
Chapter 04 Flowchart ผู้สอน อ.ยืนยง กันทะเนตร
Chapter 3 - Stack, - Queue,- Infix Prefix Postfix
School of Information Communication Technology,
 Mr.Nitirat Tanthavech.  HTML forms are used to pass data to a server.  A form can contain input elements like text fields, checkboxes, radio-buttons,
ครูปัทมา แฝงสวัสดิ์. การอ่านเรื่องงานแล้ว บอกรายละเอียดและ สาระสำคัญ.
กราฟเบื้องต้น.
Programming & Algorithm
 How do we improve the test?  Why do we have to improve the test?
stack #1 ผู้สอน อาจารย์ ยืนยง กันทะเนตร
English for everyday use
ครูรุจิรา ทับศรีนวล.
ว เคมีพื้นฐาน พันธะเคมี
กราฟเบื้องต้น.
Week 13 Basic Algorithm 2 (Searching)
Establishing a Culture of Achievement: Multiliteracies in the ELT Classroom Session #2: 27 July 2012.
ANSI/ASQ Z1.4 Acceptance Sampling Plans
ปริมาณสัมพันธ์ ผู้สอน อ. ศราวุทธ แสงอุไร Composition Stoichiometry ว ปริมาณสัมพันธ์ สถานะของ สาร และเคมีไฟฟ้า นายศราวุทธ แสงอุไร ครูวิชาการสาขาเคมี
ครูวิชาการสาขาเคมี โรงเรียนมหิดลวิทยานุสรณ์
ภาษาอังกฤษ ชั้นมัธยมศึกษาปึที่ 4 Grammar & Reading ครูรุจิรา ทับศรีนวล.
PHP FRAMEWORK – Web Programming and Web Database Asst. Prof. Dr. Choopan Rattanapoka.
Timed Math Quiz. โปรแกรมสุ่มคำนวณเลขแข่งกับ เวลา.
Practice File. Our Executive Coaching Program is proven effective. Our customer survey show ROI of coaching can be as high as 3 times the investment value.
Page : Stability and Statdy-State Error Chapter 3 Design of Discrete-Time control systems Stability and Steady-State Error.
2.1 Spanning Tree Protocol
อาจารย์ชนิดา เรืองศิริวัฒนกุล หลักสูตรสาขาวิชาเทคโนโลยีสารสนเทศ
การออกแบบอีเลิร์นนิง
พื้นฐานการเขียนแบบทางวิศวกรรม
คิดไว สรุปไว ด้วย MIND MAP ยินดีต้อนรับผู้เข้าร่วมสัมมนาหลักสูตร
1. นี่เป็นสิ่งที่พระเยซูทรงทำ พระองค์ทรงรักษาทุกคน ที่เจ็บป่วยให้หายดี
Control Charts for Count of Non-conformities
หน่วยที่ 2 ข้อมูลและสารสนเทศ
Object-Oriented Programming Paradigm
Register คลิก register.
บทที่ 1 ความรู้เบื้องต้น เกี่ยวกับระบบสารสนเทศ
Principles of Accounting II
Review of the Literature)
ที่มาและหน่วยงานกาชาดต่างๆ
เจาะลึก google หลักการทำงานของ search engine
Dr.Surasak Mungsing CSE 221/ICT221 การวิเคราะห์และออกแบบขั้นตอนวิธี Lecture 05: การวิเคราะห์ความซับซ้อนของ ขั้นตอนวิธีการเรียงลำดับข้อมูล.
แล้วไงเกี่ยวกับความจริง What About Truth?
AnalyticAL Writing ปิติ ตรีสุกล.
4.7. B-Trees โครงสร้าง tree ที่กล่าวถึงมาแล้วนั้น อยู่บนสมมติฐานที่ว่าโครงสร้างทั้งหมดสามารถจัดเก็บอยู่ในหน่วยความจำของเครื่องคอมพิวเตอร์ได้ ถ้า จำนวนข้อมูลมีปริมาณมากเกินกว่าที่จะเก็บไว้ใน.
โครงการสัมมนาเชิงปฏิบัติการบูรณาการภาครัฐและเอกชนในการจัดยุทธศาสตร์เศรษฐกิจภาคตะวันออก This template can be used as a starter file to give updates for.
สถิติเพื่อการวิเคราะห์ข้อมูล
แผนการจัดการเรียนรู้ Active Learning
การวิเคราะห์และออกแบบขั้นตอนวิธี
สารสนเทศศาสตร์เบื้องต้น
ใบสำเนางานนำเสนอ:

Web Spidering Aj. Khuanlux MitsophonsiriCS.426 INFORMATION RETRIEVAL

2 Human Cataloguing of the Web Pros: High quality, domain knowledge selection, subject-specialised, cataloguing done to well-known and developed standards Cons: Expensive, slow, descriptions need to be reviewed regularly to keep them relevant

3 Software Running Web Crawler Pros: vastly comprehensive, can be very up- to-date Cons: cannot distinguish “good pages ” from “bad pages”, indiscriminate, subject to spamming, very general

4 Spiders (Robots/Bots/Crawlers) Start with a comprehensive set of root URL’s from which to start the search. Follow all links on these pages recursively to find additional pages. Index all novel found pages in an inverted index as they are encountered. May allow users to directly submit pages to be indexed (and crawled from).

5 Search Strategies ลําดับการค้นหาแบบกว้างก่อนบนโครงสร้างต้นไม้ Breadth-first Search

6 Breadth-first search (BFS) การค้นหาแบบกว้างก่อน (Breadth first search) การค้นหาแบบกว้างก่อนเป็นการกําหนดทิศทางการ ค้นหาแบบที่ละระดับของโครงสร้างต้นไม้โดยเริ่มจากโหนด ราก ( ระดับที่ 0) แล้วลงมาระดับที่ 1 จากซ้ายไปขวา เมื่อเสร็จ ระดับที่ 1 ไประดับที่ 2 จากซ้ายไปขวาเช่นกัน ทําเช่นนี้เรื่อย ๆ จนพบโหนดที่ต้องการตามรูปที่ 3 ลําดับการเดินทางของ โหนดเป็นไปตามหมายเลขที่กํากับไว้บนโหนด สําหรับการค้นหาแบบกว้างก่อนบนโครงสร้างต้นไม้ จะ อาศัยโครงสร้างข้อมูลแบบคิว (Queue) มาช่วย ให้เริ่มต้น สํารวจที่โหนดเริ่มต้น แล้วนําโหนดข้างเคียงเก็บไว้ในคิว เมื่อ สํารวจโหนดเริ่มต้นเสร็จ ให้นําข้อมูลในคิวออกมาสํารวจ แล้ว นําโหนดข้างเคียงที่ยังไม่ได้สํารวจและไม่ได้อยู่ในคิวใส่คิวไว้ ทําเช่นนี้ไปเรื่อย ๆ จนพบโหนดที่ต้องการ หรือเมื่อสํารวจครบ ทุกโหนด

7 Breadth-first search (BFS) โครงสร้างข้อมูลแบบกราฟ การสํารวจเริ่มต้นที่ A นําโหนดข้างเคียง B C ไว้ในคิว เมื่อสํารวจ A เสร็จ นําข้อมูลในคิว คือ B ออกมาสํารวจ แล้วนําข้อมูลข้างเคียงคือ D E ใส่คิว ตอนนี้คิวจะมี B D E อยู่ แล้วนํา B ออกมาสํารวจทําเช่นนี้เรื่อย ๆ จะได้ลําดับการสํารวจข้อมูลคือ (A B C D E F G H) ตามตาราง

8 Breadth-first search (BFS) ลําดับการค้นหาแบบกว้างก่อน การค้นหาแบบกว้างก่อนโดยใช้โครงสร้างข้อมูลคิวมาช่วย ต้องมีการกําหนดโหนดเริ่มต้น และวิธีการนี้สามารถใช้ได้กับ ข้อมูลบนโครงสร้างแบบต้นไม้ด้วย

9 Search Strategies (cont) Depth-first Search ลําดับการเดินทางบนโหนดของการค้นหาแบบลึกก่อนบนโครงสร้างต้นไม้

10 Depth-first Search การค้นหาแบบลึกก่อน (Depth first search) การค้นหาแบบลึกก่อนเป็นการค้นหาที่ กําหนดทิศทางจากรูปของโครงสร้างต้นไม้ ที่ เริ่มต้นจากโหนดราก (Root node) ที่อยู่บนสุด แล้วเดินลงมาให้ลึกที่สุด เมื่อถึงโหนดล่างสุด (Terminal node) ให้ย้อนขึ้นมาที่จุดสูงสุด ของกิ่งเดี่ยวกันที่มีกิ่งแยกและยังไม่ได้เดิน ผ่าน แล้วเริ่มเดินลงจนถึงโหนดลึกสุดอีก ทํา เช่นนี้สลับไปเรื่อยจนพบโหนดที่ต้องการหา หรือสํารวจครบทุกโหนดแล้วตามรูป การ ค้นหาแบบลึกก่อนจะมีลําดับการเดินตาม โหนดดังตัวเลขที่กํากับไว้ในแต่ละโหนด

11 Depth-first Search โครงสร้างข้อมูลที่ใช้สําหรับการค้นหานี้สามารถ ใช้กับโครงสร้างกราฟได้ด้วย โดยอาศัยหลักการ เดียวกัน แต่สําหรับการเดินทางบนกราฟนั้นจะไม่มี โหนดลึกสุดดังนั้นการเดินทางบนกราฟจะต้องปรับ วิธีการเป็นดังนี้ โดยเริ่มจากโหนดเริ่มต้น จากนั้นให้ นําโหนดที่อยู่ติดกับโหนดที่กําลังสํารวจอยู่ ( ที่ยัง ไม่ได้ทําการสํารวจและยังไม่ได้อยู่ในแสต็กมาใส่ แสต็ก ) มาเก็บไว้ในสแต็กเมื่อสํารวจโหนดนั้นเสร็จ ให้พอพ (pop) ตัวบนสุดของโหนดออกมาทําการ สํารวจ แล้วนําโหนดข้างเคียงทั้งหมดที่ยังไม่ได้ สํารวจมาต่อท้ายแสต็ก แล้วพอพตัวบนสุดออกมา สํารวจ ทําเช่นนี้เรื่อย ๆ จนกระทั้งพบโหนดที่ ต้องการ หรือสํารวจครบทุดโหนด

12 Depth-first Search โครงสร้างข้อมูลแบบ กราฟ การสํารวจจะเริ่มต้นที่ A และนําโหนดข้างเคียง B และ C มาเก็บไว้ในแสต็ก เมื่อสํารวจ A เสร็จ พอพข้อมูลจากแสต็กออกมาได้ C ทําการสํารวจ C และนําโหนดข้างเคียงกับ C ที่ยังไม่ได้ทําการสํารวจและยังไม่ได้อยู่ ในแสต็กมาใส่แสต็ก D และ F พุช (Push) ใส่แสต็ก ดังนั้นในแสต็กตอนนี้มี B D F อยู่ เมื่อสํารวจ C เสร็จ พอพ F ออกมา ทําการสํารวจ แล้วนําโหนดข้างเคียงที่ยังไม่ได้สํารวจและยังไม่ได้อยู่ในแสต็กมาใส่แสต็ก ซึ่งก็คือ G ดังนั้นข้อมูลในแสต็ก จะเป็น B D G ทํ าเช่นนี้ไปเรื่อย ๆ จนจบการทํางานก็จะได้ลําดับการสํารวจคือ (A C F G H E D B) ตามตาราง

13 Depth-first Search ลําดับการค้นหาแบบ ลึกก่อน ในการค้นหาข้อมูลแบบนี้บนโครงสร้างของกราฟ มีข้อที่น่าสังเกตคือ โหนดที่เริ่มต้นการสํารวจจะต้องมีการกําหนดมาให้ว่าโหนดใดเป็นโหนดเริ่มต้น และข้อสังเกตอีกประการหนึ่งคือวิธีการค้นหาแบบลึกก่อนที่ใช้สําหรับโครงสร้างข้อมูลแบบกราฟ สามารถใช้กับโครงสร้างข้อมูลแบบต้นไม้ได้ด้วย

14 Queuing Strategy How new links added to the queue determines search strategy FIFO (append to end of Q) gives breadth-first search LIFO (add to front of Q) gives depth-first search Heuristically ordering the Q gives a “focused crawler” that directs its search towards “interesting” pages

15 Link Extraction Must find all links in a page and extract URLs Must complete relative URL’s using current page URL: to to

16 Link Extraction

17 URL Syntax A URL has the following syntax: :// ? # An authority has the syntax: : A query passes variable values from an HTML form and has the syntax: = & = … A fragment is also called a reference or a ref and is a pointer within the document to a point specified by an anchor tag of the form: ”>

18 Spider Coding Generic spider in Spider class Does breadth-first crawl from a start URL and saves copy of each page in a local directory This directory can then be indexed and searched using VSR Inverted Index Main method parameters: -u -d -c

19 Spider Coding (cont.) Robot Exclusion can be invoked to prevent crawling restricted sites/pages Specialized classes also restrict search: SiteSpider: Restrict to initial URL host DirectorySpider: Restrict to below initial URL directory

20 Anchor Text Indexing Extract anchor text (between and ) of each link followed Anchor text is usually descriptive of the document to which it points Add anchor text to the content of the destination page to provide additional relevant keyword indices Used by Google: Evil Empire IBM

21 Anchor Text Indexing (cont) Helps when descriptive text in destination page is embedded in image logos rather than in accessible text Many times anchor text is not useful: “click here” Increases content more for popular pages with many in-coming links, increasing recall of these pages May even give higher weights to tokens from anchor text

22 Robot Exclusion Web sites and pages can specify that robots should not crawl/index certain areas Two components: Robots Exclusion Protocol: Site wide specification of excluded directories Robots META Tag: Individual document tag to exclude indexing or following links

23 Robots Exclusion Protocol Site administrator puts a “robots.txt” file at the root of the host’s web directory File is a list of excluded directories for a given robot (user-agent) Exclude all robots from the entire site: User-agent: * Disallow: /

24 Robot Exclusion Protocol Examples Exclude specific directories: User-agent: * Disallow: /tmp/ Disallow: /cgi-bin/ Exclude a specific robot: User-agent: GoogleBot Disallow: / Allow a specific robot: User-agent: GoogleBot Disallow: User-agent: * Disallow: /

25 Robot Exclusion Protocol Details Only use blank lines to separate different User-agent disallowed directories One directory per “Disallow” line No regex patterns in directories

26 Robots META Tag Include META tag in HEAD section of a specific HTML document Content value is a pair of values for two aspects: index | noindex: Allow/disallow indexing of this page follow | nofollow: Allow/disallow following links on this page

27 Robots META Tag (cont) Special values: all = index,follow none = noindex,nofollow Examples:

28 Robot Exclusion Issues META tag is newer and less well-adopted than “robots.txt” Standards are conventions to be followed by “good robots” Companies have been prosecuted for “disobeying” these conventions and “trespassing” on private cyberspace “Good robots” also try not to “hammer” individual sites with lots of rapid requests “Denial of service” attack

29 Multi-Threaded Spidering Bottleneck is network delay in downloading individual pages Best to have multiple threads running in parallel each requesting a page from a different host Distribute URL’s to threads to guarantee equitable distribution of requests across different hosts to maximize through-put and avoid overloading any single server Early Google spider had multiple co-ordinated crawlers with about 300 threads each, together able to download over 100 pages per second

30 Directed/Focused Spidering Sort queue to explore more “interesting” pages first Two styles of focus: Topic-Directed Link-Directed

31 Topic-Directed Spidering Assume desired topic description or sample pages of interest are given Sort queue of links by the similarity (e.g. cosine metric) of their source pages and/or anchor text to this topic description Preferentially explores pages related to a specific topic Robosurfer assignment in AI course

32 Link-Directed Spidering Sort queue to prefer popular pages with many in-coming links (authorities) Sort queue to prefer summary pages with many out-going links (hubs)

33 Keeping Spider Pages Up to Date Web is very dynamic: many new pages, updated pages, deleted pages, etc. Periodically check spidered pages for updates and deletions: Just look at header info (e.g. META tags on last update) to determine if page has changed, only reload entire page if needed Track how often each page is updated and preferentially return to pages which are historically more dynamic Preferentially update pages that are accessed more often to optimize freshness of more popular pages