Skip to main content

A free tool for sentence similarity evaluation

Project description

semsim

Compare texts easily with semsim Python package!

Features

  • Dozens of parameters to be tuned by you for better performance!
  • Default values of all the parameters validated on datasets for paraphrase detection task
  • 6 different algorithms for efficient syntax tree comparison
  • A small pack of standard "built-in" models which can be easily downloaded via semsim package itself
  • Flexible class taxonomy which you can extend by simply inheriting from one of the model base classes
  • Python library semsim with command line interface (powered by click)

Dependencies

  • attrs
  • click
  • networkx
  • numpy
  • pymorphy2
  • scipy
  • simple_elmo
  • tensorflow
  • tensorrt
  • textract
  • torch
  • torch-geometric
  • torch-scatter
  • torch-sparse
  • torchwordemb
  • tqdm
  • ufal.udpipe

Quick start

To install semsim simply run:

pip install semsim


NOTE: If you encounter problems when installing semsim package, consider first installing some prerequisites in advance: $ pip install torch tensorflow tensorrt Then proceed to install semsim.


Now you can use semsim CLI tool as follows:

$ semsim first_src.txt second_src.txt -o output.txt

You might want to download standard "built-in" (or we should say "add-on") models for better performance. This can be done by executing the following line:

$ semsim download cbow

for fetching pretrained CBOW embeddings or

$ semsim download -a

for downloading all the add-ons at once in parallel.

More info can be found on the documentation page.

Codestyle linters and test frameworks

This library has been fully checked and tested with the following tools:

  • flake8
  • mypy
  • pydocstyle
  • pytest

Interface

CLI interface is described in the examples section of documentation. This is how you can use semsim CLI tool:

$ semsim compare first_src.txt second_src.txt -e cbow -k neural -o output.txt --max-out-pairs 200 -v

Authors

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

semsim-1.1.1.tar.gz (29.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

semsim-1.1.1-py3-none-any.whl (34.5 kB view details)

Uploaded Python 3

File details

Details for the file semsim-1.1.1.tar.gz.

File metadata

  • Download URL: semsim-1.1.1.tar.gz
  • Upload date:
  • Size: 29.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for semsim-1.1.1.tar.gz
Algorithm Hash digest
SHA256 7f54318463115d6fcef6e9434cad3f48ef995b68c5969b852e3710c31b92ea6f
MD5 b929054f95c3d3cdc5b9f6724b79ab37
BLAKE2b-256 84b4a9dff7c56a7fef02cd95e4f23f373f4f07bd97f0d495c1f2882810a7f944

See more details on using hashes here.

File details

Details for the file semsim-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: semsim-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 34.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for semsim-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e37c55e38f72696fd6c4549bfc20baad1cf035d372023d0209270f3dbcebbe27
MD5 c486f2bfa273108fd468f7b511b03c59
BLAKE2b-256 6bd778426c1345af25c759ee6cab4c3f52692d36f528b8f019814a3e2f8e77c4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page