Text this: Statistical mechanics of learning