You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at the raw JSON response, I do see raw index numbers. But when working with the actual object returned from the full_analysis() call, this object instead has an array of actual Token objects, not index numbers. Since the library essentially prevents you from working with the raw JSON (I had to hack things up to get it to save to a file; nothing I see lets you access the raw JSON yourself through an 'approved' method), this disconnect from what the documentation leads you to believe and what is actually possible ought to be fixed. To wit, the classes the library creates out of the JSON object ought to be documented along with traversal of that object (maybe I overlooked some help page...) I had to read the source code to understand what was going on.
Why do I care? I am saving all the returned data into a database and am not working with the data on the fly for various reasons. Saving an index number wold be nicer than deriving the index number of a token. I could do it by processing all the token objects first, etc and then look up the index number on demand - but that seems a bit of useless extra work given index numbers were available at some point.
I guess, overall, I would like to be able to deal with linking 'things' (token, sentence, phrase...) in the database as easily as possible. So... not sure if the library needs to change but a heads-up in the documentation about this would be nice.
The text was updated successfully, but these errors were encountered:
Looking at https://docs.expert.ai/nlapi/latest/reference/output/linguistic-analysis/ in the 'phrases', 'sentences' and 'paragraphs' section, there is a mention of arrays of index numbers for the smaller parts that make up the object, e.g. tokens make up a phrase.
Looking at the raw JSON response, I do see raw index numbers. But when working with the actual object returned from the full_analysis() call, this object instead has an array of actual Token objects, not index numbers. Since the library essentially prevents you from working with the raw JSON (I had to hack things up to get it to save to a file; nothing I see lets you access the raw JSON yourself through an 'approved' method), this disconnect from what the documentation leads you to believe and what is actually possible ought to be fixed. To wit, the classes the library creates out of the JSON object ought to be documented along with traversal of that object (maybe I overlooked some help page...) I had to read the source code to understand what was going on.
Why do I care? I am saving all the returned data into a database and am not working with the data on the fly for various reasons. Saving an index number wold be nicer than deriving the index number of a token. I could do it by processing all the token objects first, etc and then look up the index number on demand - but that seems a bit of useless extra work given index numbers were available at some point.
I guess, overall, I would like to be able to deal with linking 'things' (token, sentence, phrase...) in the database as easily as possible. So... not sure if the library needs to change but a heads-up in the documentation about this would be nice.
The text was updated successfully, but these errors were encountered: