question

Upvotes
Accepted
1 0 2 4

How to parse response?

I am using python to get social tags using calais api. My response is a json string. For social tags i see some urls but how can i get the tag name?

intelligent-tagging-apiintelligent-taggingopen-calais-apisemantic-metadata-taggingresponse
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.

Upvotes
Accepted
101 1 0 1

@mrahman1

Some prerequisite reading for your use case:

The first link will describe the AbstractionLayer...:

  1. using the CalaisModel to get a list of all the objects you are interested in by Type
  2. loop on all objects and for each get literals
  3. from the documentation find out the reference used for the literal you are interested in

In your case I think the type you need is "http://s.opencalais.com/1/type/tag/SocialTag"

and the literal is "name"

The second link above will take to a Python example.

If you have a specific coding issue you can try to paste the relevant code here and I will try to help you further.

Regards.

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.

Upvotes
31 1 1 5

@Eyal.Kenigsvain, your reply turned out to be useful for me too. I took a bit different path for parsing the response - namely, parsed the JSON file. Although the response gets parsed fine, I have encountered an issue with this _typeGroup : "socialTag". The problem is that companies and organizations are tagged as belonging to this group. As far as I understood, this type presupposes linking its members to URLs rather than giving exact position in text.

This format of output (with no offsets specified) doesn't allow me to map the extracted entity to the text. Do you happen to know if there is a way to get offsets for such entities?

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.