RameshVel
RameshVel

Reputation: 65857

Calculate the score only based on the documents have more occurance of term in lucene

I am started working on resume retrieval(document) component based on lucene.net engine. It works great, and it fetches the document and score it based on the

the idea behind the VSM is the more times a query term appears in a document relative to the number of times the term appears in all the documents in the collection, the more relevant that document is to the query.

Lucene's Practical Scoring Function is derived from the below.

score(q,d)=coord(q,d)·queryNorm(q)· ∑( tf(t in d) ·idf(t)2 · t.getBoost() · norm(t,d) ) 
                                  t in q

in this

This is very great indeed in most of the situation, but due to the fieldnorm calculation the result is not accurate

fieldnorm aka "field length norm" value represents the length of that field in that doc (so shorter fields are automatically boosted up).

Due to this we didn't get the accurate results. Say for an example i got 10000 documents in which 3000 documents got java and oracle keyword. And the no of times it appears vary on each document.

Due to the nature of the business we need to retrieve the documents got more search keyword occurrence should come first, we don't really care about the length of the document.

Because of this a Guy with a big resume with lot of keywords is been moved below in the result and some small resumes came up.

To avoid that i need to disable length normalization. Can some one help me with this??

I have attached the Luke result image for your reference.

In this image, document with java 50 times and oracle 6 times moved down to 11 th position.

alt text

But this document with java 24 times and oracle 5 times is a top scorer due to the fieldnorm.

alt text

Hope i conveyed the info clear... If not please ask me, i ll give more info

Upvotes: 7

Views: 1691

Answers (1)

Shashikant Kore
Shashikant Kore

Reputation: 5042

You can disable length normalization with Field.setOmitNorms(true)

Upvotes: 10

Related Questions