The emotion / cognition distinction is somewhat poor and often breaks down, because you can't really have one without the other (different mental states just involve differing degrees of both, phenomenologically). They aren't really causally separable, but are only really phenemonologically separable (cognition and emotion have different feels / textures, but almost always co-occur).
Most importantly, you rarely have "cognition-free" emotional states, because emotions always involve some mental model or representation of the self / world / self and world, i.e. they involve a cognitive state. Only in very extreme cases (drugs, perhaps some cases of persistent depression, etc) might you be able to have emotions that are largely uncorrelated with any kind of particular cognition.
Likewise, the same is almost certainly true for cognitive states, in that we tend to think about / model things because we need to evaluate those things. Evaluation too seems to rely heavily on emotional processes, in that damage to emotional processing tends to make rational / logical decision-making severely impaired (e.g. Damasio's work in the 90s, or https://pmc.ncbi.nlm.nih.gov/articles/PMC2396787/). Regardless, you can't remove evaluation / valuation from most thinking, and that is fundamentally linked to emotion.
Doesn't mean you couldn't potentially build a machine / thing that detects mental states, mind you. But it likely won't be very useful if it is just using simple folk-psychological terminology and concepts (or using such concepts will likely not result in much insights into the machine outputs).