Switch to medium spaCy model by default Correct paths for requirements.txtpull/107/head
parent
9bd4a957c9
commit
dc829a3d5b
@ -0,0 +1,135 @@
|
|||||||
|
# Chatter
|
||||||
|
|
||||||
|
Chatter is a tool designed to be a self-hosted chat cog.
|
||||||
|
|
||||||
|
It is based on the brilliant work over at [Chatterbot](https://github.com/gunthercox/ChatterBot) and [spaCy](https://github.com/explosion/spaCy)
|
||||||
|
|
||||||
|
|
||||||
|
## Warning
|
||||||
|
|
||||||
|
**Chatter is a CPU, RAM, and Disk intensive cog.**
|
||||||
|
|
||||||
|
Chatter by default uses spaCy's `en_core_web_md` training model, which is ~50 MB
|
||||||
|
|
||||||
|
Chatter can potential use spaCy's `en_core_web_lg` training model, which is ~800 MB
|
||||||
|
|
||||||
|
Chatter uses as sqlite database that can potentially take up a large amount os disk space,
|
||||||
|
depending on how much training Chatter has done.
|
||||||
|
|
||||||
|
The sqlite database can be safely deleted at any time. Deletion will only erase training data.
|
||||||
|
|
||||||
|
|
||||||
|
# Installation
|
||||||
|
The installation is currently very tricky, and only tested on a Windows Machine.
|
||||||
|
|
||||||
|
There are a number of reasons for this, but the main ones are as follows:
|
||||||
|
* Using a dev version of chatterbot
|
||||||
|
* Some chatterbot requirements conflict with Red's (as of 3.10)
|
||||||
|
* spaCy version is newer than chatterbot's requirements
|
||||||
|
* A symlink in spacy to map `en` to `en_core_web_sm` requires admin permissions on windows
|
||||||
|
* C++ Build tools are required on Windows for spaCy
|
||||||
|
* Pandoc is required for something on windows, but I can't remember what
|
||||||
|
|
||||||
|
## Windows Prerequisites
|
||||||
|
|
||||||
|
Install these on your windows machine before attempting the installation
|
||||||
|
|
||||||
|
[Visual Studio C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/)
|
||||||
|
|
||||||
|
[Pandoc - Universal Document Converter](https://pandoc.org/installing.html)
|
||||||
|
|
||||||
|
##Methods
|
||||||
|
### Windows - Manually
|
||||||
|
#### Step 1: Built-in Downloader
|
||||||
|
|
||||||
|
You need to get a copy of the requirements.txt provided with chatter, I recommend this method.
|
||||||
|
|
||||||
|
```
|
||||||
|
[p]repo add Fox https://github.com/bobloy/Fox-V3
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Step 2: Install Requirements
|
||||||
|
|
||||||
|
In a terminal running as an admin, navigate to the directory containing this repo.
|
||||||
|
|
||||||
|
I've used my install directory as an example.
|
||||||
|
|
||||||
|
```
|
||||||
|
cd C:\Users\Bobloy\AppData\Local\Red-DiscordBot\Red-DiscordBot\data\bobbot\cogs\RepoManager\repos\Fox\chatter
|
||||||
|
pip install -r requirements.txt
|
||||||
|
pip install --no-deps "chatterbot>=1.1"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Step 3: Load Chatter
|
||||||
|
|
||||||
|
```
|
||||||
|
[p]cog install Fox chatter
|
||||||
|
[p]load chatter
|
||||||
|
```
|
||||||
|
|
||||||
|
### Linux - Manually
|
||||||
|
|
||||||
|
Linux installation has not currently been evaluated, but Ubuntu testing is planned.
|
||||||
|
|
||||||
|
# Configuration
|
||||||
|
|
||||||
|
Chatter works out the the box without any training by learning as it goes,
|
||||||
|
but will have very poor and repetitive responses at first.
|
||||||
|
|
||||||
|
Initial training is recommended to speed up its learning.
|
||||||
|
|
||||||
|
## Training Setup
|
||||||
|
|
||||||
|
### Minutes
|
||||||
|
```
|
||||||
|
[p]chatter minutes X
|
||||||
|
```
|
||||||
|
This command configures what Chatter considers the maximum amount of minutes
|
||||||
|
that can pass between statements before considering it a new conversation.
|
||||||
|
|
||||||
|
Servers with lots of activity should set this low, where servers with low activity
|
||||||
|
will want this number to be fairly high.
|
||||||
|
|
||||||
|
This is only used during training.
|
||||||
|
|
||||||
|
### Age
|
||||||
|
|
||||||
|
```
|
||||||
|
[p]chatter age X
|
||||||
|
```
|
||||||
|
This command configures the maximum number of days Chatter will look back when
|
||||||
|
gathering messages for training.
|
||||||
|
|
||||||
|
Setting this to be extremely high is not recommended due to the increased disk space required to store
|
||||||
|
the data. Additionally, higher numbers will increase the training time tremendously.
|
||||||
|
|
||||||
|
|
||||||
|
## Training
|
||||||
|
|
||||||
|
### Train English
|
||||||
|
|
||||||
|
```
|
||||||
|
[p]chatter trainenglish
|
||||||
|
```
|
||||||
|
|
||||||
|
This will train chatter on basic english greetings and conversations.
|
||||||
|
This is far from complete, but can act as a good base point for new installations.
|
||||||
|
|
||||||
|
### Train Channel
|
||||||
|
|
||||||
|
```
|
||||||
|
[p]chatter train #channel_name
|
||||||
|
```
|
||||||
|
This command trains Chatter on the specified channel based on the configured
|
||||||
|
settings. This can take a long time to process.
|
||||||
|
|
||||||
|
|
||||||
|
## Switching Algorithms
|
||||||
|
|
||||||
|
```
|
||||||
|
[p]chatter algorithm X
|
||||||
|
```
|
||||||
|
|
||||||
|
Chatter can be configured to use one of three different Similarity algorithms.
|
||||||
|
|
||||||
|
Changing this can help if the response speed is too slow, but can reduce the accuracy of results.
|
Loading…
Reference in new issue