🎤

Rap AI Model Catalog — Lyrics Generation, Rhyme Detection, and Flow Analysis

GPT-2 rap fine-tuned models + pronouncing rhyme analysis + all runnable code

1. Rap Lyrics Generation — input → model → output

Top pick: Elida-Sensoy/gpt2-rap-generator

GPT-2 fine-tuned on rap lyrics. Runs directly via pipeline().

from transformers import pipeline, set_seed
generator = pipeline("text-generation", model="Elida-Sensoy/gpt2-rap-generator")
set_seed(42)
results = generator("I walk the streets at night", max_length=200,
                    num_return_sequences=3, temperature=1.75, top_p=0.95,
                    do_sample=True, pad_token_id=50256)

2. Rhyme Detection

import pronouncing
print(pronouncing.rhymes("flow"))  # → ['blow', 'go', 'know', 'show', ...]
print("hat" in pronouncing.rhymes("cat"))  # → True

3. Phoneme & Stress Analysis

print(pronouncing.phones_for_word("rapping"))  # → ['R AE1 P IH0 NG']
print(pronouncing.stresses_for_word("rapping"))  # → ['10']

4. Generation + Rhyme Check Pipeline

Generate lyrics → extract last words → check if consecutive lines rhyme.

5. Syllable Count — Flow Measurement

import syllables
count = syllables.estimate("Money on my mind every single day")  # → 10

6. Beat Analysis

import librosa
y, sr = librosa.load("beat.mp3")
tempo, beats = librosa.beat.beat_track(y=y, sr=sr)
print(f"BPM: {tempo:.0f}")

Model Catalog

Model Size Feature
Elida-Sensoy/gpt2-rap-generator ~500MB Eminem-style rhyme density
flax-community/gpt2-rap-lyric-generator ~500MB 10K+ songs trained
weej16/rap-lyrics-qwen-0.6b 600MB Qwen3-based, latest
pronouncing (library) 0MB CMU dict rhyme detection

Key Concepts

1

Lyrics generation — generate rap lyrics via pipeline("text-generation", model="gpt2-rap-generator")

2

Rhyme detection — pronouncing.rhymes("flow") for rhyme word list

3

Phoneme/stress analysis — pronouncing.phones_for_word() for pronunciation structure

4

Auto rhyme verification — auto-check if generated line-ending words rhyme

5

Beat analysis — extract BPM and beat positions with librosa.beat.beat_track()

Use Cases

Rap writing assistant — use AI-generated lyrics as a base to modify and develop Rhyme quality measurement — auto-analyze rhyme density and patterns in lyrics Rap education — visualize flow structure with syllable count and stress patterns