Skip to content
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

Documentation wrong for linguistic analysis function #9

Closed
drfraser opened this issue Feb 19, 2021 · 1 comment
Closed

Documentation wrong for linguistic analysis function #9

drfraser opened this issue Feb 19, 2021 · 1 comment

Comments

@drfraser
Copy link

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.

@swelcker
Copy link

Thx for the hint, i will ensure that the Product Team will have a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants