Finding the most relevant snippet from a document, based on the search query.
*** Most Relevant Snippet Selection Algorithm ***
This is a scoring based algorithm for finding the most relevant snippet
of a review, given a search query.
The process starts with producing all permutations of the search query.
Then these permutations are entered into a dictionary with their respective
scores. The permutations that are in original order of the search query get
the higher scores. In short it is;
k = # of words in search query
k*16 points - k words of query found as a phrase in order
k*8 points - k words of query found as a phrase out of order
n*4 points - n words of query (1 < n < k) found as phrase in order
n*2 points - n words of query (1 < n < k) found as phrase out of order
1 - 1 word of the search query found by itself
Please see rel_snippet.py for the rest.
RelevantSnippet
Brought to you by:
odugurlu
Downloads:
0 This Week