In this paper we give a generalized model of the interest rates term structure including Nelson-Siegel and Svensson structure. For that we introduce a continuous m-factor exponential-polynomial form of forward interest rates and demonstrate its considerably better performance in a fitting of the zero-coupon curves in comparison with the well known Nelson-Siegel and Svensson ones. In the sequel we transform the model into a dynamic model for interest rates by designing a switching dynamical system of the considerably reduced dimension n < m generating the forward rate curves in form a càdlàg function. A system is described by n-th order linear differential equation driven by a stochastic or chaotic shot noise. From fitted forward rates we specify the parameters of the switching system and discuss perspectives of our models to produce term-structure forecasts at both short and long horizons.