Spaces:
Sleeping
Sleeping
Luke Stanley
commited on
Commit
·
428143c
1
Parent(s):
ec7a11c
Adds README
Browse files
README.md
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# ChillTranslator ⁉️🌐❄️
|
2 |
+
|
3 |
+
This is an early experimental tool aimed at reducing online toxicity by automatically 🔄 transforming 🌶️ spicy or toxic comments into constructive, kinder dialogues using AI and large language models. ❄️
|
4 |
+
|
5 |
+
ChillTranslator aims to foster healthier online interactions. The potential uses of this translator are vast, and exploring its integration could prove invaluable.
|
6 |
+
|
7 |
+
Currently, it "translates" a built-in example of a spicy comment.
|
8 |
+
|
9 |
+
Online toxicity can undermine the quality of discourse, causing distress 😞 and driving people away from online communities. Or worse: it can create a viral toxic loop 🌀!
|
10 |
+
|
11 |
+
ChillTranslator hopes to mitigate toxic comments by automatically rephrasing negative comments, while maintaining the original intent and promoting positive communication 🗣️➡️💬. These rephrased texts could be suggested to the original authors as alternatives, or users could enhance their internet experience with "rose-tinted glasses" 🌹😎, automatically translating spicy comments into versions that are easier and more calming to read.
|
12 |
+
|
13 |
+
Could Reddit, Twitter, Hacker News, or even YouTube comments be more calm and constructive places? I think so!
|
14 |
+
|
15 |
+
## Approach ✨
|
16 |
+
|
17 |
+
- **Converts** text to less toxic variations
|
18 |
+
- **Preserves original intent**, focusing on constructive dialogue
|
19 |
+
- **Offline LLM model**, running DIY could save costs, avoid needing to signup to APIs, and avoid the risk of toxic content causing API access to be revoked. We use llama-cpp-python's server with Mixtral.
|
20 |
+
|
21 |
+
|
22 |
+
## Possible future directions 🌟
|
23 |
+
- **Integration**: offer a Python module and HTTP API, for use from other tools, browser extensions.
|
24 |
+
- **HuggingFace / Replicate.com etc**: Running this on a fast system, perhaps on a HuggingFace Space could be good.
|
25 |
+
- **Speed** improvments.
|
26 |
+
- Split text into sentences e.g: with pysbd for parallel processing of translations.
|
27 |
+
- Use a hate speech scoring model instead of the current "spicy" score method.
|
28 |
+
- Use a dataset of hate speech to make a dataset for traning a translation transformer like Google's T5 to run faster than Mixtral could.
|
29 |
+
- Use natural language similarity techniques to compare possible rephrasing fidelity faster.
|
30 |
+
- Enabling easy experimenting with online hosted LLM APIs
|
31 |
+
- Code refacoring to improve development speed!
|
32 |
+
|
33 |
+
## Getting Started 🚀
|
34 |
+
|
35 |
+
### Installation
|
36 |
+
|
37 |
+
1. Download a compatible and capable model like: [Mixtral-8x7B-Instruct-v0.1-GGUF](https://huggingface.co/TheBloke/Mixtral-8x7B-Instruct-v0.1-GGUF/resolve/main/mixtral-8x7b-instruct-v0.1.Q4_K_M.gguf?download=true)
|
38 |
+
2. Make sure it's named as expected by the next command.
|
39 |
+
3. Install dependencies:
|
40 |
+
```
|
41 |
+
pip install requests pydantic llama-cpp-python llama-cpp-python[server] --upgrade
|
42 |
+
```
|
43 |
+
4. Start the LLM server:
|
44 |
+
```
|
45 |
+
python3 -m llama_cpp.server --model mixtral-8x7b-instruct-v0.1.Q4_K_M.gguf --port 5834 --n_ctx 4096 --use_mlock false
|
46 |
+
```
|
47 |
+
These config options are not going to be optimal for a lot of setups, as it may not use GPU right away, but this can be configured with a different argument. Please check out https://llama-cpp-python.readthedocs.io/en/latest/ for more info.
|
48 |
+
|
49 |
+
### Usage
|
50 |
+
|
51 |
+
ChillTranslator currently has an example spicy comment it works on fixing right away.
|
52 |
+
This is how to see it in action:
|
53 |
+
```python
|
54 |
+
python3 chill.py
|
55 |
+
```
|
56 |
+
|
57 |
+
## Contributing 🤝
|
58 |
+
|
59 |
+
Contributions are welcome!
|
60 |
+
Especially:
|
61 |
+
- pull requests,
|
62 |
+
- free GPU credits
|
63 |
+
- LLM API credits / access.
|
64 |
+
|
65 |
+
ChillTranslator is released under the MIT License.
|
66 |
+
|
67 |
+
Help make the internet a kinder place, one comment at a time.
|
68 |
+
Your contribution could make a big difference!
|