<commit_before>OpenPorn Image Tagger
=====================

**An open source application to let people more easily tag arbitrary images on
Imgur with different metadata**

OpenPorn is trying to classify as many different adult images as possible with
different categories, but having one person do all the work (no matter how 
much fun it might **seem**) is a really hard task.

We're open-sourcing our first project, which is a simple application that lets
you crowdsource image classification.

More importantly, it lets your users help contribute to a productive
scientific task while they fap/schlick/[insert preferred onomatopoeia].

How it Works
------------

The application will generate 12 random Imgur images from a developed-defined 
data source.  In OpenPorn's case, we'll be scraping these images from a set of 
NSFW subreddits.

The user will also get a random tag, and is asked to click on any of the 12
images that correctly describe that tag.

For instance, a user will visit the site and will be given the tag 'anal'. They
then need to click on whichever of the 12 images that contain what they
consider to best represent 'anal', and then hit submit.

After that's done, they'll receive another set of 12 images and a new tag.

In the future, we might add a better gamification system to the system, but
that's a stretch goal at the moment.

Software Architecture
---------------------

This is something that we want to build fast, so it'll be slightly less
well-defined than the main OpenPorn application that we'll be building.

#### Application Foundation

The main application foundation is a Node.js/Express middleware server. 
This provides a RESTful API that will be consumed by our frontend Backbone 
application.

The middleware server is responsible for parsing the data in our datasource
(Reddit, for example) and putting it into a JSON format that the frontend
can more effectively use.

#### Database Design

Because tags are more free-form (a single image can have multiple tags), and
our tagging system follows a more document-oriented architecture, we'll be
using MongoDB as our database of choice.

There are two main collections in our system:

- Tags
- Images

Tags contain the name of the tag, a longer description of the tag, and a
parent category that it belongs to. An example is the following:

```json
{
    name        : 'missionary',
    description : 'Penetrating partner is on top of receiving partner',
    category    : 'positions'
}
```

An image (to save disk space) contains the Imgur ID, and a list of tags that
it contains:

```json
{
    id: 'o4FVCmq',
    tags: [
        'breasts',
        'brunnette',
        'female',
        ...
    ]
}
```

Because we're using Mongo, it's easier for tags to be cross-referenced with
the specific images later on, and we won't need to do any SQL JOINs.

#### Frontend

WIP<commit_msg>Fix JSON mistakes in README<commit_after>OpenPorn Image Tagger
=====================

**An open source application to let people more easily tag arbitrary images on
Imgur with different metadata**

OpenPorn is trying to classify as many different adult images as possible with
different categories, but having one person do all the work (no matter how 
much fun it might **seem**) is a really hard task.

We're open-sourcing our first project, which is a simple application that lets
you crowdsource image classification.

More importantly, it lets your users help contribute to a productive
scientific task while they fap/schlick/[insert preferred onomatopoeia].

How it Works
------------

The application will generate 12 random Imgur images from a developed-defined 
data source.  In OpenPorn's case, we'll be scraping these images from a set of 
NSFW subreddits.

The user will also get a random tag, and is asked to click on any of the 12
images that correctly describe that tag.

For instance, a user will visit the site and will be given the tag 'anal'. They
then need to click on whichever of the 12 images that contain what they
consider to best represent 'anal', and then hit submit.

After that's done, they'll receive another set of 12 images and a new tag.

In the future, we might add a better gamification system to the system, but
that's a stretch goal at the moment.

Software Architecture
---------------------

This is something that we want to build fast, so it'll be slightly less
well-defined than the main OpenPorn application that we'll be building.

#### Application Foundation

The main application foundation is a Node.js/Express middleware server. 
This provides a RESTful API that will be consumed by our frontend Backbone 
application.

The middleware server is responsible for parsing the data in our datasource
(Reddit, for example) and putting it into a JSON format that the frontend
can more effectively use.

#### Database Design

Because tags are more free-form (a single image can have multiple tags), and
our tagging system follows a more document-oriented architecture, we'll be
using MongoDB as our database of choice.

There are two main collections in our system:

- Tags
- Images

Tags contain the name of the tag, a longer description of the tag, and a
parent category that it belongs to. An example is the following:

```json
{
    "name"        : "missionary",
    "description" : "Penetrating partner is on top of receiving partner",
    "category"    : "positions"
}
```

An image (to save disk space) contains the Imgur ID, and a list of tags that
it contains:

```json
{
    "id"   : "o4FVCmq",
    "tags" : [
        "breasts",
        "brunette",
        "female",
        ...
    ]
}
```

Because we're using Mongo, it's easier for tags to be cross-referenced with
the specific images later on, and we won't need to do any SQL JOINs.

#### Frontend

WIP
{'fraction_non_alphanumeric': 0.07084845343010195, 'fraction_numerical': 0.003110419906687403, 'mean_word_length': 3.671509281678773, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6375702', 'n_tokens_mistral': 1566, 'n_tokens_neox': 1467, 'n_words': 869}