“Optimize the parameter in different data source”版本间的差异
来自cslt Wiki
(以“=method= ==Definition== * formula :* data source: q:standard question, q-a:standard question and answer, q-e: standard question and extracted question, q-w:standard...”为内容创建页面) |
(→MERT) |
||
| (相同用户的20个中间修订版本未显示) | |||
| 第1行: | 第1行: | ||
| + | =MERT= | ||
| + | *[http://blog.csdn.net/ict2014/article/details/25307019 method-deatil] | ||
| + | *[http://www.cs.jhu.edu/~ozaidan/zmert/ tool] | ||
| + | |||
=method= | =method= | ||
==Definition== | ==Definition== | ||
| − | * | + | * [[File:11.png]] |
| − | :* | + | |
| − | + | ==problem== | |
| + | ==boost some specific field in lucene== | ||
| + | * Here is how you can do that[http://stackoverflow.com/questions/9829161/lucene-how-to-boost-some-specific-field] | ||
| + | Query titleQuery, viewsQuery; | ||
| + | titleQuery.setBoost(0.8); | ||
| + | viewsQuery.setBoost(0.2); | ||
| + | BooleanQuery query = new BooleanQuery(); | ||
| + | query.add(titleQuery, Occur.MUST); // or Occur.SHOULD if this clause is optional | ||
| + | query.add(viewsQuery, Occur.SHOULD); // or Occur.MUST if this clause is required | ||
| + | // use query to search documents | ||
| + | The score will be proportional to 0.8*score(titleQuery) + 0.2*score(viewsQuery) (to a multiplicative constant). | ||
| + | To leverage your views field, you will probably need to use a [http://lucene.apache.org/core/3_5_0/api/core/org/apache/lucene/search/function/ValueSourceQuery.html ValueSourceQuery] | ||
2014年12月9日 (二) 02:01的最后版本
MERT
method
Definition
problem
boost some specific field in lucene
- Here is how you can do that[1]
Query titleQuery, viewsQuery; titleQuery.setBoost(0.8); viewsQuery.setBoost(0.2); BooleanQuery query = new BooleanQuery(); query.add(titleQuery, Occur.MUST); // or Occur.SHOULD if this clause is optional query.add(viewsQuery, Occur.SHOULD); // or Occur.MUST if this clause is required // use query to search documents
The score will be proportional to 0.8*score(titleQuery) + 0.2*score(viewsQuery) (to a multiplicative constant). To leverage your views field, you will probably need to use a ValueSourceQuery
