Skip to content

Instantly share code, notes, and snippets.

@fgregg
Last active December 17, 2015 03:38
Show Gist options
  • Save fgregg/5544481 to your computer and use it in GitHub Desktop.
Save fgregg/5544481 to your computer and use it in GitHub Desktop.
# In local_settings.py
def topic_classifier(title) :
if 'Damage to vehicle claim' in title :
return ['Routine', 'Damage to vehicle claim']
if 'Damage to property claim' in title :
return ['Routine', 'Damage to property claim']
if 'Excessive water rate claim' in title :
return ['Routine', 'Excessive water rate claim']
if 'Issuance of permits for sign(s)/signboard(s)' in title :
return ['Routine', 'Sign permits']
if 'Sidewalk cafe(s)' in title :
return ['Routine', 'Sidewalk cafe']
if title.startswith(('Loading/Standing/Tow Zone',
'Tow Zone - Street Cleaning',
'Tow Zone(s) - Street Cleaning',
'Traffic Lane - Tow/Away Zone',
'Loading Zone',
'Traffic Lane Tow-Away Zones')) :
return ['Routine', 'Loading/Standing/Tow Zone']
if title.startswith(('Congratulations extended',
'Congratulations and best wishes',
'Congratulation to',
'Commemoration of',
'Tribute to',
'Gratitude extended',
'Recognition extended',
'Recognition of',
'Honoring',
'Welcome extended')) or 'declaration' in title.lower() :
return ['Routine', 'Honorific']
if title.startswith(('Residential permit parking',
'Residential Permit Parking',
'Buffer zone(s) for residential permit parking')) :
return ['Routine', 'Residential permit parking']
if title.startswith(('Traffic sign(s)',
'Traffic Signs',
'Traffic Sign(s)',
'Traffic Warning Sign and/or Signals',
'Traffic warning sign and/or signals',
'Miscellaneous Signs')) :
return ['Routine', 'Traffic signs and signals']
if title.startswith('Senior citizen sewer') :
return ['Routine', 'Senior citizen sewer refund']
if title.startswith(('Grant(s) of privilege in public way',
'Amendment of grant(s) of privilege in public way')) :
return ['Routine', 'Grant of privilege in public way']
if title.startswith(('Handicapped Parking Permit',
'Handicapped Permit Parking',
'Handicapped parking permit',
'Handicapped permit parking')) :
return ['Routine', 'Handicapped Parking Permit']
if title.startswith(('Parking prohibited',
'Parking Prohibited',
'Parking Prohibitited',
'Parking Limited During Specified Hours')) :
return ['Routine', 'Parking prohibited']
if title.startswith(('Handicapped Parking Permit',
'Handicapped permit parking')) :
return ['Routine', 'Handicapped Parking Permit']
if title.startswith('Zoning Reclassification') :
return ['Routine', 'Zoning Reclassification']
if title.startswith('Awning(s)') :
return ['Routine', 'Awnings']
if title.startswith('Canopy(s)') :
return ['Routine', 'Canopy']
if title.startswith(('Honorary street designation',
'Dedication of')) :
return ['Routine', 'Honorary street']
if title.startswith('Condominium claim') :
return ['Routine', 'Condo Claim']
if 'Fixed for next City Council Meeting' in title :
return ['Routine', 'Next Meeting']
if 'Exemption from physical barrier' in title :
return ['Routine', 'Physical barrier exemption']
return ['Non-Routine']
TOPIC_CLASSIFIER = topic_classifier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment