-
Notifications
You must be signed in to change notification settings - Fork 1
/
streeteasy_genai.html
112 lines (107 loc) · 5.05 KB
/
streeteasy_genai.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>StreetEasy GenAI</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
margin: 0;
}
.container {
max-width: 800px;
width: 100%;
padding: 20px;
}
.search-form {
display: flex;
margin-bottom: 20px;
}
.search-input {
flex-grow: 1;
padding: 10px;
border: 1px solid #ddd;
border-radius: 4px 0 0 4px;
}
.search-button {
background-color: #007bff;
color: white;
border: none;
padding: 10px 20px;
border-radius: 0 4px 4px 0;
cursor: pointer;
}
.recommended {
margin-top: 20px;
}
.recommended a {
display: inline-block;
margin-right: 10px;
margin-bottom: 10px;
padding: 5px 10px;
border: 1px solid #ddd;
border-radius: 20px;
text-decoration: none;
color: black;
}
</style>
</head>
<body>
<div class="container">
<div class="row mb-5">
<div class="col-md-6">
<a href="https://github.com/Cocoon-Data-Transformation/cocoon" target="_blank"
class="text-decoration-none text-dark">
<div class="d-flex align-items-center">
<img src="https://raw.githubusercontent.com/Cocoon-Data-Transformation/cocoon/main/images/cocoon_icon.png"
alt="cocoon icon" width="40" class="me-3">
<div>
<h4 class="mb-0">Cocoon GenAI</h4>
<small class="mb-0">Prepare your data, ready for GenAI</small>
</div>
</div>
</a>
</div>
<div class="col-md-6 d-flex align-items-center justify-content-end">
<h2>StreetEasy Demo</h2>
</div>
</div>
<form class="search-form" onsubmit="return handleSubmit(event)">
<input type="text" class="search-input" id="question" placeholder="Enter your question about StreetEasy">
<button type="submit" class="search-button">Ask GenAI</button>
</form>
<div class="recommended">
<a href="#" onclick="document.getElementById('question').value='What are the price indices for housing in NYC boroughs?'; return false;">What are the price indices for housing in NYC boroughs?</a>
<a href="#" onclick="document.getElementById('question').value='In which year did the Bronx experience the highest growth in its real estate index?'; return false;">In which year did the Bronx experience the highest growth in its real estate index?</a>
<a href="#" onclick="document.getElementById('question').value='Which borough had the highest total inventory in June 2018?'; return false;">Which borough had the highest total inventory in June 2018?</a>
<a href="#" onclick="document.getElementById('question').value='Which neighborhoods in Brooklyn had the highest year-over-year change in rental prices as of September 2018?'; return false;">Which neighborhoods in Brooklyn had the highest year-over-year change in rental prices as of September 2018?</a>
<a href="#" onclick="document.getElementById('question').value='Which quintile of properties in Queens showed the highest month-over-month price index change in September 2018?'; return false;">Which quintile of properties in Queens showed the highest month-over-month price index change in September 2018?</a>
</div>
<div class="text-center mt-4">
<a href="https://cocoon-data-transformation.github.io/page/model_gallery/easy_street/models/model.html" target="_blank">
👉 Learn more about StreetEasy data source and Cocoon preparation
</a>
</div>
</div>
<script>
function cleanQuestion(question) {
const validCharsRegex = /[a-zA-Z0-9 .,?!-]/g;
const cleanedChars = question.match(validCharsRegex) || [];
return cleanedChars.join('');
}
function handleSubmit(event) {
event.preventDefault();
const question = document.getElementById('question').value;
const cleanedQuestion = cleanQuestion(question);
window.location.href = `http://34.168.161.63:5000/genai/easy_street/${encodeURIComponent(cleanedQuestion)}`;
return false;
}
</script>
</body>
</html>