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

ValueError on simple example #19

Open
GoogleCodeExporter opened this issue Jul 31, 2015 · 1 comment
Open

ValueError on simple example #19

GoogleCodeExporter opened this issue Jul 31, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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

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

No branches or pull requests

1 participant