yyydd / python-calais

Automatically exported from code.google.com/p/python-calais
1 stars 0 forks source link

ValueError on simple example #19

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Running example code as presented in the project-home
API_KEY = "my_key"
calais = Calais(API_KEY, submitter="python-calais demo")

result = calais.analyze("George Bush was the President of the United States of 
America until 2009.  Barack Obama is the new President of the United States 
now.")

result.print_entities()

What is the expected output? What do you see instead?
Expect to see;
Person: Barack Obama (0.29)
Country: United States of America (0.43)
Person: George Bush (0.43)
Country: United States (0.29)

Get the below exception/error instead;
raise ValueError(raw_result)
ValueError: <!--Use of the Calais Web Service is governed by the Terms of 
Service located at http://www.opencalais.com. 
By using this service or the results of the service you agree to these terms of 
service.--><!--Relations: PersonCareer
Country: United States
Person: Barack Obama, George Bush
...
...

What version of the product are you using? On what operating system?
Running python-calais v.1.4 
Mac OSX

Many thanks,

Original issue reported on code.google.com by jason.be...@gmail.com on 3 Mar 2013 at 1:28

GoogleCodeExporter commented 8 years ago
Just noticed this as an error with the processing directive inputs;
For "outputFormat" I should have been using "Application/JSON" instead of the 
default "XML/RDF".

Please feel free to disregard this issue.

However, I think it would make sense to include the below line as part of the 
Calais class declaration...

    processing_directives = {"contentType":None, "outputFormat":"Application/JSON", "reltagBaseURL":None, "calculateRelevanceScore":"true", "enableMetadataType":None,"docRDFaccessible":"false"}

Original comment by jason.be...@gmail.com on 3 Mar 2013 at 1:57