Skip to content

fse 1.1.0

Choose a tag to compare

@oborchers oborchers released this 27 Oct 13:35
· 1121 commits to master since this release
fc3cbfb

fse 1.1.0 is the first release since 2022 and the last feature release of the 1.x line. It brings fse to current Python, numpy, scipy and gensim, makes training scale with the number of cores, and stores vectors in less memory. From here on, 1.x receives bug and compatibility fixes; fse 2.0 is in development as a rewrite.

Upgrading from 1.0

  • SIF and uSIF give different vectors. The principal components are now computed exactly over all sentence vectors instead of from a random sample, and uSIF weights the removed components like the reference implementation. Retrain SIF and uSIF models for vectors that are comparable with new ones; uSIF models saved by 1.0 keep their old weighting when loaded. On the STS Benchmark, uSIF scores rise by 0.2 to 1.4 points.
  • Arguments are validated strictly and raise a pydantic.ValidationError instead of being coerced or ignored.
  • Requires Python 3.11 to 3.13. New dependencies: pydantic and threadpoolctl.

Highlights

  • Training scales with workers. Pass workers=os.cpu_count(). On 16 vCPUs of an AMD EPYC, 16 workers train up to 2.2 million sentences per second with Average and 1.7 million with SIF from a CorpusFile.
  • New inputs CorpusFile(path) and TextList(strings), read and split by every worker in compiled code.
  • Smaller vectors: sv_dtype and wv_dtype store sentence and word vectors as float16 or int8, with every read in float32. On the STS Benchmark, int8 changes the scores by at most 0.02 points for sentence vectors and 0.12 points for word vectors.
  • SentenceVectors.score(weights, bias) applies a linear model to all sentence vectors in blocks, and min_similarity filters the similarity searches.
  • Pre-built wheels for Linux (x86_64, aarch64), macOS (arm64, x86_64) and Windows (x86_64).
  • Many fixes, among them a 32-bit offset overflow that wrote sentence vectors into wrong rows from about 14 million sentences on, train(update=True) overwriting existing rows, and hangs when a worker failed.

The full list is in CHANGELOG.md.