On the cohomology of finite semigroups