Highlights
Outline
Continuing from Assignment 1, we will conduct Tweet analysis using Python. In particular, we will carry out some basic language processing tasks which are essential in preparing the raw input (i.e., texts) that needs to be processed before doing any further analysis (e.g., filtering punctuations, whitespaces, stop words etc.). The key problem we found in Assignment 1 was that the raw text words extracted from tweets are not "clean". In particular, they had:
Tasks
You will find example test cases for those tasks once you start the quiz on the quiz server.
Task 1 Proper capitalisation
Capital letters are treated differently to lowercase letters in computers (i.e., they are not the same when compared), so we need to match them to all lowercases. For the first take, write a function proper_capitalization(sentence) which takes an input parameter sentence (type string) and returns a string that has all letters in lower cases.
Task 2 Tokenization
In a sentence, there are zero or more words. Simply, we will define the term word as any sequence of
letters separated by a white space. Write a function tokenization(sentence) which takes an input
parameter sentence (type string) and returns a list of words from the given sentence.
Task 3 Custom stop word removal
Stopwords are words such as "and", "or", "is" etc. that are often not useful in text analysis, so we will remove them. Write a function stop_word_removal(sentence, stop_words) which takes input parameters sentence (type string) and stop_words (type string), and returns a string that removed all stopwords in sentence. Note that, you cannot assume the input parameter stop_words will actually only contain the usual stopwords.
Hint: You should utilise the previously implemented functions. This hint applies to all below tasks.
Task 4 Removing punctuation
Punctuations are typically individual characters such as "!", "?", "." etc. that are also often not useful in text analysis. Write a function remove_punc(sentence, punctuation) which takes input parameters sentence (type string) and punctuation (type string), and returns a string that strips all trailing punctuations in sentence. Here, punctuations are NOT separated by a space, but they all should be removed. Also, you should not assume that punctuation would only contain the usual punctuations.
Task 5 Removing duplicate words
Write a function remove_duplicate_words(sentence) which takes an input parameter sentence (type string), and returns a string that has all duplicated words removed from sentence. The words in the returned string should be sorted in alphabetical order.
This CITS2401 - IT Assignment has been solved by our IT experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.