{"action":"opened","issue":{"url":"https://api.github.com/repos/deepmipt/ner/issues/11","repository_url":"https://api.github.com/repos/deepmipt/ner","labels_url":"https://api.github.com/repos/deepmipt/ner/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/deepmipt/ner/issues/11/comments","events_url":"https://api.github.com/repos/deepmipt/ner/issues/11/events","html_url":"https://github.com/deepmipt/ner/issues/11","id":309169394,"number":11,"title":"Error on sentences without \"normal\" tokens","user":{"login":"universome","id":3128824,"avatar_url":"https://avatars3.githubusercontent.com/u/3128824?v=4","gravatar_id":"","url":"https://api.github.com/users/universome","html_url":"https://github.com/universome","followers_url":"https://api.github.com/users/universome/followers","following_url":"https://api.github.com/users/universome/following{/other_user}","gists_url":"https://api.github.com/users/universome/gists{/gist_id}","starred_url":"https://api.github.com/users/universome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/universome/subscriptions","organizations_url":"https://api.github.com/users/universome/orgs","repos_url":"https://api.github.com/users/universome/repos","events_url":"https://api.github.com/users/universome/events{/privacy}","received_events_url":"https://api.github.com/users/universome/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-27T23:30:26Z","updated_at":"2018-03-27T23:30:26Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"When you pass an empty string or string without normal tokens (for example, ascii emoticons), exception is raised:\r\n```\r\n>>> import ner\r\n>>> extractor = ner.Extractor()\r\n>>> list(extractor(':)')) # works fine — empty list is returned\r\n>>> list(extractor('')) # fails\r\n>>> list(extractor('|*!*|')) # fails\r\n```\r\n\r\nLooks like these cases should return empty generator too. Trace:\r\n```\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"/home/universome/pyvenvs/zoo/lib/python3.6/site-packages/ner/extractor/extractor.py\", line 54, in __call__\r\n    tags = self.network.predict_for_token_batch([tokens_lemmas])[0]\r\n  File \"/home/universome/pyvenvs/zoo/lib/python3.6/site-packages/ner/network.py\", line 379, in predict_for_token_batch\r\n    batch_x, _ = self.corpus.tokens_batch_to_numpy_batch(tokens_batch)\r\n  File \"/home/universome/pyvenvs/zoo/lib/python3.6/site-packages/ner/corpus.py\", line 205, in tokens_batch_to_numpy_batch\r\n    max_token_len = max([len(token) for utt in batch_x for token in utt])\r\nValueError: max() arg is an empty sequence\r\n```"}}
{"actor":{"display_login":"universome"}}