watson_developer_cloud.alchemy_language_v1 module¶
The AlchemyAPI Language service (https://www.ibm.com/watson/developercloud/alchemy-language.html)
-
class
AlchemyLanguageV1
(url='https://gateway-a.watsonplatform.net/calls', **kwargs)[source]¶ Bases:
watson_developer_cloud.watson_developer_cloud_service.WatsonDeveloperCloudService
-
default_url
= 'https://gateway-a.watsonplatform.net/calls'¶
-
keywords
(html=None, text=None, url=None, strict_extract_mode=False, sentiment=False, show_source_text=False, max_keywords=50, language=None)[source]¶
-
concepts
(html=None, text=None, url=None, max_items=8, linked_data=True, show_source_text=False, language=None)[source]¶
-
entities
(html=None, text=None, url=None, disambiguate=True, linked_data=True, coreference=True, quotations=False, sentiment=False, show_source_text=False, max_items=50, language=None)[source]¶
-
emotion
(html=None, text=None, url=None, show_source_text=False, source_text_type=None, constraint_query=None, xpath_query=None, language=None)[source]¶
-
relations
(html=None, text=None, url=None, sentiment=False, keywords=False, entities=False, require_entities=False, sentiment_excludes_entities=True, disambiguate=True, linked_data=True, coreference=True, show_source_text=False, max_items=50, language=None)[source]¶
-
taxonomy
(html=None, text=None, url=None, show_source_text=False, source_text_type=None, constraint_query=None, xpath_query=None, base_url=None, language=None)[source]¶ - source_text_type ->
where to obtain the text that will be processed by this API call. AlchemyAPI supports multiple modes of text extraction:
web page cleaning (removes ads, navigation links, etc.), raw text extraction (processes all web page text, including ads / nav links), visual constraint queries, and XPath queries.- Possible values:
cleaned_or_raw : cleaning enabled, fallback to raw when cleaning produces no text (default) cleaned : operate on ‘cleaned’ web page text (web page cleaning enabled) raw : operate on raw web page text (web page cleaning disabled) cquery : operate on the results of a visual constraints query
Note: The ‘constraint_query’ argument must also be set to a valid visual constraints query.- xpath : operate on the results of an XPath query
- Note: The ‘xpath’ http argument must also be set to a valid XPath query.
- constraint_query ->
- a visual constraints query to apply to the web page.
- xpath ->
- an XPath query to apply to the web page.
- base_url ->
- rel-tag output base http url (must be uri-argument encoded)
-
combined
(html=None, text=None, url=None, extract=None, disambiguate=True, linked_data=True, coreference=True, quotations=False, sentiment=False, show_source_text=False, max_items=50, base_url=None, language=None)[source]¶ Combined call for page-image, entity, keyword, title, author, taxonomy, concept, doc-emotion. INPUT: extract ->
List or comma separated string Possible values: page-image, entity, keyword, title, author, taxonomy, concept default : entity, keyword, taxonomy, concept- disambiguate ->
disambiguate detected entities Possible values:
True : enabled (default) False : disabled- linked_data ->
include Linked Data content links with disambiguated entities Possible values :
True : enabled (default) False : disabled- coreference ->
resolve he/she/etc coreferences into detected entities Possible values:
True : enabled (default) False : disabled- quotations ->
enable quotations extraction Possible values:
True : enabled False : disabled (default)- sentiment ->
enable entity-level sentiment analysis Possible values:
True : enabled False : disabled (default)- show_source_text ->
include the original ‘source text’ the entities were extracted from within the API response Possible values:
True : enabled False : disabled (default)- max_items ->
- maximum number of named entities to extract default : 50
- base_url ->
- rel-tag output base http url
OUTPUT: The response, already converted from JSON to a Python object.
-