Code Monkey home page Code Monkey logo

econtext-sdk-python's Introduction

eContext API
------------

The eContext API provides easy, quick, and accurate taxonomic classification of
any text content.

Installation
^^^^^^^^^^^^

Install the eContext API library from source using the following command: 

 $ python setup.py install

An executable will be installed into your /usr/local/bin directory that may be
used directly from the command line:

 $ echo "Serena Williams Just Grand-Slammed Her Beyonce '7/11' Remake" | econtext-api -u USERNAME -p PASSWORD -t text
 $ curl -s http://www.popularmechanics.com/science/health/a14760/real-ebola-vaccine/ | econtext-api -u USERNAME -p PASSWORD -t html
 $ echo "http://www.popularmechanics.com/science/health/a14760/real-ebola-vaccine/" | econtext-api -u USERNAME -p PASSWORD -t url

You can also specify an input file containing the text or HTML you intend to
classify.

Using the Library
^^^^^^^^^^^^^^^^^

At the basic level, for each batch of classifiations you would like to run, you
pass in a `requests.session` object containing authorization and content-type
headers to the classification object, specify the data, and then run the batch.

    from econtextapi.client import Client
    from econtextapi.classify import Social

    posts = [
        "A master class in customer service from Lego. Boy writes to Lego after losing a mini-figure. Here's their reply...",
        "This makes me realize how little hope there is for the education system in America.",
        "Perrie just finished decorating the tree I didn't really help :( ha sorry x "
    ]

    client = Client(USERNAME, PASSWORD)
    classify = Social(client)
    classify.set_classify_data(posts)
    results = classify.get_results()




classify = Social(client)
classify.set_classify_data(10000_posts)
for result in classify.get_results():
  print(result)


#  result should contain all data pertinent to _that_ result
result

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.