contenteaseAI sarjunshankar commited on
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>

Files changed (1) hide show
  1. app.py +33 -63
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
- Extract all relevant keywords and add quantities from the following text and format the result in nested JSON, ignoring personal details and focusing only on the area and furniture items as shown in the example. Each item should have a count, which will be set to 1 for simplicity. The response should be in JSON format only, without any additional comments.
98
-
99
- Good JSON example:{
100
- "Lobby Area/Entrance": {
101
- "Vinyl wall covering": 1,
102
- "Decorative hardwired lighting": 1
103
- },
104
- "Lobby": {
105
- "Carpet, carpet pad, and base": 1,
106
- "Window treatments": 1,
107
- "Artwork and decorative accessories": 1,
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
- Lobby Area - Replace carpet, carpet pad, and base. Replace window treatments. Replace artwork and decorative accessories. Replace portable lighting. (floor lamps, table lamps) Replace upholstered furniture and decorative pillows. Replace millwork. Replace the television(s).
 
 
 
 
128
  ...
129
- Registration Area - Replace vinyl wall covering. Replace hard surface floor covering. Replace artwork. Install new signature graphics on the back wall.
 
130
  ...
131
-
132
- Expected Output (JSON format):
 
133
  {
134
- "Patios/The Terrace": {
135
- "Patio decorative lighting": 1,
136
- "Lounge chairs": 1,
137
- "Chaise": 1,
138
- "Dining tables": 1,
139
- "Dining chairs": 1,
140
- "Patio furniture": 1
141
- },
142
- "Lobby Area": {
143
- "Carpet, carpet pad, and base": 1,
144
- "Window treatments": 1,
145
- "Artwork and decorative accessories": 1,
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
  """