Closed Alina-enni closed 2 years ago
The basic structure of the relevance ranked search engine works fine. The current script is a combination of the Boolean search and the ranked search that asks the user to choose a search method before typing in a query.
Made the tf-idf search show the total numbers of matching document. Also defined both of the searches as functions in hope that the code would be slightly easier to read.
You have already created your own first search engine based on Boolean search (from Week 2). Your search engine indexes real data and users can type search queries.
Create a copy of your source code for the Boolean search engine and modify the code to use relevance ranking based on tf-idf and cosine similarity instead.
Do not throw away your Boolean search engine. Just create another alternative. You can also have both search engines in the same program and ask the user which one to use. Or you can have your program automatically check whether there are any Boolean operators in the query, and in that case run Boolean search, otherwise tf-idf based search.