Republic Services’ new recycling plant in Peabody, Massachusetts, uses artificial intelligence to help sort materials.