Spaces:
Sleeping
Sleeping
Download utils.py from eaedk/TweetSentimentAnalysisAPI: direct link, hf CLI and curl.
- Browser
- Download file 584 Bytes
-
https://huggingface.co/spaces/eaedk/TweetSentimentAnalysisAPI/resolve/main/utils.py
- Command line
-
hf download hf://spaces/eaedk/TweetSentimentAnalysisAPI/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/eaedk/TweetSentimentAnalysisAPI/resolve/main/utils.py
584 Bytes
| 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) | |