def _text_conf_from_tess_dict(data):
    """From the results of pytesseract data dictionary, return joined text and avg confidence."""
    text_chunks = []
    confs = []
    for conf, text in zip(data["conf"], data["text"]):
        if float(conf) < 0.0 or not text:
            continue
        else:
            text_chunks.append(text)
            confs.append(float(conf))
    return " ".join(text_chunks), sum(confs) / (100 * len(confs)) if len(confs) else 0.0