mirror of
https://github.com/katanemo/plano.git
synced 2026-05-18 13:45:15 +02:00
fix similarity bug (#63)
This commit is contained in:
parent
97b47c2ab4
commit
941869ad24
1 changed files with 13 additions and 2 deletions
|
|
@ -262,14 +262,25 @@ impl StreamContext {
|
|||
|
||||
debug!("zeroshot intent response: {:?}", zeroshot_intent_response);
|
||||
|
||||
let desc_emb_similarity_map: HashMap<String, f64> = callout_context
|
||||
.similarity_scores
|
||||
.clone()
|
||||
.unwrap()
|
||||
.into_iter()
|
||||
.collect();
|
||||
|
||||
let pred_class_desc_emb_similarity = desc_emb_similarity_map
|
||||
.get(&zeroshot_intent_response.predicted_class)
|
||||
.unwrap();
|
||||
|
||||
let prompt_target_similarity_score = zeroshot_intent_response.predicted_class_score * 0.7
|
||||
+ callout_context.similarity_scores.as_ref().unwrap()[0].1 * 0.3;
|
||||
+ pred_class_desc_emb_similarity * 0.3;
|
||||
|
||||
debug!(
|
||||
"similarity score: {:.3}, intent score: {:.3}, description embedding score: {:.3}",
|
||||
prompt_target_similarity_score,
|
||||
zeroshot_intent_response.predicted_class_score,
|
||||
callout_context.similarity_scores.as_ref().unwrap()[0].1
|
||||
pred_class_desc_emb_similarity
|
||||
);
|
||||
|
||||
let prompt_target_name = zeroshot_intent_response.predicted_class.clone();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue