api icon indicating copy to clipboard operation
api copied to clipboard

chore(pelias_parser): add logging for chosen parser solution scores

Open missinglink opened this issue 6 years ago • 1 comments

When I was writing up https://github.com/pelias/parser/issues/76 today I noticed that the 'scoring' in the Pelias parser is pretty good, it's fairly indicative of when the parse was low quality and you'll see scores < 0.5 next to a lot of incorrect parses 🎉

So this PR is pretty simple, it adds logging of the solution scores so that we can graph them and get a better idea about how it's doing in an unpredictable production environment.

example log line:

info: [api] pelias_parser_solution score=0.44

note: if there is a parsing failure the score will be 0.00

missinglink avatar Nov 08 '19 10:11 missinglink

It sounds like the purpose of this code is for manual investigation into a single query at a time, rather than providing data that we could analyze across many requests.

In that case, it might be better as part of the debug output, since it would then be along side all the other context from a request.

If we are trying to log something for later analysis, we'll need to do as @Joxit suggests and associate the solution score with a bunch of other data like the input text, or it won't be very useful.

orangejulius avatar Nov 08 '19 14:11 orangejulius