import torch


def convert_text_ids_to_count_vector(text_ids, vector_size):
    """
    Args:
        text_ids: list[int], numericalized text
        vector_size: int, size of the CountVector

    Returns:
        torch.FloatTensor[vector_size]
    """
    count_vector = torch.bincount(text_ids, minlength=vector_size)
    count_vector = count_vector.float()

    return count_vector