improve_vectorspace: Improve a vectorspace by removing common elements.

View source: R/matrixFunctions.R

improve_vectorspaceR Documentation

Improve a vectorspace by removing common elements.

Description

See reference for a full description. Supposedly, these operations will improve performance on analogy tasks.

Usage

improve_vectorspace(vectorspace, D = round(ncol(vectorspace)/100))

Arguments

vectorspace

A VectorSpacemodel to be improved.

D

The number of principal components to eliminate.

Value

A VectorSpaceModel object, transformed from the original.

References

Jiaqi Mu, Suma Bhat, Pramod Viswanath. All-but-the-Top: Simple and Effective Postprocessing for Word Representations. https://arxiv.org/abs/1702.01417.

Examples


closest_to(demo_vectors,"great")
# stopwords like "and" and "very" are no longer top ten.
# I don't know if this is really better, though.

closest_to(improve_vectorspace(demo_vectors),"great")


bmschmidt/wordVectors documentation built on June 2, 2022, 3:53 p.m.