Skip to content
Snippets Groups Projects
Commit ceee8ff5 authored by Phil Höfer's avatar Phil Höfer
Browse files

Trim Set Predictor Output

parent f0973c69
No related branches found
No related tags found
No related merge requests found
Pipeline #9887 passed
......@@ -73,7 +73,7 @@ impl Predictor for SetPredictor {
let query_prefix = query.rsplit_once(' ').map_or("", |(head, _)| head).to_string();
let predictions: Vec<String> = top_words
.into_iter()
.map(|(word, _)| format!("\"{} {}\"", query_prefix, word))
.map(|(word, _)| format!("\"{}\"", format!("{} {}",query_prefix, word).trim()))
.collect();
return format!("[\"{}\",[{}]]", query, predictions.join(","));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment