def send_query(text, service_endpoint='drum', query_args=None):
    """Send a query to the TRIPS web service.

    Parameters
    ----------
    text : str
        The text to be processed.
    service_endpoint : Optional[str]
        Selects the TRIPS/DRUM web service endpoint to use. Is a choice between
        "drum" (default), "drum-dev", a nightly build, and "cwms" for use with
        more general knowledge extraction.
    query_args : Optional[dict]
        A dictionary of arguments to be passed with the query.

    Returns
    -------
    html : str
        The HTML result returned by the web service.
    """
    if service_endpoint in ['drum', 'drum-dev', 'cwms', 'cwmsreader']:
        url = base_url + service_endpoint
    else:
        logger.error('Invalid service endpoint: %s' % service_endpoint)
        return ''
    if query_args is None:
        query_args = {}
    query_args.update({'input': text})
    res = requests.get(url, query_args, timeout=3600)
    if not res.status_code == 200:
        logger.error('Problem with TRIPS query: status code %s' %
                     res.status_code)
        return ''
    # Gets unicode content
    return res.text
def send_query ( text , service_endpoint = 'drum' , query_args = None ) : if service_endpoint in [ 'drum' , 'drum-dev' , 'cwms' , 'cwmsreader' ] : url = base_url + service_endpoint else : logger . error ( 'Invalid service endpoint: %s' % service_endpoint ) return '' if query_args is None : query_args = { } query_args . update ( { 'input' : text } ) res = requests . get ( url , query_args , timeout = 3600 ) if not res . status_code == 200 : logger . error ( 'Problem with TRIPS query: status code %s' % res . status_code ) return '' return res . text
Send a query to the TRIPS web service.

    Parameters
    ----------
    text : str
        The text to be processed.
    service_endpoint : Optional[str]
        Selects the TRIPS/DRUM web service endpoint to use. Is a choice between
        "drum" (default), "drum-dev", a nightly build, and "cwms" for use with
        more general knowledge extraction.
    query_args : Optional[dict]
        A dictionary of arguments to be passed with the query.

    Returns
    -------
    html : str
        The HTML result returned by the web service.