GitXplorerGitXplorer
j

similarity

public
1 stars
0 forks
0 issues

Commits

List of commits on branch main.

No commits found

There are no commits on branch main.

README

The README file for this repository.

similarity

Uses embeddings to determine similar results.

Usage:

sentences = {
  'You are awesome!': 1,
  "You aren't so great.": 0,
  "Hmm, I don't know": 0,
  'Oh yeah nice work!': 1,
  # More sentences usually make the results more accurate.
}

from similarity import similar
sim = similar(sentences)

tests = [
  "Cool!",
  "Nah, this is not it..."
]

for i in tests:
    print(i)
    out = sim.similar(i, max=1) # max is amount of results returned
    if out[0] == 1:
        print("Positive!")
    else:
        print("Negative!")
    print()