File size: 584 Bytes
081c5aa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
def make_incredible_predictions():
    "This is the best function that have created"
    pass

def preprocess(text):
    "preprocessing function of the input tweet"
    
    new_text = []#initiate an empty list 
    #split text by space
    for t in text.split(" "):
        #set username to @user
        t = '@user' if t.startswith('@') and len(t) > 1 else t  
        #set tweet source to http
        t = 'http' if t.startswith('http') else t 
        #store text in the list
        new_text.append(t)
        #change text from list back to string
    return " ".join(new_text)