{"action":"created","issue":{"url":"https://api.github.com/repos/monkeylearn/monkeylearn-python/issues/9","repository_url":"https://api.github.com/repos/monkeylearn/monkeylearn-python","labels_url":"https://api.github.com/repos/monkeylearn/monkeylearn-python/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/monkeylearn/monkeylearn-python/issues/9/comments","events_url":"https://api.github.com/repos/monkeylearn/monkeylearn-python/issues/9/events","html_url":"https://github.com/monkeylearn/monkeylearn-python/issues/9","id":158488147,"number":9,"title":"Calls to classify end point seem to use 1 API call per string not per list of strings","user":{"login":"AWegnerGitHub","id":6462439,"avatar_url":"https://avatars.githubusercontent.com/u/6462439?v=3","gravatar_id":"","url":"https://api.github.com/users/AWegnerGitHub","html_url":"https://github.com/AWegnerGitHub","followers_url":"https://api.github.com/users/AWegnerGitHub/followers","following_url":"https://api.github.com/users/AWegnerGitHub/following{/other_user}","gists_url":"https://api.github.com/users/AWegnerGitHub/gists{/gist_id}","starred_url":"https://api.github.com/users/AWegnerGitHub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AWegnerGitHub/subscriptions","organizations_url":"https://api.github.com/users/AWegnerGitHub/orgs","repos_url":"https://api.github.com/users/AWegnerGitHub/repos","events_url":"https://api.github.com/users/AWegnerGitHub/events{/privacy}","received_events_url":"https://api.github.com/users/AWegnerGitHub/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-04T05:16:20Z","updated_at":"2016-06-06T15:15:50Z","closed_at":"2016-06-06T15:15:49Z","body":"If I understand the \"classify\" API documentation correctly, I should be able to pass multiple text strings in a single call and only use 1 API call, correct? I'm basing this on\r\n\r\n\r\n> This endpoint allows you to perform the classification of many text samples using only one request to a custom or public module.\r\n\r\nAssuming my understanding is accurate, I am seeing different behavior. Instead of a single API call for a list of text strings, I see one API call per text string.\r\n\r\nThis is my sample code\r\n\r\n```\r\nfrom monkeylearn import MonkeyLearn\r\nimport user_settings\r\n\r\nMONKEYLEARN_API_KEY = user_settings.KEY\r\nMODULE_ID = user_settings.MODULE_ID\r\n\r\nml = MonkeyLearn(MONKEYLEARN_API_KEY)\r\nres = ml.classifiers.detail(MODULE_ID)\r\nsamples = ['this is a string',\r\n           'a dog barks on tuesday',\r\n           'i like purple muffins',\r\n           'apples are funny fruit',\r\n           'the house is up a mountain',\r\n           'cats do not like trees',\r\n           'computers will take over',\r\n           'you sank my battleship',\r\n           'duck, duck, goose',\r\n           'yellow baby buggy bumpers']\r\n\r\nres = ml.classifiers.classify(MODULE_ID, samples, sandbox=True, debug=False)\r\nprint(\"Quota Remaining\")\r\nprint(\"-\"*20)\r\npprint.pprint(res.query_limit_remaining, indent=4)\r\n```\r\n\r\nTwo runs, back to back, of this print the following:\r\n\r\n> RUN 1:\r\n> Quota Remaining\r\n> \\--------------------\r\n> '99940'\r\n\r\n---\r\n> RUN 2:\r\n> Quota Remaining\r\n> \\--------------------\r\n> '99930'\r\n\r\nNotice that the remaining quota is 10 apart between runs. This is the same number of sample text strings. If I comment out 5 of them and run it again, I get this output:\r\n\r\n> Quota Remaining\r\n> \\--------------------\r\n> '99915'\r\n\r\nTo me, this is confirming that I am using 1 API call to the classify endpoint per string, not per group of strings. \r\n\r\nIs this the expected behavior, or should my list of 10 strings only be costing 1 API call?"},"comment":{"url":"https://api.github.com/repos/monkeylearn/monkeylearn-python/issues/comments/223990232","html_url":"https://github.com/monkeylearn/monkeylearn-python/issues/9#issuecomment-223990232","issue_url":"https://api.github.com/repos/monkeylearn/monkeylearn-python/issues/9","id":223990232,"user":{"login":"AWegnerGitHub","id":6462439,"avatar_url":"https://avatars.githubusercontent.com/u/6462439?v=3","gravatar_id":"","url":"https://api.github.com/users/AWegnerGitHub","html_url":"https://github.com/AWegnerGitHub","followers_url":"https://api.github.com/users/AWegnerGitHub/followers","following_url":"https://api.github.com/users/AWegnerGitHub/following{/other_user}","gists_url":"https://api.github.com/users/AWegnerGitHub/gists{/gist_id}","starred_url":"https://api.github.com/users/AWegnerGitHub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AWegnerGitHub/subscriptions","organizations_url":"https://api.github.com/users/AWegnerGitHub/orgs","repos_url":"https://api.github.com/users/AWegnerGitHub/repos","events_url":"https://api.github.com/users/AWegnerGitHub/events{/privacy}","received_events_url":"https://api.github.com/users/AWegnerGitHub/received_events","type":"User","site_admin":false},"created_at":"2016-06-06T15:15:49Z","updated_at":"2016-06-06T15:15:49Z","body":"Thank you for the clarification. "}}
{"actor":{"display_login":"AWegnerGitHub"}}