-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems parsing numbers: JSON forbids NaN and infinities #256
Comments
Not Sure if related in anyway but my Loklak Server Crashes and logs the user interface off when hitting it constantly with searches. Does not happen so often when I load Loklak in to a RAM Drive. In the last bit of the log. |
Hi Marc can you fix the issue? I don't know where to look for this... |
Can't promise anything, but I can take a look. |
The problem seems to be in the Bayes classifier: ptnplanet/Java-Naive-Bayes-Classifier#3 |
Unfortunately I don't know too much about Bayes classifiers. The only thing I can offer is this: Unfortunately this patch only addresses the symptoms, it does not fix the original problem. |
#256 (comment) which addresses a problem in the Bayesian Classifier source code as discussed in ptnplanet/Java-Naive-Bayes-Classifier#3
fixed in 65ede16 |
My JSON parser (GSON) throws exceptions like this every now and then:
JSON forbids NaN and infinities: Infinity at line 569 column 51 path $.statuses[11].classifier_language_probability
As far as I know the parser is right,
Infinity
orNaN
are no legal numbers in JSON. I have only foundInfinity
so far, noNaN
as far as I can tell.Here is part of my JSON (I searched for "emoji"):
{ "timestamp" : "2016-02-08T13:50:11.887Z", "created_at" : "2016-02-08T13:46:40.000Z", "screen_name" : "_____haarupp", "text" : "ちょうどあと2週間でTOKYO<img class=\"Emoji Emoji--forText\" src=\"https://abs.twimg.com/emoji/v2/72x72/1f495.png\" draggable=\"false\" alt=\"💕\" title=\"Zwei Herzen\" aria-label=\"Emoji: Zwei Herzen\"><img class=\"Emoji Emoji--forText\" src=\"https://abs.twimg.com/emoji/v2/72x72/2708.png\" draggable=\"false\" alt=\"✈️\" title=\"Flugzeug\" aria-label=\"Emoji: Flugzeug\"><img class=\"Emoji Emoji--forText\" src=\"https://abs.twimg.com/emoji/v2/72x72/1f4ad.png\" draggable=\"false\" alt=\"💭\" title=\"Gedankenblase\" aria-label=\"Emoji: Gedankenblase\"><img class=\"Emoji Emoji--forText\" src=\"https://abs.twimg.com/emoji/v2/72x72/1f3b6.png\" draggable=\"false\" alt=\"🎶\" title=\"Mehrere Musiknoten\" aria-label=\"Emoji: Mehrere Musiknoten\">だだだいすちなみなさまと卒業旅行です<img class=\"Emoji Emoji--forText\" src=\"https://abs.twimg.com/emoji/v2/72x72/1f493.png\" draggable=\"false\" alt=\"💓\" title=\"Schlagendes Herz\" aria-label=\"Emoji: Schlagendes Herz\">神奈川も楽しみ〜無計画だけど<img class=\"Emoji Emoji--forText\" src=\"https://abs.twimg.com/emoji/v2/72x72/1f606.png\" draggable=\"false\" alt=\"😆\" title=\"Lächelndes Gesicht mit geöffnetem Mund und fest verschlossenen Augen\" aria-label=\"Emoji: Lächelndes Gesicht mit geöffnetem Mund und fest verschlossenen Augen\"><img class=\"Emoji Emoji--forText\" src=\"https://abs.twimg.com/emoji/v2/72x72/1f64c.png\" draggable=\"false\" alt=\"🙌\" title=\"Person mit im Jubel nach oben gehobenen Händen\" aria-label=\"Emoji: Person mit im Jubel nach oben gehobenen Händen\">", "link" : "https://twitter.com/_____haarupp/status/696691618858971137", "id_str" : "696691618858971137", "source_type" : "TWITTER", "provider_type" : "SCRAPED", "retweet_count" : 0, "favourites_count" : 0, "images" : [ ], "images_count" : 0, "audio" : [ ], "audio_count" : 0, "videos" : [ ], "videos_count" : 0, "place_name" : "Minato-ku, Tokyo", "place_id" : "594fa6c6bc5b5ba9", "place_context" : "FROM", "location_point" : [ 139.69171127290076, 35.68949890122258 ], "location_radius" : 0, "location_mark" : [ 139.77954268483185, 35.726840780611376 ], "location_source" : "PLACE", "hosts" : [ "abs.twimg.com" ], "hosts_count" : 1, "links" : [ "https://abs.twimg.com/emoji/v2/72x72/1f495.png\"", "https://abs.twimg.com/emoji/v2/72x72/2708.png\"", "https://abs.twimg.com/emoji/v2/72x72/1f4ad.png\"", "https://abs.twimg.com/emoji/v2/72x72/1f3b6.png\"", "https://abs.twimg.com/emoji/v2/72x72/1f493.png\"", "https://abs.twimg.com/emoji/v2/72x72/1f606.png\"", "https://abs.twimg.com/emoji/v2/72x72/1f64c.png\"" ], "links_count" : 7, "mentions" : [ ], "mentions_count" : 0, "hashtags" : [ ], "hashtags_count" : 0, "classifier_profanity" : "sex", "classifier_profanity_probability" : "Infinity", "classifier_emotion" : "joy", "classifier_emotion_probability" : 3.2575725E-5, "classifier_language" : "german", "classifier_language_probability" : 3480540.2, "without_l_len" : 1086, "without_lu_len" : 1086, "without_luh_len" : 1086, "user" : { "screen_name" : "_____haarupp", "user_id" : "2985012950", "name" : "とうま はるか", "profile_image_url_https" : "https://pbs.twimg.com/profile_images/692957698988642304/VcrE2cDi_bigger.jpg", "appearance_first" : "2016-02-08T13:47:23.099Z", "appearance_latest" : "2016-02-08T13:47:23.099Z" } }
The text was updated successfully, but these errors were encountered: