Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sentence compare alternate impl #1612

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Next Next commit
implement word vector based search for future cluster creation.
  • Loading branch information
capaximperii committed Feb 4, 2019
commit 1fdf4a5c0cb43d22ea0232bd41c3c5bcb196529b
357 changes: 0 additions & 357 deletions chatterbot/comparisons.py

This file was deleted.

25 changes: 25 additions & 0 deletions chatterbot/comparisons/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

"""
This module contains various text-comparison algorithms
designed to compare one statement to another.
"""

from .levelshtein_distance import LevenshteinDistance
from .synset_distance import SynsetDistance
from .sentiment_comparison import SentimentComparison
from .jaccard_similarity import JaccardSimilarity
from .embedded_wordvector import EmbeddedWordVector

levenshtein_distance = LevenshteinDistance()
synset_distance = SynsetDistance()
sentiment_comparison = SentimentComparison()
jaccard_similarity = JaccardSimilarity()
embedded_wordvector = EmbeddedWordVector()

__all__ = (
'levelshtein_distance',
'synset_distance',
'sentiment_comparison',
'jaccard_similarity',
'embedded_wordvector'
)
7 changes: 7 additions & 0 deletions chatterbot/comparisons/comparator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class Comparator:

def __call__(self, statement_a, statement_b):
return self.compare(statement_a, statement_b)

def compare(self, statement_a, statement_b):
return 0
Loading