One fairly straightforward way is to compute the fraction of likes as
$$ \text{fraction}_\text{likes} = \frac{\text{number}_\text{likes}} {\text{number}_\text{likes}+ \text{number}_\text{dislikes}} $$
and then if $\text{fraction}_\text{likes}$ is below $0.2$, that's one star; if it's at least $0.2$ but less than $0.4$, it's two stars; and so on. More than $0.8$ is five stars.
ETA: If you allow for zero stars, you could break it down as follows: less than $0.1$, zero stars; at least $0.1$ but less than $0.3$, one star; and so on. More than $0.9$ is five stars.