Discord

Checklist HAIO 2024 Summer National Final · NLP-1 task

Spam Text Messages

English title: Spam SMS-ek

Clean and tokenise the SMS Spam Collection, build an embedding classifier from a figure, load given weights and classify new messages as spam or legit.

  • NLP
  • Text classification

The task

John Smart's old phone receives over a thousand text messages, and he needs to know which are spam. Each message is labelled spam or legit.

Task 1 (8 points): count the unique words (tokens), count spam and legit messages, clean the texts with the provided clean_text function (unchanged) and add the cleaned texts as a new DataFrame column. Task 2 (10 points): write a tokenizer assigning a unique index to every word, convert every message to an index sequence, pad all sequences to the length of the longest message, encode labels as spam = 0, legit = 1, and add the sequences and labels to the DataFrame. Task 3 (3 points): implement a PyTorch Dataset for the sequences and labels.

Task 4 (5 points): build the network shown in the figure (vocabulary size 9476 + PAD = 9477, EMBEDDING_DIM = 16, two output classes) (4) and load the weights from jános_email_modell.pth (1). Task 5 (4 points): classify a given suspicious message about a Himalayan hiking trip (2) and write a malicious message that the model classifies as legit (2).

Abridged by SOTA from the official materials. The official statement has the exact rules, and it wins wherever this summary differs.

At a glance

You get
sms.csv with labelled text messages (UCI SMS Spam Collection) and pretrained weights jános_email_modell.pth.
You submit
The completed notebook.
Scoring
30 points in total (8 + 10 + 3 + 5 + 4); graded by the organisers.
Rules
  • Keras and TensorFlow are not allowed; any PyTorch-based tool may be used.
  • The provided clean_text function must not be modified.
Format
Summer National Final (Nyári Országos Döntő), held on site at the ELTE Faculty of Informatics, Budapest, on 30 May 2024. Solved in Google Colab; the completed notebook is downloaded as .ipynb and uploaded, zipped together with the other solutions, to the CMS.

Details

Year
2024, ELTE Faculty of Informatics, Budapest, Hungary
Round
Summer National Final · NLP-1 task
Language
English
License
CC BY-NC-SA 4.0, as stated by the source