markrodrigo
commited on
Commit
•
cb7900d
1
Parent(s):
d1d124c
Update README.md
Browse files
README.md
CHANGED
@@ -29,4 +29,97 @@ is the Natural Language command adaptation of particular geographic spatial func
|
|
29 |
|
30 |
There are four primary geographic functions released in version 1.0.
|
31 |
|
32 |
-
**Model developer**: Mark Rodrigo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
There are four primary geographic functions released in version 1.0.
|
31 |
|
32 |
+
**Model developer**: Mark Rodrigo
|
33 |
+
- Chat to Map interfacing.
|
34 |
+
|
35 |
+
**Model Architecture**: The model is a QLoRA / Supervised Fine Tuning (SFT)
|
36 |
+
|
37 |
+
### Model Input / Output Overview:
|
38 |
+
|
39 |
+
Input: Text plus coordinate prompt injection.
|
40 |
+
Output: **PostGIS spatial SQL**
|
41 |
+
NOTE: Inputs and outputs are in meters and or geographic decimal degrees WGS 84 coordinates.
|
42 |
+
|
43 |
+
| Function | Question Input | Geo Input | SQL Execution Output |
|
44 |
+
|:---------:|:---------------:|:---------:|:-------------------------:|
|
45 |
+
| Area | Area question | Polygon | Number - Area sq meters |
|
46 |
+
| Centroid | Center question | Polygon | Point |
|
47 |
+
| Buffer | Buffer distance | Point | Polygon |
|
48 |
+
| Length | Length question | Line | Number - Length in meters |
|
49 |
+
|
50 |
+
### Example Prompt / Prompt File
|
51 |
+
|
52 |
+
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
|
53 |
+
<p></p>
|
54 |
+
You are a helpful assistant. You are an expert at PostGIS and Postgresql and SQL and psql.
|
55 |
+
<p></p>
|
56 |
+
<|eot_id|><|start_header_id|>user<|end_header_id|>
|
57 |
+
|
58 |
+
\### Instruction: Write a PostGIS SQL statement for the following.
|
59 |
+
<p></p>
|
60 |
+
|
61 |
+
\### Input:
|
62 |
+
|
63 |
+
<p></p>
|
64 |
+
{input}
|
65 |
+
|
66 |
+
<p></p>
|
67 |
+
|
68 |
+
\### Response:
|
69 |
+
|
70 |
+
<|eot_id|><|start_header_id|>assistant<|end_header_id|>
|
71 |
+
|
72 |
+
|
73 |
+
### Examples
|
74 |
+
**Note 10/6/24 **
|
75 |
+
- Centroid and Buffer responses are currently returning as WKT. While technically correct, this is not the desired response, and will be addressed.
|
76 |
+
</br> Reference - https://postgis.net/docs/ST_AsText.html
|
77 |
+
- English and Chinese models, etc. currently require the 8b models and or additional fine-tuning for 3b.
|
78 |
+
|
79 |
+
AREA
|
80 |
+
<p></p>
|
81 |
+
|
82 |
+
\### Input: What is the area for the polygon? : 'Polygon ((-3.7515154 40.3855551, -3.7514972 40.3856581, -3.7507005 40.3855767, -3.7507167 40.3854722, -3.7515154 40.3855551))'
|
83 |
+
<p></p>
|
84 |
+
|
85 |
+
\### Response: SELECT ST_Area(geog) As area FROM (select 'Polygon ((-3.7515154 40.3855551, -3.7514972 40.3856581, -3.7507005 40.3855767, -3.7507167 40.3854722, -3.7515154 40.3855551))' :: geography geog) subquery;
|
86 |
+
<p></p>
|
87 |
+
|
88 |
+
CENTROID
|
89 |
+
<p></p>
|
90 |
+
|
91 |
+
\### Input: What is the centroid for the polygon? : 'Polygon ((-3.6934636 40.4808785, -3.6933352 40.4811486, -3.6930125 40.4810598, -3.693141 40.4807897, -3.6934636 40.4808785))'
|
92 |
+
<p></p>
|
93 |
+
|
94 |
+
**actual**
|
95 |
+
|
96 |
+
\### Response: SELECT ST_Centroid(geog) FROM (select 'Polygon ((-3.6934636 40.4808785, -3.6933352 40.4811486, -3.6930125 40.4810598, -3.693141 40.4807897, -3.6934636 40.4808785))' :: geography as geog) subquery
|
97 |
+
|
98 |
+
**desired**
|
99 |
+
|
100 |
+
\### Response: SELECT ST_AsText(ST_Centroid(geog)) As centroid FROM (select 'Polygon ((-3.6934636 40.4808785, -3.6933352 40.4811486, -3.6930125 40.4810598, -3.693141 40.4807897, -3.6934636 40.4808785))' :: geography geog) subquery;
|
101 |
+
|
102 |
+
<p></p>
|
103 |
+
BUFFER
|
104 |
+
<p></p>
|
105 |
+
|
106 |
+
\### Input: What is the thousand meter buffer for the following point? : 'Point(-8.7522658 41.3862664)'
|
107 |
+
<p></p>
|
108 |
+
|
109 |
+
**actual**
|
110 |
+
|
111 |
+
\### Response: SELECT ST_Buffer(geog, 1000) FROM (select 'Point(-8.7522658 41.3862664)' :: geography as geog) subquery
|
112 |
+
|
113 |
+
**desired**
|
114 |
+
|
115 |
+
\### Response: SELECT ST_AsText(ST_Buffer(geog, 1000)) as buffer FROM (select 'Point(-8.7522658 41.3862664)' :: geography geog) subquery;
|
116 |
+
|
117 |
+
<p></p>
|
118 |
+
LENGTH
|
119 |
+
<p></p>
|
120 |
+
|
121 |
+
\### Input: How long is the line? : 'LINESTRING (-3.6976693 40.4263178, -3.6986082 40.4258729)'
|
122 |
+
<p></p>
|
123 |
+
|
124 |
+
\### Response: SELECT ST_Length(geog) As length FROM (select 'LINESTRING (-3.6976693 40.4263178, -3.6986082 40.4258729)' :: geography geog) subquery;
|
125 |
+
<p></p>
|