<commit_before># Wagtail Alt Generator

Autogenerate image descriptions with the help of computer vision (inspired by [altify](https://github.com/ParhamP/altify/blob/master/altify/altify)).


## Requirements

- Python 2.7 / Python 3.4 / PyPy
- Django 1.8+
- Wagtail 1.7+
- An Microsoft Cognitive Service account
- Images must be accessible by third part (to enable Computer Vision processing)


## Installation

Install the library with pip:

```
$ pip install wagtailaltgenerator (Not yet working)
```


## Quick Setup

1. Register an account on [Microsoft Cognitive Service](https://www.microsoft.com/cognitive-services/)
2. Retrive api key for the product `Computer Vision - Preview`
3. Add the key to your django settings:
    ```
    COMPUTER_VISION_API_KEY = 'yourkey'
    ```
4. Make sure `wagtailaltgenerator` is added to your `INSTALLED_APPS`.
    ```python
    INSTALLED_APPS = (
        # ...
        'wagtailaltgenerator',
    )
    ```


## Usage

1. Upload an image through Wagtail
2. Watch the title get generated...
3. ...And done!


## Settings

- `COMPUTER_VISION_API_KEY`: Api key to the Azure Computer Vision product.


## Tests

This library include tests, just run `python runtests.py`

Make sure to install dev requirements: `pip install -r requirements/dev.txt`

Before running any type of tests, make sure the env variable `COMPUTER_VISION_API_KEY` is exported.

You can also run separate test cases: `runtests.py tests.GenerateLabelTest`


## Contributing

Want to contribute? Awesome. Just send a pull request.


## License

Wagtail-alt-generator is released under the [MIT License](http://www.opensource.org/licenses/MIT).<commit_msg>Clarified api key setting<commit_after># Wagtail Alt Generator

Autogenerate image descriptions with the help of computer vision (inspired by [altify](https://github.com/ParhamP/altify/blob/master/altify/altify)).


## Requirements

- Python 2.7 / Python 3.4 / PyPy
- Django 1.8+
- Wagtail 1.7+
- An Microsoft Cognitive Service account
- Images must be accessible by third part (to enable Computer Vision processing)


## Installation

Install the library with pip:

```
$ pip install wagtailaltgenerator (Not yet working)
```


## Quick Setup

1. Register an account on [Microsoft Cognitive Service](https://www.microsoft.com/cognitive-services/)
2. Retrive api key for the product `Computer Vision - Preview`
3. Add the key to your django settings:
    ```
    COMPUTER_VISION_API_KEY = 'yourkey'
    ```
4. Make sure `wagtailaltgenerator` is added to your `INSTALLED_APPS`.
    ```python
    INSTALLED_APPS = (
        # ...
        'wagtailaltgenerator',
    )
    ```


## Usage

1. Upload an image through Wagtail
2. Watch the title get generated...
3. ...And done!


## Settings

- `COMPUTER_VISION_API_KEY`: Computer Vision api key


## Tests

This library include tests, just run `python runtests.py`

Make sure to install dev requirements: `pip install -r requirements/dev.txt`

Before running any type of tests, make sure the env variable `COMPUTER_VISION_API_KEY` is exported.

You can also run separate test cases: `runtests.py tests.GenerateLabelTest`


## Contributing

Want to contribute? Awesome. Just send a pull request.


## License

Wagtail-alt-generator is released under the [MIT License](http://www.opensource.org/licenses/MIT).
{'fraction_non_alphanumeric': 0.09806879903439952, 'fraction_numerical': 0.009052504526252263, 'mean_word_length': 3.742489270386266, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, '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': '1100957', 'n_tokens_mistral': 1049, 'n_tokens_neox': 983, 'n_words': 364}