Skip to content

datumbox/Datumbox-Python-Wrapper

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Datumbox-Python-Wrapper

The Datumbox API provides a number of Remote Procedure Calls for Text Analysis and Natural Language Processing. This repo provides an easy way to use the API when writting Python.

You'll need an API key which you can get from the Datumbox Site

##Examples##

###Twitter Sentiment Analysis

>>> from DatumBox import DatumBox
>>> datum_box = DatumBox(API_KEY)
>>> datum_box.twitter_sentiment_analysis("I love my cat")
u'positive'

Text given to the classification methods should not contain HTML tags, the text_extract method provides an easy way to remove HTML tags (But involves a remote procedure call which may be undesirable)

##Exceptions that can be raised## The wrapper will throw DatumBoxError if the API returns an error. Page 11 of the API Documentation shows you possible Error Codes / Messages

The wrapper uses urllib2 to make the remote procedure calls so you can handle any exceptions this can raise if you wish.

##Failing Tests## Many of the classification tasks the Datumbox attempts to solve are AI-Complete this means that the results returned by the API are heuristic. Specifically the Readabilty Assesment and Commercial Detection tests I wrote fail as the API returns the wrong result, this should not be taken as a weakness of the API but rather the state of NLP in general.

About

A python wrapper for Datumbox

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%