Call from on the text and return a Naf object

def frog_naf(text):
    """
    Call from on the text and return a Naf object
    """
    naf = KafNafParser(type="NAF")
    frogclient = FrogClient('localhost', 9887)
    for token in call_frog(text):
        wf = naf.create_wf(token.word, token.sent, token.offset)
        term = naf.create_term(token.lemma, token.pos, token.morphofeat, [wf])

    naf.create_linguistic_processor("text", "Frog tokenizer", get_frog_version())
    naf.create_linguistic_processor("term", "Frog MBT", get_frog_version())
    s = BytesIO()
    naf.dump(s)
    return s.getvalue()