umerbappi commited on
Commit
fdfc17a
·
verified ·
1 Parent(s): 7f90f44

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +150 -0
README.md ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ task_categories:
3
+ - text-generation
4
+ language:
5
+ - en
6
+ tags:
7
+ - music
8
+ size_categories:
9
+ - n<1K
10
+ ---
11
+ # LyricGen Dataset
12
+
13
+ A curated dataset of musical features paired with song lyrics for training language models to generate lyrics based on audio characteristics.
14
+
15
+ ## Dataset Description
16
+
17
+ The LyricGen dataset contains 605 musical feature-lyric pairs designed for fine-tuning large language models (like Llama 3.2) to generate song lyrics conditioned on musical characteristics. Each entry provides structured musical features extracted from audio alongside corresponding song lyrics.
18
+
19
+ ## Dataset Structure
20
+
21
+ The dataset is provided in JSONL format with the following structure:
22
+
23
+ ```json
24
+ {
25
+ "input": "Generate lyrics for a song with these characteristics:\nTempo: 128.3 BPM\nDuration: 2:36\nLoudness: -14.3 dB\nKey: F minor\nTime Signature: 1/4\n\nLyrics:",
26
+ "output": "[Song lyrics content]",
27
+ "full_prompt": "[Complete formatted prompt for training]"
28
+ }
29
+ ```
30
+
31
+ ### Fields
32
+
33
+ - **input**: Formatted prompt containing musical features and instruction
34
+ - **output**: Corresponding song lyrics
35
+ - **full_prompt**: Complete training prompt in chat format
36
+
37
+ ### Musical Features
38
+
39
+ Each entry includes five key musical characteristics:
40
+
41
+ 1. **Tempo**: Song tempo in beats per minute (BPM)
42
+ 2. **Duration**: Song length in MM:SS format
43
+ 3. **Loudness**: Audio loudness level in decibels (dB)
44
+ 4. **Key**: Musical key (e.g., C major, F minor)
45
+ 5. **Time Signature**: Rhythmic structure (e.g., 4/4, 3/4)
46
+
47
+ ## Data Creation Process
48
+
49
+ ### Source Data
50
+ - **Primary Source**: Million Song Dataset
51
+ - **Lyrics Source**: Genius API
52
+ - **Initial Sample**: 2,000 songs from Million Song Dataset
53
+ - **Final Dataset Size**: 605 songs (30.25% retention rate)
54
+
55
+ ### Processing Pipeline
56
+
57
+ 1. **Feature Extraction**: Five musical features were extracted from the Million Song Dataset
58
+ 2. **Lyrics Retrieval**: Song lyrics were obtained using the Genius API by matching song names
59
+ 3. **Data Filtering**:
60
+ - Removed songs without available lyrics
61
+ - Filtered to ensure musical features align with librosa library standards
62
+ - Quality control for feature accuracy and completeness
63
+ 4. **Prompt Formatting**: Data structured for instruction-following training compatible with models like Llama 3.2
64
+
65
+ ### Quality Assurance
66
+ - Musical features validated against librosa library specifications
67
+ - Lyrics matched and verified through Genius API
68
+ - Prompt formatting optimized for language model training
69
+
70
+ ## Intended Use
71
+
72
+ ### Primary Use Case
73
+ Fine-tuning large language models to generate song lyrics based on musical characteristics.
74
+
75
+ ### Compatible Models
76
+ - Llama 3.2 8B Instruct
77
+ - Other instruction-following language models
78
+ - Models supporting chat/conversation formats
79
+
80
+ ### Applications
81
+ - Music composition assistance
82
+ - Lyric generation tools
83
+ - Creative writing applications
84
+ - Music production workflows
85
+
86
+ ## Dataset Statistics
87
+
88
+ - **Total Examples**: 605
89
+ - **Source Retention Rate**: 30.25% (605/2000)
90
+ - **Musical Features**: 5 per song
91
+ - **Format**: JSONL
92
+ - **Split**: Training and validation sets available
93
+
94
+ ## Usage Example
95
+
96
+ ```python
97
+ import json
98
+ from datasets import Dataset
99
+
100
+ # Load the dataset
101
+ def load_lyricgen_data(file_path):
102
+ data = []
103
+ with open(file_path, 'r', encoding='utf-8') as f:
104
+ for line in f:
105
+ data.append(json.loads(line.strip()))
106
+ return data
107
+
108
+ # Load and use
109
+ train_data = load_lyricgen_data('train.jsonl')
110
+ dataset = Dataset.from_list(train_data)
111
+
112
+ # Example entry
113
+ print("Musical Features Input:", train_data[0]['input'])
114
+ print("Lyric Output:", train_data[0]['output'][:100] + "...")
115
+ ```
116
+
117
+ ## Limitations and Considerations
118
+
119
+ - **Copyright**: Lyrics are sourced from existing songs and may be subject to copyright restrictions
120
+ - **Bias**: Dataset reflects biases present in the Million Song Dataset and available lyrics on Genius
121
+ - **Coverage**: Limited to songs with available lyrics on Genius API
122
+ - **Language**: Primarily English lyrics
123
+ - **Musical Scope**: Features limited to five basic characteristics
124
+
125
+ ## Citation
126
+
127
+ If you use this dataset in your research, please cite:
128
+
129
+ ```bibtex
130
+ @dataset{lyricgen2024,
131
+ title={LyricGen: A Musical Features and Lyrics Dataset for Language Model Training},
132
+ author={umerbappi},
133
+ year={2024},
134
+ url={https://huggingface.co/datasets/umerbappi/LyricGen}
135
+ }
136
+ ```
137
+
138
+ ## Data Sources
139
+
140
+ - **Million Song Dataset**: Musical feature extraction
141
+ - **Genius API**: Lyrics retrieval and matching
142
+ - **Librosa Library**: Musical feature standardization
143
+
144
+ ## License
145
+
146
+ Please note that while the dataset structure and processing methodology are provided, individual song lyrics may be subject to copyright restrictions. Users should ensure compliance with applicable copyright laws when using this dataset.
147
+
148
+ ## Contact
149
+
150
+ For questions about the dataset or requests for additional information, please contact the dataset creator through the Hugging Face dataset repository.