Text this: Multiphoton, multimode state classification for nonlinear optical circuits