Ak koyun ak bacağından, kara koyun kara bacağından asılır.
Fakat koyunotlatan
'ın mahareti, renkten öte, otlatma sanatındadır.
View Demo • Report Bug • Request Feature
Want to support oldventura, who brought us koyunkirpan
, you can buy him a coffee.
-
Clone or download this repository in your project directory
git clone https://github.com/KGBTR/koyunotlatan.git
git clone [email protected]:KGBTR/koyunotlatan.git
gh repo clone KGBTR/koyunotlatan
-
Install dependencies
Before install dependencies may want to setup virtual enviroment:
python -m venv .venv
# For Sh, Bash, Zsh
. .venv/bin/activate
# For Fish
. .venv/bin/activate.fish
pip install -r requirements.txt
-
Rename
praw.example.ini
topraw.ini
For MacOSX or Linux
mv praw.example.ini praw.ini
For Powershell
Rename-Item praw.example.ini praw.ini
For CMDrename praw.example.ini praw.ini
or
Define BOT_
prefixed enviroment variables defined in .env.example
For CMD
:
set BOT_USERNAME=BotUsername
For PowerShell
:
$Env:BOT_USERNAME = "BotUsername"
For Bash
and Zsh
:
export BOT_USERNAME=BotUsername
For Fish
:
set -Ux BOT_USERNAME BotUsername
python main.py
- Collects total of 100 posts from hot and new.
- Selects one random post
- Collects keywords from this post and top comments
- Searches for similar posts
- Collects top 5 comments from similar posts
- Compares keywords from these comments to find the best fit
- Comments the best fit on the selected post
python main.py -u <post_url>
python main.py --url <post_url>
or
python main.py -i <post_id>
python main.py --id <post_id>
- Finds the submission on reddit by the post id
- Finds the submission on reddit by the post url
- Submission by url takes precedence over the submission by id.
- Collects keywords from this post and top comments
- Searches for similar posts
- Collects top 5 comments from similar posts
- Compares keywords from these comments to find the best fit
- Comments the best fit on the selected post
At the beginning, I've tried several things for koyunkirpan
. But none of the solutions were good enough. They were inconsistent, silly and not suited to the subreddit's context. Then, while I was drinking a few beers, I came up with a stupid solution that just worked. I called it "the koyunkirpan
algorithm". Yes, koyunkirpan
does not have artifical intelligence, does not use machine learning models and isn't an oracle machine :)
Trying to analyze text context was amazingly hard because of the diversity of the Turkish language. But the semantic of the text was always related to its syntax! So, I wrote a simple algorithm that searched through reddit for keywords in the source text. Here I've used a special search combination for reddit where keywords in the source text were combined together in some kind of a disjunctive normal form (DNF). The highest results always include most of the keywords in some sense. After that, the algorithm collects comments similar to the source text and collects their replies. After ranking the results, it just picks a reply and return this as the response to the source text. Simple but highly suited for a community!
Here's an example of the idea. Imagine you're asking me a question and I don't know the answer but I'm trying to look like I know the answer. So, I go to a university and wander around searching for people that ask similar questions to my original question. I listen to professors' answers, collect them, and then decide on an answer by ranking them. After that I return and just give you the selected answer.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
koyunkirpan
is not a piece of software nor a product. It's a living piece of art that can be seen as the collective consciousness of users from r/KGBTR. Each day, koyunkirpan
continues to amaze more people as he imitates comments made by real people.
Distributed under the GPLv3 license. See LICENSE
for more information.