Is there a way to understand the type of a sentence?
You can generally identify the mood of a verb by looking at grammatical structures; you don't need any language model for it. The three major moods in English are declarative, interrogative, and imperative. Assuming English is the language you will be working with, here are some questions:


Does he like coffee?
Is this a piece of chocolate?
When did you go there?
How is that possible?
Have you got any cheese?


Apart from the obvious marker '?', these examples all start with either an auxiliary verb or a wh-word, so are fairly easy to recognise with a simple lookup. The one exception I can think of is an imperative (Do be quiet, please), where the do is followed by a further verb, which wouldn't be the case with a question.

Imperatives:


Go to school now!
Eat up your vegetables!
Do shut up.
Have a go at it!


These start with a main verb in the base form, or with an auxiliary followed by a verb/not a pronoun.

Once you identified all interrogative and imperative sentences, all the remaining ones should be declarative.

So, all you would need is a small list of auxiliary verb, pronouns, and wh-words, and with a bit of simple string matching you should get most of the way there. Undoubtedly there will be some exceptions, but there shouldn't be too many of them.

In other languages there will be similar structures; or there might be explicit markers (eg in Hawai'ian an imperative starts with the marker 'e', as in Hele 'oe ma ka hale "you go to the house" vs E hele 'oe ma ka hale "Go to the house!")