def keyphrases2brat(keyphrases):
    """Receive keyphrases and return brat string"""
    brat_str = ''
    for keyphrase in keyphrases:
        keyphrase_id, (keyphrase_label_, (start, end)
            ), keyphrase_str = keyphrase
        brat_str += '%s\t%s %s %s\t%s\n' % (keyphrase_id, keyphrase_label_,
            start, end, keyphrase_str)
    return brat_str.strip('\n')
