def read_complaint_portion(age,
                           sex,
                           auth_string,
                           case_id,
                           context,
                           language_model=None):
    """Reads user input and calls the /parse endpoint of Infermedica API to
    extract conditions found in text.

    Args:
        age (dict): Patients age in {'value': int, 'unit': str} format.
        sex (str): Patients sex.
        auth_string (str): Authentication string.
        case_id (str): Case ID.
        context (list): List previous complaints.
        language_model (str): Chosen language model.

    Returns:
        dict: Response from /parse endpoint.

    """
    text = read_input('Describe you complaints')
    if not text:
        return None
    resp = apiaccess.call_parse(age,
                                sex,
                                text,
                                auth_string,
                                case_id,
                                context,
                                language_model=language_model)
    return resp.get('mentions', [])
Пример #2
0
def read_complaint_portion(auth_string, case_id, context, language_model=None):
    """Call the /parse endpoint of Infermedica API for the given message or have the user input the message beforehand.
    """
    text = read_input('Describe you complaints')
    if not text:
        return None
    resp = apiaccess.call_parse(text,
                                auth_string,
                                case_id,
                                context,
                                language_model=language_model)
    return resp.get('mentions', [])
Пример #3
0
def read_complaint_portion(auth_string, case_id, context, language_model=None):
    """Reads user input and calls the /parse endpoint of Infermedica API to
    extract conditions found in text.

    Args:
        auth_string (str): Authentication string.
        case_id (str): Case ID.
        context (list): List previous complaints.
        lanugage_model (str): Chosen language model.

    Returns:
        dict: Response from /parse endpoint.

    """
    text = read_input(
        'Describe you complaints, Leave Blank and hit enter when finished')
    if not text:
        return None
    resp = apiaccess.call_parse(text,
                                auth_string,
                                case_id,
                                context,
                                language_model=language_model)
    return resp.get('mentions', [])