<commit_before># YahooContentAnalysis

[![License](https://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT)
[![Build Status](https://travis-ci.org/PRX/yahoo_content_analysis.svg?branch=master)](https://travis-ci.org/PRX/yahoo_content_analysis)
[![Code Climate](https://codeclimate.com/github/PRX/yahoo_content_analysis/badges/gpa.svg)](https://codeclimate.com/github/PRX/yahoo_content_analysis)
[![Coverage Status](https://coveralls.io/repos/PRX/yahoo_content_analysis/badge.svg?branch=master)](https://coveralls.io/r/PRX/yahoo_content_analysis?branch=master)
[![Dependency Status](https://gemnasium.com/PRX/yahoo_content_analysis.svg)](https://gemnasium.com/PRX/yahoo_content_analysis)

Use the Yahoo! Content Analysis API to extract topics and entities.

OAuth access is implemented, though not necessary (the docs imply higher limits if requests are signed).  This should be a useful example for those wanting to do 2-legged OAuth access to Yahoo APIs using Faraday and the OAuth Faraday Middleware.

N.B. - I am not seeing the additional metadata nor related entities returned as the Yahoo docs claim they should.

## Installation

Add this line to your application's Gemfile:

    gem 'yahoo_content_analysis'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install yahoo_content_analysis

## Usage
```ruby<commit_msg>formatting<commit_after># YahooContentAnalysis

[![License](https://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT)
[![Build Status](https://travis-ci.org/PRX/yahoo_content_analysis.svg?branch=master)](https://travis-ci.org/PRX/yahoo_content_analysis)
[![Code Climate](https://codeclimate.com/github/PRX/yahoo_content_analysis/badges/gpa.svg)](https://codeclimate.com/github/PRX/yahoo_content_analysis)
[![Coverage Status](https://coveralls.io/repos/PRX/yahoo_content_analysis/badge.svg?branch=master)](https://coveralls.io/r/PRX/yahoo_content_analysis?branch=master)
[![Dependency Status](https://gemnasium.com/PRX/yahoo_content_analysis.svg)](https://gemnasium.com/PRX/yahoo_content_analysis)

Use the Yahoo! Content Analysis API to extract topics and entities.

OAuth access is implemented, though not necessary (the docs imply higher limits if requests are signed).  This should be a useful example for those wanting to do 2-legged OAuth access to Yahoo APIs using Faraday and the OAuth Faraday Middleware.

(I am not seeing the additional metadata nor related entities returned as the Yahoo docs claim they should, so YMMV.)

## Installation

Add this line to your application's Gemfile:
```ruby
    gem 'yahoo_content_analysis'
```

And then execute:
```
    $ bundle
```

Or install it yourself as:
```
    $ gem install yahoo_content_analysis
```

## Usage
```ruby
{'fraction_non_alphanumeric': 0.1207764198418404, 'fraction_numerical': 0.0007189072609633358, 'mean_word_length': 5.64200477326969, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 18, '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': '1386783', 'n_tokens_mistral': 904, 'n_tokens_neox': 835, 'n_words': 211}