While modality can be classified at a fine level (e.g., epistemic and deontic), we simply determine whether or not a sentence includes a modal marker that is involved in the main predicate of the sentence.
this binary feature is determined based on the existence of a model verb like "can", "shall", "must", and "may" or a phrase like "have to" or "need to".