def format_trec_results(qid: str, doc: str, rank: int, score: float, run_id='RunId'):
    """
    Produce a TREC formatted str of results.
    :param qid: Query Id
    :param doc: Document
    :param rank: Rank position
    :param score: Ranking score
    :param run_id: Name for this run
    :return String in TREC format
    """
    return '{}\t0\t{}\t{}\t{:.4f}\t{}'.format(qid, doc, rank, float(score), run_id)