Starting from:
$30

$24

AI Lab 3 : Artificial Text Generation Solution


    1. Find out the list of unique words in the ‘speeches.txt’ file, and find their word count. [30 Marks]

    2. Let the unique words be n. Form the n n matrix, where the ith row corresponds to the ith word, and the (i; j)th entry stands for the frequency of occurrence of jth word after the ith word. Write a function, which accepts a given word, and returns the frequencies of occurrences of the next words (basically the row corresponding to the given word). [30 Marks]

    3. Use the n n matrix to sample the next word given the current word and generate a “funny” text file of 1000 words. [40 Marks]

More products