PUT tx
POST tx/_mapping
{"properties":{"age":{"type":"long"},"time":{"type":"date","format":"yyyy-MM-dd"},"title":{"type":"text","analyzer":"ik_smart"}}}
POST tx/_doc/19
{"title":"中古","time":"1969-10-12","age":12
}
搜索query示例
POST /tx/_search
{"query":{"function_score":{"query":{"match_all":{}},"field_value_factor":{"field":"time","modifier":"log1p"}}}}
- 其实modifier.log1p和如下搜索是完全一样的
POST /tx/_search
{"query":{"function_score":{"query":{"match_all":{}},"script_score":{"script":"_score * Math.log1p(1+doc['time'].value.toInstant().toEpochMilli())"}}}}
搜索异常返回值
{"error":{"root_cause":[{"type":"exception","reason":"function score query returned an invalid score: NaN for doc: 0"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped": true,"failed_shards":[{"shard":0,"index":"tx","node":"aPOBCVYkRA-a0R9FR4eDzQ","reason":{"type":"exception","reason":"function score query returned an invalid score: NaN for doc: 0"}}]},"status":500}
Demystifying Prompts in Language Models via Perplexity Estimation
原文链接
Gonen H, Iyer S, Blevins T, et al. Demystifying prompts in language models via perplexity estimation[J]. arXiv preprint arXiv:2212.04037, 2022.
简单来说就是作者通过在不同LLM和不同…