Inverted File
Inverted File
(Chapters 3-5)
lexicographical indices
indices that are sorted e.g. inverted files e.g. Patricia (PAT) trees
Inverted Files
Information Retrieval: Data Structures and Algorithms
(Chapters 3)
Inverted Files
Each document is assigned a list of keywords or attributes. Each keyword (attribute) is associated with operational relevance weights. An inverted file is the sorted list of keywords (attributes), with each keyword having links to the documents containing that keyword. Penalty
the size of inverted files ranges from 10% to 100% of more of the size of the text itself need to update the index as the data set changes
Indexing Restrications
A controlled vocabulary which is the collection of keywords that will be indexed. Words in the text that are not in the vocabulary will not be indexed A list of stopwords that for reasons of volume will not be included in the index A set of rules that decide the beginning of a word or a piece of text that is indexable A list of character sequences to be indexed (or not indexed)
Sorted Arrays
store the list of keywords in a sorted array using a standard binary search advantage: easy to implement disadvantage: updating the index is expensive
Sorted Arrays
1. The input text is parsed into a list of words along with their location in the text. (time and storage consuming operation) 2. This list is inverted from a list of terms in location order to a list of terms in alphabetical order. 3. Add term weights, or reorganize or compress the files.
(document #, frequency)
10
current number of term postings & the storage location of postings list
Principle 1
the large primary memories are available If databases can be split into memory loads that can be rapidly processed and then combined, the overall cost will be minimized.
Principle 2
the inherent order of the input data It is very expensive to use polynomial or even nlogn sorting algorithms for large files
12
FAST-INV algorithm
concept postings/ pointers See p. 13.
Preparation
Terminology
HCN= highest concept number in dictionary, or the number of words to be indexed L= number of document/concept pairs in the collection M= available primary memory size
Assumption
M>>HCN M<L
15
Preparation
1. Allocate an array, con_entries_cnt, of size HCN. 2. For each <doc#, con#> entry in the document vector file: increment con_entries_cnt[con#]
0 (1,1), (1,4).. 2 (2,3) .. 3 (3,1), (3,2), (3,5) ... 6 (4,2), (4,3) . 8 (con#, doc#)
Preparation (continued)
5. For each <con#,count> pair obtained from con_entries_cnt: if there is no room for documents with this concept to fit in the current load, then created an entry in the load table and initialize the next load entry; otherwise update information for the current load table entry.
Terminology
LL= length of current load S= spread of concept numbers in the current load 8 bytes = space needed for each concept/weight pair 4 bytes = space needed for each concept to store count of postings for it
Constraints
8*LL+4*S<M
19