TOC, list of dirs and files created, minor stuff

This commit is contained in:
array-in-a-matrix 2022-08-17 16:24:32 -04:00
parent 30518a0d74
commit 943f351afe
1 changed files with 24 additions and 6 deletions

View File

@ -2,9 +2,16 @@
Matrix bot that generates messages based off of messages of other users using a neural network.
## Usage
## Table of content
First install the needed [libraries](#setup). Then copy `example.config.json` and rename it `config.json`. Replace the items in angled brackets with their respective values of the bot account (e.g. replace `<DOMAIN.TLD>` with the homeserver url like `https://matrix.org` or `https://matrix.arrayinamatrix.xyz`). An explanation of each configurable string is located in [configurations](#configurations) section of this document. To obtain the token of an account follow the instructions [here](https://matrix.org/docs/guides/usage-of-matrix-bot-sdk#instantiation).
- [Useage](#usage)
- [Setup](#setup)
- [Configurations](#configurations)
- [Using existing messages](#using-existing-messages)
### Usage
First install the needed using the instructions [here](#setup). Then copy `example.config.json` and rename it `config.json`. Replace the items in angled brackets with their respective values of the bot account (e.g. replace `<DOMAIN.TLD>` with the homeserver url like `https://matrix.org` or `https://matrix.arrayinamatrix.xyz`). An explanation of each configurable string is located in [configurations](#configurations) section of this document. To obtain the token of an account follow the instructions [here](https://matrix.org/docs/guides/usage-of-matrix-bot-sdk#instantiation).
Once the config file has been populated with valid data, execute the `index.js` file (Warning: executing for the first time will be slow.).
@ -17,9 +24,16 @@ Client has started!
...
```
If you do not want to wait until the bot creates its own dataset from new messages, you can export chat history easily using [Element](https://element.io/blog/element-1-9-1-export-is-finally-here/). In this case, you will need to manually remove the time stamps from the text file.
List of directories and files created by the project and its dependencies:
## Setup
- `aitextgen/`
- `node_modules/`
- `trained_model/`
- `aitextgen.tokenizer.json`
- `storage.json`
- `training-matrix.txt`
### Setup
The project is split into 2 parts `index.js` and `textgen.py`. The `index.js` file contains the code that interacts with the user on Matrix and sends text generated by the `textgen.py` file.
@ -35,11 +49,11 @@ Install Python module:
> pip3 install aitextgen
```
## Configurations
### Configurations
Before a bot can be used the fields in the `config.json` file must be populated with valid information. Values in angled brackets (stared below) must be supplied before usage.
```json
```text
► homeserver* ⇢ URL of the bot's homeserver.
► token* ⇢ Account token used to sign in the bot.
@ -56,3 +70,7 @@ Before a bot can be used the fields in the `config.json` file must be populated
► retrain ⇢ The bot retrains itself after this many extra lines of messages are recorded in the text file.
```
### Using existing messages
If you do not want to wait until the bot creates its own dataset from new messages, you can export chat history of a room easily using [Element](https://element.io/blog/element-1-9-1-export-is-finally-here/). In this case, you will need to manually remove the time stamps from the text file then place the path of the file in the `file` variable in the configuration file.