Last active
April 19, 2019 22:45
-
-
Save samueleresca/531b636c2ada582d2218372575eb6fe7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let trainDataPath = Path.Combine("../","Data","lyrics.csv") | |
let msft = CsvFile.Load(File.Open(trainDataPath, FileMode.Open), separators = ",", quote = '"', hasHeaders= true) | |
let songLyrics = | |
msft.Rows | |
|> Seq.filter (fun row -> not(row.GetColumn "lyrics" |> String.IsNullOrEmpty)) | |
|> Seq.filter (fun row -> not(String.Equals(row.GetColumn "lyrics", "[Instrumental]", StringComparison.OrdinalIgnoreCase))) | |
|> Seq.map (fun row -> { Song = (row.GetColumn "song") | |
Artist = (row.GetColumn "artist") | |
Genre = (row.GetColumn "genre") | |
Lyrics = (row.GetColumn "lyrics").Replace(Environment.NewLine, ", ") | |
Year = (row.GetColumn "year") |> int | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment