{"action":"created","issue":{"url":"https://api.github.com/repos/kevincobain2000/jProcessing/issues/7","repository_url":"https://api.github.com/repos/kevincobain2000/jProcessing","labels_url":"https://api.github.com/repos/kevincobain2000/jProcessing/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/kevincobain2000/jProcessing/issues/7/comments","events_url":"https://api.github.com/repos/kevincobain2000/jProcessing/issues/7/events","html_url":"https://github.com/kevincobain2000/jProcessing/issues/7","id":159893188,"number":7,"title":"Cannot run sentiment analysis example (classifier)","user":{"login":"renoust","id":1753109,"avatar_url":"https://avatars.githubusercontent.com/u/1753109?v=3","gravatar_id":"","url":"https://api.github.com/users/renoust","html_url":"https://github.com/renoust","followers_url":"https://api.github.com/users/renoust/followers","following_url":"https://api.github.com/users/renoust/following{/other_user}","gists_url":"https://api.github.com/users/renoust/gists{/gist_id}","starred_url":"https://api.github.com/users/renoust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renoust/subscriptions","organizations_url":"https://api.github.com/users/renoust/orgs","repos_url":"https://api.github.com/users/renoust/repos","events_url":"https://api.github.com/users/renoust/events{/privacy}","received_events_url":"https://api.github.com/users/renoust/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-13T08:03:32Z","updated_at":"2016-06-13T09:38:31Z","closed_at":null,"body":"Hi everyone,\r\n\r\nI am trying to run your sentiment analysis demo and I am facing a cElementTree.ParseError.\r\nI am running on OSX 10.11 with Python 2.7. \r\nI downloaded the wordnet files (as of today: SentiWordNet_3.0.0_20130122.txt, with the current wn: 2010-10-22).\r\nI ran your example as you presented:\r\n```\r\n>>> from jNlp.jSentiments import *\r\n>>> jp_wn = 'path_to/wnjpn-all.tab'\r\n>>> en_swn = 'path_to/SentiWordNet_3.0.0_20130122.txt'\r\n>>> classifier = Sentiment()\r\n>>> classifier.train(en_swn, jp_wn)\r\n>>> text = u'監督、俳優、ストーリー、演出、全部最高！'\r\n>>> print classifier.baseline(text)\r\n```\r\n\r\nand obtain the following error:\r\n```\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"build/bdist.macosx-10.11-intel/egg/jNlp/jSentiments.py\", line 55, in baseline\r\n  File \"build/bdist.macosx-10.11-intel/egg/jNlp/jSentiments.py\", line 48, in polarScores_text\r\n  File \"build/bdist.macosx-10.11-intel/egg/jNlp/jTokenize.py\", line 30, in jTokenize\r\n  File \"<string>\", line 124, in XML\r\ncElementTree.ParseError: not well-formed (invalid token): line 1, column 2\r\n```\r\n\r\nHowever, the polarity score example works fine, and I obtain the right scores!\r\nIf you have any idea, I'd be grateful for your help!\r\n\r\nBest,"},"comment":{"url":"https://api.github.com/repos/kevincobain2000/jProcessing/issues/comments/225533927","html_url":"https://github.com/kevincobain2000/jProcessing/issues/7#issuecomment-225533927","issue_url":"https://api.github.com/repos/kevincobain2000/jProcessing/issues/7","id":225533927,"user":{"login":"renoust","id":1753109,"avatar_url":"https://avatars.githubusercontent.com/u/1753109?v=3","gravatar_id":"","url":"https://api.github.com/users/renoust","html_url":"https://github.com/renoust","followers_url":"https://api.github.com/users/renoust/followers","following_url":"https://api.github.com/users/renoust/following{/other_user}","gists_url":"https://api.github.com/users/renoust/gists{/gist_id}","starred_url":"https://api.github.com/users/renoust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renoust/subscriptions","organizations_url":"https://api.github.com/users/renoust/orgs","repos_url":"https://api.github.com/users/renoust/repos","events_url":"https://api.github.com/users/renoust/events{/privacy}","received_events_url":"https://api.github.com/users/renoust/received_events","type":"User","site_admin":false},"created_at":"2016-06-13T09:38:31Z","updated_at":"2016-06-13T09:38:31Z","body":"Alright, it seems that usage of cabocha has changed/is different.\r\nI didn't fork the project, so I'm just giving you the edits (working on OSX 10.11)\r\n\r\nI'm running cabocha 0.69\r\nI figured out you need to parse the XML parsing of cabocha right?\r\n\r\nA few things were messing around in jCabocha.py, and the problem seems to happen in the cabocha() function:\r\n\r\nMy version of Cabocha manages well utf-8, so the forced reconversion \r\n`try: sent = sent.encode('utf-8')`\r\nis making some issues somehow.\r\nsame for the returned params\r\n`return unicode(output, 'utf-8')`\r\n\r\nas for the subprocess call, with your syntax, it seemed not able to pass the xml output (at best I had the \"tree\" output corresponding to -f0). Also you don't need to force-feed the standard input, just passing the file path works.\r\n`command = ['/usr/local/bin/cabocha', '-f3', temp.name]`\r\n\r\nNow I get the following output from your demo (not sure it's right):\r\n```\r\ntext = u'監督、俳優、ストーリー、演出、全部最高！'\r\nprint classifier.baseline(text)\r\n```\r\n\r\n```\r\nPos Score = 1.000 Neg Score = 0.000\r\nText is Positive\r\n```"}}
{"actor":{"display_login":"renoust"}}