icelandic-irony / README.md
AMBJ24's picture
Create README.md
d4132ff verified
metadata
license: cc-by-nc-4.0
language:
  - is
pipeline_tag: text-classification
library_name: transformers
tags:
  - icelandic
  - text-classification
  - sequence-classification
  - irony
  - sarcasm
  - social-media
sources: >-
  Risamálheildin slices of forums/blogs, manually labelled by us, and our own
  small corpus made from samples gathered from social media

Icelandic Irony Detector (RoBERTa, Icelandic)

Task: binary sequence classification → ["not_ironic", "ironic"]
Base model: mideind/IceBERT-igc (Icelandic RoBERTa)
Intended domain: Icelandic social-media style text (short, informal; emojis, punctuation variants).

TL;DR

A compact Icelandic RoBERTa fine-tuned to recognize ironic vs non-ironic sentences.
Useful as a filter to reduce misunderstandings in online communication.


How to use

from transformers import AutoTokenizer, AutoModelForSequenceClassification

model_id = "ambj24/icelandic-irony"   
tok  = AutoTokenizer.from_pretrained(model_id)
mod  = AutoModelForSequenceClassification.from_pretrained(model_id)

text = "Já, frábær þjónusta… 😑"
inputs = tok(text, return_tensors="pt")
logits = mod(**inputs).logits
probs = logits.softmax(-1).tolist()[0]

labels = ["not_ironic", "ironic"]
pred = labels[probs.index(max(probs))]
print(pred, dict(zip(labels, probs)))

Input length: works well for short posts; we trained with a max length around 128 tokens.

Mix: Icelandic social-media style text.