Spaces:
Runtime error
Runtime error
Commit
•
ba22d01
1
Parent(s):
6d9f6fc
feature-modify-system-instructions (#2)
Browse files- changed system prompt to check for items to be replaced in Guest Rooms (d25ebd824f059236ee9c03250b7f804544f3a40d)
Co-authored-by: Arjun Shankar <sarjunshankar@users.noreply.huggingface.co>
app.py
CHANGED
@@ -86,75 +86,45 @@ terminators = [
|
|
86 |
tokenizer.convert_tokens_to_ids("<|eot_id|>")
|
87 |
]
|
88 |
|
89 |
-
# SYS_PROMPT = """
|
90 |
-
# Extract all relevant keywords and add quantity from the following text and format the result in nested JSON, ignoring personal details and focusing only on the scope of work as shown in the example:
|
91 |
-
# Good JSON example: {'lobby': {'frcm': {'replace': {'carpet': 1, 'carpet_pad': 1, 'base': 1, 'window_treatments': 1, 'artwork_and_decorative_accessories': 1, 'portable_lighting': 1, 'upholstered_furniture_and_decorative_pillows': 1, 'millwork': 1} } } }
|
92 |
-
# Bad JSON example: {'lobby': { 'frcm': { 'replace': [ 'carpet', 'carpet_pad', 'base', 'window_treatments', 'artwork_and_decorative_accessories', 'portable_lighting', 'upholstered_furniture_and_decorative_pillows', 'millwork'] } } }
|
93 |
-
# Make sure to fetch details from the provided text and ignore unnecessary information. The response should be in JSON format only, without any additional comments.
|
94 |
-
# """
|
95 |
-
|
96 |
SYS_PROMPT = """
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
"Portable lighting": 1,
|
109 |
-
"Upholstered furniture and decorative pillows": 1,
|
110 |
-
"Millwork": 1
|
111 |
-
}
|
112 |
-
}
|
113 |
-
Make sure to fetch details from the provided text and ignore unnecessary information. The response should be in JSON format only, without any additional comments.
|
114 |
-
|
115 |
-
Task:
|
116 |
-
Convert the provided extracted text into the JSON format described above.
|
117 |
-
|
118 |
-
Provided Text:
|
119 |
-
|
120 |
-
PROPERTY IMPROVEMENT PLAN
|
121 |
-
PREPARED FOR:
|
122 |
-
Springfield, IL
|
123 |
-
To be relicensed as Hilton Garden Inn
|
124 |
-
...
|
125 |
-
Patios/The Terrace - Install patio decorative lighting. Install patio furniture. (lounge chairs, chaise, dining tables/chairs)
|
126 |
...
|
127 |
-
|
|
|
|
|
|
|
|
|
128 |
...
|
129 |
-
|
|
|
130 |
...
|
131 |
-
|
132 |
-
|
|
|
133 |
{
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
"Portable lighting (floor lamps, table lamps)": 1,
|
147 |
-
"Upholstered furniture and decorative pillows": 1,
|
148 |
-
"Millwork": 1,
|
149 |
-
"Television(s)": 1
|
150 |
-
},
|
151 |
-
"Registration Area": {
|
152 |
-
"Vinyl wall covering": 1,
|
153 |
-
"Hard surface floor covering": 1,
|
154 |
-
"Artwork (new signature graphics on the back wall)": 1
|
155 |
-
}
|
156 |
}
|
157 |
-
|
158 |
"""
|
159 |
def chunk_text(text, chunk_size=5000):
|
160 |
"""
|
|
|
86 |
tokenizer.convert_tokens_to_ids("<|eot_id|>")
|
87 |
]
|
88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
SYS_PROMPT = """
|
90 |
+
Given the text of a hotel property improvement plan, extract the items to be replaced for only the Guest Rooms/ Suites, Guest Bathrooms/Suite Bathrooms.
|
91 |
+
First, find the section of the pdf which describes improvements to be done on the Guest Rooms and Guest Bathrooms, then find the items to be replaced.
|
92 |
+
Ignore items from other sections of the hotel.
|
93 |
+
Items to be replaced are usually preceded by the words replace, install, or provide.
|
94 |
+
Return the results as a JSON with "Guest Room" and "Guest Bathroom" as keys and each value the list of unique items to be replaced.
|
95 |
+
Return only the JSON with no extra text.
|
96 |
+
|
97 |
+
Example Text:
|
98 |
+
"
|
99 |
+
Site & Building Exterior
|
100 |
+
Replace all exterior decorative lighting
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
...
|
102 |
+
Guestrooms
|
103 |
+
Replace [ORG] C-Table.
|
104 |
+
Provide full length mirror.
|
105 |
+
Replace cabinets - Kitchen.
|
106 |
+
at doors where brass hardware finishes exist – replace with stainless
|
107 |
...
|
108 |
+
Guest Bathrooms - (FRCM) Replace mirrors. Install a vanity mirror that has integrated lighting
|
109 |
+
Guest Bathrooms - (FRCM) Replace artwork and decorative accessories.
|
110 |
...
|
111 |
+
Suites - Replace microwave, refrigerator, and associated casegood cabinet.
|
112 |
+
"
|
113 |
+
Example Response:
|
114 |
{
|
115 |
+
"Guest Room": [
|
116 |
+
"C-Table",
|
117 |
+
"full length mirror",
|
118 |
+
"kitchen cabinets",
|
119 |
+
"stainless steel door hardware",
|
120 |
+
"microwave",
|
121 |
+
"refrigerator",
|
122 |
+
"casegood cabinet",],
|
123 |
+
"Guest Bathroom": [
|
124 |
+
"vanity mirror with integrated lighting",
|
125 |
+
"artwork",
|
126 |
+
"decorative accessories",],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
}
|
|
|
128 |
"""
|
129 |
def chunk_text(text, chunk_size=5000):
|
130 |
"""
|