Vector space model implementation