Given a random variable $X$, its variance $\sigma ^2 = E(X^2)-[E(X)]^2$, where $E(X)$ is the expected value of $X$. For a discrete random variable $X$, $E(X)=\sum x_iP(X=x_i)$. For a continuous variable, $E(X) = \int_{\infty}^{+\infty} xp(x)dx$.
For example, let $X$ be the outcome of rolling a perfect die, where X is a discrete random variable and $P(X=1) = P(X=2) = ... = P(X=6) = \frac{1}{6}$. Then $E(X) = 1 \times \frac{1}{6} + 2 \times \frac{1}{6} + ... + 6 \times \frac{1}{6} = 3.5$. $E(X^2) = 1^2 \times \frac{1}{6} + 2^2 \times \frac{1}{6} + ... + 6^2 \times \frac{1}{6} = \frac{91}{6}$. Thus the variance $\sigma ^2 = E(X^2)-[E(X)]^2 = \frac{91}{6} - 3.5^2 = \frac{35}{12}$.
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence