I have this legacy code that in Python 2.7 successfully returns results in xml, which are then processed by ElementTree.
result = alchemyObj.TextGetRankedNamedEntities(text)
root = ET.fromstring(result)
I am updating the program to Python 3.5 and trying to do this, so I do not need to modify the xml analysis of the results:
result = alchemy_language.entities(outputMode='xml', text='text', max_
items='10'),
root = ET.fromstring(result)
Per http://www.ibm.com/watson/developercloud/alchemy-language/api/v1/#entities outputMode allows you to choose between json default and xml. However, I get this error:
Traceback (most recent call last):
File "bin/nerv35.py", line 93, in <module>
main()
File "bin/nerv35.py", line 55, in main
result = alchemy_language.entities(outputMode='xml', text='text', max_items='10'),
TypeError: entities() got an unexpected keyword argument 'outputMode'
Does outputMode really exist? If so, what is wrong with entity parameters?
source
share