Skip to main content

Dynamic maps generation based on natural language prompts using Retrieval-Augmented Generation (RAG)

Project description

prompt2map

prompt2map is a Python package that generates dynamic maps based on natural language prompts, utilizing Retrieval-Augmented Generation (RAG).

Quickstart

Initialize the mapper with geospatial data

To get started, initialize Prompt2Map by providing a geospatial data file, embeddings, and descriptions of the fields in your dataset:

from prompt2map import Prompt2Map

# Example with portuguese 2021 Census
p2m = Prompt2Map.from_file(
    "censo2021portugal", 
    "data/censo_pt_2021/geodata.parquet",  # Main geospatial data source that will be queries and mapped 
    "data/censo_pt_2021/embeddings.parquet",  # Embedding for string literals
    "data/censo_pt_2021/variable_descriptions.csv" # Description of fields in geodata.parquet 
)

Make a query

Once initialized, you can generate maps by making natural language queries. For example, to create a population density map:

prompt = "Population density map of the district of Setúbal by parish in inhabitants / km2"
generated_map = p2m.to_map(prompt)

Screenshot of a web choropleth map of Setúbal district with parish polygons

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prompt2map-0.1.3.tar.gz (2.6 MB view details)

Uploaded Source

Built Distribution

prompt2map-0.1.3-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

Details for the file prompt2map-0.1.3.tar.gz.

File metadata

  • Download URL: prompt2map-0.1.3.tar.gz
  • Upload date:
  • Size: 2.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for prompt2map-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ca57843f026fcb74216eecc93bf8b71e17cf72091584a49444fccf8f920f64bd
MD5 93826f932d287fb9801ca6d83237b3ff
BLAKE2b-256 f1ccffe80948ccdd6cc4ea6be13fed629c3f8cc9612b0a04b2794bdb119bcb65

See more details on using hashes here.

File details

Details for the file prompt2map-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: prompt2map-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for prompt2map-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f9f7fb6e13ddf15a62791168cba145e81c7cbb2e6d54827ee2a7642261972531
MD5 e842fd83a75c00ee7ecd5d1ea051495d
BLAKE2b-256 f011dd2574348fff77c37ad93c301686ab9450d8a980009f127a88e17b3af2d3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page