Accessing a decoded JSON data structure
I am trying to extract a specific entry from this JSON using Perl { "sentences": [ { "index": 0, "tokens": [ { "index": 1, "word": "盧旺達", "originalText": "盧旺達", "lemma": "盧旺達", "characterOffsetBegin": 0, "characterOffsetEnd": 3, "pos": "NN", "ner": "PERSON" }, { "index": 2, "word": "援助", "originalText": "援助", "lemma": "援助", "characterOffsetBegin": 3, "characterOffsetEnd": 5, "pos": "NN", "ner": "O" } ] } ] } I would like access to tokens and then to ner, I have been trying to use this code but it doesn`t return anything $json = decode_json $json_string; my $tokens = $json->{"sentences"}->{"tok
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.