question

Upvotes
Accepted
31 2 1 5

Offsets in the response are not valid

I have parsed the json file and found out that it is quite hard to align the offset defined for the entity with its place in the raw text input. There are several reasons for it:

1. Each document has its own additional offset (metadata with hash and other info) which makes the initial offset number invalid.

2. Newlines and any symbols that do not get encoded properly (e.g., "company\u2019s") move the offset to the extent where the index we need cannot be restored.

Could you please help me figure out the simplest way to process offsets?

intelligent-tagging-apiintelligent-taggingjsonopen-calais-apisemantic-metadata-taggingparsing
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@tetiana.myronivska

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

Hello @tetiana.myronivska

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

AHS

1 Answer

· Write an Answer
Upvote
Accepted
1.2k 8 11 8

Proper encoding is important, here's a jsfiddle that might get you started on the right track:

https://jsfiddle.net/84255hgk/

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@Tomasz Adamusiak, thank you for your reply. It lead me to the right direction in solving the problem (I hope so).

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.