Generalized Koszul complexes and artinian modules