aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlendi <slendi@socopon.com>2023-11-05 01:06:25 +0200
committerSlendi <slendi@socopon.com>2023-11-05 01:06:25 +0200
commit2babf45aa6c47032ff5be8f2adfd4e45d4ecf9f9 (patch)
treed891ca138d387dac27b2fb9799fbbe3f62f253c2
parentb7a20686e985a5375a25cff8e77226c524c3068e (diff)
Add license information and readme.
Signed-off-by: Slendi <slendi@socopon.com>
-rw-r--r--LICENSE.md16
-rw-r--r--README.md45
-rwxr-xr-xcreate_dataset.sh2
-rwxr-xr-xtrain.py2
4 files changed, 61 insertions, 4 deletions
diff --git a/LICENSE.md b/LICENSE.md
new file mode 100644
index 0000000..5cfa932
--- /dev/null
+++ b/LICENSE.md
@@ -0,0 +1,16 @@
+UwU Classifier - Detect annoying messages.
+Copyright (C) 2023 Slendi
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..50c4d0a
--- /dev/null
+++ b/README.md
@@ -0,0 +1,45 @@
+UwU Classifier
+==============
+
+Are you annoyed at Discord people "uwuifying" their messages? Well this model
+is just for you! You can put it in any bot or any other application that
+requires it to eliminate this annoyance.
+
+Creating the dataset
+--------------------
+
+You require a couple of things for this:
+
+ - Python's request module
+ - An internet connection
+ - The `uwuify` tool (the one written in Rust, you'll find it)
+
+The dataset is a modified Topical-Chat one, to get it and then patch it up you
+just need to do:
+
+```
+$ ./create_dataset.sh
+```
+
+Now you can move on to training.
+
+Training the model
+------------------
+
+As long as you have installed Tensorflow you should be fine. If you get any
+error messages just Google. Just run this command and be patient:
+
+```
+./train.py
+```
+
+You should then find a "final_model" in the project's root directory.
+
+Using the model
+---------------
+
+There's an included `interactive.py` file which shows how you can load the model
+and use it to get a result out of it. It is an infinite loop that keeps reading
+lines, if they are "uwuified", then it will be closer to 1, and if not it will
+be closer to 0.
+
diff --git a/create_dataset.sh b/create_dataset.sh
index 6922c45..c9aec21 100755
--- a/create_dataset.sh
+++ b/create_dataset.sh
@@ -9,8 +9,6 @@ rm -f messages.txt messages_to_be_uwuified.txt
rm -rf dataset
mkdir -p dataset/{normal,uwu}
-#mv messages_good.txt dataset/normal/normal_text_1.txt
-#mv messages_uwuified.txt dataset/uwu/uwu_text_1.txt
set +x
python3 split_file.py messages_good.txt dataset/normal $(nproc)
diff --git a/train.py b/train.py
index e894da8..8ccb76d 100755
--- a/train.py
+++ b/train.py
@@ -141,5 +141,3 @@ print(accuracy)
print('Saving model')
export_model.save('final_model', save_format='tf')
-while True:
- export_model.predict([input('> ')])