forked from gunthercox/ChatterBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated for raspberry pi and fixed some other issues
- updated spaCy requirements - included install script for raspi - made changes to spaCy loading save memory - by default, have best_match adapter allow repeated responses, with option to disable
- Loading branch information
1 parent
0c4e388
commit 4f2275e
Showing
11 changed files
with
74 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from chatterbot import languages | ||
import spacy | ||
|
||
# loading spacy more than once slows down everything and makes it consume a lot of extra memory | ||
# so having a single instance will save memory | ||
class singleSpacy: | ||
_instance = None | ||
@staticmethod | ||
def getInstance(language=None): | ||
if singleSpacy._instance is None: | ||
singleSpacy(language) | ||
return singleSpacy._instance | ||
|
||
def __init__(self, language=None): | ||
language = language or languages.ENG | ||
singleSpacy._instance = spacy.load(language.ISO_639_1.lower()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
# may need to install/ update Cython | ||
# python3 -m pip install -U Cython | ||
|
||
if | ||
# for arm architecure, need to set BLIS to generic for install to work | ||
lscpu| head -n 1 | grep -q 'aarch\|arm'; then | ||
echo "Setting BLIS_ARCH to generic" | ||
export BLIS_ARCH='generic' | ||
fi | ||
echo "Installing Chatterbot" | ||
python3 -m pip install . | ||
|
||
# change 'en' to any other language if desired; by default the small model is downloaded | ||
# but this can be changed; for example: change 'en' to 'en_core_web_lg' for the large model | ||
# then will need to create corresponding shortcut link; for example: python3 -m spacy link --force en_core_web_lg en | ||
echo "Downloading and linking spaCy en model" | ||
python3 -m spacy download en |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ max_line_length = 175 | |
exclude = .eggs, .git, .tox, build, | ||
|
||
[chatterbot] | ||
version = 1.1.0 | ||
version = 1.1.1 | ||
author = Gunther Cox | ||
email = [email protected] | ||
url = https://github.com/gunthercox/ChatterBot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters