OpenStreetMap logo OpenStreetMap

ChatGpt and tagging in OpenStreetMap

Posted by jfd553 on 8 February 2023 in English.

Cartography in OSM is twofold: drawing and tagging. While the former only require the ability to click with a mouse for drawing a line on a screen, tagging a feature is more demanding. There are only two options for finding appropriate tags to describe a feature.

The first is to browse the wiki and find the feature’s page. Once there, you often need to dig through many other pages to find the accepted keys/values that would describe the detailed characteristics of the feature. All of this is very laborious, even for a seasoned contributor, particularly when mapping a feature for the first time.

The second option is to use search tools to find the tags you are looking for (keys or values). You can use a search engine (e.g., Google) by adding “OpenStreetMap Wiki” with your keywords to narrow down the results. You can also use OSM tools, such as TagInfo, TagFinder, OSMantic JOSM Plugin and some others. These tools work well if your keywords match existing keys or values, but it gets trickier if they don’t. However, for a few months now, a new tag search alternative has been offered: ChatGPT.

ChatGPT (Chat Generative Pre-trained Transformer) is a chatbot launched by OpenAI in November 2022 [1]. OpenAI is an artificial intelligence (AI) research and deployment company that gives a free access to its chatbot for the time of the “research preview” [2]. Basically, once registered, a user can ask any type of questions to the chatbot. I then decided to test the chatbot on its ability to find appropriate tags for OpenStreetMap features.

Since I’m currently working in tagging businesses, I tried a few ones. Here are a sequence of questions/answers tried on ChatGPT.

Q: What would be the tag use in OpenStreetMap for a restaurant serving pizza?

A: In OpenStreetMap, the tag for a restaurant serving pizza would be “amenity=restaurant” and “cuisine=pizza”.

The answer is good, but restaurants and pizza could easily be linked together. So, I decided to make it more difficult…

Q: What would be the tag use in OpenStreetMap for an establishment raising alpacas to make clothes?

A: In OpenStreetMap, the tag for an establishment raising alpacas to make clothes would be “landuse=farm” and “animal=alpaca”. Additionally, the “craft=textile_manufacturing” tag could be used to specify that the alpacas are being raised for textile production.

Wow, although craft=textile_manufacturing does not exist (yet), the value makes sense according to the clue I give to the chatbot. Someone tagging the feature for the first time will produce elaborate tags right from the start!

However, the tagging is not always perfect. For instance, here is an example that did not work exactly as expected.

Q: what would be the tag use in OpenStreetMap for describing a building material dealer for doors and windows?

A: In OpenStreetMap, the tag for describing a building material dealer for doors and windows would be “shop=doors” and “shop=windows”. Additionally, the “building_materials=yes” tag could be used to specify that the dealer sells building materials in general.

Well, in this case, the proposed keys and values exist in OpenStreetMap, but the answer is not adequate. First, it suggests using “shop=doors” and “shop=windows”. At a minimum, it should have suggested “shop=doors” or “shop=windows”, not both (although the latter is deprecated). Regarding building_materials=yes, building_materials is not a key but there is a section in the key=shop wiki page that uses it in a section header. Either way, this could have directed a contributor to the appropriate wiki pages.

In conclusion, ChatGPT (and other eventual competitors such as Bard) can really make tagging in OpenStreetMap easier. Using natural language without prior knowledge of expected tags greatly simplifies finding appropriate keys or values. It is certain that for the moment, the answers must be checked with OSM tools, but they should improve overtime.

[1] https://en.wikipedia.org/wiki/ChatGPT

[2] https://openai.com/blog/chatgpt/

Location: Rock Forest–Saint-Élie–Deauville, Sherbrooke, Estrie, Quebec, Canada

Discussion

Comment from MxxCon on 9 February 2023 at 14:34

The biggest problem with ChatGPT is that it sounds equally confident when it’s right and when it’s wrong. In other words it’s really good liar.🙂

Am I wrong or you can have 2 shop= keys or 1 key with 2 values separated by ; ?

Comment from jfd553 on 9 February 2023 at 17:19

Lol, you’re right, it can be a good liar! About having two values for a key, yes, you can separate them with a “;” but it applies when a key may have multiple values (e.g., ref=, cuisine=).

Comment from watmildon on 9 February 2023 at 19:43

Totally right to be wary as it’s a “generate plausible text” tool and not a “go find the right answer” tool. That said, it’s always fun to play and see where things are and see where the limits of things are!

Have you considered asking it to give cuisine=* suggestions based off the website for the restaurant? Having the language model do parsing of that form could be super helpful.

I am reminded of some work someone posted in the OSM Discord some time back about using AI text tools to crawl website= tags to scrape and generate opening hours, phone number, and social media into data tags.

Comment from SherbetS on 10 February 2023 at 23:05

landuse=farm isn’t even a good tag to use for that purpose. I definitely wouldn’t trust a robot that only got it right 1/3 times.

Comment from Thibaultmol on 28 February 2023 at 17:48

Funnily enough, I’ve actually noticed that if you tell chatGPT to only reply if it’s 100-percent certain… It actually does as instructed.

Log in to leave a comment