/occupational-safety-nlp

Structural topic model dashboard of occupational incident reports via OSHA.

Primary LanguageR

Occupational Incident NLP Analysis

Background

  • I wanted to implement a structural topic model, a type of topic modelling approach that allows for the analyst to include covariates and meta-data when estimating latent themes or topics in a corpus of text data
  • The code in this repo estimates a 3 to 6 solution topic model on occupational incident reports from the Occupational Safety and Health Administration (OSHA) covering a time period from 2015-01-01 to 2022-09-02
  • These results are presented in a dashboard for a data consumer to peruse the findings via the {stminsights} package

Results

  • While these results are very preliminary, I find a four topic solution appears to fit reasonably well using both empirical (e.g. model fit statistics like semantic coherence and exclusivity) and rational methods (reading the representative documents) to evalute the results
   Topic Document                                                                                                                                                                             
   <int> <chr>                                                                                                                                                                                
 1     1 A maintenance employee was cleaning the filler of a machine with a rag after residue built up when the rag was pulled into the machine and the employee's right index finger contact…
 2     1 On April 27, 2022, an employee was operating a band sealer when its outfeed jammed. She was clearing it when the jammed piece pulled her into the machine; this triggered the machin…
 3     1 An employee was working inside of the air handling unit and was working on the fan blade belt and pulley system. The employee rotated the fan blade pulley belt and amputated a fing…
 4     2 The injured employee backed a counterweight truck up to a crane to unload and position crane mats and install counterweight. The crane raised its boom off the boom dolly and swung …
 5     2 An employee was attaching a C-hook to a smaller scale hook attached to an overhead crane. The C-hook was resting on top of a coil. The smaller scale hook was not fitting into the C…
 6     2 An employee climbed into position at the top of a pole to attach a static wire to the static bar at the top of the pole when the employee received an electrical shock due to induce…
 7     3 On 7/15/2021 at 9:00 a.m., an employee was traveling down a warehouse aisle on an electric pallet jack when a forklift struck the pallet jack at an aisle intersection. The employee…
 8     3 An employee operating an electric pallet jack went to turn in an aisle at the same time a forklift operator carrying empty pallets was turning into the aisle. The pallet jack and t…
 9     3 An employee was operating a standup forklift to put a rack of windshields onto a rack. After placing the rack of windshields into a rack the forklift backed up and the employee's l…
10     4 A smokejumper parachuted out of a plane to fight a wildfire. He had a hard landing on rocky terrain and suffered a skull fracture, a traumatic brain injury, facial fractures, a fra…
11     4 A U.S. Postal Service employee suffered heat-related dizziness, shortness of breath, and cramps while delivering mail. The employee was hospitalized.                                
12     4 A Census Bureau employee was delivering census packets. He lost consciousness while approaching a home, fell, and struck his face on the ground. He was hospitalized, suffering from…```