Documentation for optional arguments

This commit is contained in:
Madison May
2014-12-18 16:18:53 -05:00
parent 6c23d0d7ee
commit 8e5d7977b8
2 changed files with 29 additions and 8 deletions
+19 -3
View File
@@ -42,10 +42,18 @@ Examples
>>> sentiment('Really enjoyed the movie.')
{u'Sentiment': 0.8105182526856075}
>>> tag_dict = text_tags("Facebook blog posts about Android tech make better journalism than most news outlets.")
>>> test_text = "Facebook blog posts about Android tech make better journalism than most news outlets."
>>> sorted(tag_dict.keys(), key=lambda x: tag_dict[x], reverse=True)[:5]
[u'investing', u'startups', u'business', u'entrepreneur', u'humor']
>>> 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}
>>> tag_dict
{u'fashion': 0.011450126534350728, u'art': 0.00358698972755963, u'energy': 0.005537894035625527, ...}
@@ -74,6 +82,14 @@ 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
------------
```
+10 -5
View File
@@ -46,13 +46,18 @@ Examples
>>> sentiment('Really enjoyed the movie.')
{u'Sentiment': 0.8105182526856075}
>>> tag_dict = text_tags("Facebook blog posts about Android tech make better journalism than most news outlets.")
>>> test_text = "Facebook blog posts about Android tech make better journalism than most news outlets."
>>> sorted(tag_dict.keys(), key=lambda x: tag_dict[x], reverse=True)[:5]
[u'investing', u'startups', u'business', u'entrepreneur', u'humor']
>>> tag_dict = text_tags(test_text)
>>> tag_dict
{u'fashion': 0.011450126534350728, u'art': 0.00358698972755963, u'energy': 0.005537894035625527, ...}
>>> 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()