/ Модель

Характеристики

Контекст
512 токенов
Параметры
137 млн
Лицензия
MIT
Архитектура
bert · dense
Базовая модель
bert-base-uncased
Библиотека
transformers
Опубликована
18 авг 2026

bert-lyrics-classifier

Классификация текстаТекст → label3 профессии

Дообученная BERT-модель определяет, подходит ли отдельный англоязычный куплет песни для детей.

103скачиваний за 30 дней1лайквеса обновлены21 сен 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

bert-lyrics-classifier — модель Devan Asokan для классификации отдельных куплетов песен по пригодности для детей. Она разработана в рамках выпускного проекта Asia Pacific University и представляет собой дообученную BERT-модель для бинарной классификации последовательностей на базе google-bert/bert-base-uncased. Модель принимает текст куплета на английском языке и выдаёт метку SAFE или UNSAFE. По метаданным, модель содержит 136,7 млн параметров, поддерживает контекст до 512 токенов и распространяется в формате safetensors; лицензия — MIT.

Модель предназначена для анализа текстов песен на уровне отдельных куплетов, например, чтобы выделять потенциально неподходящие фрагменты для последующей проверки родителями или модераторами. В README указана точность 0,8925 на отложенной выборке из того же процесса сбора и разметки, что использовался при обучении. К ограничениям относятся шум в метках, созданных с помощью LLM, субъективность понятия «пригодность», возможное снижение надёжности на длинных и неоднозначных куплетах и текстах с переключением языков. Возможны ложноотрицательные результаты, поэтому предсказания следует использовать как сигнал для проверки, а не как единственное основание для решения.

Сценарии применения

  • проверка куплетов песен на содержание, неподходящее для детей
  • выделение потенциально небезопасных фрагментов песни для родительской проверки
  • модерация англоязычных текстов песен на уровне куплетов

Ограничения

Метки обучающих данных создавались с помощью LLM и могут содержать ошибки, а понятие пригодности для детей зависит от культурного контекста. Надёжность может снижаться на длинных, неоднозначных или смешанных по языку куплетах; возможны ложноотрицательные результаты.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

bert-lyrics-classifier

bert-lyrics-classifier is a fine-tuned bert-base-uncased model that classifies individual song lyric verses as SAFE or UNSAFE for children, enabling verse-level (rather than whole-song) content moderation.

It was developed as part of a Final Year Project at Asia Pacific University: "Implementing a Machine Learning Based Approach for Classifying Song Lyrics Appropriateness for Children." The model powers LyricLens, a Spotify-connected dashboard that surfaces which parts of a song may not be appropriate for young listeners.

Model Details

Model Description

Most existing content filters (e.g. the Spotify "explicit" tag) label an entire song as appropriate or not, which misses the fact that a single song can contain both safe and unsafe verses. This model instead classifies lyrics at the verse level, allowing more granular moderation.

  • Developed by: Devan Asokan
  • Model type: Fine-tuned BERT for binary sequence classification
  • Language(s): English
  • License: MIT
  • Finetuned from model: bert-base-uncased

Model Sources

Uses

Direct Use

The model takes a single verse of song lyrics as input and predicts whether it is:

  • LABEL_0 — SAFE: appropriate for children
  • LABEL_1 — UNSAFE: not appropriate for children

It is intended to be used as one component of a larger content-moderation pipeline (e.g. flagging specific verses within a song for parental review), not as a sole, fully automated gatekeeping decision.

Out-of-Scope Use

  • Not intended for languages other than English (verses are filtered to English before classification upstream).
  • Not intended as a substitute for human judgment in high-stakes moderation decisions.
  • Not evaluated on song lyrics outside the genre/style distribution of the training data (see Training Data).

Bias, Risks, and Limitations

  • The training labels were generated with LLM-assisted annotation rather than exclusively human review, so label noise from the annotating model may be present.
  • "Appropriateness" is a subjective, culturally variable judgment; the model reflects the definitions and prompt used during annotation, not a universal standard.
  • Long or ambiguous verses (e.g. long choruses, code-switched lyrics) may be classified less reliably — see the project checklist for known open issues.
  • As with any classifier, false negatives (unsafe content marked safe) are possible; this model should not be relied on as the only safeguard for children's content exposure.

Recommendations

Users should treat predictions as a decision-support signal rather than a final verdict, and periodically spot-check outputs against the source lyrics before relying on the classification in a downstream product.

How to Get Started with the Model

from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

repo_id = "devanasokan/bert-lyrics-classifier"

tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForSequenceClassification.from_pretrained(repo_id)

verse = "Dancing in the sunshine with my friends all day long"
inputs = tokenizer(verse, return_tensors="pt", truncation=True, padding=True)

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_id = torch.argmax(logits, dim=-1).item()
labels = {0: "SAFE", 1: "UNSAFE"}
print(labels[predicted_class_id])

Or with the pipeline API:

from transformers import pipeline

classifier = pipeline("text-classification", model="devanasokan/bert-lyrics-classifier")
classifier("Dancing in the sunshine with my friends all day long")

Training Details

Training Data

The model was trained on devanasokan/lyrics-appropriateness-dataset: song lyrics collected via the Spotify and Genius APIs, split into verses, and labelled SAFE / UNSAFE with LLM-assisted annotation, followed by cleaning and language filtering (English only). Labels were mapped as SAFE → 0, UNSAFE → 1.

The dataset was split 80/10/10 into train/validation/test sets.

Training Procedure

Hyperparameters were tuned with Optuna (TPE sampler) over learning rate, per-device batch size, and weight decay, optimizing validation accuracy across 10 trials with early stopping.

Training Hyperparameters (best trial)

  • Base model: bert-base-uncased
  • Learning rate: 2e-5
  • Batch size: 8
  • Weight decay: 0.01
  • Epochs: 3
  • Precision: fp32
  • Seed: 42 (fixed for reproducibility, including deterministic CUDA algorithms)

Evaluation

Testing Data

Held-out test split (10% of the labelled verse dataset), from the same collection/annotation pipeline as the training data.

Metrics

Accuracy, precision, recall, and F1-score (weighted for the UNSAFE class) were used to evaluate classification performance.

Results

MetricScore
Accuracy0.8925
Precision0.8918
Recall0.8934
F1-score0.8926

This BERT model was compared against RNN, LSTM, and DistilBERT baselines trained on the same dataset; BERT was selected for deployment based on overall performance.

Environmental Impact

  • Hardware Type: [NVIDIA GeForce RTX 4060]
  • Hours used: [9]
  • Cloud Provider: [More Information Needed]

Citation

If you use this model, please cite the associated Final Year Project:

@misc{asokan2026lyriclens,
  author = {Asokan, Devan},
  title = {Implementing a Machine Learning Based Approach for Classifying Song Lyrics Appropriateness for Children},
  year = {2026},
  publisher = {Asia Pacific University},
  howpublished = {\url{https://github.com/lemonmelonn/devanasokan_fyp}}
}

Model Card Author

Devan Asokan

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers · text-classification

Можно запустить

Подбираем GPU…

Класс архитектуры
BertForSequenceClassification
Ревизия весов
0f4a650

0 моделей