Web Search Engine Design 20001148 KLE lab Sequence
Web Search Engine Design 컴공 20001148 김보현 KLE lab
Sequence Diagram
Class Design 역할: 1. Web crawler가 모아온 문서를 입력으로 받아서 2 -gram term으로 parsing하고 DB에 저장 2. 각각의 term에 대해 IDF(Inverse Document Frequency) 와 Document weight을 계산하여 table에 저장하도록 시킴 3. 각 문서의 Rank를 갱신하도록 시킴 Methods: 1. 2. 3. 4. 5. Make. Bigram : Bigram class의 Add. Doc, Parce, Get. Bigram 함수를 차례로 호출 Update. Term : Term table에 term과 Doc. ID 삽입 Update. IDF : IDF table을 idf와 Doc. ID 삽입 Update. Doc. Weight : Doc. Weight table에 Doc. Id와 Term. Id, weight 삽입 Update. Rank : Rank table에 Doc. Id와 rank값 삽입
Class Design 역할: 1. string을 2 -gram으로 parsing 2. Parsing하다가 hyper link가 나오면 link table update 3. 주어진 index에 대한 bigram을 return Methods: 1. 2. 3. 4. 5. Add. Doc : 해당 file을 string 단위로 읽어서 Add. String 함수 호출 Add. String : 주어진 string을 Rawdata에 추가 Parse : Rawdata를 2음절 단위로 잘라서 Stripped. Data에 저장 Get. Bigram : 주어진 index 위치의 Stripped. Data return Update. Link : parsing 도중 link가 나오면 DBManager의 Add. Link 함수 호출
Class Design 역할: 1. 2. 3. 4. Database와 직접 통신하면서 Table들을 관리 총 5개의 Table을 update하는 함수들을 가짐 Doc. Id와 weight을 가지는 Doc. Info 관리 Document의 link 정보를 가지고 Rank 계산 Methods: Update. Term. Table : Doc. Id, Term을 table에 삽입 Update. IDFTable : Term table의 정보를 가지고 idf를 계산하고 table에 삽입 Update. Doc. Weight. Table : Term table과 IDF table의 정보를 가지고 Doc. Weight을 계산하고 table에 삽입 Get. Doc. Info : 주어진 index를 가지고 몇번째 document의 Doc. Info를 반환 Get. Doc. Num : 전체 document 개수를 반환 Update. Link. Table : Doc. Id와 Link. URL, Link. Doc. Id를 table에 삽입 Update. Rank. Table : Doc. Id와 Rank를 table에 삽입
Database Doc. Weight Table Doc. Id(uint) Term. Id(uint) Weight(float) Term Table Doc. Id(uint) Term(string) Link Table Doc. Id(uint) Link. URL(string) Rank Table Doc. Id(uint) Rank(float) Link. Doc. Id(uint) IDF Table Term. Id( uint) IDF(fl oat)
Class Design 역할: 1. 사용자로부터 query를 입력받아서 2 -gram으로 분해한다 2. query weight을 계산한다 3. document weight과 query weight으로 similarity를 계산한다. 4. rank와 similarity를 가지고 결과에 포함될 문서 를 결정한다. Methods: 1. Accpet. Query : 사용자가 입력한 query를 string으로 받음 2. Make. Bigram : Bigram class의 Add. Doc, Parce, Get. Bigram 함수를 차례로 호 출 3. Cal. Query. Weight : query string의 weight을 계산 4. Cal. Similarity : 문서 weight과 query weight을 가지고 문서의 similarity를 계산 5. Decide. Relevant. Set : similarity와 rank를 가지고 relevant set 포함 여부를 결정
Data Types Doc. Id와 Doc. Weight을 포함하는 Datatype Doc. Info와 Similarity를 포함하는 Datatype Doc. Id와 Doc. Sim, Doc. Rank를 포함하는 Set (검색 결과에 들어가는 문서들을 저장하기 위한 것)
Relevance Feedback (cont’d) query expansion 1. Represent the query in the concept space: ☞ define the inverse term frequency : ☞ term vector : ☞ weight : ☞ the relationship between two terms : ☞ the query vector :
Relevance Feedback 2. Compute a similarity between each term kv correlated to the query terms and the whole query q 3. Expand the query with the top r ranked terms according to sim(q, kv ) ☞ To each expansion term kv in the query q’ 4. 구현 ☞ DBManager class에 Refine. Doc. Weight 함수 추가 ☞ Retriever class에 Refine. Query. Weight, Refine. Similarity 함수 추가 ☞ 새로운 weight과 similarity를 가지고 다시 결과를 구한다
- Slides: 10