{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "81fd300c", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import os\n", "import random" ] }, { "cell_type": "code", "execution_count": 2, "id": "1237ddf7", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "8500\n" ] } ], "source": [ "with open(\"Lilgpt.txt\",'r') as file:\n", " data = file.read()\n", "List1 = data.split(\"\")\n", "with open(\"ye.txt\",'r') as file:\n", " data = file.read()\n", "List2 = data.split(\"\")\n", "with open(\"zenske.txt\",'r') as file:\n", " data = file.read()\n", "List3 = data.split(\"\")\n", "with open(\"flowmasteri.txt\",'r') as file:\n", " data = file.read()\n", "List4 = data.split(\"\")\n", "with open(\"wutang.txt\",'r') as file:\n", " data = file.read()\n", "List5 = data.split(\"\")\n", "List = List1+List2+List3+List4+List5\n", "print(len(List))" ] }, { "cell_type": "code", "execution_count": 3, "id": "18b93c2e", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "\n", "3 Headed Goat[Intro]\n", "(Aviator)\n", "\n", "[Chorus: Lil Baby]\n", "These ain't no Guess jeans\n", "I dropped out of school, I'm still good at math, but, nigga, don't test me\n", "I played to the left, they went to the right, they tried to finesse me\n", "Still riding 'round with that blicky, I hope they don't catch me\n", "Police had raided our spot, so we went to the next street\n", "Play like I'm dumb, as soon as it pop, I'm goin' retarded\n", "He say I'm hard and he say I'm garbage, I'm rich regardless\n", "We in Miami in the middle of the winter, and we on them jet skis\n", "If we in Atlanta, I'm runnin' the 'Cat and I'm workin' the red key\n", "\n", "[Verse 1: Lil Durk]\n", "I cannot mention my homies inside of my song 'cause I know they be trappin' a lot\n", "I can't keep takin' these pills, when I'm in the trenches, they say I be cappin' a lot\n", "I know a nigga who say he got rich off the dope, but I know he be actin' a lot\n", "I know some niggas who said that they took down the city, but niggas be lackin' a lot\n", "Yeah\n", "That shit was awful, nigga had that dog food\n", "That day they shot you, I slid on a Mongoose\n", "You cannot come back around me, you turned your back on me, I cannot forget\n", "The police was lyin', they say that they caught you, but nigga, they made you admit\n", "Your name was found, you put in that work, they took your stick, you a bitch\n", "Fuck my opps, they be on my dick, they all be mad we rich (Turn up)\n", "[Verse 2: Lil Baby]\n", "Only twenty-five, livin' like a boss, ridin' 'round with a chauffeur\n", "I don't sell drugs, still be paranoid, keep lookin' over my shoulder\n", "Niggas lyin' like I'm stealin' swag, boy, that's my shit like I wrote it\n", "\n", "[Verse 3: Polo G]\n", "Uh\n", "These rappers really nice as hell\n", "I'm a different nigga when I'm pissed off\n", "Man, he say he gon' press up on who?\n", "I'ma get the steel like I'm Chris Paul\n", "Back to back suburbans, I'm a big dawg\n", "I was in the slums servin' Fentanyl\n", "Zombieland, junkies havin' withdrawals\n", "I been gettin' to it, lotta missed calls\n", "Turn it off, what the fuck is he talking 'bout?\n", "I should slap you for sayin' he hot as me\n", "I don't know who could fuck with me honestly\n", "They know I'm the man, so they watchin' me\n", "Different color bands like Monopoly\n", "Man, he must not be usin' his head\n", "If he thinkin' I don't keep a Glock with me\n", "That's like suicide if you play with us\n", "Got a better chance at the lottery\n", "Call an ambulance when that chopper sweep\n", "Make the crowd dance, choreography\n", "Once I got a plan, ain't no stoppin' me\n", "Three-car garage, million-dollar crib\n", "With a foreign bitch ridin' on top of me\n", "Lot of people done said I wouldn't be shit\n", "Well, I guess they owe me an apology\n", "[Chorus: Lil Baby]\n", "These ain't no Guess jeans\n", "I dropped out of school, I'm still good at math, but, nigga, don't test me\n", "I played to the left, they went to the right, they tried to finesse me\n", "Still riding 'round with that blicky, I hope they don't catch me\n", "Police had raided our spot, so we went to the next street\n", "Play like I'm dumb, as soon as it pop, I'm goin' retarded\n", "He say I'm hard and he say I'm garbage, I'm rich regardless\n", "We in Miami in the middle of the winter, and we on them jet skis\n", "If we in Atlanta, I'm runnin' the 'Cat and I'm workin' the red key35EmbedShare URLCopyEmbedCopy\n", "\n" ] } ], "source": [ "print(List[1])\n" ] }, { "cell_type": "code", "execution_count": 4, "id": "9c7698db", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "3 Headed Goat[Intro]\n", "(Aviator)\n", "[Chorus: Lil Baby]\n", "These ain't no Guess jeans\n", "I dropped out of school, I'm still good at math, but, nigga, don't test me\n", "I played to the left, they went to the right, they tried to finesse me\n", "Still riding 'round with that blicky, I hope they don't catch me\n", "Police had raided our spot, so we went to the next street\n", "Play like I'm dumb, as soon as it pop, I'm goin' retarded\n", "He say I'm hard and he say I'm garbage, I'm rich regardless\n", "We in Miami in the middle of the winter, and we on them jet skis\n", "If we in Atlanta, I'm runnin' the 'Cat and I'm workin' the red key\n", "[Verse 1: Lil Durk]\n", "I cannot mention my homies inside of my song 'cause I know they be trappin' a lot\n", "I can't keep takin' these pills, when I'm in the trenches, they say I be cappin' a lot\n", "I know a nigga who say he got rich off the dope, but I know he be actin' a lot\n", "I know some niggas who said that they took down the city, but niggas be lackin' a lot\n", "Yeah\n", "That shit was awful, nigga had that dog food\n", "That day they shot you, I slid on a Mongoose\n", "You cannot come back around me, you turned your back on me, I cannot forget\n", "The police was lyin', they say that they caught you, but nigga, they made you admit\n", "Your name was found, you put in that work, they took your stick, you a bitch\n", "Fuck my opps, they be on my dick, they all be mad we rich (Turn up)\n", "[Verse 2: Lil Baby]\n", "Only twenty-five, livin' like a boss, ridin' 'round with a chauffeur\n", "I don't sell drugs, still be paranoid, keep lookin' over my shoulder\n", "Niggas lyin' like I'm stealin' swag, boy, that's my shit like I wrote it\n", "[Verse 3: Polo G]\n", "Uh\n", "These rappers really nice as hell\n", "I'm a different nigga when I'm pissed off\n", "Man, he say he gon' press up on who?\n", "I'ma get the steel like I'm Chris Paul\n", "Back to back suburbans, I'm a big dawg\n", "I was in the slums servin' Fentanyl\n", "Zombieland, junkies havin' withdrawals\n", "I been gettin' to it, lotta missed calls\n", "Turn it off, what the fuck is he talking 'bout?\n", "I should slap you for sayin' he hot as me\n", "I don't know who could fuck with me honestly\n", "They know I'm the man, so they watchin' me\n", "Different color bands like Monopoly\n", "Man, he must not be usin' his head\n", "If he thinkin' I don't keep a Glock with me\n", "That's like suicide if you play with us\n", "Got a better chance at the lottery\n", "Call an ambulance when that chopper sweep\n", "Make the crowd dance, choreography\n", "Once I got a plan, ain't no stoppin' me\n", "Three-car garage, million-dollar crib\n", "With a foreign bitch ridin' on top of me\n", "Lot of people done said I wouldn't be shit\n", "Well, I guess they owe me an apology\n", "[Chorus: Lil Baby]\n", "These ain't no Guess jeans\n", "I dropped out of school, I'm still good at math, but, nigga, don't test me\n", "I played to the left, they went to the right, they tried to finesse me\n", "Still riding 'round with that blicky, I hope they don't catch me\n", "Police had raided our spot, so we went to the next street\n", "Play like I'm dumb, as soon as it pop, I'm goin' retarded\n", "He say I'm hard and he say I'm garbage, I'm rich regardless\n", "We in Miami in the middle of the winter, and we on them jet skis\n", "If we in Atlanta, I'm runnin' the 'Cat and I'm workin' the red key35EmbedShare URLCopyEmbedCopy\n" ] } ], "source": [ "NewList = []\n", "for l in List:\n", " n = l\n", " n = n.replace(\"\",\"\")\n", " n = os.linesep.join([s for s in n.splitlines() if s])\n", " n = \"\"+ n + \"\"\n", " NewList.append(n)\n", "print(NewList[1])" ] }, { "cell_type": "code", "execution_count": 5, "id": "f31e28d8", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "800\n", "7700\n" ] } ], "source": [ "random.shuffle(NewList)\n", "counter = 0\n", "List_val = []\n", "List_train = []\n", "for l in NewList:\n", " if counter<800:\n", " List_val.append(l)\n", " else:\n", " List_train.append(l)\n", " counter += 1\n", "print(len(List_val))\n", "print(len(List_train))" ] }, { "cell_type": "code", "execution_count": 6, "id": "9efd0b25", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "PainI finally moved out my momma house\n", "Got a happy home\n", "Only thing fucked up, Daddy gone (Gone forever man)\n", "Listen up this is real shit (Real shit)\n", "It's fucked up when u got nobody to share it with (Fucked up)\n", "Give my last so my grandma can see me now (See me now)\n", "Smilin tellin everybody bout her grandbaby (her grandbaby)\n", "T-Lady hold on all I got is you (Mama)\n", "It's fucked up what I done put me and my mama through\n", "What's happenin Ivory I know you lookin down watchin me\n", "Everyday I got yo kids fresh from head to feet (All of em)\n", "Wish I can put u in the bentley with the brown [? ]\n", "I wish we never would've went out to that club\n", "On the road to riches mane lost a flock of niggas\n", "[? ] a whole block of niggas\n", "Niggas bite the hand that feed em I done seen it all\n", "Jus got a call... Slo dead... Not my fuckin dawg\n", "I never thought this pain last this many years\n", "I... I never thought this pain last this many years\n", "Still in tears\n", "I... I never thought this pain last this many years\n", "I lost my daddy in a heartbeat\n", "Real talk eyes turnin right in front me\n", "Ever since I saw that shit... it hunt me\n", "Pray for me cause I shake in my fuckin sleep\n", "Wish I could[? ] shoot the 50 nigga\n", "I shoulda put him under my wing and I miss him nigga\n", "I told [? ] way back stop ridin with ya pack\n", "He ain't listen\n", "And now my nigga right back in penitentury he don't listen\n", "I lost Ivory and it fucked me up\n", "My whole life changed\n", "Nigga put me up in beast mode\n", "My heart cold\n", "And as the years role\n", "I wish that he could have everything I got\n", "And a lil mo'\n", "Yo kids love me nigga\n", "My kids and yo kids call each other sister and brothers\n", "You forever my lil hustler\n", "Just saw yo gangsta at the car lot nigga and a tear dropped nigga\n", "I never thought this pain last this many years\n", "I... I never thought this pain last this many years\n", "Still in tears\n", "I... I never thought this pain last this many years\n", "Seem like it was yesterday\n", "The mo money I get this shit hurt\n", "I thought that would take the stress away\n", "To see u smilin with yo chain countin money nigga\n", "When Trina pulled you on stage you was stuntin nigga\n", "But through it all mane you kno how we rock nigga\n", "From the yo to the block to the hospital\n", "Never again would I have another big dawg\n", "But ya mama and kids I got em all but I\n", "I never thought this pain last this many years\n", "I... I never thought this pain last this many years\n", "Still in tears\n", "I... I never thought this pain last this many yea2EmbedShare URLCopyEmbedCopy\n" ] } ], "source": [ "print(List_train[1])" ] }, { "cell_type": "code", "execution_count": 7, "id": "5dfecab1", "metadata": {}, "outputs": [], "source": [ "val_set =List_val[0]\n", "for i in range(1,len(List_val)):\n", " val_set = val_set+\"\\n\\n\"+ List_val[i]" ] }, { "cell_type": "code", "execution_count": 8, "id": "3a895d2f", "metadata": {}, "outputs": [], "source": [ "train_set =List_train[0]\n", "for i in range(1,len(List_train)):\n", " train_set = train_set+\"\\n\\n\"+List_train[i]" ] }, { "cell_type": "code", "execution_count": 9, "id": "74ea6efc", "metadata": {}, "outputs": [], "source": [ "file1 = open(\"train2.txt\",\"w+\")\n", "file1.write(train_set)\n", "file1.close()" ] }, { "cell_type": "code", "execution_count": 10, "id": "3416e6da", "metadata": {}, "outputs": [], "source": [ "file2 = open(\"val2.txt\",\"w+\")\n", "file2.write(val_set)\n", "file2.close()" ] }, { "cell_type": "code", "execution_count": 15, "id": "1bd0ca86", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Songs
0<BOS>Playa Hater[Intro: The Notorious B.I.G.]\\...
1<BOS>PainI finally moved out my momma house\\nG...
2<BOS>I Don’t Do Much[Flip talking]\\nCounting m...
3<BOS>Fuck the Weatherman[Intro]\\nLike seriousl...
4<BOS>It’s Kim Bitches (Get That Money)[Intro]\\...
\n", "
" ], "text/plain": [ " Songs\n", "0 Playa Hater[Intro: The Notorious B.I.G.]\\...\n", "1 PainI finally moved out my momma house\\nG...\n", "2 I Don’t Do Much[Flip talking]\\nCounting m...\n", "3 Fuck the Weatherman[Intro]\\nLike seriousl...\n", "4 It’s Kim Bitches (Get That Money)[Intro]\\..." ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_train = pd.DataFrame(List_train,columns = [\"Songs\"])\n", "df_train.head()" ] }, { "cell_type": "code", "execution_count": 17, "id": "f78a2abc", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Songs
0<BOS>Straight Gutta[Verse 1: Streetlife]\\nI’m ...
1<BOS>Georgia... Bush / Weezy’z Ambitionz[Part ...
2<BOS>1991 Freestyle[Intro: Ol' Dirty Bastard]\\...
3<BOS>The Wolf* iTunes bonus track\\n[RZA]\\nWatc...
4<BOS>Never Mind[Pre-Chorus]\\nI'm a pimp under ...
\n", "
" ], "text/plain": [ " Songs\n", "0 Straight Gutta[Verse 1: Streetlife]\\nI’m ...\n", "1 Georgia... Bush / Weezy’z Ambitionz[Part ...\n", "2 1991 Freestyle[Intro: Ol' Dirty Bastard]\\...\n", "3 The Wolf* iTunes bonus track\\n[RZA]\\nWatc...\n", "4 Never Mind[Pre-Chorus]\\nI'm a pimp under ..." ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_val = pd.DataFrame(List_val,columns = [\"Songs\"])\n", "df_val.head()" ] }, { "cell_type": "code", "execution_count": 18, "id": "240e7d42", "metadata": {}, "outputs": [], "source": [ "df_train.to_csv(\"Train.tsv\",sep=\"\\t\",index = False)" ] }, { "cell_type": "code", "execution_count": 19, "id": "5899b85b", "metadata": {}, "outputs": [], "source": [ "df_val.to_csv(\"Val.tsv\",sep=\"\\t\",index = False)" ] }, { "cell_type": "code", "execution_count": 20, "id": "c0dd966c", "metadata": {}, "outputs": [], "source": [ "df = pd.read_csv(\"Train.tsv\",sep = \"\\t\")" ] }, { "cell_type": "code", "execution_count": 21, "id": "922af4c8", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Songs
0<BOS>Playa Hater[Intro: The Notorious B.I.G.]\\...
1<BOS>PainI finally moved out my momma house\\nG...
2<BOS>I Don’t Do Much[Flip talking]\\nCounting m...
3<BOS>Fuck the Weatherman[Intro]\\nLike seriousl...
4<BOS>It’s Kim Bitches (Get That Money)[Intro]\\...
\n", "
" ], "text/plain": [ " Songs\n", "0 Playa Hater[Intro: The Notorious B.I.G.]\\...\n", "1 PainI finally moved out my momma house\\nG...\n", "2 I Don’t Do Much[Flip talking]\\nCounting m...\n", "3 Fuck the Weatherman[Intro]\\nLike seriousl...\n", "4 It’s Kim Bitches (Get That Money)[Intro]\\..." ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.head()" ] }, { "cell_type": "code", "execution_count": null, "id": "be9f103f", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.10" } }, "nbformat": 4, "nbformat_minor": 5 }