Sometimes we use inversion in other cases, when we are not making a question.
When we use a negative adverb or adverb phrase at the beginning of the sentence it can sound quite formal:
Seldom have I seen such beautiful work.
('Seldom' is at the beginning, so we use inversion. This sentence emphasizes what beautiful work it is.)
I have seldom seen such beautiful work.
('Seldom' is in the normal place, so we don't use inversion. This is a normal sentence with no special emphasis.)