By a result of Gerstenhaber and Schack, the simplicial cohomology ring $\operatorname{H}^{\bullet}({\mathcal C},k)$ of a poset ${\mathcal C}$ is isomorphic to the Hochschild cohomology ring $\operatorname{HH}^{\bullet}(k{\mathcal C})$ of the category algebra $k{\mathcal C}$, where the poset is viewed as a category and $k$ is a field. Extending results of Mishchenko, under certain assumptions on a category ${\mathcal C}$, we construct a category ${\mathcal D}$ and a graded $k$-linear isomorphism $\operatorname{HH}^{\bullet}(k{\mathcal C})\cong \operatorname{H}^{\bullet}({\mathcal D},k)$. Interpreting the degree one cohomology, we also show how the $k$-space of derivations on $k{\mathcal C}$ graded by some semigroup corresponds to the $k$-space of characters on ${\mathcal D}$.