Skip to content
This repository has been archived by the owner on Jun 4, 2021. It is now read-only.

replace fuzzywuzzy #39

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions frozen_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ docutils==0.15.2
drawnow==0.72.0
enum34==1.1.6
futures==3.2.0
fuzzywuzzy==0.17.0
google-api-core==1.8.0
google-auth==1.6.3
google-cloud==0.34.0
Expand Down Expand Up @@ -48,9 +47,9 @@ pycountry==18.12.8
Pygments==2.4.2
pyparsing==2.3.1
python-dateutil==2.8.0
python-Levenshtein==0.12.0
pytz==2018.9
qibuild==3.13
rapidfuzz==0.12.2
rdflib==4.2.2
requests==2.21.0
reverse-geocoder==1.5.1
Expand Down
3 changes: 1 addition & 2 deletions mac_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ scipy==1.2.3
sklearn

nltk==3.4
fuzzywuzzy
python-Levenshtein
rapidfuzz

rdflib
iribaker
Expand Down
2 changes: 1 addition & 1 deletion pepper/brain/reasoners/type_reasoner.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from pepper import config

from fuzzywuzzy import process
from rapidfuzz import process
import requests


Expand Down
6 changes: 3 additions & 3 deletions pepper/knowledge/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from pepper.knowledge.sentences import *
from pepper import config

from fuzzywuzzy import fuzz
from rapidfuzz import fuzz

from random import choice
from time import strftime
Expand Down Expand Up @@ -113,13 +113,13 @@ def query(self, query):

# Fuzzily try to find best matching query
for Q, A in self.QNA_STATIC.items():
r = fuzz.partial_ratio(query, Q)
r = fuzz.partial_ratio(query, Q, score_cutoff=ratio)
if r > ratio:
answer = A
ratio = r

for Q, A in self.QNA_DYNAMIC.items():
r = fuzz.partial_ratio(query, Q)
r = fuzz.partial_ratio(query, Q, score_cutoff=ratio)
if r > ratio:
answer = A()
ratio = r
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ scipy==1.2.3
sklearn

nltk==3.4
fuzzywuzzy[speedup]
rapidfuzz

rdflib
iribaker
Expand Down