def get_intent_queries(infold, intent_names, mode):
    """ Get list of queries with their corresponding intent number. """
    intent_queries = ['sentence\tlabel\n']

    for index, intent in enumerate(intent_names):
        queries = open(f'{infold}/{mode}set/{intent}.csv', 'r').readlines()
        for query in queries[1:]:
            phrases = query.split(";")
            intent_query = phrases[4][1:-1] + "\t" + str(index)
            intent_queries.append(intent_query)

    return intent_queries