-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable interpolation on autocomplete #131
Comments
Hi @adelcasse, this feature would need to be addressed in the The interpolation engine was designed to be a standalone service, I would prefer not to implement autocomplete here because it's a linguistics/syntax/natural language problem and not directly related to address schemas/geodesic math etc. I think would be 'cleaner' if an outside system (eg. Pelias using an elasticsearch index, or any other system) was able to resolve partially completed address inputs into a complete 'street name' and desired 'house number' (we also need a lat/lon anywhere inside the bounding box of the street in order to disabiguate two streets with the same name in the same city). Once this has been done you can send those three values (street name, house number, filter point) to the interpolation service and it will return a value, either an interpolation or an exact match. see: #112 (comment) regarding integration. In that comment, I wrote a little about our current integration between 'Pelias proper' and the interpolation engine:
Let me explain a little more about how that currently works. more info: [design doc] [relationship to pelias] [existing standards] [conflation] indexing
searching
sorry for the wall of text :) If we want to enable this feature for autocomplete then we need to have a parsing engine capable of (at minimum) being able to parse partially completed input text in to Writing a geographic text parser is not an easy undertaking, and one that is autocomplete aware is even more difficult, we currently use three parsing engines:
Have a look at the readme docs for those repos to get a better understanding of how they work. The current obstacle to enabling interpolation on autocomplete is that none of these engines is sufficiently capable of parsing partially completed address input (eg. If they were able to do so, then it would probably result in 10,000+ street names globally starting with There may be some workarounds for this (like only using the top 10), but they would also need to be considered. Again, sorry for the wall of text, hopefully that gives some background to the feature and an idea of it's complexity. If you're still interested in discussing further we could set up a call, depending on your timelines we might be available for consultancy work, if that interests you, or I can continue to help out for free on the issue tracker :) |
Hi @missinglink , I work with @adelcasse and I would like to add this feature to Pelias. For now I've tried to do the following in pelias-api :
This works well for my test cases (french streets), but it might not work worldwide. That's why I'd like to have your opinion on how to proceed :) I have a few questions in mind:
|
hi @elsa-pato, sorry for the late reply. I'd suggest looking in to your second point a bit more before you continue:
This hasn't been my experience, libpostal isn't designed to work with partially specified inputs. Some basic examples: http://localhost:4400/parse?address=Rue
[
{
"label": "city",
"value": "rue"
}
] http://localhost:4400/parse?address=Champs-E
[
{
"label": "house",
"value": "champs-e"
}
] http://localhost:4400/parse?address=Boulevard
[
{
"label": "suburb",
"value": "boulevard"
}
] http://localhost:4400/parse?address=s
[
{
"label": "city_district",
"value": "s"
}
] |
In a lot of cases it also struggles with fully specified street names: http://localhost:4400/parse?address=L’Esplanade des Invalides
[
{
"label": "house",
"value": "l'esplanade des invalides"
}
] It really wasn't designed to work for anything less than a full postal address, and really must have a city or region specified in the input to work correctly. |
Hi,
But sure, it's not perfect yet..
(this result is actually quite weird, as -as far as I know, and in France at least- an "esplanade" is rarely a house name, more like a square. But maybe in other countries it's different, I'm currently trying to get a planet build to run more tests)
ok, this one really fails :p One more thing is, as I implemented it, we call libpostal & interpolate only if the standard autocomplete search didn't return any result ; so it usually means that the user wrote quite a precise address, which I guess helps libpostal, and might help autocomplete stay performant. You can check what I did there https://gitlab.scity.coop/pelias-contrib/api/commit/d24f37121f4cb184b26c99934199c338cc8ddf56 (it's really just a quick & dirty solution to start with) That said, I'll give a deeper look to libpostal and see what I can do :) |
We are hoping to merge pelias/api#1287 soon which replaces the |
the core team are looking at this again right now. I've spent some time making the interpolation service more performant, and it can now handle around 6k/s requests on a single thread, so it that should be adequate to handle the load. The problem still remains the logic for when to call the interpolation service when in autocomplete mode. Since this issue was opened we've completely refactored the parsing logic for autocomplete to use our own parser, which may help make this problem a little easier. @adelcasse did you manage to find a solution that worked for you? are you still interested in contributing to the discussion of how this might work? |
@missinglink sorry I didn't see your message before. We had something working on our side with libpostal as @elsa-pato described. We would need to look at it again but sure we're interested in contributing to the discussion if useful (I don't know if there were changes on that subject since 31 march). |
@missinglink I've made tests with the "compare" tool (to see différences between your -geocode.earth- and our servers) and I see that your dev environment is "less strict" on housenumbers than your production one (and returns the street first when there is no matching housenumber) : is it the result of pelias/api#1432 or something else ? Is your dev environment code somewhere already ? |
We would like to contribute on enabling interpolation for autocomplete. This is a big step in resolving issues in the use of Pelias in our product. As discussed with @orangejulius on Gitter, I open this issue to discuss how we could help on implementing it and how it should be done.
The text was updated successfully, but these errors were encountered: