I don’t think it is correct to say prison work is slavery.
I wouldn’t usually call it that either, but I don’t think it is that far of a stretch to understand those who do see it that way.
I’m not sure a sweatshop is a fair comparison since I have never heard that they imprison their “employees” between shifts, or throw them in small rooms if they aren’t will to work anymore.