A Python Wrapper for indico. Use pre-built state of the art machine learning algorithms with a single line of code.
Project description
A wrapper for a series of APIs made by indico.
Check out the main site on:
Check out our documentation on:
http://indicoiopython.s3-website-us-west-2.amazonaws.com/indicoio.html
Our APIs are totally free to use, and ready to be used in your application. No data or training required.
Documentation
Found here
Current APIs
Right now this wrapper supports the following apps:
Positive/Negative Sentiment Analysis
Political Sentiment Analysis
Image Feature Extraction
Facial Emotion Recognition
Facial Feature Extraction
Language Detection
Text Topic Tagging
Examples
>>> import numpy as np >>> from indicoio import political, sentiment, fer, facial_features, language >>> political("Guns don't kill people. People kill people.") {u'Libertarian': 0.47740164630834825, u'Green': 0.08454409540443657, u'Liberal': 0.16617097211030055, u'Conservative': 0.2718832861769146} >>> sentiment('Worst movie ever.') {u'Sentiment': 0.07062467665597527} >>> sentiment('Really enjoyed the movie.') {u'Sentiment': 0.8105182526856075} >>> test_text = "Facebook blog posts about Android tech make better journalism than most news outlets." >>> tag_dict = text_tags(test_text) >>> sorted(tag_dict.keys(), key=lambda x: tag_dict[x], reverse=True)[:3] [u'startups_and_entrepreneurship', u'investment', u'business'] >>> text_tags(test_text, threshold=0.1) # return only keys with value > 0.1 {u'startups_and_entrepreneurship': 0.21888586688354486} >>> text_tags(test_text, top_n=1) # return only keys with top_n values {u'startups_and_entrepreneurship': 0.21888586688354486} >>> test_face = np.linspace(0,50,48*48).reshape(48,48).tolist() >>> fer(test_face) {u'Angry': 0.08843749137458341, u'Sad': 0.39091163159204684, u'Neutral': 0.1947947999669361, u'Surprise': 0.03443785859010413, u'Fear': 0.17574534848440568, u'Happy': 0.11567286999192382} >>> facial_features(test_face) [0.0, -0.02568680526917187, 0.21645604230056517, ...] >>> language_dict = language('Quis custodiet ipsos custodes') >>> sorted(language_dict.keys(), key=lambda x: language_dict[x], reverse=True)[:5] [u'Latin', u'Dutch', u'Greek', u'Portuguese', u'Spanish'] >>> language_dict {u'Swedish': 0.00033330636691921914, u'Lithuanian': 0.007328693814717631, u'Vietnamese': 0.0002686116137658802, u'Romanian': 8.133913804076592e-06, ...}
If you have a local indico server running, simply import from indicoio.local.
>>> from indicoio.local import political, sentiment, fer, facial_features, language
If you’d like to use our batch api interface, please send an email to contact@indico.io.
>>> from indicio import batch_sentiment batch_sentiment(['Text to analyze', 'More text'], auth=("example@example.com", "********"))
Installation
pip install indicoio
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.