Skip to content
/ scv Public

Similarities and distances calculator among vectors

License

Notifications You must be signed in to change notification settings

tamada/scv

Repository files navigation

⚖️ scv

build Coverage Status Go Report Card codebeat badge

License Version DOI

Docker

Similarities and distance Calculator among Vectors.

🗣️ Description

There are several algorithms to calculate the similarities of two bectors; however, no commands are exists treats them. scv standardizes the interface for calculating the similarities and distances among vectors.

🏃 Usage

❓ CLI help message

scv [OPTIONS] <VECTORS...>
OPTIONS
    -a, --algorithm <ALGORITHM>    specifies the calculating algorithm.  This option is mandatory.
                                   The value of this option accepts several values separated with comma.
                                   Available values are: simpson, jaccard, dice, cosine, pearson,
                                   euclidean, manhattan, chebyshev, and levenshtein.
    -f, --format <FORMAT>          specifies the resultant format. Default is default.
                                   Available values are: default, json, and xml.
    -t, --input-type <TYPE>        specifies the type of VECTORS. Default is file.
                                   If TYPE is separated with comma, each type shows
                                   the corresponding VECTORS.
                                   Available values are: byte_file, term_file, string, and json.
    -h, --help                     prints this message.
VECTORS
    the source of vectors for calculation.

👟 Examples

$ scv -t string -a simpson distance similarity
simpson(distance, similarity) = 0.5000
$ scv -t string -a jaccard,dice distance similarity
jaccard(distance, similarity) = 0.3333
dice(distance, similarity) = 0.5000

🐳 Docker

Docker

docker run -it ghcr.io/tamada/scv:latest gives some strings for comparing

If scv reads some files, -v option should be specified.

docker run -v $PWD:/home/scv -it ghcr.io/tamada/scv:latest -f json testdata/*.json

versions

  • 1.0.0, latest

⚓ Install

🍺 Homebrew

Simply type the following commands.

brew tap tamada/brew
brew install scv

Go lang

go get github.com/tamada/scv

💪 Compile yourself

git clone https://github.com/tamada/scv
cd scv
make

😄 About

👨‍💼 Authors 👩‍💼

📜 License

Apache 2.0

🎃 Icon

Icon

This image is obtained from iconscount.com.