ginnyxxxxxxx commited on
Commit
3e23051
·
1 Parent(s): 29bf700
Files changed (1) hide show
  1. README.md +75 -6
README.md CHANGED
@@ -1,12 +1,81 @@
1
  ---
2
- title: Demo
3
- emoji: 👀
4
- colorFrom: yellow
5
- colorTo: gray
6
  sdk: gradio
7
- sdk_version: 6.6.0
8
  app_file: app.py
9
  pinned: false
10
  ---
11
 
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: HiCoTraj
3
+ emoji: 🗺️
4
+ colorFrom: red
5
+ colorTo: indigo
6
  sdk: gradio
 
7
  app_file: app.py
8
  pinned: false
9
  ---
10
 
11
+ # HiCoTraj Demo
12
+
13
+ **Zero-Shot Demographic Reasoning via Hierarchical Chain-of-Thought Prompting from Trajectory**
14
+ *ACM SIGSPATIAL GeoGenAgent Workshop 2025*
15
+
16
+ ---
17
+
18
+ ## Overview
19
+
20
+ HiCoTraj demonstrates how a large language model can infer demographic attributes — specifically **household income** — from raw human mobility trajectories, using a three-stage hierarchical chain-of-thought (HiCoT) prompting strategy. No training data or fine-tuning is required; the model reasons step-by-step from spatial patterns alone.
21
+
22
+ ---
23
+
24
+ ## Interface Layout
25
+
26
+ | Component | Description |
27
+ |-----------|-------------|
28
+ | **Agent Cards** | Top panel — 6 showcase agents from the NUMOSIM dataset. Click any card to load that agent's data throughout the interface. |
29
+ | **Trajectory Map** | Interactive map of stay points, ordered chronologically (yellow → dark red). Click any dot for location, time, and activity details. |
30
+ | **Summary Tab** | Rule-based processed data: top locations, temporal distribution, activity breakdown, and observation period. |
31
+ | **Raw Data Tab** | Full daily activity log. Use **Show All Days** to expand beyond the preview. |
32
+ | **CoT Panel** | Right column — step-by-step LLM reasoning. Advance with the ▶ button; each click runs one stage. |
33
+
34
+ ---
35
+
36
+ ## How to Run the Demo
37
+
38
+ 1. **Select an agent** by clicking one of the six cards at the top of the page.
39
+ 2. **Explore the Trajectory Map** — hover and click stay-point markers to inspect visit details.
40
+ 3. **Switch to the Raw Data tab** and click *Show All Days* to view the complete daily log.
41
+ 4. Click **▶ Stage 1: Feature Extraction** to begin the reasoning chain.
42
+ 5. Click **▶ Stage 2: Behavioral Analysis** — Stage 1 results are now visible.
43
+ 6. Click **▶ Stage 3: Demographic Inference** — all three stages shown simultaneously.
44
+ 7. Click **↺ Reset** to clear results and try a different agent.
45
+
46
+ > 💡 **Tip:** Click **▼ prompt** under each stage header to expand the full prompt specification used for that step.
47
+
48
+ ---
49
+
50
+ ## Hierarchical Chain-of-Thought Stages
51
+
52
+ ### 🔵 Stage 01 — Feature Extraction
53
+
54
+ The LLM receives raw trajectory data and extracts **objective features without interpretation**: location inventory (POI names, visit counts, price tier), temporal patterns (time-of-day and weekday/weekend split), spatial activity radius, and daily activity sequences.
55
+
56
+ *Displayed as:* location table with visit bars · time-of-day color segment bar · weekday/weekend split
57
+
58
+ ### 🟠 Stage 02 — Behavioral Analysis
59
+
60
+ Using Stage 1 features, the model performs **behavioral abstraction** across four dimensions: Routine & Schedule (work pattern type), Economic Behavior (spending tier from venue choices), Social & Lifestyle (leisure and community engagement), and Routine Stability (consistency of movement patterns).
61
+
62
+ *Displayed as:* 2×2 card grid — one card per behavioral dimension
63
+
64
+ ### 🔴 Stage 03 — Demographic Inference
65
+
66
+ The model synthesizes Stages 1 and 2 to **infer the agent's household income bracket**, citing specific mobility evidence. The structured output (`INCOME_PREDICTION` / `INCOME_REASONING`) enables reliable extraction and display.
67
+
68
+ *Displayed as:* income prediction badge · evidence-grounded reasoning text
69
+
70
+ ---
71
+
72
+ ## Dataset
73
+
74
+ **NUMOSIM** — *NUMoSim: A Synthetic Mobility Dataset with Anomaly Detection Benchmarks.*
75
+ Stanford C., Adari S., Liao X., et al. ACM SIGSPATIAL Workshop on Geospatial Anomaly Detection, 2024.
76
+
77
+ Synthetic trajectories preserving real population demographics and mobility patterns.
78
+
79
+ - **Demo subset:** 6 agents
80
+ - **Attribute inferred:** household income bracket
81
+ - **Method:** zero-shot LLM, no fine-tuning