Statistical Mechanics of Semantic Compression